|
From: Jon O. <jon...@us...> - 2008-03-09 23:49:51
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24767 Modified Files: mx_functions_style.php Log Message: oops. i accidently removed all your updates, i was trying to understand what you had done, and swtiched files... Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** mx_functions_style.php 9 Mar 2008 23:38:00 -0000 1.62 --- mx_functions_style.php 9 Mar 2008 23:49:46 -0000 1.63 *************** *** 153,157 **** function mx_Template($root = '.') { ! parent::Template($root); } --- 153,158 ---- function mx_Template($root = '.') { ! $this->root = $root; ! parent::Template($this->root); } *************** *** 311,318 **** --- 312,350 ---- $filename = $mx_root_path . 'templates/' . $mx_user->default_template_name . '/' . $filename2; } + // + // Look at Custom Root folder..............this is used my mx_mod installers too.......this does not use standard templates folders wich are set when the template was re-initialized and defined as custom var + // else if( file_exists( $this->root . '/' . $filename) ) { $filename = $this->root . '/' . $filename; } + if( file_exists($this->root . '/' . $style_path . '/' . $filename) ) + { + // + // First check current template + // + $filename = $this->root . '/' . $style_path . '/' . $filename; + } + else if( file_exists($this->root . '/' . $style_path . '/' . $filename2) ) + { + // + // tpl - html + // + $filename = $this->root. '/' . $style_path . '/' . $filename2; + } + else if( file_exists($this->root . '/' . $mx_user->default_template_name . '/' . $filename) ) + { + // + // Then check current template + // + $filename = $mx_root_path . '/' . $mx_user->default_template_name . '/' . $filename; + } + else if( file_exists($this->root . '/' . $moduleDefault . '/' . $filename) ) + { + // + // Finally check the Custom Root folde(for compatibility with some old modules) + // + $filename = $this->root . '/' . $moduleDefault . '/' . $filename; + } else { *************** *** 411,415 **** if( !file_exists($filename) ) { ! die("Template->make_filename(): Error - file $filename does not exist. <br />Module: $module_root_path <br />Current style: $style_path <br />Cloned style: $mx_user->cloned_template_name <br />Default style: $mx_user->default_template_name <br />Custom module default style: $moduleDefault"); } } --- 443,447 ---- if( !file_exists($filename) ) { ! die("Template->make_filename(): Error - file $filename does not exist. <br />Class-Root: $this->root <br />Module: $module_root_path <br />Current style: $style_path <br />Cloned style: $mx_user->cloned_template_name <br />Default style: $mx_user->default_template_name <br />Custom module default style: $moduleDefault"); } } *************** *** 455,458 **** --- 487,491 ---- define('MX_IMAGES' , 50); define('MX_IMAGES_NONE' , 60); + define('MX_LANG_CUSTOM' , 70); /**#@-*/ *************** *** 1167,1171 **** } ! $img_lang = ( file_exists($phpbb_root_path . $this->current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; // --- 1200,1212 ---- } ! //$img_lang = ( file_exists($phpbb_root_path . $this->current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; ! if (PORTAL_BACKEND == 'phpbb3') ! { ! $img_lang = ($this->lang['default_lang']) ? $this->lang['default_lang'] : (($board_config['phpbb_lang']) ? $board_config['phpbb_lang'] : 'en'); ! } ! else ! { ! $img_lang = ($this->lang['default_lang']) ? $this->get_old_lang($this->lang['default_lang']) : (($board_config['default_lang']) ? $board_config['default_lang'] : 'english'); ! } // *************** *** 1210,1213 **** --- 1251,1270 ---- $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'); *************** *** 1220,1225 **** $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 . '/' . $this->cloned_template_name . '.cfg'); } --- 1277,1283 ---- $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'); } *************** *** 1231,1238 **** $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 . '/' . $this->default_template_name . '.cfg'); } // // We have no template to use - die --- 1289,1309 ---- $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 *************** *** 1240,1244 **** if ( !$mx_template_config ) { ! mx_message_die(CRITICAL_ERROR, "Could not open MX-Publisher " . $module_root_path . $this->default_current_template_path . " style config file", '', __LINE__, __FILE__); } --- 1311,1315 ---- 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__); } *************** *** 1291,1302 **** if ($lang_mode == MX_LANG_MAIN || $lang_mode == MX_LANG_ALL) { // ------------------------------------------------------------------------- // Read Module Main Language Definition // ------------------------------------------------------------------------- ! if ((@include $mx_root_path . $mx_block->module_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx") === false) { ! if ((@include $mx_root_path . $mx_block->module_root_path . "language/lang_english/lang_main.$phpEx") === false) { ! mx_message_die(CRITICAL_ERROR, 'Module main language file ' . $mx_root_path . $mx_block->module_root_path . "language/lang_" . $default_lang . "/lang_main.$phpEx" . ' couldn\'t be opened.'); } } --- 1362,1382 ---- if ($lang_mode == MX_LANG_MAIN || $lang_mode == MX_LANG_ALL) { + if (!empty($this->module_lang_path[$mx_block->module_root_path])) + { + $module_lang_path = $this->module_lang_path[$mx_block->module_root_path]; + } + else + { + $module_lang_path = $mx_root_path . $mx_block->module_root_path; + } + // ------------------------------------------------------------------------- // Read Module Main Language Definition // ------------------------------------------------------------------------- ! if ((@include $module_lang_path . "language/lang_" . $default_lang . "/lang_main.$phpEx") === false) { ! if ((@include $module_lang_path . "language/lang_english/lang_main.$phpEx") === false) { ! mx_message_die(CRITICAL_ERROR, 'Module main language file ' . $mx_root_path . $module_lang_path . "language/lang_" . $default_lang . "/lang_main.$phpEx" . ' couldn\'t be opened.'); } } *************** *** 1308,1316 **** // Read Module Admin Language Definition // ------------------------------------------------------------------------- ! if ((@include $mx_root_path . $mx_block->module_root_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx") === false) { ! if ((@include $mx_root_path . $mx_block->module_root_path . "language/lang_english/lang_admin.$phpEx") === false) { ! mx_message_die(CRITICAL_ERROR, 'Modiule admin language file ' . $mx_root_path . $mx_block->module_root_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx" . ' couldn\'t be opened.'); } } --- 1388,1396 ---- // Read Module Admin Language Definition // ------------------------------------------------------------------------- ! if ((@include $module_lang_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx") === false) { ! if ((@include $module_lang_path . "language/lang_english/lang_admin.$phpEx") === false) { ! mx_message_die(CRITICAL_ERROR, 'Modiule admin language file ' . $mx_root_path . $module_lang_path . "language/lang_" . $default_lang . "/lang_admin.$phpEx" . ' couldn\'t be opened.'); } } *************** *** 1647,1650 **** --- 1727,1744 ---- $this->loaded_default_styles[$mx_block->module_root_path] = $default_module_style; } + + 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 |