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

Documentation generated on Mon, 08 Apr 2013 18:13:36 +0200 by phpDocumentor 1.4.1