| 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 |
|
|
| 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': |
| 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 |
|
|
| 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' |
| 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" ) ) |
| 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 |
{ |
{ |
| 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 |
{ |
{ |
| 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( ); |
| 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 |
|
|