### Eclipse Workspace Patch 1.0
#P gmaplocation
Index: todo.txt
===================================================================
RCS file: todo.txt
diff -N todo.txt
Index: gmaplocation.info
===================================================================
RCS file: /cvs/drupal/contributions/modules/gmaplocation/gmaplocation.info,v
retrieving revision 1.1
diff -u -r1.1 gmaplocation.info
--- gmaplocation.info 18 Jun 2008 14:19:44 -0000 1.1
+++ gmaplocation.info 13 Feb 2009 12:52:59 -0000
@@ -1,5 +1,6 @@
-; $Id: gmaplocation.info,v 1.1 2008/06/18 14:19:44 bmihelac Exp $
+; $Id$
name = Google Maps location
description = Display one geographic location via Google Maps
package = Location
-version = "$Name: $"
\ No newline at end of file
+core = 6.x
+version = 6.x-1.x-dev
\ No newline at end of file
Index: gmaplocation.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/gmaplocation/gmaplocation.module,v
retrieving revision 1.1
diff -u -r1.1 gmaplocation.module
--- gmaplocation.module 18 Jun 2008 14:19:44 -0000 1.1
+++ gmaplocation.module 13 Feb 2009 12:52:59 -0000
@@ -3,35 +3,33 @@
/**
* Implementation of hook_help
*/
-function gmaplocation_help($section) {
- switch ($section) {
- case 'admin/help#pathauto':
- $output = t("<p>The gmaplocation module displays marker of your geographic location with Google Maps.</p>");
- return $output;
+function gmaplocation_help($path, $arg) {
+ switch ($path) {
+ case 'admin/help#gmaplocation':
+ $output = t("<p>The gmaplocation module displays marker of your geographic location with Google Maps.</p>");
+ return $output;
}
}
/**
* Implementation of hook_menu().
*/
-function gmaplocation_menu($may_cache) {
+function gmaplocation_menu() {
$items = array();
- if ($may_cache) {
- $items[] = array(
- 'path' => 'admin/settings/gmaplocation',
- 'title' => t('Google Maps location'),
- 'description' => t('Configure Google Maps location.'),
- 'callback' => 'drupal_get_form',
- 'callback arguments' => array('gmaplocation_admin_settings'),
- 'access' => user_access('admin gmaplocation'),
- 'type' => MENU_NORMAL_ITEM,
- );
- $items[] = array('path' => 'gmaplocation', 'title' => t('Our Location'),
- 'access' => TRUE,
- 'callback' => 'gmaplocation_page',
- 'type' => MENU_SUGGESTED_ITEM,
- );
- }
+ $items['admin/settings/gmaplocation'] = array(
+ 'title' => 'Google Maps location',
+ 'description' => 'Configure Google Maps location.',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('gmaplocation_admin_settings'),
+ 'access callback' => 'user_access',
+ 'access arguments' => array('admin gmaplocation'),
+ 'type' => MENU_NORMAL_ITEM,
+ );
+ $items['gmaplocation'] = array('title' => 'Our Location',
+ 'access callback' => TRUE,
+ 'page callback' => 'gmaplocation_page',
+ 'type' => MENU_SUGGESTED_ITEM,
+ );
return $items;
}
@@ -103,14 +101,14 @@
'#description' => t('Google Maps key for your domain.') . " " .
t('Obtain key on !url', array('!url' => l('http://code.google.com/apis/maps/signup.html', 'http://code.google.com/apis/maps/signup.html')))
);
- $form['#submit'] = array('system_settings_form_submit' => array(), 'gmaplocation_admin_settings_submit' => array());
+ $form['#validate'][] = 'gmaplocation_admin_settings_submit';
return system_settings_form($form);
}
-function gmaplocation_admin_settings_submit($form, $form_values) {
- if ($form_values['gmaplocation_address']) {
- $latlng = gmaplocation_geocode_for_address_recursive($form_values['gmaplocation_address']);
+function gmaplocation_admin_settings_validate($form, &$form_state) {
+ if ($form_state['values']['gmaplocation_address']) {
+ $latlng = gmaplocation_geocode_for_address_recursive($form_state['values']['gmaplocation_address']);
if ($latlng != FALSE) {
list($lat, $lng) = $latlng;
} else {
@@ -118,8 +116,8 @@
$lat = 46.051426;
$lng = 14.505965;
}
- variable_set('gmaplocation_lat', $lat);
- variable_set('gmaplocation_lng', $lng);
+ $form_state['values']['gmaplocation_lat'] = $lat;
+ $form_state['values']['gmaplocation_lng'] = $lng;
}
}
@@ -191,7 +189,7 @@
}
function gmaplocation_in_place_edit_form() {
- $form['#base'] = 'system_settings_form';
+ $form['#submit'][] = 'system_settings_form_submit';
$form['description'] = array(
'#prefix' => '<p>',
'#value' => t('Click and drag marker to fine tune position of your location.'),
@@ -272,7 +270,7 @@
* @ingroup themeable
*/
function theme_gmaplocation_block_image_link() {
- return(l('<img src="' . gmaplocation_static_image_url(160, 120) . '" />', 'gmaplocation', array(), NULL, NULL, FALSE, TRUE));
+ return(l('<img src="' . gmaplocation_static_image_url(160, 120) . '" />', 'gmaplocation', array('html' => TRUE)));
}
/**
@@ -284,3 +282,13 @@
return ('<div id="gmaplocation_map" style="width: 640px; height: 480px"></div>');
}
+/**
+ * Implementation of hook_theme().
+ */
+function gmaplocation_theme() {
+ return array(
+ 'gmaplocation_block_image_link' => array(),
+ 'gmaplocation_map' => array(),
+ );
+}
+
\ No newline at end of file
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ .project 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>gmaplocation</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>