Location: PHPKode > projects > MappingWidgets > mappingwidgets-0.3.1/configs/settings.inc.php
<?php
/**
 * $Id: settings.inc.php 31 2006-03-04 13:49:07Z openwereld $
 */

if( $_SERVER['HTTP_HOST'] == 'mappingwidgets.sourceforge.net' )
{
    // settings for the Sourceforge site
    define( 'MAPPINGWIDGETS_BASE_URI', '/modules/carto/lib/mappingwidgets/htdocs/' );
    define( 'MAPPINGWIDGETS_TMP_DIR', '/tmp/persistent/mappingwidgets/' );
}

if( strpos( __FILE__, DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'carto' . DIRECTORY_SEPARATOR ) )
{
    // mappingwidgets is installed under carto module
    // NB: this code may not work in case of symbolic links!
    
    $basedir = substr( __FILE__, 0, strpos( __FILE__, "configs") );
    $drupaldir = substr( __FILE__, 0, strpos( __FILE__, "modules") );
    $baseuri = /*'http://' . $_SERVER['HTTP_HOST'] .*/ substr( $_SERVER['REQUEST_URI'], 0, strpos( $_SERVER['REQUEST_URI'], "modules") );

    if ( ! defined( 'SMARTY_DIR' ) )
    {
        define( 'SMARTY_DIR', $dir . '/lib/Smarty-2.6.10/libs/' );
    }

    if( ! defined('MAPPINGWIDGETS_BASE_URI') )
    {
        define( 'MAPPINGWIDGETS_BASE_URI', $baseuri . 'modules/carto/lib/mappingwidgets/htdocs/' );
    }

    if( ! defined('MAPPINGWIDGETS_WIDGETS_URI') )
    {
        // ??
        define( 'MAPPINGWIDGETS_WIDGETS_URI', $baseuri . 'modules/carto/lib/mappingwidgets/widgets/' );
    }

    if( ! defined('MAPPINGWIDGETS_TMP_DIR') )
    {
        if( strtoupper(substr(PHP_OS,0,3)) == "WIN" )
            define( 'MAPPINGWIDGETS_TMP_DIR', "C:/TEMP/mappingwidgets/" );
        else // linux
            define( 'MAPPINGWIDGETS_TMP_DIR', '/tmp/mappingwidgets/' );
    }

    if( ! defined('MAPPINGWIDGETS_IMAGEPATH') )
    {
        // same as IMAGEPATH constant in WEB section of map files
        define( 'MAPPINGWIDGETS_IMAGEPATH', $drupaldir . 'files/' );
    }
    
    if( ! defined('MAPPINGWIDGETS_IMAGEURL') )
    {
        // same as IMAGEURL constant in WEB section of map files
        define( 'MAPPINGWIDGETS_IMAGEURL', $baseuri . 'files/' );
    }
}
else
{
    // mappingwidgets is NOT installed under carto module
    
    if ( ! defined( 'SMARTY_DIR' ) )
    {
        if( strtoupper(substr(PHP_OS,0,3)) == "WIN" )
            define( 'SMARTY_DIR', "C:/Program Files/Smarty-2.6.9/libs/" );
        else // linux
            define( 'SMARTY_DIR', '/usr/share/php/smarty/libs/' );
    }
    
    
    if( ! defined( 'MAPPINGWIDGETS_BASE_URI' ) )
    {
        // linux & windows
        define( 'MAPPINGWIDGETS_BASE_URI', '/drupal-stable/modules/carto/lib/mappingwidgets/htdocs/' );//'/mappingwidgets/' );
    }
    
    if ( ! defined( 'MAPPINGWIDGETS_TMP_DIR' ) )
    {
        if( strtoupper(substr(PHP_OS,0,3)) == "WIN" )
        {
            define( 'MAPPINGWIDGETS_TMP_DIR', "C:/TEMP/mappingwidgets/" );
        }
        else // linux
            define( 'MAPPINGWIDGETS_TMP_DIR', '/tmp/mappingwidgets/' );
    }
}

if ( ! defined( 'MAPPINGWIDGETS_COMPILE_DIR' ) )
{
    define( 'MAPPINGWIDGETS_COMPILE_DIR', MAPPINGWIDGETS_TMP_DIR . 'templates_c' );
}

if ( ! defined( 'MAPPINGWIDGETS_CACHE_DIR' ) )
{
    define( 'MAPPINGWIDGETS_CACHE_DIR', MAPPINGWIDGETS_TMP_DIR . 'cache' );
}

if ( ! defined( 'MAPPINGWIDGETS_TMP_IMAGE_DIR' ) )
{
    define( 'MAPPINGWIDGETS_TMP_IMAGE_DIR', MAPPINGWIDGETS_TMP_DIR . 'images' );
}

if ( ! defined( 'MAPPINGWIDGETS_TMP_MAP_DIR' ) )
{
    define( 'MAPPINGWIDGETS_TMP_MAP_DIR', MAPPINGWIDGETS_TMP_DIR . 'maps' );
}

?>
Return current item: MappingWidgets