|
From: Jon O. <jon...@us...> - 2008-03-11 19:57:55
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv3570 Modified Files: mx_functions_core.php mx_functions_style.php template.php Log Message: core now support modulename.cfg out of the box ;) Index: template.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/template.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** template.php 10 Feb 2008 23:05:13 -0000 1.26 --- template.php 11 Mar 2008 19:57:47 -0000 1.27 *************** *** 94,98 **** // Default template directory. // If file for default template isn't found file from this template is used. ! var $tpldef = 'subSilver'; // this will hash handle names to the compiled code for that handle. --- 94,99 ---- // Default template directory. // If file for default template isn't found file from this template is used. ! //var $tpldef = 'subSilver'; ! var $tpldef = '_core'; // this will hash handle names to the compiled code for that handle. Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** mx_functions_core.php 9 Mar 2008 23:38:00 -0000 1.84 --- mx_functions_core.php 11 Mar 2008 19:57:47 -0000 1.85 *************** *** 281,285 **** // $sql = "SELECT blk.*, ! mdl.module_path, fnc.function_file, fnc.function_id, fnc.function_admin FROM " . BLOCK_TABLE . " blk, --- 281,285 ---- // $sql = "SELECT blk.*, ! mdl.module_path fnc.function_file, fnc.function_id, fnc.function_admin FROM " . BLOCK_TABLE . " blk, Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** mx_functions_style.php 9 Mar 2008 23:49:46 -0000 1.63 --- mx_functions_style.php 11 Mar 2008 19:57:47 -0000 1.64 *************** *** 153,158 **** function mx_Template($root = '.') { ! $this->root = $root; ! parent::Template($this->root); } --- 153,165 ---- function mx_Template($root = '.') { ! parent::Template($root); ! ! // ! // Temp solution when the rootdir is not created ! // ! if (empty($this->root)) ! { ! $this->root = $root; ! } } *************** *** 319,323 **** $filename = $this->root . '/' . $filename; } ! if( file_exists($this->root . '/' . $style_path . '/' . $filename) ) { // --- 326,330 ---- $filename = $this->root . '/' . $filename; } ! else if( file_exists($this->root . '/' . $style_path . '/' . $filename) ) { // *************** *** 528,531 **** --- 535,539 ---- var $default_module_style = ''; + var $module_lang_path = array(); var $is_admin = false; *************** *** 725,729 **** $board_config['default_lang'] = 'english'; } ! include($phpbb_lang_path . "lang_" . $board_config['default_lang'] . "/lang_admin.$phpEx"); // Also include phpBB admin lang keys include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . "/lang_admin.$phpEx"); // Also include mxP Admin lang keys --- 733,737 ---- $board_config['default_lang'] = 'english'; } ! include($phpbb_lang_path . "lang_" . $board_config['default_lang'] . "/lang_admin.$phpEx"); // Also include phpBB admin lang keys include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . "/lang_admin.$phpEx"); // Also include mxP Admin lang keys *************** *** 1239,1242 **** --- 1247,1251 ---- { global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; + global $mx_block; //unset($GLOBALS['MX_TEMPLATE_CONFIG']); *************** *** 1244,1247 **** --- 1253,1261 ---- // + // Load module cfg + // + $moduleCfgFile = str_replace('/', '', str_replace('modules/', '', $mx_block->module_root_path)); + + // // Load MX-Publisher Template configuration data // - First try current template *************** *** 1251,1283 **** $default_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->template_name; ! ! // ! // If use default template with difrent modules config file name ! // ! if (!empty($this->module_cfg_name[$module_root_path])) ! { ! $module_cfg_info = "<br />Custom module config file: " . $this->module_cfg_name[$module_root_path]; ! $default_cfg_file = $this->module_cfg_name[$module_root_path]; ! ! } ! else { ! $module_cfg_info = "<br />Custom module config file: Not set"; ! $default_cfg_file = false; } - - - @include($mx_root_path . $module_root_path . $this->current_template_path . '/' . $this->template_name . '.cfg'); // // Since we have no current Template Config file, try the cloned template instead // ! if ( !$mx_template_config ) { $current_template_path = $module_root_path . $this->cloned_current_template_path; $template_name = $this->cloned_template_name; - $default_cfg_file = ($default_cfg_file) ? $default_cfg_file : $this->cloned_template_name; ! @include($mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $default_cfg_file . '.cfg'); } --- 1265,1288 ---- $default_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->template_name; ! ! @include($mx_root_path . $module_root_path . $this->current_template_path . '/' . $template_name . '.cfg'); ! if (!$mx_template_config) { ! @include($mx_root_path . $module_root_path . $this->current_template_path . '/' . $moduleCfgFile . '.cfg'); } // // Since we have no current Template Config file, try the cloned template instead // ! if (!$mx_template_config) { $current_template_path = $module_root_path . $this->cloned_current_template_path; $template_name = $this->cloned_template_name; ! @include($mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $template_name . '.cfg'); ! if (!$mx_template_config) ! { ! @include($mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $moduleCfgFile . '.cfg'); ! } } *************** *** 1285,1315 **** // If use default template intead // ! if ( !$mx_template_config ) { $current_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->default_template_name; - $default_cfg_file = ($default_cfg_file) ? $default_cfg_file : $this->default_template_name; ! @include($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $default_cfg_file . '.cfg'); } - - // - // If use default module template intead - // - if ( !$mx_template_config ) - { - $current_template_path = $module_root_path . $this->default_module_style; - $template_name = $this->default_module_style; - $default_cfg_file = ($default_cfg_file) ? $default_cfg_file : $this->default_module_style; - @include($mx_root_path . $module_root_path . $this->default_module_style . '/' . $default_cfg_file . '.cfg'); - } - // // We have no template to use - die // ! if ( !$mx_template_config ) { ! mx_message_die(CRITICAL_ERROR, "Could not open " . $mx_root_path . $module_root_path . $this->cloned_current_template_path . '/' . $this->cloned_template_name . '.cfg' . " style config file or file can not be validated. <br /> Current style: $this->template_name <br />Cloned style: $this->cloned_template_name <br />Default style: $this->default_template_name <br />Custom module default style: $this->default_module_style $module_cfg_info", '', __LINE__, __FILE__); } --- 1290,1311 ---- // If use default template intead // ! if (!$mx_template_config) { $current_template_path = $module_root_path . $this->default_current_template_path; $template_name = $this->default_template_name; ! @include($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $template_name . '.cfg'); ! if (!$mx_template_config) ! { ! @include($mx_root_path . $module_root_path . $this->default_current_template_path . '/' . $moduleCfgFile . '.cfg'); ! } } // // We have no template to use - die // ! if (!$mx_template_config) { ! mx_message_die(CRITICAL_ERROR, "Could not open " . $mx_root_path . $module_root_path . $this->default_current_template_path . " style config file", '', __LINE__, __FILE__); } *************** *** 1364,1368 **** if (!empty($this->module_lang_path[$mx_block->module_root_path])) { ! $module_lang_path = $this->module_lang_path[$mx_block->module_root_path]; } else --- 1360,1364 ---- if (!empty($this->module_lang_path[$mx_block->module_root_path])) { ! $module_lang_path = $this->module_lang_path[$mx_block->module_root_path]; } else *************** *** 1728,1744 **** } - function set_module_cfg_name($module_cfg_name = '') - { - global $mx_block; - - $this->module_cfg_name[$mx_block->module_root_path] = $module_cfg_name; - } - function set_module_lang_path($module_lang_path = '') { global $mx_block; ! $this->module_lang_path[$mx_block->module_root_path] = $module_lang_path; } } // class mx_user ?> \ No newline at end of file --- 1724,1734 ---- } function set_module_lang_path($module_lang_path = '') { global $mx_block; ! $this->module_lang_path[$mx_block->module_root_path] = $module_lang_path; } + } // class mx_user ?> \ No newline at end of file |