Fix for Patch file from Eclipse—unnecessary cruft?

  1. ### Eclipse Workspace Patch 1.0
  2. #P gmaplocation
  3. Index: todo.txt
  4. ===================================================================
  5. RCS file: todo.txt
  6. diff -N todo.txt
  7. Index: gmaplocation.info
  8. ===================================================================
  9. RCS file: /cvs/drupal/contributions/modules/gmaplocation/gmaplocation.info,v
  10. retrieving revision 1.1
  11. diff -u -r1.1 gmaplocation.info
  12. --- gmaplocation.info   18 Jun 2008 14:19:44 -0000      1.1
  13. +++ gmaplocation.info   13 Feb 2009 12:52:59 -0000
  14. @@ -1,5 +1,6 @@
  15. -; $Id: gmaplocation.info,v 1.1 2008/06/18 14:19:44 bmihelac Exp $
  16. +; $Id$
  17.  name = Google Maps location
  18.  description = Display one geographic location via Google Maps
  19.  package = Location
  20. -version = "$Name:  $"
  21. \ No newline at end of file
  22. +core = 6.x
  23. +version = 6.x-1.x-dev
  24. \ No newline at end of file
  25. Index: gmaplocation.module
  26. ===================================================================
  27. RCS file: /cvs/drupal/contributions/modules/gmaplocation/gmaplocation.module,v
  28. retrieving revision 1.1
  29. diff -u -r1.1 gmaplocation.module
  30. --- gmaplocation.module 18 Jun 2008 14:19:44 -0000      1.1
  31. +++ gmaplocation.module 13 Feb 2009 12:52:59 -0000
  32. @@ -3,35 +3,33 @@
  33.  /**
  34.   * Implementation of hook_help
  35.   */  
  36. -function gmaplocation_help($section) {
  37. -  switch ($section) {
  38. -    case 'admin/help#pathauto':
  39. -      $output = t("<p>The gmaplocation module displays marker of your geographic location with Google Maps.</p>");
  40. -      return $output;
  41. +function gmaplocation_help($path, $arg) {
  42. +   switch ($path) {
  43. +      case 'admin/help#gmaplocation':
  44. +        $output = t("<p>The gmaplocation module displays marker of your geographic location with Google Maps.</p>");
  45. +        return $output;
  46.    }
  47.  }
  48.  
  49.  /**
  50.   * Implementation of hook_menu().
  51.   */
  52. -function gmaplocation_menu($may_cache) {
  53. +function gmaplocation_menu() {
  54.    $items = array();
  55. -  if ($may_cache) {
  56. -    $items[] = array(
  57. -      'path' => 'admin/settings/gmaplocation',
  58. -      'title' => t('Google Maps location'),
  59. -      'description' => t('Configure Google Maps location.'),
  60. -      'callback' => 'drupal_get_form',
  61. -      'callback arguments' => array('gmaplocation_admin_settings'),
  62. -      'access' => user_access('admin gmaplocation'),
  63. -      'type' => MENU_NORMAL_ITEM,
  64. -    );    
  65. -    $items[] = array('path' => 'gmaplocation', 'title' => t('Our Location'),
  66. -      'access' => TRUE,
  67. -      'callback' => 'gmaplocation_page',
  68. -      'type' => MENU_SUGGESTED_ITEM,
  69. -      );
  70. -  }
  71. +  $items['admin/settings/gmaplocation'] = array(
  72. +    'title' => 'Google Maps location',
  73. +    'description' => 'Configure Google Maps location.',
  74. +    'page callback' => 'drupal_get_form',
  75. +    'page arguments' => array('gmaplocation_admin_settings'),
  76. +    'access callback' => 'user_access',
  77. +    'access arguments' => array('admin gmaplocation'),
  78. +    'type' => MENU_NORMAL_ITEM,
  79. +  );    
  80. +  $items['gmaplocation'] = array('title' => 'Our Location',
  81. +    'access callback' => TRUE,
  82. +    'page callback' => 'gmaplocation_page',
  83. +    'type' => MENU_SUGGESTED_ITEM,
  84. +    );
  85.    return $items;
  86.  }
  87.  
  88. @@ -103,14 +101,14 @@
  89.      '#description' => t('Google Maps key for your domain.') . " " .  
  90.                        t('Obtain key on !url', array('!url' => l('http://code.google.com/apis/maps/signup.html', 'http://code.google.com/apis/maps/signup.html')))
  91.                        );
  92. -       $form['#submit'] = array('system_settings_form_submit' => array(), 'gmaplocation_admin_settings_submit' => array());
  93. +       $form['#validate'][] = 'gmaplocation_admin_settings_submit';
  94.                        
  95.    return system_settings_form($form);
  96.  }
  97.  
  98. -function gmaplocation_admin_settings_submit($form, $form_values) {
  99. -  if ($form_values['gmaplocation_address']) {
  100. -    $latlng = gmaplocation_geocode_for_address_recursive($form_values['gmaplocation_address']);
  101. +function gmaplocation_admin_settings_validate($form, &$form_state) {
  102. +  if ($form_state['values']['gmaplocation_address']) {
  103. +    $latlng = gmaplocation_geocode_for_address_recursive($form_state['values']['gmaplocation_address']);
  104.      if ($latlng != FALSE) {
  105.        list($lat, $lng) = $latlng;
  106.      } else {
  107. @@ -118,8 +116,8 @@
  108.        $lat = 46.051426;
  109.        $lng = 14.505965;
  110.      }
  111. -    variable_set('gmaplocation_lat', $lat);
  112. -    variable_set('gmaplocation_lng', $lng);
  113. +    $form_state['values']['gmaplocation_lat'] = $lat;
  114. +    $form_state['values']['gmaplocation_lng'] = $lng;
  115.    }
  116.  }
  117.  
  118. @@ -191,7 +189,7 @@
  119.  }
  120.  
  121.  function gmaplocation_in_place_edit_form() {
  122. -  $form['#base'] = 'system_settings_form';
  123. +  $form['#submit'][] = 'system_settings_form_submit';
  124.    $form['description'] = array(
  125.      '#prefix' => '<p>',
  126.      '#value' => t('Click and drag marker to fine tune position of your location.'),
  127. @@ -272,7 +270,7 @@
  128.   * @ingroup themeable
  129.   */
  130.  function theme_gmaplocation_block_image_link() {
  131. -  return(l('<img src="' . gmaplocation_static_image_url(160, 120) . '" />', 'gmaplocation', array(), NULL, NULL, FALSE, TRUE));
  132. +  return(l('<img src="' . gmaplocation_static_image_url(160, 120) . '" />', 'gmaplocation', array('html' => TRUE)));
  133.  }
  134.  
  135.  /**
  136. @@ -284,3 +282,13 @@
  137.    return ('<div id="gmaplocation_map" style="width: 640px; height: 480px"></div>');
  138.  }
  139.  
  140. +/**
  141. + * Implementation of hook_theme().
  142. + */
  143. +function gmaplocation_theme() {
  144. +  return array(
  145. +    'gmaplocation_block_image_link' => array(),
  146. +    'gmaplocation_map' => array(),
  147. +  );
  148. +}
  149. +
  150. \ No newline at end of file
  151. Index: .project
  152. ===================================================================
  153. RCS file: .project
  154. diff -N .project
  155. --- /dev/null   1 Jan 1970 00:00:00 -0000
  156. +++ .project    1 Jan 1970 00:00:00 -0000
  157. @@ -0,0 +1,11 @@
  158. +<?xml version="1.0" encoding="UTF-8"?>
  159. +<projectDescription>
  160. +       <name>gmaplocation</name>
  161. +       <comment></comment>
  162. +       <projects>
  163. +       </projects>
  164. +       <buildSpec>
  165. +       </buildSpec>
  166. +       <natures>
  167. +       </natures>
  168. +</projectDescription>

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.