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''COMMENT_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.                         'contribute',
  47.                         'contact'
  48.                        );
  49.  
  50.  
  51.  
  52. // INI file to PHP Constants
  53. include_once ("../class/class.config_file.php");
  54. if(!isset($CONFIG))
  55. {
  56.   $CONFIG new config_file;
  57.   $CONFIG->initializeIniParams();
  58. }
  59. define('CURRENT_APP_URL'SITE_ROOT_URLCURRENT_APP'/');
  60. define('THEME_ADMIN_PATH',        "../".THEME_DIRECTORY."/admin/".THEME_ADMIN."/");
  61. define('THEME_PUBLIC_PATH',        "../".THEME_DIRECTORY."/public/".THEME_PUBLIC."/");
  62.  
  63.  
  64. // Debuger Init
  65. if(defined('MOD_DEBUG'&& MOD_DEBUG == true{
  66.   require_once('../class/system/PHP_Debug/dbg.conf.php');
  67.   require_once('../class/system/PHP_Debug/PHP/Debug.php');
  68.   $Dbg new PHP_Debug($options);
  69.   $renderer 'HTML_Div';
  70.   $Dbg->addSetting($renderer'app_renderer_mode');
  71.   $Dbg->addSettings($options'app_settings');
  72.  
  73.   $Dbg->add('Admin theme : <b>'.THEME_ADMIN.'</b> | Public theme : <b>'.THEME_PUBLIC .'</b>');
  74.   $debug_line $Dbg->add('Pre-execute and includes');
  75. }
  76.  
  77. // Bootstrap (common includes)
  78. include_once("../config/server.php");
  79. include_once("../lib/items.php");
  80. include_once("../lib/lib_common.php");
  81.  
  82.  
  83. // Culture Init
  84. include_once('../lib/lang.php');
  85. include_once('../class/class.culture.php');
  86. define('U_L'culture::getInstance()->getVar('current'));
  87.  
  88. // Include ONLY the desired language PRODUCTION mode
  89. include(themePath('../languages/' .U_L'/define.php'));
  90. $GLOBALS['links'array_merge($GLOBALS['links']$l10n_links);
  91. $GLOBALS['filters'array_merge($GLOBALS['filters']$l10n_filters);
  92.  
  93. // Plugins Init - Dispatcher + installed plugins
  94. include_once("../lib/vendor/sfEventDispatcher/sfEventDispatcher.php");
  95. $dispatcher new sfEventDispatcher();
  96.  
  97. if(defined('MOD_PLUGINS'&& MOD_PLUGINS == 1{
  98.     include_once('../class/class.plugin.php');
  99.     foreach(availablePlugins(as $plugin{
  100.       $plug new plugin($plugin);
  101.       if($plug->is_active()) $plug->loadPlugin();
  102.     }
  103. }
  104.  
  105.  
  106. /**
  107.  * These globals have to be declared after $GLOBALS['links'] array.
  108.  */
  109.  
  110. $GLOBALS['multiSelect_includes'array('project|add''project|mod');
  111.  
  112. $GLOBALS['textboxList_includes'array('workshop|add''workshop|mod',
  113.              'workshop|add_u');
  114.  
  115. $GLOBALS['fancyUpload_includes'array('files');
  116.  
  117. // finally, we include user configuration file if exists
  118. if(CURRENT_APP == 'admin'{
  119.   $user_conf THEME_ADMIN_PATH.'/override/config/define.php';
  120. else {
  121.   $user_conf THEME_PUBLIC_PATH.'/override/config/define.php';
  122. }
  123. if(file_exists($user_conf)) include_once($user_conf);
  124. ?>

Documentation generated on Thu, 03 May 2012 15:03:37 +0200 by phpDocumentor 1.4.1