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

Diff of /contributions/modules/carto/carto.module

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

revision 1.16, Fri Sep 29 08:19:42 2006 UTC revision 1.17, Fri Sep 29 14:34:22 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: carto.module,v 1.15 2006/05/14 20:13:27 openwereld Exp $  // $Id: carto.module,v 1.16 2006/09/29 08:19:42 openwereld Exp $
3    
4  define( 'DEFAULT_WMS_SEARCH_FIELDS', 'name,title,abstract' );  define( 'DEFAULT_WMS_SEARCH_FIELDS', 'name,title,abstract' );
5    
# Line 33  function carto_help( $section ) Line 33  function carto_help( $section )
33      case 'admin/help#carto': // 2nd part      case 'admin/help#carto': // 2nd part
34          // return something to prevent message "No help is available for module carto."          // return something to prevent message "No help is available for module carto."
35          $output .= '<p>' . t('The Carto module uses mappingwidgets for web mapping functionality.') . '</p>';          $output .= '<p>' . t('The Carto module uses mappingwidgets for web mapping functionality.') . '</p>';
36          $output .= '<p>' . t('For more help on mappingwidgets see <a href="http://mappingtools.org/mappingwidgets/">http://mappingtools.org/mappingwidgets/</a>.') . '</p>';          $output .= '<p>' . t('For more help on mappingwidgets see <a href="http://mappingtools.org/manual/">http://mappingtools.org/manual/</a>.') . '</p>';
37          break;          break;
38    
39      case 'admin/modules#description':      case 'admin/modules#description':
# Line 85  function carto_init( ) Line 85  function carto_init( )
85      // If not in bootstrap, include hooks      // If not in bootstrap, include hooks
86      if( ! _carto_is_bootstrap( ) )      if( ! _carto_is_bootstrap( ) )
87      {      {
88          include 'modules/carto/carto.inc';          include drupal_get_path('module','carto') . '/carto.inc';
89      }      }
90  }  }
91    
# Line 205  function carto_menu( $may_cache ) Line 205  function carto_menu( $may_cache )
205                  , 'type' => MENU_CALLBACK                  , 'type' => MENU_CALLBACK
206                  );                  );
207    
208            // settings
209            $items[] = array( 'path' => 'admin/settings/carto'
210                    , 'title' => t('carto')
211                    , 'callback' => 'drupal_get_form'
212                    , 'callback arguments' => 'carto_admin_settings'
213                    , 'access' => user_access('administer site configuration')
214                    , 'type' => MENU_NORMAL_ITEM
215                    );
216    
217          // used for ajax functionality?          // used for ajax functionality?
218          $items[] = array( 'path' => 'carto/action/simple'          $items[] = array( 'path' => 'carto/action/simple'
219                  , 'callback' => 'carto_action_simple'                  , 'callback' => 'carto_action_simple'
# Line 227  function carto_menu( $may_cache ) Line 236  function carto_menu( $may_cache )
236   * After a submit, this function is called by the system module after the   * After a submit, this function is called by the system module after the
237   * variables have been saved.   * variables have been saved.
238   */   */
239  function carto_settings( )  function carto_admin_settings( )
240  {  {
241      // only for administrators      // only for administrators
242      if( ! user_access( "administer carto" ) )      if( ! user_access( "administer carto" ) )
# Line 344  function carto_settings( ) Line 353  function carto_settings( )
353              $form = array_merge( $form, call_user_func($func) );              $form = array_merge( $form, call_user_func($func) );
354          }          }
355      }      }
356      return $form;      return system_settings_form($form);
357  }  }
358    
359  /**  /**
360   * (drupal 4.7.x)   * (drupal 4.7.x)
361   * Validate function for 'carto_settings_form'.   * Validate function for 'carto_settings_form'.
362   */   */
363  function carto_settings_form_validate( $form_id, &$form )  function carto_admin_settings_validate( $form_id, &$form )
364  {  {
365      if( ! file_exists( $form['mappingwidgets']['carto_mappingwidgets_dir'] . 'MappingWidgets.php' ) )      if( ! file_exists( $form['mappingwidgets']['carto_mappingwidgets_dir'] . 'MappingWidgets.php' ) )
366      {      {
# Line 381  function carto_settings_form_validate( $ Line 390  function carto_settings_form_validate( $
390   * (drupal 4.7.x)   * (drupal 4.7.x)
391   * Submit function for 'carto_settings_form'.   * Submit function for 'carto_settings_form'.
392   */   */
393  function carto_settings_form_submit( $form_id, $values )  function carto_admin_settings_submit( $form_id, $values )
394  {  {
395      if( $values['carto']['carto_empty_cache'] == 1 )      if( $values['carto']['carto_empty_cache'] == 1 )
396      {      {
# Line 813  function carto_filter( $op, $delta = 0, Line 822  function carto_filter( $op, $delta = 0,
822          case 'process':          case 'process':
823              if( ! function_exists('get_carto_mapper') )              if( ! function_exists('get_carto_mapper') )
824              {              {
825                  trigger_error( t('Carto module is not configured correctly.'), E_USER_ERROR );                  trigger_error( t('Carto module is not configured correctly. Check your \'config.inc\' file.'), E_USER_ERROR );
826                  return "";                  return "";
827              }              }
828              $cartoSmarty = get_carto_mapper( );              $cartoSmarty = get_carto_mapper( );
# Line 1190  function carto_node_info() Line 1199  function carto_node_info()
1199  {  {
1200      return array(      return array(
1201          'carto-wms' => array( 'name' => t('web mapping service')          'carto-wms' => array( 'name' => t('web mapping service')
1202                              , 'base' => 'carto_wms' )                              , 'module' => 'carto_wms'
1203                                , 'description' => t('todo: description of carto-wms node type')
1204                                )
1205      );      );
1206  }  }
1207    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.2