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

Diff of /contributions/modules/carto/carto.inc

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

revision 1.12, Fri Sep 29 08:19:42 2006 UTC revision 1.13, Fri Sep 29 14:34:22 2006 UTC
# Line 1  Line 1 
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' ) )
# Line 71  if( ! defined('MAPPINGWIDGETS_BASE_URI') Line 72  if( ! defined('MAPPINGWIDGETS_BASE_URI')
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    
# Line 84  if( file_exists(variable_get('carto_mapp Line 85  if( file_exists(variable_get('carto_mapp
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    
# Line 131  if( file_exists(variable_get('carto_mapp Line 132  if( file_exists(variable_get('carto_mapp
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          }          }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.2