|
From: Jon O. <jon...@us...> - 2008-03-11 19:58:34
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4607 Modified Files: Tag: core28x mx_functions_style.php Log Message: core now support modulename.cfg out of the box ;) Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.17.2.23 retrieving revision 1.17.2.24 diff -C2 -d -r1.17.2.23 -r1.17.2.24 *** mx_functions_style.php 9 Mar 2008 11:55:14 -0000 1.17.2.23 --- mx_functions_style.php 11 Mar 2008 19:58:29 -0000 1.17.2.24 *************** *** 47,52 **** function mx_Template($root = '.') { ! $this->root = $root; ! parent::Template($this->root); } --- 47,59 ---- function mx_Template($root = '.') { ! parent::Template($root); ! ! // ! // Temp solution when the rootdir is not created ! // ! if (empty($this->root)) ! { ! $this->root = $root; ! } } *************** *** 147,151 **** $filename = $this->root . '/' . $filename; } ! if( file_exists($this->root . '/' . $style_path . '/' . $filename) ) { // --- 154,158 ---- $filename = $this->root . '/' . $filename; } ! else if( file_exists($this->root . '/' . $style_path . '/' . $filename) ) { // *************** *** 237,240 **** --- 244,248 ---- define('MX_IMAGES' , 50); define('MX_IMAGES_NONE' , 60); + define('MX_LANG_CUSTOM' , 70); /**#@-*/ *************** *** 277,280 **** --- 285,289 ---- var $default_module_style = ''; + var $module_lang_path = array(); var $is_admin = false; *************** *** 737,740 **** --- 746,750 ---- { global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; + global $mx_block; //unset($GLOBALS['MX_TEMPLATE_CONFIG']); *************** *** 742,745 **** --- 752,760 ---- // + // Load module cfg + // + $moduleCfgFile = str_replace('/', '', str_replace('modules/', '', $mx_block->module_root_path)); + + // // Load mxBB Template configuration data // - First try current template *************** *** 749,770 **** $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'); // --- 764,773 ---- $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'); } // *************** *** 775,781 **** $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'); } --- 778,787 ---- $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'); ! } } *************** *** 787,807 **** $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 --- 793,804 ---- $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 *************** *** 809,813 **** 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__); } --- 806,810 ---- 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__); } *************** *** 862,866 **** if (!empty($this->module_lang_path[$mx_block->module_root_path])) { ! $module_lang_path = $this->module_lang_path[$mx_block->module_root_path]; } else --- 859,863 ---- if (!empty($this->module_lang_path[$mx_block->module_root_path])) { ! $module_lang_path = $this->module_lang_path[$mx_block->module_root_path]; } else *************** *** 1036,1052 **** } - 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 --- 1033,1043 ---- } 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 |