Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797/admin Modified Files: admin_mx_chkobjs.php admin_mx_gen_cache.php admin_mx_meta.php admin_mx_module.php admin_mx_phpinfo.php admin_mx_portal.php index.php page_footer_admin.php pagestart.php Added Files: admin_mx_block_cp.php admin_mx_module_cp.php admin_mx_page_cp.php Removed Files: admin_mx_block.php admin_mx_block_auth.php admin_mx_menu.php admin_mx_page.php admin_mx_page_auth.php admin_mx_page_setting.php admin_mx_page_template_setting.php Log Message: Major commit Adding new adminCP, blockCP and many new oo components Finally finalizing latest months hard work :-) --- admin_mx_page_auth.php DELETED --- --- admin_mx_page.php DELETED --- Index: admin_mx_chkobjs.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_chkobjs.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** admin_mx_chkobjs.php 28 Apr 2005 04:13:49 -0000 1.10 --- admin_mx_chkobjs.php 20 Aug 2005 18:19:11 -0000 1.11 *************** *** 26,30 **** if( !empty($setmodules) ) { ! $module['Portal - System']['Integrity_Checker'] = 'admin/' . basename(__FILE__); return; } --- 26,30 ---- if( !empty($setmodules) ) { ! $module['4_Panel_system']['4_1_Integrity'] = 'admin/' . basename(__FILE__); return; } --- admin_mx_block_auth.php DELETED --- --- admin_mx_page_template_setting.php DELETED --- Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** index.php 1 May 2005 15:41:06 -0000 1.8 --- index.php 20 Aug 2005 18:19:11 -0000 1.9 *************** *** 90,93 **** --- 90,95 ---- 'body' => 'admin/index_navigate.tpl') ); + + $admincp_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/'; $template->assign_vars(array( *************** *** 100,103 **** --- 102,113 ---- "U_FORUM_INDEX" => append_sid(PHPBB_URL . "index.$phpEx"), "U_ADMIN_INDEX" => append_sid("index.$phpEx?pane=right"), + //+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 "L_FORUM_INDEX" => $lang['Main_index'], "L_ADMIN_INDEX" => $lang['Admin_Index'], *************** *** 118,121 **** --- 128,135 ---- ksort($module_portal); + //+MOD: DHTML Menu for ACP + $menu_cat_id = 0; + //-MOD: DHTML Menu for ACP + while( list($cat, $action_array) = each($module_portal) ) { *************** *** 123,126 **** --- 137,144 ---- $template->assign_block_vars('module_portal.catrow', 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' => $cat) ); *************** *** 139,143 **** "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PORTAL_URL . $file) --- 157,163 ---- "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! //+MOD: DHTML Menu for ACP ! 'ROW_COUNT' => $row_count, ! //-MOD: DHTML Menu for ACP "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PORTAL_URL . $file) *************** *** 145,148 **** --- 165,171 ---- $row_count++; } + //+MOD: DHTML Menu for ACP + $menu_cat_id++; + //-MOD: DHTML Menu for ACP } *************** *** 157,160 **** --- 180,187 ---- ksort($module_phpbb); + //+MOD: DHTML Menu for ACP + $menu_cat_id = 0; + //-MOD: DHTML Menu for ACP + while( list($cat, $action_array) = each($module_phpbb) ) { *************** *** 162,165 **** --- 189,196 ---- $template->assign_block_vars('module_phpbb.catrow', 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' => $cat) ); *************** *** 178,182 **** "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PHPBB_URL . 'admin/' . $file)) --- 209,215 ---- "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, ! //+MOD: DHTML Menu for ACP ! 'ROW_COUNT' => $row_count, ! //-MOD: DHTML Menu for ACP "ADMIN_MODULE" => $action, "U_ADMIN_MODULE" => append_sid(PHPBB_URL . 'admin/' . $file)) *************** *** 184,187 **** --- 217,223 ---- $row_count++; } + //+MOD: DHTML Menu for ACP + $menu_cat_id++; + //-MOD: DHTML Menu for ACP } *************** *** 216,219 **** --- 252,259 ---- ksort($module_mx); + //+MOD: DHTML Menu for ACP + $menu_cat_id = 0; + //-MOD: DHTML Menu for ACP + while( list($cat, $action_array) = each($module_mx) ) { *************** *** 221,224 **** --- 261,268 ---- $template->assign_block_vars('module_mx.catrow', 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' => $cat) ); *************** *** 237,240 **** --- 281,287 ---- "ROW_COLOR" => "#" . $row_color, "ROW_CLASS" => $row_class, + //+MOD: DHTML Menu for ACP + 'ROW_COUNT' => $row_count, + //-MOD: DHTML Menu for ACP "ADMIN_MODULE" => $action, *************** *** 243,246 **** --- 290,296 ---- $row_count++; } + //+MOD: DHTML Menu for ACP + $menu_cat_id++; + //-MOD: DHTML Menu for ACP } // ----------------------------------------------------------------------------------- --- NEW FILE: admin_mx_module_cp.php --- <?php /** ------------------------------------------------------------------------ * subject : mx-portal, CMS & portal * begin : june, 2002 * copyright : (C) 2002-2005 MX-System * email : jon...@ho... * project site : www.mx-system.com * * description : * ------------------------------------------------------------------------- * $Id: admin_mx_module_cp.php,v 1.1 2005/08/20 18:19:11 jonohlsson Exp $ */ /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ if( !empty($setmodules) ) { $file = basename(__FILE__); $module['2_CP']['2_2_ModuleCP'] = 'admin/' . $file; return; } // // Security and Page header // define('IN_PORTAL', 1); $mx_root_path = './../'; require($mx_root_path . 'extension.inc'); $no_page_header = TRUE; require('./pagestart.' . $phpEx); // // Instatiate the mx_admin class // $mx_admin = new mx_admin(); // // Instatiate the $mx_dynamic_select class (dynamic block select javascript) // $mx_dynamic_select = new mx_dynamic_select(); $mx_dynamic_select->generate(); // // Mode & Action setting // $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); $action = $mx_request_vars->request('action', MX_TYPE_NO_TAGS, ''); // Main module id, to load the adminCP blocks and parameter data $nav_module_id = $mx_request_vars->request('module_id', MX_TYPE_INT, ''); if ( empty($nav_module_id) ) { $cookie_tmp = $board_config['cookie_name'].'_adminModule_module_id'; $nav_module_id = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? $HTTP_COOKIE_VARS[$cookie_tmp] : ''; } // // SUBMIT? // if( !empty($mode) && !empty($action) ) { // // Get vars // $portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, 1); $id = $mx_request_vars->request('id', MX_TYPE_INT, ''); // // Send to adminCP // $result_message = $mx_admin->do_it($mode, $action, $id); } // if .. !empty($mode) // Load states $cookie_tmp = $board_config['cookie_name'].'_admincp_blockstates'; $cookie_states = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? explode(",", $HTTP_COOKIE_VARS[$cookie_tmp]) : array(); $sort_cookie = !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_pagesort']) ? explode(",", $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_pagesort']) : array(); if ( isset( $HTTP_POST_VARS['include_all'] ) ) { switch ( $HTTP_POST_VARS['include_all'] ) { case '0': $include_all = '0'; break; case '1': $include_all = '1'; break; default: $include_all = isset($sort_cookie[3]) ? $sort_cookie[3] : '0'; } } else { $include_all = isset($sort_cookie[3]) ? $sort_cookie[3] : '0'; } $sort_cookie = array(isset($sort_cookie[0]) ? $sort_cookie[0] : '', isset($sort_cookie[1]) ? $sort_cookie[1] : '', isset($sort_cookie[2]) ? $sort_cookie[2] : $include_all, $include_all); setcookie($board_config['cookie_name'] . '_pagesort', implode(',', $sort_cookie), time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); // -------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------- // // Start page proper // $block_auth_fields = array('auth_view', 'auth_edit'); $block_auth_ary = array( 'auth_view' => AUTH_ALL, 'auth_edit' => AUTH_MOD, ); $block_auth_levels = array('ALL', 'REG', 'PRIVATE', 'MOD', 'ADMIN', 'ANONYMOUS'); $block_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN, AUTH_ANONYMOUS); $field_names = array( 'auth_view' => $lang['View'], 'auth_edit' => $lang['Edit'], ); $template->set_filenames(array( 'admin_block' => 'admin/mx_modulecp_admin_body.tpl') ); // // Define some graphics // $module_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/admin_icons/'; $admin_icon['contract'] = $module_nav_icon_url . 'contract.gif'; $admin_icon['expand'] = $module_nav_icon_url . 'expand.gif'; $admin_icon['module'] = $module_nav_icon_url . 'icon_module.gif'; $admin_icon['function'] = $module_nav_icon_url . 'icon_function.gif'; $admin_icon['parameter'] = $module_nav_icon_url . 'icon_parameter.gif'; $admin_icon['block'] = $module_nav_icon_url . 'icon_block.gif'; $admin_icon['edit_block'] = $module_nav_icon_url . 'icon_edit.gif'; // // Hidden vars // // // Send to template // $template->assign_vars(array( 'L_TITLE' => $lang['Modulecp_admin'], 'L_EXPLAIN' => $lang['Modulecp_admin_explain'], 'NAV_MODULE_ID' => $nav_module_id, 'U_PORTAL_ROOT_PATH' => PORTAL_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, 'SID' => $userdata['session_id'], 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">-::-<br/>' . $result_message . '<br/> -::-</span></div>': '', // // General // "L_ACTION" => $lang['Action'], "L_DELETE" => $lang['Delete'], 'L_SETTING' => $lang['Settings'], 'L_VIEW' => $lang['View'], "L_EDIT" => $lang['Edit'], "L_ADD" => $lang['Create_parameter'], 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'L_CREATE_BLOCK' => ( !empty($lang['Create_block']) ) ? $lang['Create_block'] : 'Create new block', 'L_MOVE_UP' => $lang['Move_up'], 'L_MOVE_DOWN' => $lang['Move_down'], 'L_RESYNC' => $lang['Resync'], 'L_QUICK_NAV' => $lang['Quick_nav_modules'], 'L_INCLUDE_ALL' => $lang['Include_all_modules'], 'S_SUBMIT' => $lang['Update'], // // Parameter // 'L_PARAMETER_NAME' => $lang['Parameter_name'], 'L_PARAMETER_DESC' => $lang['Parameter_desc'], 'L_PARAMETER_TYPE' => $lang['Parameter_type'], 'L_PARAMETER_DEFAULT' => $lang['Parameter_default'], 'L_PARAMETER_FUNCTION' => $lang['Parameter_function'], "L_PARAMETER_TITLE" => $lang['Parameter_admin'], "L_PARAMETER_TEXT" => $lang['Parameter_admin_explain'], 'L_PARAMETER_ID' => $lang['Parameter_id'], // // Function // 'L_FUNCTION' => $lang['Function'], 'L_FUNCTION_TITLE' => $lang['Function_name'], 'L_FUNCTION_DESC' => $lang['Function_desc'], 'L_FUNCTION_FILE' => $lang['Function_file'], 'L_FUNCTION_ADMIN_FILE' => $lang['Function_admin_file'], 'L_ADD_FUNCTION' => $lang['Create_function'], // // Module // 'L_MODULE' => $lang['Module'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_DESC' => $lang['Module_desc'], 'L_MODULE_PATH' => $lang['Module_path'], 'L_MODULE_INCLUDE_ADMIN' => $lang['Module_include_admin'], // Block 'L_AUTH_TITLE' => $lang['Auth_Block'], 'L_AUTH_TITLE_EXPLAIN' => $lang['Auth_Block_explain'], 'L_BLOCK_TITLE' => $lang['Block_title'], 'L_BLOCK_DESC' => $lang['Block_desc'], 'L_SHOW_BLOCK' => $lang['Show_block'], 'L_SHOW_BLOCK_EXPLAIN' => $lang['Show_block_explain'], 'L_SHOW_TITLE' => $lang['Show_title'], 'L_SHOW_TITLE_EXPLAIN' => $lang['Show_title_explain'], 'L_SHOW_STATS' => $lang['Show_stats'], 'L_SHOW_STATS_EXPLAIN' => $lang['Show_stats_explain'], 'L_GROUPS' => $lang['Usergroups'], 'L_IS_MODERATOR' => $lang['Is_Moderator'], // // Graphics // 'IMG_URL_CONTRACT' => $admin_icon['contract'], 'IMG_URL_EXPAND' => $admin_icon['expand'], 'IMG_ICON_MODULE' => $admin_icon['module'], 'IMG_ICON_FUNCTION' => $admin_icon['function'], 'IMG_ICON_PARAMETER' => $admin_icon['parameter'], 'IMG_ICON_BLOCK' => $admin_icon['block'], 'IMG_ICON_EDIT_BLOCK' => $admin_icon['edit_block'], // // Cookies // 'COOKIE_NAME' => $board_config['cookie_name'], 'COOKIE_PATH' => $board_config['cookie_path'], 'COOKIE_DOMAIN' => $board_config['cookie_domain'], 'COOKIE_SECURE' => $board_config['cookie_secure'], 'S_ACTION' => append_sid("admin_mx_module_cp.$phpEx"), 'S_ACTION_DEFAULT' => append_sid("admin_mx_module_cp.$phpEx"), // // Sorting Options // 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], 'S_INCLUDE_ALL_YES' => ( $include_all == '1' ) ? 'checked="checked"' : '', 'S_INCLUDE_ALL_NO' => ( $include_all == '0' ) ? 'checked="checked"' : '' )); // // ---------------------------------------------------------------------------------- Modules // // Get the list of phpBB usergroups $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> " . TRUE . " ORDER BY group_name ASC"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $groupdata[] = $row; } // // Get current/active module // $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_id = '" . $nav_module_id . "' ORDER BY module_name ASC"; if( !($q_modules_current = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } $module_rows_current = array(); $module_rows_current = $db->sql_fetchrowset($q_modules_current); // // Get the rest modules // $sql = "SELECT * FROM " . MODULE_TABLE . " WHERE module_id <> '" . $nav_module_id . "' ORDER BY module_name ASC"; if( !($q_modules = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } $module_rows = array(); if( $total_modules = $db->sql_numrows($q_modules) ) { $module_rows = $db->sql_fetchrowset($q_modules); } if ( $total_modules == 0 ) { $template->assign_block_vars('nomodule', array( 'NONE' => $lang['No_modules'] )); } $module_rows = array_merge($module_rows_current, $module_rows); // // Setup an additional var for the quick nav dropdown // $module_rows_select = array(); // // Module loop // for( $module_count = 0; $module_count < $total_modules + 1; $module_count++ ) { // // Give main vars specific names // $module_id = $module_rows[$module_count]['module_id']; $is_current_module = ($module_id == $nav_module_id); $module_rows_select[$module_id] = $module_rows[$module_count]['module_name']; if (!$include_all && $module_count > 0) { continue; } $mode = MX_MODULE_TYPE; $action = MX_DO_UPDATE; // // Hidden fields // $s_hidden_module_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $module_id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $check_opt = ''; if( $module_rows[$module_count]['module_include_admin'] == 1 ) { $check_opt = 'checked="checked"'; } // // Load module specidic block parameters - add to standard // $type_row = array(); if ( file_exists( $mx_root_path . $module_rows[$module_count]['module_path'] . 'admin/mx_blockcp_parameter.php' ) ) { include_once( $mx_root_path . $module_rows[$module_count]['module_path'] . 'admin/mx_blockcp_parameter.php' ); if (class_exists('mx_blockcp_parameter')) { $mx_blockcp_parameter = new mx_blockcp_parameter(); if ( method_exists( $mx_blockcp_parameter, 'get_parameters' ) ) { $type_row = $mx_blockcp_parameter->get_parameters($type_row); } } } $type_row['Text'] = !empty($lang['ParType_Text']) ? $lang['ParType_Text'] : "Text"; $type_row['TextArea'] = !empty($lang['ParType_TextArea']) ? $lang['ParType_TextArea'] : "TextArea"; $type_row['BBText'] = !empty($lang['ParType_BBText']) ? $lang['ParType_BBText'] : "BBText"; $type_row['Html'] = !empty($lang['ParType_Html']) ? $lang['ParType_Html'] : "Html" ; $type_row['Boolean'] = !empty($lang['ParType_Boolean']) ? $lang['ParType_Boolean'] : "Boolean"; $type_row['Number'] = !empty($lang['ParType_Number']) ? $lang['ParType_Number'] : "Number" ; $type_row['Radio_single_select'] = !empty($lang['ParType_Radio_single_select']) ? $lang['ParType_Radio_single_select'] : "Radio_single_select"; $type_row['Menu_single_select'] = !empty($lang['ParType_Menu_single_select']) ? $lang['ParType_Menu_single_select'] : "Menu_single_select"; $type_row['Menu_multiple_select'] = !empty($lang['ParType_Menu_multiple_select']) ? $lang['ParType_Menu_multiple_select'] : "Menu_multiple_select"; $type_row['Checkbox_multiple_select'] = !empty($lang['ParType_Checkbox_multiple_select']) ? $lang['ParType_Checkbox_multiple_select'] : "Checkbox_multiple_select"; $type_row['Function'] = !empty($lang['ParType_Function']) ? $lang['ParType_Function'] : "Function"; //$type_row['Values'] = !empty($lang['ParType_Values']) ? $lang['ParType_Values'] : "Values"; // // Module subpanel - edit // $visible = in_array('adminModule_' . $module_id, $cookie_states); $template->assign_block_vars('module', array( 'L_TITLE' => $lang['Module_admin'], 'L_MODULE' => $lang['Module'], 'VISIBLE' => $visible ? 'block' : 'none', 'IMG_URL' => $visible ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'MODULE_ID' => $module_id, 'MODULE_TITLE' => $module_rows[$module_count]['module_name'], 'MODULE_DESC' => ( $module_rows[$module_count]['module_desc'] != '' ) ? ' - ' . $module_rows[$module_count]['module_desc'] : '', 'U_MODULE_EDIT' => append_sid(PORTAL_URL . "admin/admin_mx_module.$phpEx?module_id=" . $module_rows[$module_count]['module_id']), // Module subpanel - edit 'E_MODULE_NAME' => $module_rows[$module_count]['module_name'], 'E_MODULE_DESC' => $module_rows[$module_count]['module_desc'], 'E_MODULE_PATH' => $module_rows[$module_count]['module_path'], 'E_MODULE_INCLUDE_CHECK_OPT' => $check_opt, 'S_HIDDEN_FIELDS' => $s_hidden_module_fields, 'S_SUBMIT' => $lang['Update'] )); if ( $module_count == 1 ) { $template->assign_block_vars('module.allmodules', array()); } if ( $is_current_module ) { $template->assign_block_vars('module.is_current', array()); } else { $template->assign_block_vars('module.reload', array( 'U_MODULE_EDIT' => append_sid(PORTAL_URL . "admin/admin_mx_module_cp.$phpEx?module_id=" . $module_id), )); // // Only load all parameters for current module // continue; } // ----------------------------------------------------------------------------------Functions // Now continue with the module functions // $sql = "SELECT * FROM " . FUNCTION_TABLE . " WHERE module_id = '" . $module_rows[$module_count]['module_id'] . "' ORDER BY function_name ASC"; if( !($q_functions = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query functions information", "", __LINE__, __FILE__, $sql); } $function_rows = array(); if( $total_functions = $db->sql_numrows($q_functions) ) { $function_rows = $db->sql_fetchrowset($q_functions); } if ( $total_functions == 0 ) { $template->assign_block_vars('module.nofunction', array( 'NONE' => $lang['No_functions'] )); } // // Function loop // $modulelist = get_list('module_id', MODULE_TABLE, 'module_id', 'module_name', $module_id, true); for( $function_count = 0; $function_count < $total_functions + 1; $function_count++ ) { $new_function = $function_count == $total_functions; $function_id = $new_function ? $module_id . '_0' : $function_rows[$function_count]['function_id']; $id = $new_function ? $module_id : $function_id; $mode = MX_FUNCTION_TYPE; $action = $new_function ? MX_DO_INSERT : MX_DO_UPDATE; $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $function_id; // // Hidden fields // $s_hidden_function_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $function_title = !$new_function ? $function_rows[$function_count]['function_name'] : ''; $function_desc = !$new_function ? $function_rows[$function_count]['function_desc'] : ''; $function_file = !$new_function ? $function_rows[$function_count]['function_file'] : ''; $function_admin_file = !$new_function ? $function_rows[$function_count]['function_admin'] : ''; $message_delete = $lang['Delete_function'] . ' - ' . $function_title . '<br /><br />' . $lang['Delete_function_explain'] . '<br /><br />' . sprintf($lang['Click_function_delete_yes'], '<a href="' . append_sid("admin_mx_module_cp.$phpEx" . $deletemode) . '">', '</a>') . '<br /><br />'; $module_path = '../' . $module_rows[$module_count]['module_path']; // // Function subpanel - edit // $visible_func_tag = in_array('adminFunction_' . $function_id, $cookie_states); $visible_func_delete_tag = in_array('adminFunctionDelete_' . $function_id, $cookie_states); $visible_par_tag = in_array('adminParameter_' . $function_id, $cookie_states); $visible_block_tag = in_array('adminBlock_' . $function_id, $cookie_states); $template->assign_block_vars('module.function', array( 'L_TITLE' => $lang['Function_admin'], 'L_TITLE_PAR' => $lang['Parameter_admin'], 'L_EDIT' => $new_function ? '' : $lang['Edit'], 'L_EDIT_PAR' => $new_function ? '' : $lang['Parameters'], 'L_SHOW_BLOCKS' => $new_function ? '' : $lang['Show_blocks'], 'L_DELETE' => $new_function ? '' : $lang['Delete'], 'COOKIE_TAG' => $new_function ? 'adminFunction_' : 'adminBlock_', 'VISIBLE_FUNC' => $visible_func_tag ? 'block' : 'none', 'VISIBLE_DELETE' => $visible_func_delete_tag ? 'block' : 'none', 'VISIBLE_PAR' => $visible_par_tag ? 'block' : 'none', 'VISIBLE_BLOCK' => $visible_block_tag ? 'block' : 'none', 'IMG_URL_FUNC' => $visible_func_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_DELETE' => $visible_func_delete_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_PAR' => $visible_par_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_BLOCK' => $visible_block_tag ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'FUNCTION_ID' => $function_id, 'FUNCTION_TITLE' => $new_function ? '<span class="cattitle">'. $lang['Create_function'] . '</span>' : '<span class="topictitle">'.$lang['Function'].': </span>'.$function_title, 'FUNCTION_DESC' => ( $function_desc != '' ) ? ' - ' . $function_desc : '', 'U_FUNCTION_DELETE' => append_sid(PORTAL_URL . "admin/admin_mx_module_cp.$phpEx" . $deletemode), // // Function subpanel - edit // 'L_MODULE' => $lang['Module'], 'L_FUNCTION' => $lang['Function'], 'L_FUNCTION_TITLE' => $lang['Function_name'], 'L_FUNCTION_DESC' => $lang['Function_desc'], 'L_FUNCTION_FILE' => $lang['Function_file'], 'L_FUNCTION_ADMIN_FILE' => $lang['Function_admin_file'], 'E_MODULE_SELECT' => $modulelist, 'E_FUNCTION_TITLE' => $function_title, 'E_FUNCTION_DESC' => $function_desc, 'E_FUNCTION_FILE' => $function_file, 'E_FUNCTION_ADMIN_FILE' => $function_admin_file, // Quick Panels 'MESSAGE_DELETE' => $message_delete, 'S_HIDDEN_FIELDS' => $s_hidden_function_fields, 'S_SUBMIT' => $new_function ? $lang['Create_function'] : $lang['Update'] )); if ($new_function) { continue; } else { $template->assign_block_vars('module.function.is_function', array()); } // ----------------------------------------------------------------------------------Parameters // Now continue with the function parameters // $sql = "SELECT * FROM " . PARAMETER_TABLE . " par WHERE par.function_id = $function_id ORDER BY par.parameter_id"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Couldn't obtain the parameters from database", "", __LINE__, __FILE__, $sql); } $parameter_rows = $db->sql_fetchrowset($result); $total_parameters = count($parameter_rows); if ( $total_parameters == 0 ) { $template->assign_block_vars('module.function.noparameter', array( 'NONE' => $lang['No_parameters'] )); } $functionlist = get_list('function_id', FUNCTION_TABLE, 'function_id', 'function_name', $function_id, true); // // Parameter loop // for( $parameter_count = 0; $parameter_count < $total_parameters + 1; $parameter_count++ ) { $new_parameter = $parameter_count == $total_parameters; $parameter_id = $new_parameter ? $function_id . '_0': $parameter_rows[$parameter_count]['parameter_id']; $id = $new_parameter ? $function_id : $parameter_id; $mode = MX_PARAMETER_TYPE; $action = $new_parameter ? MX_DO_INSERT : MX_DO_UPDATE; $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $parameter_id; // // Hidden fields // $s_hidden_parameter_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $parameter_title = !$new_parameter ? $parameter_rows[$parameter_count]['parameter_name'] : ''; $parameter_type = !$new_parameter ? get_list_static('parameter_type', $type_row, $parameter_rows[$parameter_count]['parameter_type']) : get_list_static('parameter_type', $type_row, 'BBText'); $parameter_function = $parameter_rows[$parameter_count]['parameter_function']; $parameter_function = !$new_parameter && !empty($parameter_function) ? ( $parameter_rows[$parameter_count]['parameter_type'] != 'Function' ? implode( "\n", unserialize( stripslashes( $parameter_function ) ) ) : $parameter_function ) : ''; $parameter_default = !$new_parameter ? $parameter_rows[$parameter_count]['parameter_default'] : ''; $message_delete = $lang['Delete_parameter'] . ' - ' . $parameter_title . '<br /><br />' . $lang['Delete_parameter_explain'] . '<br /><br />' . sprintf($lang['Click_parameter_delete_yes'], '<a href="' . append_sid("admin_mx_module_cp.$phpEx" . $deletemode) . '">', '</a>') . '<br /><br />'; // Replace htmlentites for < and > with actual character. $row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; // // Parameter subpanel - edit // $visible = in_array('adminParEdit_' . $parameter_id, $cookie_states); $visible_delete = in_array('adminParDelete_' . $parameter_id, $cookie_states); $template->assign_block_vars('module.function.parameter', array( 'L_TITLE' => $lang['Parameter_admin'], 'L_EXPLAIN' => $lang['Parameter_admin_explain'], 'VISIBLE' => $visible ? 'block' : 'none', 'VISIBLE_DELETE' => $visible_delete ? 'block' : 'none', 'IMG_URL' => $visible ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_DELETE' => $visible_delete ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', "ROW_COLOR" => '#' . $row_color, "ROW_CLASS" => $row_class, 'L_EDIT' => $new_parameter ? '' : $lang['Edit'], 'L_DELETE' => $new_parameter ? '' : $lang['Delete'], "PARAMETER_ID" => $parameter_id, "PARAMETER_TITLE" => $new_parameter ? '<span class="cattitle">'. $lang['Create_parameter'] . '</span>' : ( ! empty ( $lang[$parameter_title] ) ? $lang[$parameter_title] : $parameter_title ), "PARAMETER_DESC" => $new_parameter ? '' : ' - ' . $parameter_desc, "U_DELETE" => append_sid("admin_mx_module_cp.php" . $deletemode), // // Parameter subpanel - edit // 'L_FUNCTION' => $lang['Function'], 'L_PARAMETER_TITLE' => $lang['Parameter_name'], 'L_PARAMETER_TYPE' => $lang['Parameter_type'], 'L_PARAMETER_DEFAULT' => $lang['Parameter_default'], 'L_PARAMETER_FUNCTION' => $lang['Parameter_function'], "L_PARAMETER_TEXT" => $lang['Parameter_admin_explain'], 'L_PARAMETER_ID' => $lang['Parameter_id'], 'E_FUNCTION_SELECT' => $functionlist, 'E_PARAMETER_TITLE' => $parameter_title, 'E_PARAMETER_TYPE' => $parameter_type, 'E_PARAMETER_FUNCTION' => $parameter_function, 'E_PARAMETER_DEFAULT' => $parameter_default, // Quick Panels 'MESSAGE_DELETE' => $message_delete, 'S_HIDDEN_FIELDS' => $s_hidden_parameter_fields, 'S_SUBMIT' => $new_parameter ? $lang['Create_parameter'] : $lang['Update'] )); if (!$new_parameter) { $template->assign_block_vars('module.function.parameter.is_parameter', array()); } } // ----------------------------------------------------------------------------------Blocks // Now continue with the function blocks // $sql = "SELECT blk.*, function_admin, fnc.function_name, fnc.function_id, fnc.function_desc, fnc.module_id FROM " . BLOCK_TABLE . " blk, " . FUNCTION_TABLE . " fnc WHERE blk.function_id = fnc.function_id AND fnc.function_id = '" . $function_rows[$function_count]['function_id'] . "' ORDER BY fnc.function_name ASC"; if( !($q_blocks = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, "Could not query blocks information", "", __LINE__, __FILE__, $sql); } $block_rows = array(); if( $total_blocks = $db->sql_numrows($q_blocks) ) { $block_rows = $db->sql_fetchrowset($q_blocks); } if ( $total_blocks == 0 ) { $template->assign_block_vars('module.function.noblock', array( 'NONE' => $lang['No_blocks'] )); } // // Block loop // for( $block_count = 0; $block_count < $total_blocks + 1; $block_count++ ) { $new_block = $block_count == $total_blocks; $block_id = $new_block ? $function_id . '_0' : $block_rows[$block_count]['block_id']; $id = $new_block ? $function_id : $block_id; $mode = MX_BLOCK_TYPE; $mode_private = MX_BLOCK_PRIVATE_TYPE; $action = $new_block ? MX_DO_INSERT : MX_DO_UPDATE; $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $block_id; // // Hidden fields // $s_hidden_block_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; // // Hidden fields // $s_hidden_block_private_fields = '<input type="hidden" name="mode" value="' . $mode_private . '" /> <input type="hidden" name="action" value="' . MX_DO_UPDATE . '" /> <input type="hidden" name="id" value="' . $id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $block_title = !$new_block ? $block_rows[$block_count]['block_title'] : ''; $block_desc = !$new_block ? $block_rows[$block_count]['block_desc']: ''; $message_delete = $lang['Delete_block'] . ' - ' . $block_title . '<br /><br />' . $lang['Delete_block_explain'] . '<br /><br />' . sprintf($lang['Click_block_delete_yes'], '<a href="' . append_sid("admin_mx_module_cp.$phpEx" . $deletemode) . '">', '</a>') . '<br /><br />'; $show_block = !$new_block ? $block_rows[$block_count]['show_block'] : '1'; $show_title = !$new_block ? $block_rows[$block_count]['show_title'] : '1'; $show_stats = !$new_block ? $block_rows[$block_count]['show_stats'] : '0'; $show_title_yes = ( $show_title == 1 ) ? 'checked="checked"' : ''; $show_title_no = ( $show_title == 0 ) ? 'checked="checked"' : ''; $show_block_yes = ( $show_block == 1 ) ? 'checked="checked"' : ''; $show_block_no = ( $show_block == 0 ) ? 'checked="checked"' : ''; $show_stats_yes = ( $show_stats == 1 ) ? 'checked="checked"' : ''; $show_stats_no = ( $show_stats == 0 ) ? 'checked="checked"' : ''; $block_editor_id = !$new_block ? $block_rows[$block_count]['block_editor_id'] : $userdata['user_id']; $editor_name_tmp = get_userdata($block_editor_id); $editor_name = $editor_name_tmp['username']; $block_time = !$new_block ? $block_rows[$block_count]['block_time'] : time(); $edit_time = create_date( $board_config['default_dateformat'], $block_time, $board_config['board_timezone'] ); if ($new_block) { $block_rows[$block_count][$block_auth_fields[0]] = AUTH_ALL; $block_rows[$block_count][$block_auth_fields[1]] = AUTH_ADMIN; } // // Block subpanel - edit // $visible_tag_edit = in_array('adminEdit_' . $block_id, $cookie_states); $visible_tag_private = in_array('adminPrivate_' . $block_id, $cookie_states); $visible_tag_delete = in_array('adminBlockDelete_' . $block_id, $cookie_states); $visible_tag_settings = in_array('adminSettings_' . $block_id, $cookie_states); $template->assign_block_vars('module.function.block', array( 'L_TITLE' => $lang['Block_admin'], 'VISIBLE_EDIT' => $visible_tag_edit ? 'block' : 'none', 'VISIBLE_PRIVATE' => $visible_tag_private ? 'block' : 'none', 'VISIBLE_DELETE' => $visible_tag_delete ? 'block' : 'none', 'VISIBLE_SETTINGS' => $visible_tag_settings ? 'block' : 'none', 'IMG_URL_EDIT' => $visible_tag_edit ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_PRIVATE' => $visible_tag_private ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_DELETE' => $visible_tag_delete ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'IMG_URL_SETTINGS' => $visible_tag_settings ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', 'L_SETTINGS' => $new_block ? '' : $lang['Block_cp'], 'L_PERMISSIONS_ADV' => $new_block ? '' : $lang['Permissions_adv'], 'L_DELETE' => $new_block ? '' : $lang['Delete'], 'L_EDIT' => $new_block ? '' : $lang['Block_quick_edit'], 'L_QUICK_STATS' => $new_block ? '' : $lang['Block_quick_stats'], 'BLOCK_ID' => $block_id, 'BLOCK_TITLE' => $new_block ? '<span class="cattitle">'. $lang['Create_block'] . '</span>' : $block_title, 'BLOCK_DESC' => ( $block_desc != '' ) ? '<br /> ' . $block_desc : '', 'BLOCK_LAST_EDITED' => ( $editor_name != '' && !$new_block) ? ' (' . $lang['Block_updated_by'] . $editor_name . ', ' . $edit_time . ')' : '', 'U_BLOCK_SETTINGS' => append_sid(PORTAL_URL . "admin/admin_mx_block_cp.$phpEx?block_id=$block_id"), 'U_BLOCK_DELETE' => append_sid(PORTAL_URL . "admin/admin_mx_module_cp.$phpEx" . $deletemode), 'U_BLOCK_PERMISSIONS' => append_sid(PORTAL_URL . "admin/admin_mx_block_auth.$phpEx?cat_id=$block_id"), // // Block subpanel - edit // 'L_FUNCTION' => $lang['Function'], 'L_AUTH_TITLE' => $lang['Auth_Block'], 'L_AUTH_TITLE_EXPLAIN' => $lang['Auth_Block_explain'], 'L_BLOCK_TITLE' => $lang['Block_title'], 'L_BLOCK_DESC' => $lang['Block_desc'], 'L_SHOW_BLOCK' => $lang['Show_block'], 'L_SHOW_BLOCK_EXPLAIN' => $lang['Show_block_explain'], 'L_SHOW_TITLE' => $lang['Show_title'], 'L_SHOW_TITLE_EXPLAIN' => $lang['Show_title_explain'], 'L_SHOW_STATS' => $lang['Show_stats'], 'L_SHOW_STATS_EXPLAIN' => $lang['Show_stats_explain'], 'E_BLOCK_TITLE' => $block_title, 'E_BLOCK_DESC' => $block_desc, 'S_FUNCTION_LIST' => $functionlist, 'S_SHOW_BLOCK_YES' => $show_block_yes, 'S_SHOW_BLOCK_NO' => $show_block_no, 'S_SHOW_TITLE_YES' => $show_title_yes, 'S_SHOW_TITLE_NO' => $show_title_no, 'S_SHOW_STATS_YES' => $show_stats_yes, 'S_SHOW_STATS_NO' => $show_stats_no, // Quick Panels 'MESSAGE_DELETE' => $message_delete, 'S_HIDDEN_FIELDS' => $s_hidden_block_fields, 'S_HIDDEN_PRIVATE_FIELDS' => $s_hidden_block_private_fields, 'S_SUBMIT' => $new_block ? $lang['Create_block'] : $lang['Update'] )); // // Auth // for( $l = 0; $l < count($block_auth_fields); $l++ ) { $custom_auth[$l] = ' <select name="' . $block_auth_fields[$l] . '">'; for( $k = 0; $k < count($block_auth_levels); $k++ ) { $selected = ( $block_rows[$block_count][$block_auth_fields[$l]] == $block_auth_const[$k] ) ? ' selected="selected"' : ''; $custom_auth[$l] .= '<option value="' . $block_auth_const[$k] . '"' . $selected . '>' . $lang['AUTH_' . $block_auth_levels[$k]] . "</option>\n"; } $custom_auth[$l] .= '</select> '; $cell_title = $field_names[$block_auth_fields[$l]]; $template->assign_block_vars('module.function.block.block_auth_titles', array( 'CELL_TITLE' => $cell_title )); $template->assign_block_vars('module.function.block.block_auth_data', array( 'S_AUTH_LEVELS_SELECT' => $custom_auth[$l] )); $s_column_span++; } // // PRIVATE auth // $view_groups = @explode(',', $block_rows[$block_count]['auth_view_group']); $edit_groups = @explode(',', $block_rows[$block_count]['auth_edit_group']); $moderator_groups = @explode(',', $block_rows[$block_count]['auth_moderator_group']); $row_private = ''; for( $i = 0; $i < count($groupdata); $i++ ) { $row_color = ( !( $i % 2 ) ) ? 'row1' : 'row2'; $row_private .= '<tr>'; $row_private .= '<td width="40%" class="'.$row_color.'" align="center"><span class="gen">'.$groupdata[$i]['group_name'].'</span></td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; if ( $block_rows[$block_count]['auth_view'] == AUTH_ACL ) { $view_checked = in_array($groupdata[$i]['group_id'], $view_groups) ? 'checked="checked"' : ''; $row_private .= '<input name="view[]" type="checkbox" ' . $view_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; } else { $row_private .= '-'; } $row_private .= '</td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; if ( $block_rows[$block_count]['auth_edit'] == AUTH_ACL ) { $edit_checked = in_array($groupdata[$i]['group_id'], $edit_groups) ? 'checked="checked"' : ''; $row_private .= '<input name="edit[]" type="checkbox" ' . $edit_checked . 'value="'.$groupdata[$i]['group_id'].'" />'; } else { $row_private .= '-'; } $row_private .= '</td>'; $row_private .= '<td width="20%" class="'.$row_color.'" align="center">'; $row_private .= '<input name="moderator[]" type="checkbox" '. (( in_array($groupdata[$i]['group_id'], $moderator_groups) ) ? 'checked="checked"' : '') . '" value="'.$groupdata[$i]['group_id'].'" />'; $row_private .= '</td>'; $row_private .= '</tr>'; } $template->assign_block_vars('module.function.block.grouprows', array( 'GROUP_ROWS' => $row_private )); if (!$new_block) { $template->assign_block_vars('module.function.block.is_block', array()); } } // for ... blocks } // for ... functions } // for .... modules // // Create quick nav box // $module_select_box = get_list_static('module_id', $module_rows_select, $nav_module_id, false); $template->assign_vars(array( 'MODULE_SELECT_BOX' => $module_select_box )); include_once('./page_header_admin.' . $phpEx); $template->pparse('admin_block'); include_once('./page_footer_admin.' . $phpEx); ?> Index: admin_mx_phpinfo.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_phpinfo.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** admin_mx_phpinfo.php 28 Apr 2005 04:13:50 -0000 1.5 --- admin_mx_phpinfo.php 20 Aug 2005 18:19:11 -0000 1.6 *************** *** 21,25 **** if( !empty($setmodules) ) { ! $module['Portal - System']['phpInfo'] = 'admin/' . basename(__FILE__); return; } --- 21,25 ---- if( !empty($setmodules) ) { ! $module['4_Panel_system']['4_1_PHPinfo'] = 'admin/' . basename(__FILE__); return; } Index: admin_mx_module.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** admin_mx_module.php 28 Apr 2005 04:13:49 -0000 1.30 --- admin_mx_module.php 20 Aug 2005 18:19:11 -0000 1.31 *************** *** 21,25 **** if( !empty($setmodules) ) { ! $module['Portal - Modules']['Module_admin'] = 'admin/' . basename( __FILE__ ); return; } --- 21,26 ---- if( !empty($setmodules) ) { ! $file = basename(__FILE__); ! $module['2_CP']['2_1_Modules'] = 'admin/' . $file; return; } *************** *** 35,38 **** --- 36,44 ---- // + // Instatiate the mx_cache class + // + $mx_admin = new mx_admin(); + + // // Pak file delimiter // *************** *** 40,55 **** // ! // Check to see what mode we should operate in. // ! if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) ! { ! $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; ! $mode = htmlspecialchars($mode); ! } ! else { ! $mode = ''; } if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) ) { --- 46,67 ---- // ! // Mode & Action setting // ! $mode = $mx_request_vars->request('mode', MX_TYPE_NO_TAGS, ''); ! $action = $mx_request_vars->request('action', MX_TYPE_NO_TAGS, ''); ! ! // Main module id, to load the adminCP blocks and parameter data ! $nav_module_id = $mx_request_vars->request('module_id', MX_TYPE_INT, ''); ! ! if ( empty($nav_module_id) ) { ! $cookie_tmp = $board_config['cookie_name'].'_adminModule_module_id'; ! $nav_module_id = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? $HTTP_COOKIE_VARS[$cookie_tmp] : ''; } + // Load states + $cookie_tmp = $board_config['cookie_name'].'_admincp_blockstates'; + $cookie_states = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? explode(",", $HTTP_COOKIE_VARS[$cookie_tmp]) : array(); + if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) ) { *************** *** 64,77 **** $mode = 'upgrade_module'; } ! if( isset($HTTP_POST_VARS['this_module_path']) || isset($HTTP_GET_VARS['this_module_path']) ) ! { ! $this_module_path = ( isset($HTTP_POST_VARS['this_module_path']) ) ? $HTTP_POST_VARS['this_module_path'] : $HTTP_GET_VARS['this_module_path']; ! $this_module_path = htmlspecialchars($this_module_path); ! } ! else { ! $this_module_path = ''; ! } // // Main switch --- 76,98 ---- $mode = 'upgrade_module'; } ! ! $this_module_path = $mx_request_vars->request('this_module_path', MX_TYPE_NO_TAGS, ''); ! ! if( !empty($mode) && !empty($action) ) { ! // ! // Get vars ! // ! $portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, 1); ! $id = $mx_request_vars->request('id', MX_TYPE_INT, ''); ! ! // ! // Send to adminCP ! // ! $result_message = $mx_admin->do_it($mode, $action, $id); ! ! } // if .. !empty($mode) + /* // // Main switch *************** *** 79,86 **** if( !empty($mode) ) { ! $module_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); ! $function_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); ! $parameter_id = intval($HTTP_GET_VARS['id']); ! switch( $mode ) { --- 100,109 ---- if( !empty($mode) ) { ! // ! // Get vars ! // ! $module_id = $function_id = $mx_request_vars->request('id', MX_TYPE_INT, 0); ! $parameter_id = $mx_request_vars->get('id', MX_TYPE_INT, 0);; ! switch( $mode ) { *************** *** 114,160 **** break; - case 'edit_func': - module_edit_func($function_id); - break; - - case 'insert_func': - module_insert_func(0); - break; - - case 'modify_func': - module_update_func($function_id); - break; - - case 'delete_func': - module_delete_func($function_id, false); - break; - - case 'add_func': - module_edit_func(0); - break; - - case 'add_param': - module_edit_param(0, $function_id); - break; - - case 'edit_param': - module_edit_param($parameter_id, 0); - break; - - case 'delete_param': - module_delete_param($parameter_id, false); - break; - - case 'modify_param': - $parameter_id = intval($HTTP_POST_VARS['id']); - module_update_param($parameter_id); - break; - - case 'insert_param': - module_insert_param(0); - break; - case 'export_pack': ! $module_id = intval($HTTP_POST_VARS['module_select']); if( empty($module_id) ) { --- 137,142 ---- break; case 'export_pack': ! $module_id = $mx_request_vars->request('module_select', MX_TYPE_INT, 0); if( empty($module_id) ) { *************** *** 166,170 **** case 'upgrade_module': ! $file_name = $HTTP_POST_VARS['file_select']; if( empty($file_name) ) { --- 148,152 ---- case 'upgrade_module': ! $file_name = $mx_request_vars->request('file_select', MX_TYPE_NO_TAGS, ''); if( empty($file_name) ) { *************** *** 179,183 **** case 'import_pack' : ! $file_name = $HTTP_POST_VARS['file_select']; if( empty($file_name) ) { --- 161,165 ---- case 'import_pack' : ! $file_name = $mx_request_vars->request('file_select', MX_TYPE_NO_TAGS, ''); if( empty($file_name) ) { *************** *** 196,210 **** } // End mode switch } // End ifmode ! ! // Display list of Modules --------------------------------------------------------------- ! // --------------------------------------------------------------------------------------- ! $sql = "SELECT * FROM " . MODULE_TABLE . " ORDER BY module_id"; ! ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Couldn't obtain modules from database", "", __LINE__, __FILE__, $sql); ! } ! $module = $db->sql_fetchrowset($result); $template->set_filenames(array( --- 178,189 ---- } // End mode switch } // End ifmode + */ ! // -------------------------------------------------------------------------------------------------------------------- ! // -------------------------------------------------------------------------------------------------------------------- ! // -------------------------------------------------------------------------------------------------------------------- ! // ! // Start page proper ! // $template->set_filenames(array( *************** *** 212,302 **** ); $s_hidden_fields_module = '<input type="hidden" name="mode" value="add" /><input type="hidden" name="id" value="' . $module_id . '" />'; - $s_hidden_fields_function = '<input type="hidden" name="mode" value="add_func" /><input type="hidden" name="id" value="' . $module_id . '" />'; $template->assign_vars(array( 'L_ACTION' => $lang['Action'], - 'L_MODULE_TITLE' => $lang['Module_admin'], - 'L_MODULE_TEXT' => $lang['Module_admin_explain'], - 'L_FUNCTION_TITLE' => $lang['Function_admin'], - 'L_FUNCTION_TEXT' => $lang['Function_admin_explain'], 'L_DELETE' => $lang['Delete'], 'L_UNINSTALL' => $lang['Uninstall_module'], 'L_EDIT' => $lang['Edit'], 'L_ADD' => $lang['Create_module'], ! 'L_ADD_FUNCTION' => $lang['Create_function'], 'L_CODE' => $lang['Code'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_DESC' => $lang['Module_desc'], - 'L_FUNCTION_NAME' => $lang['Function_name'], - 'L_FUNCTION_DESC' => $lang['Function_desc'], 'L_IMPORT_PACK' => $lang['import_module_pack'], 'L_UPGRADE_PACK' => $lang['upgrade_module_pack'], 'L_EXPORT_PACK' => $lang['export_module_pack'], 'S_HIDDEN_FIELDS_MODULE' => $s_hidden_fields_module, ! 'S_HIDDEN_FIELDS_FUNCTION' => $s_hidden_fields_function, 'S_ACTION' => append_sid("admin_mx_module.$phpEx") )); // ! // Loop through the rows of modules setting block vars for the template. // - for( $i = 0; $i < count($module); $i++ ) - { - // Replace htmlentites for < and > with actual character. - $row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; - $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars('module', array( ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class, ! 'CODE' => $module[$i]['module_id'], ! 'NAME' => $module[$i]['module_name'] . '<br />' . $module[$i]['module_version'], ! 'DESC' => $module[$i]['module_desc'], ! 'U_EDIT' => append_sid("admin_mx_module.$phpEx?mode=edit&id=" . $module[$i]['module_id']), ! 'U_DELETE' => append_sid("admin_mx_module.$phpEx?mode=delete&id=" . $module[$i]['module_id']) ! )); } ! // Display list of function --------------------------------------------------------------- ! // ---------------------------------------------------------------------------------------- ! $sql = "SELECT module_name, function_id, function_name, function_desc ! FROM " . FUNCTION_TABLE . " fnc, " . MODULE_TABLE . " mdl ! WHERE mdl.module_id = fnc.module_id ! ORDER BY fnc.module_id, fnc.function_id"; ! if( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Couldn't obtain functions from database", "", __LINE__, __FILE__, $sql); } ! $function_rows = $db->sql_fetchrowset($result); // ! // Loop through the rows of functions setting block vars for the template. // ! for( $i = 0; $i < count($function_rows); $i++ ) { ! // Replace htmlentites for < and > with actual character. ! $row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !( $i % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $template->assign_block_vars('function', array( ! 'ROW_COLOR' => '#' . $row_color, ! 'ROW_CLASS' => $row_class, ! 'MODULE' => $function_rows[$i]['module_name'], ! 'CODE' => $function_rows[$i]['function_id'], ! 'NAME' => $function_rows[$i]['function_name'], ! 'DESC' => $function_rows[$i]['function_desc'], ! 'U_EDIT' => append_sid("admin_mx_module.$phpEx?mode=edit_func&id=" . $function_rows[$i]['function_id']), ! 'U_DELETE' => append_sid("admin_mx_module.$phpEx?mode=delete_func&id=" . $function_rows[$i]['function_id']) )); } // // Generate Module and Function Page // --- 191,429 ---- ); + // + // Define some graphics + // + $module_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/admin_icons/'; + $admin_icon['contract'] = $module_nav_icon_url . 'contract.gif'; + $admin_icon['expand'] = $module_nav_icon_url . 'expand.gif'; + $admin_icon['module'] = $module_nav_icon_url . 'icon_module.gif'; + + // + // Hidden vars + // $s_hidden_fields_module = '<input type="hidden" name="mode" value="add" /><input type="hidden" name="id" value="' . $module_id . '" />'; + // + // Send to template + // $template->assign_vars(array( + 'L_TITLE' => $lang['Module_admin'], + 'L_EXPLAIN' => $lang['Module_admin_explain'], + + 'NAV_MODULE_ID' => $nav_module_id, + + // + // General + // 'L_ACTION' => $lang['Action'], 'L_DELETE' => $lang['Delete'], 'L_UNINSTALL' => $lang['Uninstall_module'], 'L_EDIT' => $lang['Edit'], + 'L_SETTING' => $lang['Settings'], 'L_ADD' => $lang['Create_module'], ! ! // ! // Module ! // 'L_CODE' => $lang['Code'], 'L_MODULE_NAME' => $lang['Module_name'], 'L_MODULE_DESC' => $lang['Module_desc'], 'L_IMPORT_PACK' => $lang['import_module_pack'], 'L_UPGRADE_PACK' => $lang['upgrade_module_pack'], 'L_EXPORT_PACK' => $lang['export_module_pack'], + + 'L_QUICK_NAV' => $lang['Quick_nav'], + + 'IMG_URL_CONTRACT' => $admin_icon['contract'], + 'IMG_URL_EXPAND' => $admin_icon['expand'], + 'IMG_ICON_MODULE' => $admin_icon['module'], 'S_HIDDEN_FIELDS_MODULE' => $s_hidden_fields_module, ! 'S_SUBMIT' => $lang['Update'], ! ! // ! // Cookies ! // ! 'COOKIE_NAME' => $board_config['cookie_name'], ! 'COOKIE_PATH' => $board_config['cookie_path'], ! 'COOKIE_DOMAIN' => $board_config['cookie_domain'], ! 'COOKIE_SECURE' => $board_config['cookie_secure'], ! 'S_ACTION' => append_sid("admin_mx_module.$phpEx") )); // ! // ---------------------------------------------------------------------------------- Modules // ! // Display list of Modules --------------------------------------------------------------- ! // --------------------------------------------------------------------------------------- ! // ! // Get current/active module ! // ! $sql = "SELECT * ! FROM " . MODULE_TABLE . " ! WHERE module_id = '" . $nav_module_id . "' ! ORDER BY module_name ASC"; ! if( !($q_modules_current = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } ! $module_rows_current = array(); ! $module_rows_current = $db->sql_fetchrowset($q_modules_current); ! // ! // Get the rest modules ! // ! ! $sql = "SELECT * ! FROM " . MODULE_TABLE . " ! WHERE module_id <> '" . $nav_module_id . "' ! ORDER BY module_name ASC"; ! ! if( !($q_modules = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql); } ! ! $module_rows = array(); ! if( $total_modules = $db->sql_numrows($q_modules) ) ! { ! $module_rows = $db->sql_fetchrowset($q_modules); ! } ! ! if ( $total_modules == 0 ) ! { ! $template->assign_block_vars('nomodule', array( ! 'NONE' => $lang['No_modules'] ! )); ! } ! ! $module_rows = array_merge($module_rows_current, $module_rows); // ! // Setup an additional var for the quick nav dropdown // ! $module_rows_select = array(); ! ! // ! // Loop through the rows of modules setting block vars for the template. ! // ! for( $module_count = -1; $module_count < $total_modules + 1; $module_count++ ) { ! // ! // Give main vars specific names ! // ! $new_module = $module_count == -1; ! ! $newmode = $new_module ? 'add' : 'modify'; ! $module_id = $new_module ? '0' : $module_rows[$module_count]['module_id']; ! $mode = MX_MODULE_TYPE; ! $action = $new_module ? MX_DO_INSERT : MX_DO_UPDATE; ! ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $module_id; ! $upgrademode = '?mode=' . $mode . '&action=' . MX_DO_UPGRADE . '&id=' . $module_id; ! $exportmode = '?mode=' . $mode . '&action=' . MX_DO_EXPORT . '&id=' . $module_id; ! ! $settingmode = '?module_id=' . $module_id; ! ! // ! // Hidden fields ! // ! $s_hidden_module_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> ! <input type="hidden" name="action" value="' . $action . '" /> ! <input type="hidden" name="id" value="' . $module_id . '" /> ! <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! ! $is_current_module = $module_id == $nav_module_id; ! $module_rows_select[$module_id] = $module_rows[$module_count]['module_name']; ! ! $check_opt = ''; ! if( $module_rows[$module_count]['module_include_admin'] == 1 ) ! { ! $check_opt = 'checked="checked"'; ! } ! ! $message_uninstall = $lang['Module_delete'] ! . '<br /><br />' . sprintf($lang['Click_module_delete_yes'], '<a href="' . append_sid("admin_mx_module.$phpEx" . $deletemode) . '">', '</a>') ! . '<br /><br />'; ! ! $message_upgrade = $lang['upgrade_module_pack_explain'] ! . '<br /><br />' . sprintf($lang['Click_module_upgrade_yes'], '<a href="' . append_sid("admin_mx_module.$phpEx" . $upgrademode) . '">', '</a>') ! . '<br /><br />'; ! ! $message_export = $lang['export_module_pack_explain'] ! . '<br /><br />' . sprintf($lang['Click_module_export_yes'], '<a href="' . append_sid("admin_mx_module.$phpEx" . $exportmode) . '">', '</a>') ! . '<br /><br />'; ! ! // ! // Module subpanel - edit ! // ! $visible = in_array('adminModule_' . $module_id, $cookie_states); ! $visible_upgrade = in_array('adminModuleUpgrade_' . $module_id, $cookie_states); ! $visible_export = in_array('adminModuleExport_' . $module_id, $cookie_states); ! $visible_uninstall = in_array('adminModuleDelete_' . $module_id, $cookie_states); ! ! $template->assign_block_vars('module', array( ! 'L_TITLE' => $new_module ? $lang['Create_module'] : $lang['Edit_module'], ! 'L_MODULE' => $lang['Module'], ! 'VISIBLE' => $visible ? 'block' : 'none', ! 'VISIBLE_UPGRADE' => $visible_upgrade ? 'block' : 'none', ! 'VISIBLE_EXPORT' => $visible_export ? 'block' : 'none', ! 'VISIBLE_DELETE' => $visible_uninstall ? 'block' : 'none', ! ! 'IMG_URL' => $visible ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! 'IMG_URL_UPGRADE' => $visible_upgrade ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! 'IMG_URL_EXPORT' => $visible_export ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! 'IMG_URL_DELETE' => $visible_uninstall ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! ! 'U_MODULE' => append_sid("admin_mx_module_cp.$phpEx" . $settingmode), ! ! 'MODULE_ID' => $module_id, ! 'MODULE_TITLE' => $new_module ? $lang['Create_module'] : $module_rows[$module_count]['module_name'], ! 'MODULE_DESCRIPTION' => ( $module_rows[$module_count]['module_desc'] != '' ) ? ' - ' . $module_rows[$module_count]['module_desc'] : '', ! 'MODULE_VERSION' => ( $module_rows[$module_count]['module_version'] != '' ) ? '- ' . $module_rows[$module_count]['module_version'] : '', ! ! // Module subpanel - edit ! 'E_MODULE_NAME' => $module_rows[$module_count]['module_name'], ! 'E_MODULE_DESC' => $module_rows[$module_count]['module_desc'], ! 'E_MODULE_PATH' => $module_rows[$module_count]['module_path'], ! 'E_MODULE_INCLUDE_CHECK_OPT' => $check_opt, ! ! // Quick Panels ! 'MESSAGE_UPGRADE' => $message_upgrade, ! 'MESSAGE_EXPORT' => $message_export, ! 'MESSAGE_DELETE' => $message_uninstall, ! ! 'S_SUBMIT' => $new_module ? $lang['Create_module'] : $lang['Update'], ! ! 'S_HIDDEN_FIELDS' => $s_hidden_module_fields )); + + if (!$new_module) + { + $template->assign_block_vars('module.settings', array()); + } + + } // + // Create quick nav box + // + + $module_select_box = get_list_static('module_id', $module_rows_select, $nav_module_id, false); + + $template->assign_vars(array( + 'MODULE_SELECT_B... [truncated message content] |