[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * initialise template system variables 4 * see {@link http://www.zen-cart.com/wiki/index.php/Developers_API_Tutorials#InitSystem wikitutorials} for more details. 5 * 6 * Determines current template name for current language, from database<br /> 7 * Then loads template-specific language file, followed by master/default language file<br /> 8 * ie: includes/languages/classic/english.php followed by includes/languages/english.php 9 * 10 * @package initSystem 11 * @copyright Copyright 2003-2006 Zen Cart Development Team 12 * @copyright Portions Copyright 2003 osCommerce 13 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 14 * @version $Id: init_templates.php 3123 2006-03-06 23:36:46Z drbyte $ 15 */ 16 if (!defined('IS_ADMIN_FLAG')) { 17 die('Illegal Access'); 18 } 19 20 /* 21 * Determine the active template name 22 */ 23 $template_dir = ""; 24 $sql = "select template_dir 25 from " . TABLE_TEMPLATE_SELECT . " 26 where template_language = 0"; 27 $template_query = $db->Execute($sql); 28 $template_dir = $template_query->fields['template_dir']; 29 30 $sql = "select template_dir 31 from " . TABLE_TEMPLATE_SELECT . " 32 where template_language = '" . $_SESSION['languages_id'] . "'"; 33 $template_query = $db->Execute($sql); 34 if ($template_query->RecordCount() > 0) { 35 $template_dir = $template_query->fields['template_dir']; 36 } 37 38 /** 39 * The actual template directory to use 40 */ 41 define('DIR_WS_TEMPLATE', DIR_WS_TEMPLATES . $template_dir . '/'); 42 /** 43 * The actual template images directory to use 44 */ 45 define('DIR_WS_TEMPLATE_IMAGES', DIR_WS_TEMPLATE . 'images/'); 46 /** 47 * The actual template icons directory to use 48 */ 49 define('DIR_WS_TEMPLATE_ICONS', DIR_WS_TEMPLATE_IMAGES . 'icons/'); 50 51 /** 52 * Load the appropriate Language files, based on the currently-selected template 53 */ 54 55 if (file_exists(DIR_WS_LANGUAGES . $template_dir . '/' . $_SESSION['language'] . '.php')) { 56 $template_dir_select = $template_dir . '/'; 57 /** 58 * include the template language overrides 59 */ 60 include_once(DIR_WS_LANGUAGES . $template_dir_select . $_SESSION['language'] . '.php'); 61 } else { 62 $template_dir_select = ''; 63 // include_once(DIR_WS_LANGUAGES . $template_dir_select . $_SESSION['language'] . '.php'); 64 } 65 /** 66 * include the template language master (to catch all items not defined in the override file). 67 * The intent here is to: load the override version to catch preferencial changes; 68 * then load the original/master version to catch any defines that didn't get set into the override version during upgrades, etc. 69 */ 70 // THE FOLLOWING MIGHT NEED TO BE DISABLED DUE TO THE EXISTENCE OF function() DECLARATIONS IN MASTER ENGLISH.PHP FILE 71 // THE FOLLOWING MAY ALSO SEND NUMEROUS ERRORS IF YOU HAVE ERROR_REPORTING ENABLED, DUE TO REPETITION OF SEVERAL DEFINE STATEMENTS 72 include_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '.php'); 73 74 75 /** 76 * send the content charset "now" so that all content is impacted by it 77 */ 78 header("Content-Type: text/html; charset=" . CHARSET); 79 80 /** 81 * include the extra language definitions 82 */ 83 include(DIR_WS_MODULES . 'extra_definitions.php'); 84 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |