| 1 |
<?php |
<?php |
| 2 |
// $Id: carto.inc,v 1.11 2006/04/01 22:24:19 openwereld Exp $ |
// $Id: carto.inc,v 1.12 2006/09/29 08:19:42 openwereld Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* These are the functions to be defined only when module is enabled. |
* These are the functions to be defined only when module is enabled. |
| 6 |
* Otherwise they could mess up with the admin system |
* Otherwise they could mess up with the admin system |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
if( file_exists( 'modules/carto/config.inc' ) ) |
$carto_config_path = drupal_get_path('module','carto') . '/config.inc'; |
| 10 |
|
if( file_exists( $carto_config_path ) ) |
| 11 |
{ |
{ |
| 12 |
include 'modules/carto/config.inc'; |
include $carto_config_path; |
| 13 |
|
|
| 14 |
// override carto variables |
// override carto variables |
| 15 |
if( defined( 'SMARTY_DIR' ) ) |
if( defined( 'SMARTY_DIR' ) ) |
| 72 |
global $base_url; |
global $base_url; |
| 73 |
if( $value != '' ) |
if( $value != '' ) |
| 74 |
{ |
{ |
| 75 |
define( "MAPPINGWIDGETS_BASE_URI", $base_path() . $value ); |
define( "MAPPINGWIDGETS_BASE_URI", base_path() . $value ); |
| 76 |
} |
} |
| 77 |
else |
else |
| 78 |
{ |
{ |
| 79 |
define( 'MAPPINGWIDGETS_BASE_URI', $base_path() . 'modules/carto/lib/mappingwidgets/htdocs/' ); |
define( 'MAPPINGWIDGETS_BASE_URI', base_path() . 'modules/carto/lib/mappingwidgets/htdocs/' ); |
| 80 |
} |
} |
| 81 |
} |
} |
| 82 |
|
|
| 85 |
{ |
{ |
| 86 |
// load configuration for current Drupal site |
// load configuration for current Drupal site |
| 87 |
if( ($path = drupal_get_filename( 'config', 'carto' )) ) |
if( ($path = drupal_get_filename( 'config', 'carto' )) ) |
| 88 |
include_once( $path ); |
require_once( $path ); |
| 89 |
|
|
| 90 |
require_once( variable_get('carto_mappingwidgets_dir',MAPPINGWIDGETS_DIR) . 'MappingWidgets.php' ); |
require_once( variable_get('carto_mappingwidgets_dir',MAPPINGWIDGETS_DIR) . 'MappingWidgets.php' ); |
| 91 |
|
|
| 132 |
|
|
| 133 |
function set_html_head( ) |
function set_html_head( ) |
| 134 |
{ |
{ |
| 135 |
|
// todo: put this somewhere else in drupal 5.0? |
| 136 |
|
drupal_add_css( variable_get('carto_mappingwidgets_base_uri',substr(MAPPINGWIDGETS_BASE_URI,strlen(base_path()))) |
| 137 |
|
. 'skins/default/styles/mappingwidgets.css' ); |
| 138 |
|
drupal_add_css( drupal_get_path('module','carto') . "/carto.css" ); |
| 139 |
|
|
| 140 |
$output = "\n"; |
$output = "\n"; |
|
if( function_exists('base_path') ) |
|
|
{ |
|
|
// >= drupal 4.7.0 beta6 |
|
|
$output .= theme('stylesheet_import', base_path() . variable_get('carto_mappingwidgets_base_uri',substr(MAPPINGWIDGETS_BASE_URI,strlen(base_path()))) |
|
|
. 'skins/default/styles/mappingwidgets.css' ); |
|
|
$output .= theme('stylesheet_import', base_path() . drupal_get_path('module','carto') . "/carto.css" ); |
|
|
|
|
|
// drupal_set_message( 'base_path=' . base_path() ); |
|
|
// drupal_set_message( 'carto_mappingwidgets_base_uri=' . variable_get('carto_mappingwidgets_base_uri','') ); |
|
|
// drupal_set_message( 'MAPPINGWIDGETS_BASE_URI=' . MAPPINGWIDGETS_BASE_URI ); |
|
|
} |
|
|
else |
|
|
{ |
|
|
$output .= "<style type=\"text/css\">@import url(" |
|
|
. variable_get('carto_mappingwidgets_base_uri',MAPPINGWIDGETS_BASE_URI) |
|
|
. 'skins/default/styles/mappingwidgets.css' |
|
|
. ");</style>\n"; |
|
|
$output .= "<style type=\"text/css\">@import url(" |
|
|
. drupal_get_path('module','carto') . "/carto.css);</style>\n"; |
|
|
} |
|
| 141 |
$output .= "<meta http-equiv=\"imagetoolbar\" content=\"no\" />\n"; |
$output .= "<meta http-equiv=\"imagetoolbar\" content=\"no\" />\n"; |
| 142 |
return drupal_set_html_head( $output ); |
return drupal_set_html_head( $output ); |
| 143 |
} |
} |