|
From: Jon O. <jon...@us...> - 2008-01-29 19:37:32
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28869 Modified Files: index.php Added Files: index_new.php Log Message: going back to old adminCP development adminCP is moved to index_new.php --- NEW FILE: index_new.php --- <?php /** * * @package mxBB Portal Core * @version $Id: index_new.php,v 1.1 2008/01/29 19:37:26 jonohlsson Exp $ * @copyright (c) 2002-2006 mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://www.mxbb.net * @origin This file is borrowed from phpBB, with some modifications */ // Security and Page header define( 'IN_PORTAL', 1 ); $mx_root_path = './../'; $phpEx = substr( strrchr( __FILE__, '.' ), 1 ); $no_page_header = true; require( './pagestart.' . $phpEx ); error_reporting( E_ALL ^E_NOTICE); // ------------------------------ // DEBUG ONLY ;-) // error_reporting(E_ALL); // ------------------------------ // --------------- // Begin functions /** * Enter description here... * * @param unknown_type $needle * @param unknown_type $haystack * @return unknown */ function inarray( $needle, $haystack ) { for( $i = 0; $i < sizeof( $haystack ); $i++ ) { if ( $haystack[$i] == $needle ) { return true; } } return false; } /** * Enter description here... * * @param unknown_type $dir_module * @return unknown */ function read_admin( $dir_module ) { global $phpEx, $template, $lang, $board_config, $phpbb_root_path, $mx_user; $module = array(); if ( $dir = @opendir( $dir_module ) ) { $setmodules = 1; while ( $file = @readdir( $dir ) ) { if ( preg_match( "/^admin_.*?\." . $phpEx . "$/", $file ) ) { include( $dir_module . '/' . $file ); } } @closedir( $dir ); unset( $setmodules ); } return $module; } // End functions // ------------- /** */ if ( !defined( 'PORTAL_BACKEND')) { define( 'PORTAL_BACKEND', 'phpbb2'); } define( 'PHPBB2X_BACKEND', 'phpbb2' ); define( 'OLYMPUS_BACKEND', 'phpbb3' ); define( 'MAIN_CATEGORY', 'portal' ); define( 'MODULE_CATEGORY', 'modules' ); define( 'PHPBB2X_CATEGORY', 'phpbb2' ); define( 'OLYMPUS_CATEGORY', 'phpbb3' ); if ( (empty( $_SID) || $_SID == 'sid=' ) ) { $_SID = 'sid='.$HTTP_GET_VARS['sid']; } if ( (empty( $SID) || $SID == 'sid=' ) ) { $SID = 'sid='.$HTTP_GET_VARS['sid']; } if ( PORTAL_BACKEND == PHPBB2X_BACKEND) { mx_page::load_file( 'functions_selects', 'phpbb2'); } //mx_page::load_file( 'functions_'); class mx_acp { var $template; var $db; var $panel_html = ''; var $category = ''; var $panel = ''; var $tabs = array(); var $menu_complete = array(); var $menu_actions = array(); var $menu = array(); var $category_title = ''; var $panel_title = ''; var $action_script = ''; var $phpbb3_hook = null; var $phpbb3_i = null; /** * Constructor * * @access protected */ function mx_acp() { global $template, $db, $lang, $phpEx, $mx_root_path; $this->template = $template; $this->db = $db; $this->_template_set_filenames(); $this->category = MAIN_CATEGORY; $this->category_title = $lang['MX_Portal']; if ( OLYMPUS_CATEGORY == PORTAL_BACKEND ) { include_once( $mx_root_path . 'includes/shared/phpbb3/includes/functions_hook.' . $phpEx ); $this->phpbb3_hook = new mx_phpbb3_admin(); $this->phpbb3_hook->hook( 'admin' ); } } /* * Parsing params for display * @param string $params query string */ function decode_url( $params ) { global $lang, $mx_user ; if ( isset( $params['cat'] ) ) { $this->category = $params['cat']; switch ( $this->category ) { case MAIN_CATEGORY: $this->category_title = $lang['MX_Portal']; break; case MODULE_CATEGORY: $this->category_title = $lang['MX_Modules']; break; case PHPBB2X_CATEGORY: $this->category_title = $lang['Phpbb']; break; case OLYMPUS_CATEGORY: $this->category_title = ''; $this->phpbb3_i = @$params['i']; break; } // switch } if ( isset( $params['panel'] ) ) { $this->panel = $params['panel']; } } /* * get current tabs */ function assign_tabs() { global $lang, $mx_user, $db; // MX PORTAL MAIN CATEGORY $this->tabs = array(); $this->tabs[] = array( // # 'ACTIVE_TAB' => ( $this->category == MAIN_CATEGORY )?' id="activetab"':'', 'CATEGORY' => MAIN_CATEGORY, 'PARAMS' => '', 'L_TAB' => $lang['MX_Portal'], ); // MX PORTAL MODULE CATEGORY $this->tabs[] = array( // # 'ACTIVE_TAB' => ( $this->category == MODULE_CATEGORY )?' id="activetab"':'', 'CATEGORY' => MODULE_CATEGORY, 'PARAMS' => '', 'L_TAB' => $lang['MX_Modules'], ); // PHPBB TABS switch ( PORTAL_BACKEND ) { case PHPBB2X_BACKEND: // phpBB2 Backend TABS $this->tabs[] = array( // # 'ACTIVE_TAB' => ( $this->category == PHPBB2X_CATEGORY )?' id="activetab"':'', 'CATEGORY' => PHPBB2X_CATEGORY, 'PARAMS' => '', 'L_TAB' => $lang['Phpbb'], ); break; case OLYMPUS_BACKEND: // phpBB3 Backend TABS $phpbb3_tabs = $this->phpbb3_hook->get_tabs( $this->phpbb3_i ); if ( $this->category == OLYMPUS_CATEGORY ) { $this->category_title = $lang['Phpbb'] . ' • ' . $phpbb3_tabs['CATEGORY_TITLE']; } $this->tabs = array_merge( $this->tabs, $phpbb3_tabs['TABS'] ); break; } foreach( $this->tabs as $key => $tab ) { $this->template->assign_block_vars( 'tab', $tab ); } } function _read_menu_actions( $menu_array, $category = MAIN_CATEGORY) { if ( !is_array( $menu_array)) { return; } switch( $category) { case MAIN_CATEGORY: case MODULE_CATEGORY: case PHPBB2X_CATEGORY: $cat_keys = array_keys( $menu_array); for( $i = 0; $i< count($menu_array); $i++) { while( list( $menu, $action) = each( $menu_array[$cat_keys[$i]])) { $this->menu_actions[$action] = 'panel='.$menu; } } break; case OLYMPUS_CATEGORY: $cat_main = array_keys( $menu_array); for( $i=0; $i< count( $menu_array); $i++) { $cat_keys = array_keys( $menu_array[$cat_main[$i]]); for( $j=0; $j< count( $menu_array[$cat_main[$i]]); $j++) { while( list( $menu, $action) = each($menu_array[$cat_main[$i]][$cat_keys[$j]])) { $this->menu_actions[$action] = $menu; } } } break; } } function assign_menu() { global $lang, $db, $mx_user, $mx_root_path, $phpbb_root_path, $phpEx; $allow_menu_sort = true; // # // # Load Main Portal Menu // # $this->menu_complete[MAIN_CATEGORY] = read_admin( './' ); $this->_read_menu_actions( $this->menu_complete[MAIN_CATEGORY], MAIN_CATEGORY); // # // # Load Main Modules Menu // # $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_include_admin = 1 ORDER BY module_name"; if ( !( $q_modules = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Could not query modules information", '', __LINE__, __FILE__, $sql ); } if ( $total_modules = $db->sql_numrows( $q_modules ) ) { $module_rows = $db->sql_fetchrowset( $q_modules ); } $db->sql_freeresult( $result ); $menu_array = array(); for( $module_cnt = 0; $module_cnt < $total_modules; $module_cnt++ ) { $module_path_admin = $mx_root_path . $module_rows[$module_cnt]['module_path'] . "admin/"; $module_path_root = $mx_root_path . $module_rows[$module_cnt]['module_path']; // ********************************************************************** // Read language definition // ********************************************************************** $board_langfile = $module_path_root . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx; $main_langfile = $module_path_root . 'language/lang_english/lang_admin.' . $phpEx; if ( file_exists( $board_langfile ) ) { include( $board_langfile ); } else if ( file_exists( $main_langfile ) ) { include( $main_langfile ); } $menu_array = array_merge_recursive( $menu_array, read_admin( $module_path_admin ) ); } $this->menu_complete[MODULE_CATEGORY] = $menu_array; $this->_read_menu_actions( $this->menu_complete[MODULE_CATEGORY], MODULE_CATEGORY); switch( PORTAL_BACKEND) { case PHPBB2X_BACKEND: $mnu_ary = read_admin( $phpbb_root_path . 'admin/' ); $menu_array = array(); foreach( $mnu_ary as $key => $menu) { $i = 0; foreach( $menu as $menu_id => $action_file) { $menu_array[$key][$menu_id . '_' . $key] = substr($phpbb_root_path, strlen($mx_root_path)) . 'admin/' . $action_file; $lang[ $menu_id . '_' . $key ] = $lang[ $menu_id]; $i++; } } $this->menu_complete[PHPBB2X_CATEGORY] = $menu_array; $this->_read_menu_actions( $menu_array, PHPBB2X_CATEGORY); break; case OLYMPUS_BACKEND: $this->menu_complete[OLYMPUS_CATEGORY] = $this->phpbb3_hook->get_menu_complete(); $this->_read_menu_actions( $this->menu_complete[OLYMPUS_CATEGORY], OLYMPUS_CATEGORY); break; } $menu_array = $this->menu_complete[$this->category]; switch ( $this->category ) { case MAIN_CATEGORY: case MODULE_CATEGORY: case PHPBB2X_CATEGORY: if ( empty( $this->panel ) ) { $mnu_ary = $menu_array; ksort( $mnu_ary ); $menu_array_keys = array_keys( $mnu_ary ); ksort( $mnu_ary[$menu_array_keys[0]] ); $panel_keys = array_keys( $mnu_ary[$menu_array_keys[0]] ); $this->panel = $panel_keys[0]; } break; case OLYMPUS_CATEGORY: $allow_menu_sort = false; $menu_array = $this->phpbb3_hook->get_menu( $this->phpbb3_i ); break; } if ( sizeOf( $menu_array ) == 0 ) { return; } $this->menu = $menu_array; if ( $allow_menu_sort ) { ksort( $menu_array ); } $menu_cat_id = 0; while ( list( $category, $action_array ) = each( $menu_array ) ) { $lang_category = ( !empty( $lang[$category] ) ) ? $lang[$category] : preg_replace( "/_/", " ", $category ); $this->template->assign_block_vars( 'category', array( // +MOD: DHTML Menu for ACP 'MENU_CAT_ID' => $menu_cat_id, 'MENU_CAT_ROWS' => count( $action_array ), // -MOD: DHTML Menu for ACP 'ADMIN_CATEGORY' => $lang_category ) ); if ( $allow_menu_sort ) { ksort( $action_array ); } $row_count = 0; while ( list( $panel, $file ) = each( $action_array ) ) { $lang_menu = isset( $mx_user->lang[$panel] )?$mx_user->lang[$panel]:( !empty( $lang[$panel] ) ? $lang[$panel] : preg_replace( "/_/", " ", $panel ) ); $file_part = explode( '?', $file ); if ( $this->panel == $panel ) { if ( strpos( $file, 'http://' ) !== false ) { header( 'Location: ' . $file ); } $this->action_script = $file_part[0]; $this->panel_title = $lang_menu; } $menu_link_params = str_replace( '?', '', '&cat=' . $this->category . '&panel=' . $panel . '&' . $file_part[1] ); $menu_link_params = explode( '&', $menu_link_params ); sort( $menu_link_params, SORT_STRING ); reset( $menu_link_params ); $menu_link = basename( __FILE__ ) . '?' . implode( '&', $menu_link_params ); $menu_link = str_replace( '&&', '&', $menu_link ); $menu_link = str_replace( '?&', '?', $menu_link ); if ( strpos( $menu_link, 'sid=' ) === false ) { $menu_link = mx_append_sid( $menu_link ); } $this->template->assign_block_vars( 'category.panel', array( "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, // +MOD: DHTML Menu for ACP 'ROW_COUNT' => $row_count, // -MOD: DHTML Menu for ACP "L_PANEL" => $lang_menu, 'U_PANEL' => $menu_link, 'A_PANEL' => $this->panel == $panel?' id="activemenu"':'', ) ); $row_count++; } // +MOD: DHTML Menu for ACP $menu_cat_id++; // -MOD: DHTML Menufor ACP } } function prepare_action_script() { if ( empty( $this->action_script ) ) { return ''; } global $mx_root_path, $phpbb_root_path; switch ( $this->category ) { case MAIN_CATEGORY: case MODULE_CATEGORY: case PHPBB2X_CATEGORY: $script = trim( file_get_contents( $mx_root_path . $this->action_script ) ); $folders = explode( '/' , dirname( $this->action_script ) ); $module_root_path = ''; for( $i = 0; $i < sizeOf( $folders ); $i++ ) { if ( $folders[$i] == 'admin' ) { unset( $folders[$i] ); } } $module_root_path = implode( '/', $folders ) . '/'; $preg_array = array( '#^<\?(php)?#' => '', '#\?>$#' => '', "#define\('IN_PORTAL', 1\);#si" => '', '#\$mx_root_path = [^;]*;#si' => '', '#([^_]{1})append_sid#si' => '\1mx_append_sid', '#([^_]{1})message_die#si' => '\1mx_message_die', '#\$phpEx = [^;]*;#' => '', '#(include|require)(_once)?.*(pagestart|footer|header)(_admin)?[^;]*;#' => '', "#\\\$module_root_path = ['\\\"]([^']*)['\\\"];#" => '$module_root_path = "' . $mx_root_path . $module_root_path . '";', '#.*(\$HTTP_GET_VARS\[\'pane\'\] == \'right\')#si' => 'if ( 1==1', '#\$db->sql_close\(\);#si' => '', '#->assign_vars\([^(]*\(#si' => '\0 ' . "'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH,'U_PORTAL_ROOT_PATH' => PORTAL_URL,", // '#if.*setmodules.*return[^\}]*\}#' => '', '#\$phpbb_root_path =[^;]*;#si' => '// \0 <= has been allready defined', '#require[^;]*;#si' => '// \0', ); if ( $this->category == PHPBB2X_CATEGORY) { $preg_array = array_merge( $preg_array, array( // # "#\n(@?(include|require)[^;]*;)#si" => "\n" . '// \1 <= has been allready defined', '#phpbb_realpath#si' => 'phpbb2::phpbb_realpath', //$preg_replace[] = "\n" . '\1'; )); $func_cnt = preg_match_all( "#\nfunction ([^(]*)\\(#si", $script, $func_match); for( $i = 0; $i<$func_cnt; $i++) { if ( function_exists( $func_match[1][$i])) { $preg_array = array_merge( $preg_array, array( // # "#\nfunction ".$func_match[1][$i]. '#si' => "\nfunction ".$func_match[1][$i].'_defined', )); } } } $script = preg_replace( array_keys($preg_array), array_values($preg_array), $script ); break; case OLYMPUS_BACKEND: $script = trim( file_get_contents( $phpbb_root_path . $this->action_script ) ); break; } // switch return $script; } function display() { // print_r( $this->template->files);die(); $this->_template_assign_vars(); $this->template->pparse( 'adm_header' ); // $this->template->assign_var( 'CONTENT_ACP', $this->panel_html ); $this->template->pparse( 'adm_body' ); $this->template->pparse( 'adm_footer' ); } function _template_set_filenames() { $this->template->set_filenames( array( 'adm_header' => 'admin/mainpage_header.html', 'adm_body' => 'admin/mainpage_body.html', 'adm_footer' => 'admin/mainpage_footer.html', ) ); } function assign_content_acp( $acp_html ) { global $mx_root_path, $phpbb_root_path, $phpEx; $preg_pattern = $preg_replace = array(); switch ( $this->category ) { case MAIN_CATEGORY: case MODULE_CATEGORY: case PHPBB2X_CATEGORY: default: $match_count = preg_match_all( '#(href|action)="(((' . PORTAL_URL . '|' . PHPBB_URL . ')?((' . $mx_root_path . ')?(admin/|adm/)?([^"?]*)?))\??([^"]*?))"#si', $acp_html, $match_links ); for( $i=0; $i < $match_count; $i++) { if ( eregi( 'javascript:', $match_links[2][$i]) || empty($match_links[8][$i]) || eregi( './../index.php', $match_links[2][$i] ) ) { continue; } //print $match_links[2][$i] . ' • ' . $match_links[8][$i]. '<br/>'; for( $j = 0;$j <= $menu_array_normal_count;$j++ ) { //print $menu_array_normal[$menu_array_normal_keys[$j]] . '<br/>'; if ( strpos( $menu_array_normal[$menu_array_normal_keys[$j]], $match_links[8][$i] ) !== false ) { $action_file = $menu_array_normal_keys[$j]; $query_string = ''; if ( $match_links[9][$i] != '' ) { $query_string = '&' . $match_links[9][$i]; } $acp_html = str_replace( $match_links[2][$i], mx_append_sid( "index.$phpEx?cat=" . $this->category . "&panel=$action_file$query_string" ), $acp_html ); break; } } //print '<p> </p><hr/>'; } break; case OLYMPUS_CATEGORY: break; } // switch $forms_cnt = preg_match_all( "#<form([^>]*)>#si", $acp_html, $forms); // print '<pre font-size="12px">'; for( $f_i = 0; $f_i < $forms_cnt; $f_i++) { $form_cnt = preg_match_all( "#([^=]*)=[\"']([^\"']*)[\"']#si", $forms[1][$f_i], $form); //print $f_i . ' • ' . $forms[1][$f_i] . '<br/>'; //print_r( $form); $form_action = ''; $form_method = ''; for( $i= 0; $i< $form_cnt; $i++) { if ( strtolower(trim($form[1][$i])) == 'method' ) { $form_method = strtoupper($form[2][$i]); } else if ( strtolower(trim($form[1][$i])) == 'action') { $form_action = $form[2][$i]; } } $html_add = "\n"; if ( $form_method == 'GET') { $action = explode( '?', $form_action); $params = explode( '&', $action[1]); for( $i=0; $i< count( $params); $i++) { $param = explode( '=', $params[$i]); $html_add .= '<input type="hidden" name="'.$param[0]. '" value="' . $param[1] . '" />' . "\n"; } } //print htmlentities( $forms[1][$f_i]) . '><br/>'; //print htmlentities( $forms[1][$f_i] . '>'. $html_add) . '<br/>'; $acp_html = str_replace( $forms[1][$f_i] . '>', $forms[1][$f_i] .'>'. $html_add, $acp_html); } //print '</pre>'; $this->template->assign_var( 'CONTENT_ACP', $acp_html ); } function _template_assign_vars() { global $board_config, $userdata, $lang, $mx_user, $admincp_nav_icon_url; global $theme, $images; $l_timezone = explode('.', $board_config['board_timezone']); $l_timezone = (count($l_timezone) > 1 && $l_timezone[count($l_timezone)-1] != 0) ? $lang[sprintf('%.1f', $board_config['board_timezone'])] : $lang[number_format($board_config['board_timezone'])]; // // Generate stats // $endtime = explode(' ', microtime()); $stime = ( $endtime[1] + $endtime[0] ) - $mx_starttime; $execution_stats = sprintf($lang['Execution_Stats'], $db->num_queries, round($stime, 4)); switch (PORTAL_BACKEND) { case 'internal': case 'phpbb2': $current_phpbb_version = '2' . $board_config['version']; break; case 'phpbb3': $current_phpbb_version = $board_config['version']; break; } // isset( $mx_user->lang[$action_file_id] )?$mx_user->lang[$action_file_id]:( isset( $lang[$action_file_id] )?$lang[$action_file_id]:str_replace( '_' , ' ', $action_file_id ) ) $global_vars = array( // +MOD: DHTML Menu for ACP 'COOKIE_NAME' => $board_config['cookie_name'], 'COOKIE_PATH' => $board_config['cookie_path'], 'COOKIE_DOMAIN' => $board_config['cookie_domain'], 'COOKIE_SECURE' => $board_config['cookie_secure'], 'IMG_URL_CONTRACT' => $admincp_nav_icon_url . '/contract.gif', 'IMG_URL_EXPAND' => $admincp_nav_icon_url . '/expand.gif', // -MOD: DHTML Menu for ACP 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'T_PHPBB_STYLESHEET' => $theme['head_stylesheet'], 'T_MXBB_STYLESHEET' => $theme['head_stylesheet'], 'T_GECKO_STYLESHEET' => 'gecko.css', 'MX_ICON_CSS' => $images['mx_graphics']['icon_style'], 'LOGO' => !empty($images['mx_logo_acp']) ? $images['mx_logo_acp']: $images['mx_logo'], "U_PORTAL_INDEX" => mx_append_sid( PORTAL_URL . basename( __FILE__ ) ), "U_FORUM_INDEX" => mx_append_sid( PHPBB_URL . "index.$phpEx" ), "U_PORTAL_ADMIN_INDEX" => mx_append_sid( basename( __FILE__ ) ), "U_ADMIN_INDEX" => mx_append_sid( basename( __FILE__ ) ), 'U_LOGOUT' => mx_append_sid( PORTAL_URL . 'login.' . $phpEx . '?logout=1' ), 'ADMIN_TITLE' => $lang['mxBB_adminCP'], 'USERNAME' => $mx_user->data['username'], 'CATEGORY' => $this->category, 'L_LOGGED_IN_AS' => $lang['Logged_in_as'], "L_PORTAL_INDEX" => $lang['Portal_index'], "L_PREVIEW_PORTAL" => $lang['Preview_portal'], 'L_LOGOUT' => $lang['Log_out'], "L_FORUM_INDEX" => $lang['Main_index'], "L_ADMIN_INDEX" => $lang['Admin_Index'], "L_PREVIEW_FORUM" => $lang['Preview_forum'], 'L_ADMIN_CATEGORY' => $this->category_title, 'L_ADMIN_PART' => $this->panel_title, 'ACTION_SCRIPT' => $this->action_script, 'SITENAME' => $board_config['sitename'], 'L_ADMIN' => $lang['Admin'], 'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), 'L_FAQ' => $lang['FAQ'], 'U_INDEX' => mx_append_sid('../index.'.$phpEx), 'S_TIMEZONE' => sprintf($lang['All_times'], $l_timezone), 'S_LOGIN_ACTION' => mx_append_sid('../login.'.$phpEx), 'S_JUMPBOX_ACTION' => mx_append_sid('../viewforum.'.$phpEx), 'S_CURRENT_TIME' => sprintf($lang['Current_time'], phpBB2::create_date($board_config['default_dateformat'], time(), $board_config['board_timezone'])), 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_ENCODING' => $lang['ENCODING'], 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], 'S_USER_LANG' => $mx_user->lang['default_lang'], 'PHPBB_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? $current_phpbb_version : '', 'MX_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? PORTAL_VERSION : '', 'TRANSLATION_INFO' => (isset($lang['TRANSLATION_INFO'])) ? $lang['TRANSLATION_INFO'] : ((isset($lang['TRANSLATION'])) ? $lang['TRANSLATION'] : ''), 'POWERED_BY' => $lang['Powered_by'], 'EXECUTION_STATS' => $execution_stats ); $this->template->assign_vars( $global_vars ); } } $mx_acp = new mx_acp(); $mx_acp->decode_url( $HTTP_GET_VARS ); $mx_acp->assign_tabs(); $mx_acp->assign_menu(); $script = $mx_acp->prepare_action_script(); switch ( 0 ) { case 0; ob_start(); eval( $script ); $panel_html = ob_get_contents(); ob_end_clean(); break; case 1: $panel_html = preg_replace( array("#\n#esi", "#\t#si"), array("sprintf('%4d', \$i++) . '\n'", ' '), str_replace( "\n", "<br/>\n", htmlentities( $script ) )); break; case 2: ob_start(); eval( $script ); $panel_html = ob_get_contents(); ob_end_clean(); $panel_html .= preg_replace( array("#\n#esi", "#\t#si"), array("sprintf('%4d', \$i++) . '\n'", ' '), str_replace( "\n", "<br/>\n", htmlentities( $script ) )); break; case 3: ob_start(); eval( $script ); $panel_html = ob_get_contents(); ob_end_clean(); $panel_html .= preg_replace( array("#\n#esi", "#\t#si"), array("sprintf('%4d', \$i++) . '\n'", ' '), str_replace( "\n", "<br/>\n", htmlentities( $panel_html ) ));; break; } $mx_acp->assign_content_acp( $panel_html ); $mx_acp->display(); die(); if ( !$is_phpbb || PORTAL_BACKEND == 'phpbb2' ) { while ( list( $cat, $menu_list ) = each( $menu_array ) ) { while ( list( $menu_id, $menu_link ) = each( $menu_list ) ) { $menu_array_normal[$menu_id] = $menu_link; $menu_array_revert[$menu_link] = $menu_id; } } $d = preg_match_all( '#(href|action)="(((' . PORTAL_URL . '|' . PHPBB_URL . ')?((' . $mx_root_path . ')?(admin/)?([^"?]*)?))\??([^"]*?))"#si', $admin_html, $matches_links ); $menu_array_normal_keys = array_keys( $menu_array_normal ); $menu_array_normal_count = count( $menu_array_normal ); for( $i = 0; $i < count( $matches_links[0] ); $i++ ) { if ( strpos( $matches_links[2][$i], 'javascript:' ) !== false || $matches_links[8][$i] == '' || strpos( $matches_links[2][$i], './../index.php' ) !== false ) { continue; } for( $j = 0;$j < $menu_array_normal_count;$j++ ) { if ( strpos( $menu_array_normal[$menu_array_normal_keys[$j]], $matches_links[8][$i] ) !== false ) { $action_file = $menu_array_normal_keys[$j]; $query_string = ''; if ( $matches_links[9][$i] != '' ) { $query_string = '&' . $matches_links[9][$i]; } $admin_html = str_replace( $matches_links[2][$i], mx_append_sid( "index.$phpEx?cat=$category&action_file=$action_file$query_string" ), $admin_html ); break; } } } } $template->assign_block_vars( 'module_portal', array( 'ACTIVETAB' => $is_portal?' id="activetab"':'', ) ); $template->assign_block_vars( 'module_mx', array( 'ACTIVETAB' => $is_module?' id="activetab"':'', ) ); // error_reporting( E_ALL); $menu_params = ''; $template->assign_var( 'L_ADMIN_CATEGORY', $lang_category ); display_tab_menu( $menu_array, $action_file_id, $allow_menu_sort, $menu_params ); $template->pparse( 'adm_header' ); $template->assign_var( 'CONTENT_ACP', $admin_html ); $template->pparse( 'adm_body' ); $template->pparse( 'adm_footer' ); // print '<pre>'; // print_r( $lang); // print '</pre>'; ?> Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** index.php 21 Jan 2008 01:06:20 -0000 1.36 --- index.php 29 Jan 2008 19:37:25 -0000 1.37 *************** *** 7,26 **** * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://www.mxbb.net ! * @origin This file is borrowed from phpBB, with some modifications */ // Security and Page header ! define( 'IN_PORTAL', 1 ); $mx_root_path = './../'; ! $phpEx = substr( strrchr( __FILE__, '.' ), 1 ); ! $no_page_header = true; [...1871 lines suppressed...] ! $template->set_filenames(array( ! "body" => "admin/index_frameset.tpl") ! ); + $template->assign_vars(array( + 'ADMIN_TITLE' => $lang['mxBB_adminCP'], + "S_FRAME_NAV" => mx_append_sid("index_right.$phpEx?pane=left"), + "S_FRAME_MAIN" => mx_append_sid("index_right.$phpEx?pane=right")) + ); + + header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT"); + header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + + $template->pparse("body"); + + $db->sql_close(); + exit; + } ?> \ No newline at end of file |