Update of /cvsroot/mxbb/core/includes In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv11504 Modified Files: mx_functions.php mx_functions_admincp.php mx_functions_blockcp.php mx_functions_core.php mx_functions_style.php page_header.php Log Message: fixing some missing varables and indexes in AdminCP Class Index: mx_functions_blockcp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_blockcp.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** mx_functions_blockcp.php 29 Jul 2009 06:31:38 -0000 1.30 --- mx_functions_blockcp.php 25 Jun 2013 17:14:48 -0000 1.31 *************** *** 60,64 **** * @return unknown */ ! function _controlpanel( $id, $new_block = false ) { global $blockcptemplate, $lang, $db, $board_config, $theme, $phpEx, $mx_root_path, $s_hidden_fields, $userdata, $cookie_states, $module_nav_icon_url, $portalpage, $mx_request_vars, $images, $mx_backend; --- 60,64 ---- * @return unknown */ ! function _controlpanel($id, $new_block = false) { global $blockcptemplate, $lang, $db, $board_config, $theme, $phpEx, $mx_root_path, $s_hidden_fields, $userdata, $cookie_states, $module_nav_icon_url, $portalpage, $mx_request_vars, $images, $mx_backend; *************** *** 73,103 **** die('Invalid block panel call - no id'); } ! ! // // Main parameters - // $block_keys = array( 'block_title' => 'block_title', 'block_desc' => 'block_desc', 'show_block' => 'show_block', 'show_title' => 'show_title', 'show_stats' => 'show_stats'); ! ! // // General - // $mode_general = MX_BLOCK_TYPE; $mode_permissions = MX_BLOCK_PRIVATE_TYPE; $mode_settings = MX_BLOCK_SETTINGS_TYPE; ! $block_id = $id; $module_id = $mx_request_vars->is_request('module_id') ? $mx_request_vars->request('module_id', MX_TYPE_INT, 0) : mx_parent_data($block_id, 'module_id'); $function_id = $mx_request_vars->is_request('function_id') ? $mx_request_vars->request('function_id', MX_TYPE_INT, 0) : mx_parent_data($block_id, 'function_id'); ! ! // // Define auth constants - // $block_auth_fields = array('auth_view', 'auth_edit'); // , 'auth_delete' ! $block_auth_ary = array( 'auth_view' => AUTH_ALL, 'auth_edit' => AUTH_ADMIN, ); ! $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); --- 73,97 ---- die('Invalid block panel call - no id'); } ! // Main parameters $block_keys = array( 'block_title' => 'block_title', 'block_desc' => 'block_desc', 'show_block' => 'show_block', 'show_title' => 'show_title', 'show_stats' => 'show_stats'); ! // General $mode_general = MX_BLOCK_TYPE; $mode_permissions = MX_BLOCK_PRIVATE_TYPE; $mode_settings = MX_BLOCK_SETTINGS_TYPE; ! $block_id = $id; $module_id = $mx_request_vars->is_request('module_id') ? $mx_request_vars->request('module_id', MX_TYPE_INT, 0) : mx_parent_data($block_id, 'module_id'); $function_id = $mx_request_vars->is_request('function_id') ? $mx_request_vars->request('function_id', MX_TYPE_INT, 0) : mx_parent_data($block_id, 'function_id'); ! // Define auth constants $block_auth_fields = array('auth_view', 'auth_edit'); // , 'auth_delete' ! $block_auth_ary = array( 'auth_view' => AUTH_ALL, 'auth_edit' => AUTH_ADMIN, ); ! $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); *************** *** 106,116 **** 'auth_edit' => $lang['Edit'], ); ! ! // // Update block - // $action = MX_DO_UPDATE; $buttonvalue = $lang['Update']; ! $block_title = $mx_request_vars->post($block_keys['block_title'], MX_TYPE_NO_TAGS, $this->$block_keys['block_title']); $block_desc = $mx_request_vars->post($block_keys['block_desc'], MX_TYPE_NO_TAGS, $this->$block_keys['block_desc']); --- 100,108 ---- 'auth_edit' => $lang['Edit'], ); ! // Update block $action = MX_DO_UPDATE; $buttonvalue = $lang['Update']; ! $block_title = $mx_request_vars->post($block_keys['block_title'], MX_TYPE_NO_TAGS, $this->$block_keys['block_title']); $block_desc = $mx_request_vars->post($block_keys['block_desc'], MX_TYPE_NO_TAGS, $this->$block_keys['block_desc']); *************** *** 118,125 **** $show_title = $mx_request_vars->post($block_keys['show_title'],MX_TYPE_INT, $this->$block_keys['show_title']); $show_stats = $mx_request_vars->post($block_keys['show_stats'], MX_TYPE_INT, $this->$block_keys['show_stats']); ! ! // // Add block - // $action_add = MX_DO_INSERT; $buttonvalue_add = $lang['Create_block']; --- 110,115 ---- $show_title = $mx_request_vars->post($block_keys['show_title'],MX_TYPE_INT, $this->$block_keys['show_title']); $show_stats = $mx_request_vars->post($block_keys['show_stats'], MX_TYPE_INT, $this->$block_keys['show_stats']); ! // Add block $action_add = MX_DO_INSERT; $buttonvalue_add = $lang['Create_block']; *************** *** 133,146 **** $show_stats_yes_add = ''; $show_stats_no_add = 'checked="checked"'; ! ! // // Now get started - // $functionlist = get_list_formatted('function_list', $function_id, '', '', true); /* ! // Populate missing parameters (if any) ! // $sql = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . " (block_id, parameter_id, parameter_value) SELECT " . $block_id . ", parameter_id, parameter_default --- 123,134 ---- $show_stats_yes_add = ''; $show_stats_no_add = 'checked="checked"'; ! // Now get started $functionlist = get_list_formatted('function_list', $function_id, '', '', true); /* ! * Populate missing parameters (if any) ! * $sql = "INSERT INTO " . BLOCK_SYSTEM_PARAMETER_TABLE . " (block_id, parameter_id, parameter_value) SELECT " . $block_id . ", parameter_id, parameter_default *************** *** 152,163 **** } */ ! ! // // Hidden fields ! // ! $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $mode . '" /> <input type="hidden" name="action" value="' . $action . '" />'; ! ! $show_title_yes = ( $show_title == 1 ) ? 'checked="checked"' : ''; $show_title_no = ( $show_title == 0 ) ? 'checked="checked"' : ''; --- 140,148 ---- } */ ! // Hidden fields ! $s_hidden_fields .= '<input type="hidden" name="mode" value="' . $this->blockcp_mode . '" /> <input type="hidden" name="action" value="' . $action . '" />'; ! $show_title_yes = ( $show_title == 1 ) ? 'checked="checked"' : ''; $show_title_no = ( $show_title == 0 ) ? 'checked="checked"' : ''; *************** *** 168,177 **** $show_stats_yes = ( $show_stats == 1 ) ? 'checked="checked"' : ''; $show_stats_no = ( $show_stats == 0 ) ? 'checked="checked"' : ''; ! ! // // Define some graphics - // $module_nav_icon_url = PORTAL_URL . $images['mx_graphics']['admin_icons'] . '/'; ! $admin_icon['contract'] = $module_nav_icon_url . 'contract.gif'; $admin_icon['expand'] = $module_nav_icon_url . 'expand.gif'; --- 153,160 ---- $show_stats_yes = ( $show_stats == 1 ) ? 'checked="checked"' : ''; $show_stats_no = ( $show_stats == 0 ) ? 'checked="checked"' : ''; ! // Define some graphics $module_nav_icon_url = PORTAL_URL . $images['mx_graphics']['admin_icons'] . '/'; ! $admin_icon['contract'] = $module_nav_icon_url . 'contract.gif'; $admin_icon['expand'] = $module_nav_icon_url . 'expand.gif'; *************** *** 182,195 **** $admin_icon['block'] = $module_nav_icon_url . 'icon_block.gif'; $admin_icon['edit_block'] = $module_nav_icon_url . 'icon_edit.gif'; - // // JS - // $cookie_tmp = $board_config['cookie_name'].'_adminBlockCP_mode'; $cookie_blockCP = !empty($_COOKIE[$cookie_tmp]) ? $_COOKIE[$cookie_tmp] : 'settings'; - // // Send General Vars to template - // $visible_general_add = $cookie_blockCP == 'general_add'; $visible_general = $cookie_blockCP == 'general'; --- 165,175 ---- $admin_icon['block'] = $module_nav_icon_url . 'icon_block.gif'; $admin_icon['edit_block'] = $module_nav_icon_url . 'icon_edit.gif'; + $admin_icon['page'] = $module_nav_icon_url . 'icon_block.gif'; // JS $cookie_tmp = $board_config['cookie_name'].'_adminBlockCP_mode'; $cookie_blockCP = !empty($_COOKIE[$cookie_tmp]) ? $_COOKIE[$cookie_tmp] : 'settings'; // Send General Vars to template $visible_general_add = $cookie_blockCP == 'general_add'; $visible_general = $cookie_blockCP == 'general'; *************** *** 197,201 **** $visible_private = $cookie_blockCP == 'private'; $visible_delete = $cookie_blockCP == 'delete'; ! $blockcptemplate->assign_vars(array( 'VISIBLE_GENERAL_ADD' => $visible_general_add ? 'block' : 'none', --- 177,181 ---- $visible_private = $cookie_blockCP == 'private'; $visible_delete = $cookie_blockCP == 'delete'; ! $blockcptemplate->assign_vars(array( 'VISIBLE_GENERAL_ADD' => $visible_general_add ? 'block' : 'none', *************** *** 209,221 **** 'IMG_URL_PRIVATE' => $visible_private ? $admin_icon['contract'] : $admin_icon['expand'], 'IMG_URL_DELETE' => $visible_delete ? $admin_icon['contract'] : $admin_icon['expand'], ! 'L_TITLE' => $lang['Block_admin'], 'L_EXPLAIN' => $lang['Block_admin_explain'], ! 'SID' => $userdata['session_id'], ! ! // // General - // "L_ACTION" => $lang['Action'], "L_DELETE" => $lang['Delete'], --- 189,199 ---- 'IMG_URL_PRIVATE' => $visible_private ? $admin_icon['contract'] : $admin_icon['expand'], 'IMG_URL_DELETE' => $visible_delete ? $admin_icon['contract'] : $admin_icon['expand'], ! 'L_TITLE' => $lang['Block_admin'], 'L_EXPLAIN' => $lang['Block_admin_explain'], ! 'SID' => $userdata['session_id'], ! // General "L_ACTION" => $lang['Action'], "L_DELETE" => $lang['Delete'], *************** *** 227,239 **** 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], ! ! 'L_SETTING' => $l_setting, 'L_DELETE' => $lang['Delete'], 'L_EDIT' => $lang['Edit'], ! 'L_AUTH_TITLE' => $lang['Auth_Block'], 'L_AUTH_TITLE_EXPLAIN' => $lang['Auth_Block_explain'], 'L_FUNCTION' => $lang['Function'], ! 'L_BLOCK_TITLE' => $lang['Block_title'], 'L_BLOCK_DESC' => $lang['Block_desc'], --- 205,217 ---- 'L_YES' => $lang['Yes'], 'L_NO' => $lang['No'], ! ! 'L_SETTING' => isset($l_setting) ? $l_setting : $lang['Block_cp'], 'L_DELETE' => $lang['Delete'], 'L_EDIT' => $lang['Edit'], ! 'L_AUTH_TITLE' => $lang['Auth_Block'], 'L_AUTH_TITLE_EXPLAIN' => $lang['Auth_Block_explain'], 'L_FUNCTION' => $lang['Function'], ! 'L_BLOCK_TITLE' => $lang['Block_title'], 'L_BLOCK_DESC' => $lang['Block_desc'], *************** *** 244,317 **** 'L_SHOW_STATS' => $lang['Show_stats'], 'L_SHOW_STATS_EXPLAIN' => $lang['Show_stats_explain'], ! 'BLOCK_ID' => $block_id, 'BLOCK_TITLE' => ' ' . $block_title, 'BLOCK_DESC' => ( $block_desc != '' ) ? ' - ' . $block_desc : '', ! 'U_BLOCK_SETTINGS' => mx_append_sid(PORTAL_URL . "admin/admin_mx_blockcp.$phpEx?block_id=$block_id"), 'U_BLOCK_DELETE' => mx_append_sid(PORTAL_URL . "admin/admin_mx_block.$phpEx?mode=delete_block&block_id=$block_id"), 'U_BLOCK_PERMISSIONS' => mx_append_sid(PORTAL_URL . "admin/admin_mx_block_auth.$phpEx?cat_id=$block_id"), ! 'E_BLOCK_TITLE' => $block_title, 'E_BLOCK_DESC' => $block_desc, ! 'S_FUNCTION_LIST' => $functionlist, ! ! // // Update - // '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, ! ! // // Add - // 'S_SHOW_BLOCK_YES_ADD' => $show_block_yes_add, 'S_SHOW_BLOCK_NO_ADD' => $show_block_no_add, ! 'S_SHOW_TITLE_YES_ADD' => $show_title_yes_add, 'S_SHOW_TITLE_NO_ADD' => $show_title_no_add, ! 'S_SHOW_STATS_YES_ADD' => $show_stats_yes_add, 'S_SHOW_STATS_NO_ADD' => $show_stats_no_add, ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_SUBMIT_UPDATE' => $buttonvalue, 'S_SUBMIT' => $lang['Update'], ! '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_PAGE' => $admin_icon['page'], ! 'IMG_ICON_PAGE_COLUMN' => $admin_icon['page_column'], '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'], - )); ! ! // // Hidden fields - // $s_hidden_general_fields = '<input type="hidden" name="mode" value="' . $mode_general . '" /> <input type="hidden" name="action" value="' . $action . '" /> --- 222,285 ---- 'L_SHOW_STATS' => $lang['Show_stats'], 'L_SHOW_STATS_EXPLAIN' => $lang['Show_stats_explain'], ! 'BLOCK_ID' => $block_id, 'BLOCK_TITLE' => ' ' . $block_title, 'BLOCK_DESC' => ( $block_desc != '' ) ? ' - ' . $block_desc : '', ! 'U_BLOCK_SETTINGS' => mx_append_sid(PORTAL_URL . "admin/admin_mx_blockcp.$phpEx?block_id=$block_id"), 'U_BLOCK_DELETE' => mx_append_sid(PORTAL_URL . "admin/admin_mx_block.$phpEx?mode=delete_block&block_id=$block_id"), 'U_BLOCK_PERMISSIONS' => mx_append_sid(PORTAL_URL . "admin/admin_mx_block_auth.$phpEx?cat_id=$block_id"), ! 'E_BLOCK_TITLE' => $block_title, 'E_BLOCK_DESC' => $block_desc, ! 'S_FUNCTION_LIST' => $functionlist, ! // Update '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, ! // Add 'S_SHOW_BLOCK_YES_ADD' => $show_block_yes_add, 'S_SHOW_BLOCK_NO_ADD' => $show_block_no_add, ! 'S_SHOW_TITLE_YES_ADD' => $show_title_yes_add, 'S_SHOW_TITLE_NO_ADD' => $show_title_no_add, ! 'S_SHOW_STATS_YES_ADD' => $show_stats_yes_add, 'S_SHOW_STATS_NO_ADD' => $show_stats_no_add, ! 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_SUBMIT_UPDATE' => $buttonvalue, 'S_SUBMIT' => $lang['Update'], ! '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_PAGE' => $admin_icon['page'], ! 'IMG_ICON_PAGE_COLUMN' => isset($admin_icon['page_column']) ? $admin_icon['page_column'] : 0, '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'], )); ! // Hidden fields $s_hidden_general_fields = '<input type="hidden" name="mode" value="' . $mode_general . '" /> <input type="hidden" name="action" value="' . $action . '" /> *************** *** 322,326 **** <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! $s_hidden_general_add_fields = '<input type="hidden" name="mode" value="' . $mode_general . '" /> <input type="hidden" name="action" value="' . MX_DO_INSERT . '" /> --- 290,294 ---- <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! $s_hidden_general_add_fields = '<input type="hidden" name="mode" value="' . $mode_general . '" /> <input type="hidden" name="action" value="' . MX_DO_INSERT . '" /> *************** *** 331,335 **** <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! $s_hidden_permissions_fields = '<input type="hidden" name="mode" value="' . $mode_permissions . '" /> <input type="hidden" name="action" value="' . $action . '" /> --- 299,303 ---- <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! $s_hidden_permissions_fields = '<input type="hidden" name="mode" value="' . $mode_permissions . '" /> <input type="hidden" name="action" value="' . $action . '" /> *************** *** 346,366 **** <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! ! // // Get blockcp mode -> to set action file - // $s_action_file = $this->blockcp_mode == 'mx_blockcp' ? $mx_root_path . 'modules/mx_coreblocks/mx_blockcp.' . $phpEx : $mx_root_path . 'admin/admin_mx_block_cp.' . $phpEx; ! $deletemode = '?mode=' . $mode_general . '&action=' . MX_DO_DELETE . '&id=' . $block_id . '&module_id=' . $module_id . '&function_id=' . $function_id . '&portalpage=' . $portalpage. '&sid=' . $userdata['session_id']; ! $message_delete = $lang['Delete_block'] . ' - ' . $block_title . '<br /><br />' . $lang['Delete_block_explain'] . '<br /><br />' . sprintf($lang['Click_block_delete_yes'], '<a href="' . mx_append_sid($s_action_file . $deletemode) . '">', '</a>') . '<br /><br />'; ! ! ! // // Activate BlockCP SubPanels, based on auth - // if (($this->auth_mod || $is_admin) && !$new_block) { --- 314,329 ---- <input type="hidden" name="portalpage" value="' . $portalpage . '" /> <input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; ! // Get blockcp mode -> to set action file $s_action_file = $this->blockcp_mode == 'mx_blockcp' ? $mx_root_path . 'modules/mx_coreblocks/mx_blockcp.' . $phpEx : $mx_root_path . 'admin/admin_mx_block_cp.' . $phpEx; ! $deletemode = '?mode=' . $mode_general . '&action=' . MX_DO_DELETE . '&id=' . $block_id . '&module_id=' . $module_id . '&function_id=' . $function_id . '&portalpage=' . $portalpage. '&sid=' . $userdata['session_id']; ! $message_delete = $lang['Delete_block'] . ' - ' . $block_title . '<br /><br />' . $lang['Delete_block_explain'] . '<br /><br />' . sprintf($lang['Click_block_delete_yes'], '<a href="' . mx_append_sid($s_action_file . $deletemode) . '">', '</a>') . '<br /><br />'; ! // Activate BlockCP SubPanels, based on auth if (($this->auth_mod || $is_admin) && !$new_block) { *************** *** 370,380 **** 'S_SUBMIT' => $buttonvalue )); ! ! // // Some general blockcp settings are moderator only - // $blockcptemplate->assign_block_vars('blockcp_general.is_mod', array()); } ! if ( ($is_admin ) || $new_block) { --- 333,341 ---- 'S_SUBMIT' => $buttonvalue )); ! // Some general blockcp settings are moderator only $blockcptemplate->assign_block_vars('blockcp_general.is_mod', array()); } ! if ( ($is_admin ) || $new_block) { *************** *** 384,391 **** 'S_SUBMIT' => $buttonvalue_add )); ! ! // // Output values of individual auth fields - add - // for( $j = 0; $j < count($block_auth_fields); $j++ ) { --- 345,350 ---- 'S_SUBMIT' => $buttonvalue_add )); ! // Output values of individual auth fields - add for( $j = 0; $j < count($block_auth_fields); $j++ ) { *************** *** 428,444 **** 'S_SUBMIT' => $buttonvalue )); ! ! // // Some general blockcp settings are moderator only - // $blockcptemplate->assign_block_vars('blockcp_general.is_auth', array()); ! // ! // Now query all permissions data (not needed if not authorized ;) ! // - // // Output values of individual auth fields - edit - // for( $j = 0; $j < count($block_auth_fields); $j++ ) { --- 387,399 ---- 'S_SUBMIT' => $buttonvalue )); ! // Some general blockcp settings are moderator only $blockcptemplate->assign_block_vars('blockcp_general.is_auth', array()); ! /* ! * Now query all permissions data (not needed if not authorized ;) ! */ // Output values of individual auth fields - edit for( $j = 0; $j < count($block_auth_fields); $j++ ) { *************** *** 463,489 **** )); } ! ! ! // ! // PRIVATE auth ! // ! ! // // Get the list of phpBB usergroups - // $sql = $mx_backend->generate_group_select_sql(); - 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; ! } ! $db->sql_freeresult($result); ! $view_groups = @explode(',', $this->block_info['auth_view_group']); $edit_groups = @explode(',', $this->block_info['auth_edit_group']); --- 418,439 ---- )); } ! ! /* ! * PRIVATE auth ! */ ! // Get the list of phpBB usergroups $sql = $mx_backend->generate_group_select_sql(); 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; ! } $db->sql_freeresult($result); ! $view_groups = @explode(',', $this->block_info['auth_view_group']); $edit_groups = @explode(',', $this->block_info['auth_edit_group']); *************** *** 542,549 **** )); } ! ! // // Load and display additional blockcp parameters or panels (if any) - // if (!empty($this->block_parameters)) { --- 492,497 ---- )); } ! // Load and display additional blockcp parameters or panels (if any) if (!empty($this->block_parameters)) { *************** *** 556,560 **** } ! return $template; } --- 504,508 ---- } ! return true; } Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** mx_functions_core.php 19 Jun 2013 12:22:41 -0000 1.132 --- mx_functions_core.php 25 Jun 2013 17:14:48 -0000 1.133 *************** *** 1498,1507 **** { global $userdata, $lang; ! ! // // Weird rewrite for php5 - anyone explaining why wins a medal ;) ! // ! $temp = $this->block_config[$this->block_id]; ! $this->block_info = $temp['block_info']; $this->block_parameters = isset($temp['block_parameters']) ? $temp['block_parameters'] : array(); unset($temp); --- 1498,1505 ---- { global $userdata, $lang; ! // Weird rewrite for php5 - anyone explaining why wins a medal ;) ! $temp = isset($this->block_config[$this->block_id]) ? $this->block_config[$this->block_id] : false; ! $this->block_info = isset($temp['block_info']) ? $temp['block_info'] : mx_get_info(BLOCK_TABLE, 'block_id', $this->block_id); $this->block_parameters = isset($temp['block_parameters']) ? $temp['block_parameters'] : array(); unset($temp); *************** *** 1522,1531 **** $this->block_time = $this->block_info['block_time']; $this->editor_id = $this->block_info['block_editor_id']; ! ! $this->module_root_path = $this->block_info['module_root_path']; ! $this->block_file = $this->block_info['block_file']; ! $this->block_edit_file = $this->block_info['block_edit_file']; ! $this->function_id = $this->block_info['function_id']; ! $this->is_dynamic = $this->_is_dynamic(); $this->is_sub = $this->_is_sub(); --- 1520,1539 ---- $this->block_time = $this->block_info['block_time']; $this->editor_id = $this->block_info['block_editor_id']; ! ! if (isset($this->block_info['module_root_path']) && !defined('IN_ADMIN')) ! { ! $this->module_root_path = $this->block_info['module_root_path']; ! $this->block_file = $this->block_info['block_file']; ! $this->block_edit_file = $this->block_info['block_edit_file']; ! $this->function_id = $this->block_info['function_id']; ! } ! else ! { ! global $module_root_path; ! $this->module_root_path = isset($this->block_info['module_root_path']) ? $this->block_info['module_root_path'] : $module_root_path; ! $this->block_file = isset($this->block_info['block_file']) ? $this->block_info['block_file'] : ''; ! $this->block_edit_file = isset($this->block_info['block_edit_file']) ? $this->block_info['block_edit_file'] : ''; ! $this->function_id = isset($this->block_info['block_edit_file']) ? $this->block_info['block_edit_file'] : ''; ! } $this->is_dynamic = $this->_is_dynamic(); $this->is_sub = $this->_is_sub(); *************** *** 2173,2177 **** */ var $is_panel = false; ! /** * Load custom module parameters --- 2181,2185 ---- */ var $is_panel = false; ! /** * Load custom module parameters *************** *** 2229,2235 **** --- 2237,2298 ---- } } + } + + /** + * Load custom module parameters + * + * @access private + * @param unknown_type $parameter_data + * @param unknown_type $block_id + * @return unknown + */ + function _get_custom_module_parameters3($parameter_data, $block_id, $classname = 'mx_module_defs', $include_path = false) + { + global $mx_root_path, $phpEx; + $info_file = "admin/{$classname}.$phpEx"; + if (file_exists((($include_path === false) ? $mx_root_path . $this->module_root_path . 'includes/' : $include_path) . $info_file)) + { + include_once((($include_path === false) ? $mx_root_path . $this->module_root_path . 'includes/' : $include_path) . $info_file); + if (class_exists($classname)) + { + $mx_module_defs = new $classname; + if (method_exists($mx_module_defs, 'display_module_parameters')) + { + $mx_module_defs->display_module_parameters($parameter_data, $block_id); + } + } + return $mx_module_defs->is_parameter; + } + return false; } /** + * load custom module panels + * + * @access private + * @param unknown_type $parameter_data + * @param unknown_type $block_id + */ + function _get_custom_module_panels3($parameter_data, $block_id, $classname = 'mx_module_defs', $include_path = false) + { + global $mx_root_path, $phpEx; + $info_file = "admin/{$classname}.$phpEx"; + if (file_exists((($include_path === false) ? $mx_root_path . $this->module_root_path . 'includes/' : $include_path) . $info_file)) + { + include_once((($include_path === false) ? $mx_root_path . $this->module_root_path . 'includes/' : $include_path) . $info_file); + if (class_exists($classname)) + { + $mx_module_defs = new $classname; + if (method_exists($mx_module_defs, 'display_module_panels')) + { + $mx_module_defs->display_module_panels($parameter_data, $block_id); + } + } + return $mx_module_defs->is_panel; + } + return false; + } + + /** * submit custom module parameters * Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** page_header.php 24 Jun 2013 02:12:37 -0000 1.74 --- page_header.php 25 Jun 2013 17:14:48 -0000 1.75 *************** *** 20,30 **** /********** NOTE: - The following code related to GZIP initialization has been moved to the new mx_session_start() function, declared in mx_functions.php - // // gzip_compression - // $do_gzip_compress = FALSE; if ( $board_config['gzip_compress'] ) --- 20,27 ---- *************** *** 58,88 **** } **********/ ! ! // // If MX-Publisher frame template is not set, instantiate it ! // ! if ( is_object($layouttemplate) == FALSE ) { - // // Initialize template ! // ! $layouttemplate = new mx_Template( $mx_root_path . 'templates/'. $mx_user->theme['template_name'], $board_config, $db ); } - - // // If MX-Publisher page is not set, instantiate it - // if (!isset($mx_page->page_navigation_block)) { ! // ! // Load and instatiate page and block classes ! // - temp fix to instatiate mx_page for the login page ! // ! $mx_page->init( '1' ); } - // // Parse and show the overall header. - // $page_ov_header2 = substr_count($mx_page->page_ov_header, 'html') ? str_replace(".html", ".tpl", $mx_page->page_ov_header) : str_replace(".tpl", ".html", $mx_page->page_ov_header); $layouttemplate->set_filenames(array( --- 55,76 ---- } **********/ ! $layouttemplate = isset($layouttemplate) ? $layouttemplate : ""; // If MX-Publisher frame template is not set, instantiate it ! if (!is_object($layouttemplate)) { // Initialize template ! $layouttemplate = new mx_Template($mx_root_path . 'templates/'. $mx_user->theme['template_name'], $board_config, $db); } // If MX-Publisher page is not set, instantiate it if (!isset($mx_page->page_navigation_block)) { ! /* ! * Load and instatiate page and block classes ! * - temp fix to instatiate mx_page for the login page ! */ ! $mx_page->init('1'); } // Parse and show the overall header. $page_ov_header2 = substr_count($mx_page->page_ov_header, 'html') ? str_replace(".html", ".tpl", $mx_page->page_ov_header) : str_replace(".tpl", ".html", $mx_page->page_ov_header); $layouttemplate->set_filenames(array( *************** *** 90,101 **** )); - // // Generate logged in/logged out status - // $mx_backend->page_header('generate_login_logout_stats'); - // // Generate HTML required for Mozilla Navigation bar - // if ( !isset( $nav_links ) ) { --- 78,85 ---- *************** *** 121,127 **** } - // // Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility - // $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'] )]; --- 105,109 ---- *************** *** 136,142 **** } - // // Search box - // $search_page_id_pafiledb = get_page_id('dload.' . $phpEx, true); $search_page_id_kb = get_page_id('kb.' . $phpEx, true); --- 118,122 ---- *************** *** 149,155 **** $option_search_google = '<option value="google">' . $lang['Mx_search_google'] . '</option>'; - // // Generate list of additional css files to include (defined by modules) - // $mx_addional_css_files = ''; if (isset($mx_page->mxbb_css_addup) && (count($mx_page->mxbb_css_addup) > 0)) --- 129,133 ---- *************** *** 161,167 **** } - // // Generate list of additional js files to include (defined by modules) - // $mx_addional_js_files = ''; if (isset($mx_page->mxbb_js_addup) && (count($mx_page->mxbb_js_addup) > 0)) --- 139,143 ---- *************** *** 173,179 **** } - // // Generate additional header code (defined by modules) - // $mx_addional_header_text = ''; if (isset($mx_page->mxbb_header_addup) && (count($mx_page->mxbb_header_addup) > 0)) --- 149,153 ---- *************** *** 187,197 **** $useragent = (isset($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); - switch (PORTAL_BACKEND) { case 'internal': - case 'phpbb2': - $admin = ($userdata['session_logged_in'] && $userdata['user_level'] == ADMIN) ? true : false; break; --- 161,168 ---- *************** *** 271,277 **** 'IS_ADMIN' => $admin, - // // These theme variables are not used for MX-Publisher, since MX-Publisher require a theme.css file - // 'T_HEAD_STYLESHEET' => isset($mx_user->theme['head_stylesheet']) ? $mx_user->theme['head_stylesheet'] : 'stylesheet.css', 'T_BODY_BACKGROUND' => isset($mx_user->theme['body_background']) ? $mx_user->theme['body_background'] : '', --- 242,246 ---- *************** *** 368,379 **** )); - // // Definitions of main navigation links - // $mx_backend->page_header('generate_nav_links'); - // // Navigation Menu in overall_header - // if ($mx_page->auth_view || $mx_page->auth_mod) { --- 337,344 ---- *************** *** 390,418 **** $mx_block->init( $block_id ); - - // // Define $module_root_path, to be used within blocks - // $mx_module_path = $module_root_path; $module_root_path = $mx_root_path . $mx_block->module_root_path; ! $template = new mx_Template($mx_root_path . 'templates/'. $mx_user->theme['template_name']); ! ! // // Include block file and cache output - // ob_start(); @include($module_root_path . $mx_block->block_file); $overall_navigation_menu = ob_get_contents(); ob_end_clean(); ! ! // // Output Block contents - // $layouttemplate->assign_vars(array( 'OVERALL_NAVIGATION' => $overall_navigation_menu) ); ! ! if ( ( ( $mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block ) || $mx_block->auth_mod ) ) { $mx_block->output_cp_button(true); --- 355,376 ---- $mx_block->init( $block_id ); // Define $module_root_path, to be used within blocks $mx_module_path = $module_root_path; $module_root_path = $mx_root_path . $mx_block->module_root_path; ! $template = new mx_Template($mx_root_path . 'templates/'. $mx_user->theme['template_name']); ! // Include block file and cache output ob_start(); @include($module_root_path . $mx_block->block_file); $overall_navigation_menu = ob_get_contents(); ob_end_clean(); ! // Output Block contents $layouttemplate->assign_vars(array( 'OVERALL_NAVIGATION' => $overall_navigation_menu) ); ! ! if ((($mx_block->auth_view && $mx_block->auth_edit && $mx_block->show_block) || $mx_block->auth_mod)) { $mx_block->output_cp_button(true); Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** mx_functions_style.php 24 Jun 2013 02:12:37 -0000 1.132 --- mx_functions_style.php 25 Jun 2013 17:14:48 -0000 1.133 *************** *** 1051,1058 **** $this->default_style_phpbb_path = $this->style_path . $this->default_style_name; //new $this->style = $style; ! // ! // Load template settings ! // - pass cloned template name to $theme ! // $template_config_row = $this->_load_template_config(); --- 1051,1058 ---- $this->default_style_phpbb_path = $this->style_path . $this->default_style_name; //new $this->style = $style; ! /* ! * Load template settings ! * - pass cloned template name to $theme ! */ $template_config_row = $this->_load_template_config(); *************** *** 1079,1092 **** $this->cloned_style_phpbb_path = !empty($this->cloned_template_name) ? $this->style_path . $this->cloned_template_name : ''; //new - // // What template to use? - // $template = new mx_Template($mx_root_path . $this->template_path . $this->template_name); ! ! define('TEMPLATE_ROOT_PATH', $this->template_path . $this->template_name . '/'); - // // Get missing theme colors from *.cfg file (sort of desperate fix) - // foreach($row as $key => $value) { --- 1079,1088 ---- $this->cloned_style_phpbb_path = !empty($this->cloned_template_name) ? $this->style_path . $this->cloned_template_name : ''; //new // What template to use? $template = new mx_Template($mx_root_path . $this->template_path . $this->template_name); ! //todo@ remove redefination ! @define('TEMPLATE_ROOT_PATH', $this->template_path . $this->template_name . '/'); // Get missing theme colors from *.cfg file (sort of desperate fix) foreach($row as $key => $value) { *************** *** 1096,1107 **** } } - // // Load images - // $this->_load_phpbb_images(); $this->_load_mxbb_images(); ! // // Load backend specific style defs. - // $this->setup_style(); return $row; --- 1092,1100 ---- } } // Load images $this->_load_phpbb_images(); $this->_load_mxbb_images(); ! // Load backend specific style defs. $this->setup_style(); return $row; Index: mx_functions_admincp.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_admincp.php,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** mx_functions_admincp.php 23 Jun 2013 21:46:49 -0000 1.69 --- mx_functions_admincp.php 25 Jun 2013 17:14:48 -0000 1.70 *************** *** 131,138 **** * Constructor */ ! function mx_admin($stand_alone = true, $db = true) { // Setup $this->db ! if ($db !== false) { if (!is_object($db) || !method_exists($db, 'sql_query')) --- 131,138 ---- * Constructor */ ! function mx_admin($stand_alone = true, $db = false) { // Setup $this->db ! if ($db == true) { if (!is_object($db) || !method_exists($db, 'sql_query')) *************** *** 550,557 **** $max_order = $row['max_order']; $next_order = intval($max_order + 10); ! ! // // There is no problem having duplicate page names so we won't check for it. - // $sql = "INSERT INTO " . COLUMN_TABLE . " (column_title, column_order, column_size, page_id) VALUES ('" . $column_title . "', $next_order, '" . $column_size . "', $page_id)"; --- 550,555 ---- $max_order = $row['max_order']; $next_order = intval($max_order + 10); ! // There is no problem having duplicate page names so we won't check for it. $sql = "INSERT INTO " . COLUMN_TABLE . " (column_title, column_order, column_size, page_id) VALUES ('" . $column_title . "', $next_order, '" . $column_size . "', $page_id)"; *************** *** 3853,3865 **** if ($all_functions) { ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; ! if (!$is_admin) { - // - // Authorization SQL - // $auth_blocks = get_auth_blocks(); $auth_sql = " AND blk.block_id in ( ". $auth_blocks. " ) "; } // --- 3851,3866 ---- if ($all_functions) { ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? true : false; ! // Authorization SQL ! if ($is_admin !== false) { $auth_blocks = get_auth_blocks(); $auth_sql = " AND blk.block_id in ( ". $auth_blocks. " ) "; } + else + { + $auth_blocks = ""; + $auth_sql = " "; + } // *************** *** 3923,3927 **** } ! $k = $j - 1; if( $row[$j]['module_id'] != $row[$k]['module_id'] ) --- 3924,3928 ---- } ! $k = ($j > 0) ? $j - 1 : 0; if( $row[$j]['module_id'] != $row[$k]['module_id'] ) *************** *** 3941,3953 **** $function_id = $row[$j]['function_id']; ! $function_title = ($row[$j]['function_name']) ? addslashes(strip_tags(trim($row[$j]['function_name']))) : ''; ! $function_desc = ($function_desc_tmp) ? addslashes(strip_tags(trim($function_desc_tmp))) : ''; ! ! $this->_addFunction($module_id, $function_id, $function_title, $function_desc); ! ! // // Get all function blocks (if any) ! // ! if (isset($functionBlocks[$function_id])) { foreach($functionBlocks[$function_id] as $key => $block_row) --- 3942,3955 ---- $function_id = $row[$j]['function_id']; ! $function_title = ($row[$j]['function_name']) ? addslashes(strip_tags(trim($row[$j]['function_name']))) : 'function'; ! $function_desc = ($function_desc_tmp) ? addslashes(strip_tags(trim($function_desc_tmp))) : 'function desc'; ! ! if(!is_null($module_id) && ($module_id !== 0)) ! { ! $this->_addFunction($module_id, $function_id, $function_title, $function_desc); ! } ! // Get all function blocks (if any) ! if (isset($functionBlocks[$function_id]) && ($module_id !== 0)) { foreach($functionBlocks[$function_id] as $key => $block_row) *************** *** 3996,4000 **** $row = $db->sql_fetchrowset($result); } - $db->sql_freeresult($result); $module_id = $function_id = $block_id = 0; --- 3998,4001 ---- *************** *** 4002,4006 **** for( $j = 0; $j < $total_blocks; $j++ ) { ! if( $row[$j]['module_id'] != $row[$j-1]['module_id'] ) { $module_desc_tmp = str_replace("\n", '', $row[$j]['module_desc']); --- 4003,4008 ---- for( $j = 0; $j < $total_blocks; $j++ ) { ! $k = ($j > 0) ? $j - 1 : 0; ! if($row[$j]['module_id'] != $row[$k]['module_id']) { $module_desc_tmp = str_replace("\n", '', $row[$j]['module_desc']); *************** *** 4026,4031 **** $function_title = !empty($row[$j]['function_name']) ? addslashes(strip_tags(trim($row[$j]['function_name']))) : ''; $function_desc = !empty($function_desc_tmp) ? addslashes(strip_tags(trim($function_desc_tmp))) : ''; ! ! $this->_addFunction($module_id, $function_id, $function_title, $function_desc); } --- 4028,4036 ---- $function_title = !empty($row[$j]['function_name']) ? addslashes(strip_tags(trim($row[$j]['function_name']))) : ''; $function_desc = !empty($function_desc_tmp) ? addslashes(strip_tags(trim($function_desc_tmp))) : ''; ! ! if(!is_null($module_id) && ($module_id !== 0)) ! { ! $this->_addFunction($module_id, $function_id, $function_title, $function_desc); ! } } *************** *** 4055,4059 **** function _addBlock($module_id = '', $function_id = '', $block_id = '', $block_title = '', $block_desc = '') { ! $this->functionBlocks[$module_id][$function_id] = $this->functionBlocks[$module_id][$function_id] . (!empty($this->functionBlocks[$module_id][$function_id]) ? ',' : '') . '"' . $block_title . $block_desc . '","' . $block_id . '"'; } --- 4060,4071 ---- function _addBlock($module_id = '', $function_id = '', $block_id = '', $block_title = '', $block_desc = '') { ! if (!empty($this->functionBlocks[$module_id][$function_id])) ! { ! $this->functionBlocks[$module_id][$function_id] = $this->functionBlocks[$module_id][$function_id] . (!empty($this->functionBlocks[$module_id][$function_id]) ? ',' : '') . '"' . $block_title . $block_desc . '","' . $block_id . '"'; ! } ! else ! { ! $this->functionBlocks[$module_id][$function_id] = (!empty($this->functionBlocks[$module_id][$function_id]) ? ',' : '') . '"' . $block_title . $block_desc . '","' . $block_id . '"'; ! } } *************** *** 4069,4075 **** function _addFunction($module_id = '', $function_id = '', $function_title = '', $function_desc = '') { ! $this->moduleFunctions[$module_id] = $this->moduleFunctions[$module_id] . (!empty($this->moduleFunctions[$module_id]) ? ',' : '') . '"' . $function_title . '","' . $function_id . '"'; } ! /** * Enter description here... --- 4081,4094 ---- function _addFunction($module_id = '', $function_id = '', $function_title = '', $function_desc = '') { ! if (!empty($this->moduleFunctions[$module_id])) ! { ! $this->moduleFunctions[$module_id] = $this->moduleFunctions[$module_id] . (!empty($this->moduleFunctions[$module_id]) ? ',' : '') . '"' . $function_title . '","' . $function_id . '"'; ! } ! else ! { ! $this->moduleFunctions[$module_id] = '"' . $function_title . '","' . $function_id . '"'; ! } } ! /** * Enter description here... *************** *** 4082,4086 **** function _addModule($module_id = '', $module_title = '', $module_desc = '') { ! $this->modules[$module_id] = $module_title; } --- 4101,4112 ---- function _addModule($module_id = '', $module_title = '', $module_desc = '') { ! if (!empty($module_title)) ! { ! $this->modules[$module_id] = $module_title; ! } ! else ! { ! $this->modules[$module_id] = 'Module'; ! } } Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** mx_functions.php 18 Jun 2013 22:40:28 -0000 1.117 --- mx_functions.php 25 Jun 2013 17:14:48 -0000 1.118 *************** *** 945,951 **** $style_select = '<select name="' . $select_name . '">'; if ($show_instruction) { - $selected1 = ( $default_style == -1 ) ? ' selected="selected"' : ''; $style_select .= '<option value="-1"' . $selected1 . '>' . $lang['Select_page_style'] . '</option>'; } --- 945,951 ---- $style_select = '<select name="' . $select_name . '">'; + $selected1 = ( $default_style == -1 ) ? ' selected="selected"' : ''; if ($show_instruction) { $style_select .= '<option value="-1"' . $selected1 . '>' . $lang['Select_page_style'] . '</option>'; } *************** *** 955,959 **** $id = $row['themes_id']; $selected = ( $id == $default_style && !$selected1) ? ' selected="selected"' : ''; ! $style_select .= '<option value="' . $id . '"' . $selected . '>' . $row['style_name'] . '</option>'; } $db->sql_freeresult($result); --- 955,959 ---- $id = $row['themes_id']; $selected = ( $id == $default_style && !$selected1) ? ' selected="selected"' : ''; ! $style_select .= '<option value="' . $id . '"' . $selected . '>' . $row['style_name'] . '</option>'; } $db->sql_freeresult($result); *************** *** 1536,1540 **** for( $j = 0; $j < $total_blocks; $j++ ) { ! if( $row[$j]['module_name'] != $row[$j-1]['module_name'] ) { $column_list .= '<option value="">' . 'Module: ' . $row[$j]['module_name'] . '----------' . "</option>\n"; --- 1536,1541 ---- for( $j = 0; $j < $total_blocks; $j++ ) { ! $i = abs($j - 1); ! if( $row[$j]['module_name'] != $row[$i]['module_name'] ) { $column_list .= '<option value="">' . 'Module: ' . $row[$j]['module_name'] . '----------' . "</option>\n"; *************** *** 1543,1547 **** if( $type == 'block_list' ) { ! if( $row[$j]['function_name'] != $row[$j-1]['function_name'] ) { $block_type = $row[$j]['function_name'] . ': '; --- 1544,1548 ---- if( $type == 'block_list' ) { ! if( $row[$j]['function_name'] != $row[$i]['function_name'] ) { $block_type = $row[$j]['function_name'] . ': '; |