/[drupal]/contributions/modules/gmapez/gmapez.module
ViewVC logotype

Diff of /contributions/modules/gmapez/gmapez.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Tue Aug 5 05:11:08 2008 UTC revision 1.2, Tue Jun 9 18:36:45 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: gmapez.module,v 1.1.4.1 2008/08/05 08:18:53 berend Exp $
3    
4  /*  /*
5   * Implementation of hook_perm   * Implementation of hook_perm
# Line 12  function gmapez_perm() { Line 12  function gmapez_perm() {
12  /*  /*
13   * Implementation of hook_menu   * Implementation of hook_menu
14   */   */
15  function gmapez_menu ($may_cache) {  function gmapez_menu () {
16    $items = array();    $items['admin/settings/gmapez'] = array(
17    if ($may_cache) {      'title' => t('GMapEZ'),
18      $items[] = array('path' => 'admin/settings/gmapez',      'description' => t('Configure the GMapEZ module.'),
19        'title' => t('GMapEZ'),      'page callback' => 'drupal_get_form',
20        'description' => t('Configure the GMapEZ module.'),      'page arguments' => array('gmapez_admin_settings'),
21        'callback' => 'drupal_get_form',      'access arguments' => array('administer gmapez'));
       'callback arguments' => 'gmapez_admin_settings',  
       'access' => user_access('administer gmapez'));  
   }  
   else {  
     if (arg(0) != 'admin' && variable_get('gmapez_always', 1)) {  
       gmapez_add_script();  
     }  
   }  
22    return $items;    return $items;
23  }  }
24    
25    
26  /*  /*
27     * Add script to every page, except admin pages.
28     */
29    function gmapez_init () {
30      if (arg(0) != 'admin' && variable_get('gmapez_always', 1)) {
31        gmapez_add_script();
32      }
33    }
34    
35    
36    /*
37   * Add the gmapez script   * Add the gmapez script
38   */   */
39  function gmapez_add_script () {  function gmapez_add_script () {
# Line 39  function gmapez_add_script () { Line 41  function gmapez_add_script () {
41    if (! $initialized) {    if (! $initialized) {
42      $key = variable_get('gmapez_gmapkey', 'ABQIAAAAVBWrZTQWTeQ_EA-QxCBdXBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQ8GMDInMeMDuMjCUi2ppmV64EOcw');      $key = variable_get('gmapez_gmapkey', 'ABQIAAAAVBWrZTQWTeQ_EA-QxCBdXBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQ8GMDInMeMDuMjCUi2ppmV64EOcw');
43      drupal_set_html_head('<meta name="gmapkey" content="'. $key .'" />');      drupal_set_html_head('<meta name="gmapkey" content="'. $key .'" />');
44      drupal_add_js (drupal_get_path('module', 'gmapez') . '/gmapez-2.4-improved.js');      drupal_add_js (drupal_get_path('module', 'gmapez') . '/gmapez-2.5-improved.js');
45      $initialized = 1;      $initialized = 1;
46    }    }
47  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2