Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4716/admin Modified Files: admin_mx_block_cp.php admin_mx_chkobjs.php admin_mx_module.php admin_mx_module_cp.php admin_mx_page_cp.php admin_mx_portal.php Log Message: Finalizing core 2.8 ;) Index: admin_mx_chkobjs.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_chkobjs.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** admin_mx_chkobjs.php 20 Aug 2005 18:19:11 -0000 1.11 --- admin_mx_chkobjs.php 6 Sep 2005 18:51:56 -0000 1.12 *************** *** 68,78 **** ), array( - 'table' => PARAMETER_OPTION_TABLE, - 'fkeys' => array( - array(PARAMETER_TABLE, 'parameter_id', 'parameter_name'), - array(PARAMETER_OPTION_TABLE, 'option_id', 'option_desc') - ) - ), - array( 'table' => BLOCK_TABLE, 'fkeys' => array( --- 68,71 ---- Index: admin_mx_page_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_page_cp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_mx_page_cp.php 21 Aug 2005 21:40:51 -0000 1.2 --- admin_mx_page_cp.php 6 Sep 2005 18:51:56 -0000 1.3 *************** *** 58,62 **** { $cookie_tmp = $board_config['cookie_name'].'_adminPage_page_id'; ! $nav_page_id = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? $HTTP_COOKIE_VARS[$cookie_tmp] : ''; } --- 58,62 ---- { $cookie_tmp = $board_config['cookie_name'].'_adminPage_page_id'; ! $nav_page_id = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? $HTTP_COOKIE_VARS[$cookie_tmp] : '1'; } *************** *** 74,77 **** --- 74,88 ---- $result_message = $mx_admin->do_it($mode, $action, $id); + // + // If new page, load new page settings panel + // + if (is_array($result_message)) + { + $nav_page_id = $result_message['new_page_id']; + $result_message = $result_message['text']; + } + + $result_message = $lang['AdminCP_status'] . '<hr>' . $result_message; + } // if .. !empty($mode) *************** *** 194,197 **** --- 205,209 ---- 'L_TITLE_PAGES' => $lang['Page_admin'], + 'L_TITLE_NEW_PAGE' => $lang['Page_admin_new_page'], 'L_TITLE_TEMPLATES' => $lang['Page_templates_admin'], 'L_EXPLAIN' => $lang['Page_admin_explain'], *************** *** 204,208 **** 'L_CHANGE_NOW' => $lang['Change'], 'S_SUBMIT' => $lang['Update'], ! 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">-::-<br/>' . $result_message . '<br/> -::-</span></div>': '', // --- 216,220 ---- 'L_CHANGE_NOW' => $lang['Change'], 'S_SUBMIT' => $lang['Update'], ! 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">' . $result_message . '<br/> -::-</span></div>': '', // *************** *** 407,411 **** $template->assign_block_vars('templates.current_template', array()); } ! $sql = "SELECT * FROM " . COLUMN_TEMPLATES . " --- 419,428 ---- $template->assign_block_vars('templates.current_template', array()); } ! ! if ( $new_template ) ! { ! continue; ! } ! $sql = "SELECT * FROM " . COLUMN_TEMPLATES . " *************** *** 419,504 **** $column_rows = array(); ! if( $total_column = $db->sql_numrows($q_column) ) { ! $column_rows = $db->sql_fetchrowset($q_column); ! // ! // Okay, let's build the index ! // ! for( $column = 0; $column < $total_column + 1; $column++ ) ! { ! $new_column = $column == $total_column; ! $column_template_id = $new_column ? $template_id . '_0' : $column_rows[$column]['column_template_id']; ! $mode = MX_PAGE_TEMPLATE_COLUMN_TYPE; ! $action = $new_column ? MX_DO_INSERT : MX_DO_UPDATE; ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $column_template_id; ! $upmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_template_id . '&move=-15'; ! $downmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_template_id . '&move=15'; ! // ! // Hidden fields ! // ! $s_hidden_column_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> ! <input type="hidden" name="action" value="' . $action . '" /> ! <input type="hidden" name="id" value="' . $column_template_id . '" /> ! <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! // ! // Subpanel - column edit ! // ! $column_title = $new_column ? '' : $column_rows[$column]['column_title']; ! $column_size = $new_column ? '100%' : $column_rows[$column]['column_size']; ! $message_delete = $lang['Delete_page_template_column'] . ' - ' . $column_title ! . '<br /><br />' . $lang['Delete_page_template_column_explain'] ! . '<br /><br />' . sprintf($lang['Click_page_template_column_delete_yes'], '<a href="' . append_sid("admin_mx_page_cp.$phpEx" . $deletemode) . '">', '</a>') ! . '<br /><br />'; ! $visible_column_edit = in_array('adminTemplateColumnEdit_' . $page_template_id . '_' . $column_template_id, $cookie_states); ! $visible_column_delete = in_array('adminTemplateColumnDelete_' . $page_template_id . '_' . $column_template_id, $cookie_states); ! $template->assign_block_vars('templates.columnrow', array( ! 'VISIBLE' => $visible_column_edit ? 'block' : 'none', ! 'VISIBLE_DELETE' => $visible_column_delete ? 'block' : 'none', ! 'IMG_URL' => $visible_column_edit ? $admin_icon['contract'] : $admin_icon['expand'], ! 'IMG_URL_DELETE' => $visible_column_delete ? $admin_icon['contract'] : $admin_icon['expand'], ! 'COLUMN_ID' => $column_template_id, ! 'COLUMN_TITLE' => $new_column ? $lang['Create_column'] : $column_title, ! 'U_COLUMN_DELETE' => append_sid("admin_mx_page_cp.$phpEx" . $deletemode), ! 'U_COLUMN_MOVE_UP' => append_sid("admin_mx_page_cp.$phpEx" . $upmode), ! 'U_COLUMN_MOVE_DOWN' => append_sid("admin_mx_page_cp.$phpEx" . $downmode), ! // ! // Column Edit ! // ! 'L_DELETE' => $new_column ? '' : $lang['Delete'], ! 'L_MOVE_UP' => $new_column ? '' : $lang['Move_up'], ! 'L_MOVE_DOWN' => $new_column ? '' : $lang['Move_down'], ! 'L_COLUMN' => $lang['Column'], ! 'L_COLUMN_NAME' => $lang['Column_name'], ! 'L_COLUMN_SIZE' => $lang['Column_Size'], ! 'VISIBLE' => $visible_column_edit ? 'block' : 'none', ! 'IMG_URL_EDIT' => $visible_column_edit ? $admin_icon['contract'] : $admin_icon['expand'], ! ! 'E_COLUMN_TITLE' => $column_title, ! 'E_COLUMN_SIZE' => $column_size, ! 'S_SUBMIT' => $new_column ? $lang['Create_column'] : $lang['Update'], ! // Quick Panels ! 'MESSAGE_DELETE' => $message_delete, ! 'S_HIDDEN_FIELDS' => $s_hidden_column_fields ! )); ! } // for ... column ! } // if ... total_categories } --- 436,523 ---- $column_rows = array(); ! if( $total_column = $db->sql_numrows($q_columns) ) { ! $column_rows = $db->sql_fetchrowset($q_columns); ! } ! ! // ! // Okay, let's build the index ! // ! for( $column = 0; $column < $total_column + 1; $column++ ) ! { ! $new_column = $column == $total_column; ! $column_template_id = $new_column ? $page_template_id . '_0' : $column_rows[$column]['column_template_id']; ! $mode = MX_PAGE_TEMPLATE_COLUMN_TYPE; ! $action = $new_column ? MX_DO_INSERT : MX_DO_UPDATE; ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $column_template_id; ! $upmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_template_id . '&page_template_id=' . $page_template_id . '&move=-15'; ! $downmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_template_id . '&page_template_id=' . $page_template_id . '&move=15'; ! // ! // Hidden fields ! // ! $s_hidden_column_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> ! <input type="hidden" name="action" value="' . $action . '" /> ! <input type="hidden" name="page_template_id" value="' . $page_template_id . '" /> ! <input type="hidden" name="id" value="' . $column_template_id . '" /> ! <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! // ! // Subpanel - column edit ! // ! $column_title = $new_column ? '' : $column_rows[$column]['column_title']; ! $column_size = $new_column ? '100%' : $column_rows[$column]['column_size']; ! $message_delete = $lang['Delete_page_template_column'] . ' - ' . $column_title ! . '<br /><br />' . $lang['Delete_page_template_column_explain'] ! . '<br /><br />' . sprintf($lang['Click_page_template_column_delete_yes'], '<a href="' . append_sid("admin_mx_page_cp.$phpEx" . $deletemode) . '">', '</a>') ! . '<br /><br />'; ! $visible_column_edit = in_array('adminTemplateColumnEdit_' . $page_template_id . '_' . $column_template_id, $cookie_states); ! $visible_column_delete = in_array('adminTemplateColumnDelete_' . $page_template_id . '_' . $column_template_id, $cookie_states); ! $template->assign_block_vars('templates.columnrow', array( ! 'VISIBLE' => $visible_column_edit ? 'block' : 'none', ! 'VISIBLE_DELETE' => $visible_column_delete ? 'block' : 'none', ! 'IMG_URL' => $visible_column_edit ? $admin_icon['contract'] : $admin_icon['expand'], ! 'IMG_URL_DELETE' => $visible_column_delete ? $admin_icon['contract'] : $admin_icon['expand'], ! 'COLUMN_ID' => $column_template_id, ! 'COLUMN_TITLE' => $new_column ? $lang['Create_column'] : $column_title, ! 'U_COLUMN_DELETE' => append_sid("admin_mx_page_cp.$phpEx" . $deletemode), ! 'U_COLUMN_MOVE_UP' => append_sid("admin_mx_page_cp.$phpEx" . $upmode), ! 'U_COLUMN_MOVE_DOWN' => append_sid("admin_mx_page_cp.$phpEx" . $downmode), ! // ! // Column Edit ! // ! 'L_DELETE' => $new_column ? '' : $lang['Delete'], ! 'L_MOVE_UP' => $new_column ? '' : $lang['Move_up'], ! 'L_MOVE_DOWN' => $new_column ? '' : $lang['Move_down'], ! 'L_COLUMN' => $lang['Column'], ! 'L_COLUMN_NAME' => $lang['Column_name'], ! 'L_COLUMN_SIZE' => $lang['Column_Size'], ! 'VISIBLE' => $visible_column_edit ? 'block' : 'none', ! 'IMG_URL_EDIT' => $visible_column_edit ? $admin_icon['contract'] : $admin_icon['expand'], ! ! 'E_COLUMN_TITLE' => $column_title, ! 'E_COLUMN_SIZE' => $column_size, ! 'S_SUBMIT' => $new_column ? $lang['Create_column'] : $lang['Update'], ! // Quick Panels ! 'MESSAGE_DELETE' => $message_delete, ! 'S_HIDDEN_FIELDS' => $s_hidden_column_fields ! )); ! } // for ... column } *************** *** 544,548 **** $page_rows_current = array(); ! $page_rows_current = $db->sql_fetchrowset($q_pages_current); // --- 563,570 ---- $page_rows_current = array(); ! if( $total_pages_current = $db->sql_numrows($q_pages_current) ) ! { ! $page_rows_current = $db->sql_fetchrowset($q_pages_current); ! } // *************** *** 566,570 **** } ! if ( $total_pages == 0 ) { $template->assign_block_vars('nopage', array( --- 588,592 ---- } ! if ( ($total_pages_current + $total_pages) == 0 ) { $template->assign_block_vars('nopage', array( *************** *** 574,578 **** $page_rows = array_merge($page_rows_current, $page_rows); ! // --- 596,600 ---- $page_rows = array_merge($page_rows_current, $page_rows); ! $total_pages = $total_pages + $total_pages_current; // *************** *** 590,597 **** $page_id = $new_page ? 'new_page' : $page_rows[$page_count]['page_id']; $is_current_page = $page_id == $nav_page_id; - - $page_rows_select_tmp = !empty($page_rows[$page_count]['page_desc']) ? ' (' . $page_rows[$page_count]['page_desc'] . ')' : ''; - $page_rows_select[$page_id] = $page_rows[$page_count]['page_name'] . $page_rows_select_tmp; if (!$include_all && $page_count > 0) { --- 612,622 ---- $page_id = $new_page ? 'new_page' : $page_rows[$page_count]['page_id']; $is_current_page = $page_id == $nav_page_id; + if ($page_count - -1) + { + $page_rows_select_tmp = !empty($page_rows[$page_count]['page_desc']) ? ' (' . $page_rows[$page_count]['page_desc'] . ')' : ''; + $page_rows_select[$page_id] = $page_rows[$page_count]['page_name'] . $page_rows_select_tmp; + } + if (!$include_all && $page_count > 0) { *************** *** 610,613 **** --- 635,644 ---- <input type="hidden" name="id" value="' . $page_id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; + + $s_hidden_private_fields = '<input type="hidden" name="mode" value="' . MX_PAGE_PRIVATE_TYPE . '" /> + <input type="hidden" name="action" value="' . MX_DO_UPDATE . '" /> + <input type="hidden" name="id" value="' . $page_id . '" /> + <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; + $page_title = !$new_page ? $page_rows[$page_count]['page_name'] : ''; *************** *** 697,700 **** --- 728,732 ---- 'S_HIDDEN_FIELDS' => $s_hidden_page_fields, + 'S_HIDDEN_PRIVATE_FIELDS' => $s_hidden_private_fields, 'S_SUBMIT' => $new_page ? $lang['Add_Page'] : $lang['Update'] *************** *** 749,756 **** } ! if ( $is_current_page || $new_page ) { $template->assign_block_vars('pages.is_current', array()); } else { --- 781,792 ---- } ! if ( $is_current_page ) { $template->assign_block_vars('pages.is_current', array()); } + else if ( $new_page ) + { + $template->assign_block_vars('pages.is_new', array()); + } else { *************** *** 811,823 **** // Get blocklist for alternative add_block $blocklist = get_list_formatted('block_list', 0, 'block_id'); ! $mx_page = new mx_page(); ! $mx_page->init( $page_id ); $mx_block = new mx_block(); $radio_column_list = ''; ! if ( $mx_page->total_column > 0) { $template->assign_block_vars('pages.has_columns', array()); --- 847,879 ---- // Get blocklist for alternative add_block $blocklist = get_list_formatted('block_list', 0, 'block_id'); + + $sql = "SELECT * + FROM " . COLUMN_TABLE . " + WHERE page_id = $page_id + ORDER BY page_id, column_order"; ! if( !($q_columns = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not query page columns information", "", __LINE__, __FILE__, $sql); ! } ! ! $column_rows = array(); ! if( $total_column = $db->sql_numrows($q_columns) ) ! { ! $column_rows = $db->sql_fetchrowset($q_columns); ! } + if ( $total_column == 0 ) + { + $template->assign_block_vars('nocolumns', array( + 'NONE' => $lang['No_columns'] + )); + } + $mx_block = new mx_block(); $radio_column_list = ''; ! if ( $total_column > 0 ) { $template->assign_block_vars('pages.has_columns', array()); *************** *** 827,841 **** // Okay, let's build the index // ! for( $column = 0; $column < $mx_page->total_column + 1; $column++ ) { ! $new_column = $column == $mx_page->total_column; ! $column_id = $new_column ? $page_id . '_0' : $mx_page->columns[$column]['column_id']; $mode = MX_PAGE_COLUMN_TYPE; $action = $new_column ? MX_DO_INSERT : MX_DO_UPDATE; ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $column_id; ! $upmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_id . '&move=-15'; ! $downmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_id . '&move=15'; // --- 883,897 ---- // Okay, let's build the index // ! for( $column = 0; $column < $total_column + 1; $column++ ) { ! $new_column = $column == $total_column; ! $column_id = $new_column ? $page_id . '_0' : $column_rows[$column]['column_id']; $mode = MX_PAGE_COLUMN_TYPE; $action = $new_column ? MX_DO_INSERT : MX_DO_UPDATE; ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $column_id . '&page_id=' . $page_id; ! $upmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_id . '&page_id=' . $page_id . '&move=-15'; ! $downmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $column_id . '&page_id=' . $page_id . '&move=15'; // *************** *** 845,848 **** --- 901,905 ---- <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $column_id . '" /> + <input type="hidden" name="page_id" value="' . $page_id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; *************** *** 856,861 **** // ! $column_title = $new_column ? '' : $mx_page->columns[$column]['column_title']; ! $column_size = $new_column ? '100%' : $mx_page->columns[$column]['column_size']; $visible_column_edit = in_array('adminColumnEdit_' . $page_id . '_' . $column_id, $cookie_states); --- 913,918 ---- // ! $column_title = $new_column ? '' : $column_rows[$column]['column_title']; ! $column_size = $new_column ? '100%' : $column_rows[$column]['column_size']; $visible_column_edit = in_array('adminColumnEdit_' . $page_id . '_' . $column_id, $cookie_states); *************** *** 904,921 **** if (!$new_column) { ! $radio_column_list .= '<input type="radio" name="column_id" value="'.$column_id.'" '.$radio_column_checked.' /><span class="gensmall">'.$column_title.' </span><br />'; } ! // // Now continue with page blocks // ! for( $block = 0; $block < $mx_page->total_block; $block++ ) { ! if( $mx_page->columns[$column]['column_id'] == $mx_page->blocks[$block]['column_id'] ) ! { ! $block_id = $mx_page->blocks[$block]['block_id']; $mx_block->init( $block_id ); ! $block_order = $mx_page->blocks[$block]['block_order']; $editor_name_tmp = get_userdata($mx_block->editor_id); $editor_name = $editor_name_tmp['username']; --- 961,995 ---- if (!$new_column) { ! $radio_column_list .= '<input type="radio" name="id" value="'.$column_id.'" '.$radio_column_checked.' /><span class="gensmall">'.$column_title.' </span><br />'; } ! ! $sql = "SELECT cbl.*, blk.*, function_admin ! FROM " . COLUMN_BLOCK_TABLE . " cbl, ! " . BLOCK_TABLE . " blk, ! " . FUNCTION_TABLE . " fnc ! WHERE blk.function_id = fnc.function_id ! AND blk.block_id = cbl.block_id ! AND cbl.column_id = '" . $column_rows[$column]['column_id'] . "' ! ORDER BY column_id, block_order"; ! ! if( !($q_blocks = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not query blocks information", "", __LINE__, __FILE__, $sql); ! } ! ! if( $total_blocks = $db->sql_numrows($q_blocks) ) ! { ! $block_rows = $db->sql_fetchrowset($q_blocks); ! } ! // // Now continue with page blocks // ! for( $block = 0; $block < $total_blocks; $block++ ) { ! $block_id = $block_rows[$block]['block_id']; $mx_block->init( $block_id ); ! $block_order = $block_rows[$block]['block_order']; $editor_name_tmp = get_userdata($mx_block->editor_id); $editor_name = $editor_name_tmp['username']; *************** *** 923,930 **** $mode = MX_PAGE_BLOCK_TYPE; ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&block_id=' . $block_id . '&column_id=' . $column_id . '&block_order=' . $block_order; ! $upmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&block_id=' . $block_id . '&column_id=' . $column_id . '&block_order=' . $block_order . '&move=-15'; ! $downmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&block_id=' . $block_id . '&column_id=' . $column_id . '&block_order=' . $block_order . '&move=15'; ! $syncmode = '?mode=' . $mode . '&action=' . MX_DO_SYNC . '&block_id=' . $block_id . '&column_id=' . $column_id; if( !empty($mx_block->block_edit_file) ) --- 997,1005 ---- $mode = MX_PAGE_BLOCK_TYPE; ! $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $block_id . '&column_id=' . $column_id . '&block_order=' . $block_order; ! ! $upmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $block_id . '&column_id=' . $column_id . '&page_id=' . $page_id . '&block_order=' . $block_order . '&move=-15'; ! $downmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $block_id . '&column_id=' . $column_id . '&page_id=' . $page_id . '&block_order=' . $block_order . '&move=15'; ! $syncmode = '?mode=' . $mode . '&action=' . MX_DO_SYNC . '&id=' . $block_id . '&column_id=' . $column_id; if( !empty($mx_block->block_edit_file) ) *************** *** 942,952 **** // admin_mx_block.php will populate them if necessary (see B4). // ! //$param_rows = get_exists(PARAMETER_TABLE, 'function_id', $mx_block->block_config[$block_id]['function_id']); ! //if( $param_rows['number'] > 0 ) ! if ( count( $mx_block->block_config[$block_id] ) > 17) ! { ! $l_setting = $lang['Block_cp']; ! $u_setting = append_sid("admin_mx_block_cp.$phpEx?block_id=$block_id"); ! } } --- 1017,1022 ---- // admin_mx_block.php will populate them if necessary (see B4). // ! $l_setting = $lang['Block_cp']; ! $u_setting = append_sid("admin_mx_block_cp.$phpEx?block_id=$block_id"); } *************** *** 970,974 **** 'U_BLOCK_RESYNC' => append_sid("admin_mx_page_cp.$phpEx" . $syncmode) )); - } // if ... column_id == column_id } // for ... blocks --- 1040,1043 ---- *************** *** 984,987 **** --- 1053,1057 ---- <input type="hidden" name="action" value="' . $action . '" /> <input type="hidden" name="id" value="' . $column_id . '" /> + <input type="hidden" name="page_id" value="' . $page_id . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; *************** *** 1006,1012 **** $page_select_box = get_list_static('page_id', $page_rows_select, $nav_page_id, false); $template->assign_vars(array( 'PAGE_SELECT_BOX' => $page_select_box, ! 'RADIO_COLUMN_LIST' => $radio_column_list )); --- 1076,1093 ---- $page_select_box = get_list_static('page_id', $page_rows_select, $nav_page_id, false); + $mode = MX_PAGE_BLOCK_TYPE; + $action = MX_DO_INSERT; + + // + // Hidden fields + // + $s_hidden_dyn_fields = '<input type="hidden" name="mode" value="' . $mode . '" /> + <input type="hidden" name="action" value="' . $action . '" /> + <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; + $template->assign_vars(array( 'PAGE_SELECT_BOX' => $page_select_box, ! 'RADIO_COLUMN_LIST' => $radio_column_list, ! 'S_HIDDEN_DYN_FIELDS' => $s_hidden_dyn_fields )); Index: admin_mx_module.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** admin_mx_module.php 20 Aug 2005 18:19:11 -0000 1.31 --- admin_mx_module.php 6 Sep 2005 18:51:56 -0000 1.32 *************** *** 64,79 **** $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']) ) - { - $mode = 'export_pack'; - } - if( isset($HTTP_POST_VARS['import_pack']) || isset($HTTP_GET_VARS['import_pack']) ) - { - $mode = 'import_pack'; - } [...1455 lines suppressed...] - $output_message .= '<br /><b><font color=#0000ff>[db...error]</font></b> line: ' . __LINE__ . ' , ' . $sql . '<br />'; - $pak_error = true; - return $output_message; - } - else - { - $output_message .= '<font color=#00ff00>[db...ok]</font>'; - } - - $output_message .= ' ' . $parameter_row[1] . '-' . $resultset_param[$p]['parameter_id'] . ','; - } - - $output_message .= '<br /> ... ok<br />'; - - return $output_message; - } - ?> \ No newline at end of file --- 374,376 ---- Index: admin_mx_module_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_module_cp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_mx_module_cp.php 21 Aug 2005 21:40:51 -0000 1.2 --- admin_mx_module_cp.php 6 Sep 2005 18:51:56 -0000 1.3 *************** *** 76,79 **** --- 76,80 ---- // $result_message = $mx_admin->do_it($mode, $action, $id); + $result_message = $lang['AdminCP_status'] . '<hr>' . $result_message; } // if .. !empty($mode) *************** *** 164,169 **** '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>': '', // --- 165,170 ---- 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, ! 'SID' => $userdata['session_id'], ! 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">' . $result_message . '<br/> -::-</span></div>': '', // *************** *** 380,394 **** $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); } } --- 381,395 ---- $type_row = array(); ! if ( file_exists( $mx_root_path . $module_rows[$module_count]['module_path'] . 'admin/mx_module_defs.php' ) ) { ! include_once( $mx_root_path . $module_rows[$module_count]['module_path'] . 'admin/mx_module_defs.php' ); ! if (class_exists('mx_module_defs')) { ! $mx_module_defs = new mx_module_defs(); ! if ( method_exists( $mx_module_defs, 'get_parameters' ) ) { ! $type_row = $mx_module_defs->get_parameters($type_row); } } *************** *** 408,411 **** --- 409,414 ---- $type_row['Function'] = !empty($lang['ParType_Function']) ? $lang['ParType_Function'] : "Function"; + + $type_row['Separator'] = !empty($lang['ParType_Separator']) ? $lang['ParType_Separator'] : "-Separator-"; //$type_row['Values'] = !empty($lang['ParType_Values']) ? $lang['ParType_Values'] : "Values"; *************** *** 596,600 **** FROM " . PARAMETER_TABLE . " par WHERE par.function_id = $function_id ! ORDER BY par.parameter_id"; if( !($result = $db->sql_query($sql)) ) --- 599,603 ---- FROM " . PARAMETER_TABLE . " par WHERE par.function_id = $function_id ! ORDER BY par.parameter_order"; if( !($result = $db->sql_query($sql)) ) *************** *** 626,629 **** --- 629,635 ---- $deletemode = '?mode=' . $mode . '&action=' . MX_DO_DELETE . '&id=' . $parameter_id; + $upmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $parameter_id . '&function_id=' . $function_id . '&block_order=' . $block_order . '&move=-15'; + $downmode = '?mode=' . $mode . '&action=' . MX_DO_MOVE . '&id=' . $parameter_id . '&function_id=' . $function_id . '&block_order=' . $block_order . '&move=15'; + // // Hidden fields *************** *** 634,642 **** <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']; --- 640,646 ---- <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $parameter_title = !$new_parameter ? $parameter_rows[$parameter_count]['parameter_name'] : ''; ! $parameter_type_key = $parameter_rows[$parameter_count]['parameter_type']; ! $parameter_type = !$new_parameter ? get_list_static('parameter_type', $type_row, $parameter_type_key) : get_list_static('parameter_type', $type_row, 'BBText'); $parameter_function = $parameter_rows[$parameter_count]['parameter_function']; *************** *** 651,656 **** // 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']; // --- 655,660 ---- // Replace htmlentites for < and > with actual character. ! //$row_color = ( !( $i % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !( $parameter_count % 2 ) ) ? 'row1' : 'row1'; // *************** *** 668,673 **** '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'], --- 672,677 ---- 'IMG_URL_DELETE' => $visible_delete ? $module_nav_icon_url . 'contract.gif' : $module_nav_icon_url . 'expand.gif', ! //"ROW_COLOR" => '#' . $row_color, ! "ROW_CLASS" => $parameter_type_key == 'Separator' ? 'row3' : $row_class, 'L_EDIT' => $new_parameter ? '' : $lang['Edit'], *************** *** 677,682 **** --- 681,689 ---- "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, + "PARAMETER_TYPE" => $new_parameter ? '' : (!empty($lang['ParType_'.$parameter_type_key]) ? $lang['ParType_'.$parameter_type_key] : $parameter_type_key), "U_DELETE" => append_sid("admin_mx_module_cp.php" . $deletemode), + "U_MOVE_UP" => append_sid("admin_mx_module_cp.php" . $upmode), + "U_MOVE_DOWN" => append_sid("admin_mx_module_cp.php" . $downmode), // Index: admin_mx_portal.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_portal.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** admin_mx_portal.php 20 Aug 2005 18:19:11 -0000 1.16 --- admin_mx_portal.php 6 Sep 2005 18:51:56 -0000 1.17 *************** *** 64,70 **** } - // Update cache - update_session_cache($block_id); - $message = $lang['Portal_Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_portal_config'], "<a href=\"" . append_sid("admin_mx_portal.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); --- 64,67 ---- Index: admin_mx_block_cp.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_block_cp.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin_mx_block_cp.php 20 Aug 2005 18:19:11 -0000 1.1 --- admin_mx_block_cp.php 6 Sep 2005 18:51:56 -0000 1.2 *************** *** 75,90 **** setcookie($board_config['cookie_name'] . '_adminBlockCP_block_id', $block_id, time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); // ! // Load states // ! //$cookie_tmp = $board_config['cookie_name'].'_blockcp_blockstates'; ! //$cookie_states = !empty($HTTP_COOKIE_VARS[$cookie_tmp]) ? explode(",", $HTTP_COOKIE_VARS[$cookie_tmp]) : array(); ! $mx_blockcp->init($block_id, true); // // SUBMIT? // ! if( !empty($mode) && !empty($action) ) { // --- 75,98 ---- setcookie($board_config['cookie_name'] . '_adminBlockCP_block_id', $block_id, time() + 10000000, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); + $mx_blockcp->init($block_id, true); + // ! // Define blockcp mode: 'mx_blockcp' or 'admin_mx_block_cp' // ! $mx_blockcp->blockcp_mode = 'admin_mx_block_cp'; ! // ! // Parameters ! // ! $submit = ( isset($HTTP_POST_VARS['submit']) ) ? true : false; ! $submit_pars = ( isset($HTTP_POST_VARS['submit_pars']) ) ? true : false; ! $cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? true : false; ! $preview = ( isset($HTTP_POST_VARS['preview']) ) ? true : false; ! $refresh = $preview || $submit_search; // // SUBMIT? // ! if( ($submit || $submit_pars) && !empty($mode) && !empty($action) ) { // *************** *** 92,101 **** // //$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_blockcp->submit_parameters($block_id); // --- 100,122 ---- // //$portalpage = $mx_request_vars->request('portalpage', MX_TYPE_INT, 1); ! $block_id = $mx_request_vars->request('id', MX_TYPE_INT, ''); ! ! if( $submit ) ! { ! // ! // Send to adminCP ! // ! $result_message = $mx_admin->do_it($mode, $action, $block_id); ! } ! ! if( $submit_pars ) ! { ! // ! // Send to BlockCP ! // ! $result_message = $mx_blockcp->submit_parameters($block_id); ! } ! $result_message = $lang['AdminCP_status'] . '<hr>' . $result_message; // *************** *** 151,162 **** // - // Parameters - // - $submit = ( isset($HTTP_POST_VARS['post']) ) ? true : false; - $cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? true : false; - $preview = ( isset($HTTP_POST_VARS['preview']) ) ? true : false; - $refresh = $preview || $submit_search; - - // // Cancel // --- 172,175 ---- *************** *** 181,186 **** // $blockcptemplate->assign_vars(array( ! 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">-::-<br/>' . $result_message . '<br/> -::-</span></div>': '', ! 'S_ACTION_SUBMIT' => append_sid("admin_mx_block_cp.$phpEx") )); --- 194,199 ---- // $blockcptemplate->assign_vars(array( ! 'RESULT_MESSAGE' => !empty($result_message) ? '<div style="overflow:auto; height:50px;"><span class="gensmall">' . $result_message . '<br/> -::-</span></div>': '', ! 'S_ACTION_SUBMIT' => append_sid("admin_mx_block_cp.$phpEx") )); |