linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file define.php

Documentation is available at define.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage config_files
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //BE CAREFULL THIS FILE IS A SYSTEM FILE : use define_release.ini and define_db.ini for settings
  12.  
  13. /////////////////////////////////////
  14. //    GLOBALS
  15. /////////////////////////////////////
  16.  
  17. // Defining CURRENT_APP
  18. if(strpos($_SERVER["SCRIPT_FILENAME"]'admin'!== falsedefine('CURRENT_APP''admin');
  19. else define('CURRENT_APP''public');
  20.  
  21. // Defining APPS
  22. // $GLOBALS['APPS'] = array('admin', 'public');
  23.  
  24.  
  25. define('END_LINE',        "\n");
  26. define('TAB_LINE',        "\t");
  27.  
  28. $GLOBALS['authorized_theme_sections'array ('THEME_SETTINGS');
  29. $GLOBALS['authorized_db_sections'array ('DATABASE');
  30. $GLOBALS['authorized_release_sections'array ('LANGUAGE_SETTINGS','NOTIFICATION_SETTINGS','LOCALES_SETTINGS','MODULES_SETTINGS','DEBUG_SETTINGS''SYSTEM_SETTINGS''SERVER_SETTINGS','MAIL_SETTINGS','MAIL_INFORMATIONS''SUPPORT_SETTINGS','LOGS_SETTINGS');
  31.  
  32. $GLOBALS['current_title'array()// HTML <title> tag
  33.  
  34. $GLOBALS['links'array()// Localized variables
  35. $GLOBALS['filters'array()// Localized (filters) variables
  36.  
  37. $GLOBALS['menuitems'array (
  38.                         'home',
  39.                         'news',
  40.                         'project',
  41.                         'dashboard',
  42.                         'workgroup',
  43.                         'workgroup-subscription',
  44.                         'publication',
  45.                         'directory',
  46.                         'contact'
  47.                        );
  48.  
  49.  
  50.  
  51. // INI file to PHP Constants
  52. include_once ("../class/class.config_file.php");
  53. if(!isset($CONFIG))
  54. {
  55.   $CONFIG new config_file;
  56.   $CONFIG->initializeIniParams();
  57. }
  58. define('CURRENT_APP_URL'SITE_ROOT_URLCURRENT_APP'/');
  59. define('THEME_ADMIN_PATH',        "../".THEME_DIRECTORY."/admin/".THEME_ADMIN."/");
  60. define('THEME_PUBLIC_PATH',        "../".THEME_DIRECTORY."/public/".THEME_PUBLIC."/");
  61.  
  62.  
  63. // Debuger Init
  64. if(defined('MOD_DEBUG'&& MOD_DEBUG == true{
  65.   require_once('../class/system/PHP_Debug/dbg.conf.php');
  66.   require_once('../class/system/PHP_Debug/PHP/Debug.php');
  67.   $Dbg new PHP_Debug($options);
  68.   $renderer 'HTML_Div';
  69.   $Dbg->addSetting($renderer'app_renderer_mode');
  70.   $Dbg->addSettings($options'app_settings');
  71.  
  72.   $Dbg->add('Admin theme : <b>'.THEME_ADMIN.'</b> | Public theme : <b>'.THEME_PUBLIC .'</b>');
  73.   $debug_line $Dbg->add('Pre-execute and includes');
  74. }
  75.  
  76. // Bootstrap (common includes)
  77. include_once("../config/server.php");
  78. include_once("../lib/items.php");
  79. include_once("../lib/lib_common.php");
  80.  
  81.  
  82. // Culture Init
  83. include_once('../lib/lang.php');
  84. include_once('../class/class.culture.php');
  85. define('U_L'culture::getInstance()->getVar('current'));
  86.  
  87. // Include ONLY the desired language PRODUCTION mode
  88. include(themePath('../languages/' .U_L'/define.php'));
  89. $GLOBALS['links'array_merge($GLOBALS['links']$l10n_links);
  90. $GLOBALS['filters'array_merge($GLOBALS['filters']$l10n_filters);
  91.  
  92. // Plugins Init - Dispatcher + installed plugins
  93. include_once("../lib/vendor/sfEventDispatcher/sfEventDispatcher.php");
  94. $dispatcher new sfEventDispatcher();
  95.  
  96. include_once('../class/class.plugin.php');
  97. foreach(availablePlugins(as $plugin{
  98.   $plug new plugin($plugin);
  99.   if($plug->is_active()) $plug->loadPlugin();
  100. }
  101.  
  102.  
  103. /**
  104.  * These globals have to be declared after $GLOBALS['links'] array.
  105.  */
  106. $GLOBALS['datePicker_includes'array('project|add''project|mod',
  107.                'dashboard|add''dashboard|mod',
  108.                'workshop|add_cal''workshop|mod_cal',
  109.                'prefs-utilisateur|');
  110.  
  111. $GLOBALS['multiSelect_includes'array('project|add''project|mod');
  112.  
  113. $GLOBALS['textboxList_includes'array('workshop|add''workshop|mod',
  114.              'workshop|add_u');
  115.  
  116. $GLOBALS['fancyUpload_includes'array('files');
  117.  
  118. // finally, we include user configuration file if exists
  119. if(CURRENT_APP == 'admin'{
  120.   $user_conf THEME_ADMIN_PATH.'/override/config/define.php';
  121. else {
  122.   $user_conf THEME_PUBLIC_PATH.'/override/config/define.php';
  123. }
  124. if(file_exists($user_conf)) include_once($user_conf);
  125. ?>

Documentation generated on Fri, 01 Apr 2011 09:29:58 +0200 by phpDocumentor 1.4.1