|
From: Markus P. <mar...@us...> - 2005-04-19 19:59:45
|
Update of /cvsroot/mxbb/core/modules/mx_coreblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31885/modules/mx_coreblocks Modified Files: mx_menu_nav.php Log Message: Fixed some named array with non-quoted indexes and code layout. Added use of new mx_request_vars class. Index: mx_menu_nav.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_menu_nav.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** mx_menu_nav.php 6 Mar 2005 01:10:13 -0000 1.19 --- mx_menu_nav.php 19 Apr 2005 19:59:34 -0000 1.20 *************** *** 19,136 **** * (at your option) any later version. */ ! ! $block_config = read_block_config( $block_id ); $title = $block_config[$block_id]['block_title']; $b_description = $block_config[$block_id]['block_desc']; // Setup config parameters ! $config_name = array( 'menu_display_mode', 'menu_page_sync' ); ! for( $i = 0; $i < count( $config_name ); $i++ ) { $config_value = $block_config[$block_id][$config_name[$i]]['parameter_value']; $mx_menu_config[$config_name[$i]] = $config_value; } // Define some parameters $menu_display_mode = $mx_menu_config['menu_display_mode']; ! $menu_page_sync = $mx_menu_config['menu_page_sync'] != 'No'; $sql1 = "SELECT cat_id FROM " . MENU_CAT_TABLE . " ! ORDER BY cat_order, cat_id "; ! ! if ( !( $result_show = $db->sql_query( $sql1 ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain folded/unfolded information', '', __LINE__, __FILE__, $sql ); } ! $menu_cat_show = $db->sql_fetchrowset( $result_show ); ! for( $catrow_count = 0; $catrow_count < count( $menu_cat_show ); $catrow_count++ ) { ! $show .= ',' . $menu_cat_show[$catrow_count][cat_id]; } ! $show = substr ( $show, 1 ); // Get the current MX page. ! $page_id = ( !empty( $HTTP_POST_VARS['page'] ) ) ? intval( $HTTP_POST_VARS['page'] ) : intval( $HTTP_GET_VARS['page'] ); ! if ( empty( $page_id ) ) ! { ! $page_id = 1; ! } ! ! switch ( $menu_display_mode ) { case 'Vertical': ! $template->set_filenames( array( "body" => 'mx_menu_nav.tpl' ) ! ); break; case 'Horizontal': ! $template->set_filenames( array( "body" => 'mx_menu_nav_horizontal.tpl' ) ! ); break; default: ! $template->set_filenames( array( "body" => 'mx_menu_nav.tpl' ) ! ); break; } ! $sql = "SELECT cat_id , ! cat_show , ! cat_title , ! cat_desc , ! cat_url , ! cat_target , ! bbcode_uid ! FROM " . MENU_CAT_TABLE . " WHERE block_id = $block_id ORDER BY cat_order, cat_id "; ! ! if ( !( $result_cat = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain menu navigation configuration', '', __LINE__, __FILE__, $sql ); } ! $menu_cat_config = $db->sql_fetchrowset( $result_cat ); ! $num_of_cats = count( $menu_cat_config ); ! $cat_width = $num_of_cats > 0 ? ceil( 100 / $num_of_cats ) . '%' : '100%'; ! $template->assign_vars( array( 'BLOCK_SIZE' => ( !empty( $block_size ) ? $block_size : '100%' ), ! 'L_TITLE' => $title, ! 'L_DESC' => $b_description, ! 'S_ACTION' => $edit_url, ! 'EDIT_IMG' => $edit_img, ! 'NUM_OF_CATS' => $num_of_cats, ! 'NUM_OF_CATS_EDIT' => $num_of_cats - 1, ! 'CAT_WIDTH' => $cat_width, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! ) ); for( $catrow_count = 0; $catrow_count < $num_of_cats; $catrow_count++ ) { ! $cat_title = $menu_cat_config[$catrow_count][cat_title]; ! $cat_id = $menu_cat_config[$catrow_count][cat_id]; ! $cat = ( !empty( $lang[$cat_title] ) ? $lang[$cat_title] : $cat_title ); $bbcode_uid = $menu_cat_config[$catrow_count]['bbcode_uid']; ! $cat = mx_decode( $cat, $bbcode_uid ) ; $cat_desc = ''; $cat_icon = '<img border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/minus.gif" /> '; ! $cat_url = append_sid( PORTAL_URL . 'index.' . $phpEx . '?page=' . $page_id . '&show=' . $show . '&out=' . $cat_id ); ! if ( !empty( $show ) ) { ! $show_lst = $show . "," . $cat_id ; } else { ! $show_lst = $cat_id ; } ! $cat_desc = $menu_cat_config[$catrow_count][cat_desc]; ! $cat_desc = mx_decode( $cat_desc, $bbcode_uid ) ; ! $cat_desc = $cat_desc != '' ? $cat_desc . '<hr>' : ''; $cat_icon = '<img align="absmiddle" border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/plus.gif" /> '; ! $cat_url = append_sid( PORTAL_URL . 'index.' . $phpEx . '?page=' . $page_id . '&show=' . $show_lst ); $cat_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/'; --- 19,134 ---- * (at your option) any later version. */ ! ! // ! // Read block settings ! // ! $block_config = read_block_config($block_id); $title = $block_config[$block_id]['block_title']; $b_description = $block_config[$block_id]['block_desc']; + + // // Setup config parameters ! // ! $config_name = array('menu_display_mode', 'menu_page_sync'); ! for( $i = 0; $i < count($config_name); $i++ ) { $config_value = $block_config[$block_id][$config_name[$i]]['parameter_value']; $mx_menu_config[$config_name[$i]] = $config_value; } + + // // Define some parameters + // $menu_display_mode = $mx_menu_config['menu_display_mode']; ! $menu_page_sync = ( $mx_menu_config['menu_page_sync'] != 'No' ); $sql1 = "SELECT cat_id FROM " . MENU_CAT_TABLE . " ! ORDER BY cat_order, cat_id"; ! if ( !($result_show = $db->sql_query($sql1)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain folded/unfolded information', '', __LINE__, __FILE__, $sql); } ! $menu_cat_show = $db->sql_fetchrowset($result_show); ! for( $catrow_count = 0; $catrow_count < count($menu_cat_show); $catrow_count++ ) { ! $show .= ',' . $menu_cat_show[$catrow_count]['cat_id']; } ! $show = substr($show, 1); + // // Get the current MX page. + // + $page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1); ! switch( $menu_display_mode ) { case 'Vertical': ! $template->set_filenames(array('body' => 'mx_menu_nav.tpl')); break; case 'Horizontal': ! $template->set_filenames(array('body' => 'mx_menu_nav_horizontal.tpl')); break; default: ! $template->set_filenames(array('body' => 'mx_menu_nav.tpl')); break; } ! $sql = "SELECT * ! FROM " . MENU_CAT_TABLE . " ! WHERE block_id = $block_id ! ORDER BY cat_order, cat_id"; ! if ( !($result_cat = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain menu navigation configuration', '', __LINE__, __FILE__, $sql); } ! $menu_cat_config = $db->sql_fetchrowset($result_cat); ! $num_of_cats = count($menu_cat_config); ! $cat_width = $num_of_cats > 0 ? ceil(100 / $num_of_cats) . '%' : '100%'; ! $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), ! 'L_TITLE' => $title, ! 'L_DESC' => $b_description, ! 'S_ACTION' => $edit_url, ! 'EDIT_IMG' => $edit_img, ! 'NUM_OF_CATS' => $num_of_cats, ! 'NUM_OF_CATS_EDIT' => $num_of_cats - 1, ! 'CAT_WIDTH' => $cat_width, ! 'S_HIDDEN_FORM_FIELDS' => $s_hidden_fields ! )); for( $catrow_count = 0; $catrow_count < $num_of_cats; $catrow_count++ ) { ! $cat_title = $menu_cat_config[$catrow_count]['cat_title']; ! $cat_id = $menu_cat_config[$catrow_count]['cat_id']; ! $cat = ( !empty($lang[$cat_title]) ? $lang[$cat_title] : $cat_title ); $bbcode_uid = $menu_cat_config[$catrow_count]['bbcode_uid']; ! $cat = mx_decode($cat, $bbcode_uid); $cat_desc = ''; $cat_icon = '<img border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/minus.gif" /> '; ! $cat_url = append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $page_id . '&show=' . $show . '&out=' . $cat_id); ! if ( !empty($show) ) { ! $show_lst = $show . "," . $cat_id; } else { ! $show_lst = $cat_id; } ! $cat_desc = $menu_cat_config[$catrow_count]['cat_desc']; ! $cat_desc = mx_decode($cat_desc, $bbcode_uid); ! $cat_desc = ( $cat_desc != '' ? $cat_desc . '<hr />' : '' ); $cat_icon = '<img align="absmiddle" border="0" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/plus.gif" /> '; ! $cat_url = append_sid(PORTAL_URL . 'index.' . $phpEx . '?page=' . $page_id . '&show=' . $show_lst); $cat_nav_icon_url = PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/'; *************** *** 138,307 **** $cat_target = ( $menu_cat_config[$catrow_count]['cat_target'] == 0 ) ? '' : '_blank'; ! $cat_url_tmp = append_sid( 'index.php?page=' . $menu_cat_config[$catrow_count]['cat_url'] ) ; $catt = ( $menu_cat_config[$catrow_count]['cat_url'] != 0 ) ? '<a class="genmed" href="' . $cat_url_tmp . '" target="' . $cat_target . '" /><span class="genmed">' . $cat . '</span></a>' : $cat; ! $sql = "SELECT menu_id , ! cat_id , ! menu_name , ! menu_desc , ! menu_links , ! block_id , ! function_id , ! page_id , ! auth_view , ! auth_view_group , ! link_target , ! menu_order , ! bbcode_uid , ! menu_icon ! FROM " . MENU_NAV_TABLE . " WHERE cat_id = " . $cat_id . " ORDER BY menu_order, menu_id "; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Could not obtain menu navigation configuration', '', __LINE__, __FILE__, $sql ); } - $is_auth_ary = array(); $mx_show_cat = false; - - $menu_nav_config = $db->sql_fetchrowset( $result ); - - for( $row_count = 0; $row_count < count( $menu_nav_config ); $row_count++ ) - { - $menu_id = $menu_nav_config[$row_count][menu_id]; - - // Find if user is allowed for view - - $is_auth_ary = menu_auth( AUTH_VIEW, $menu_id , $userdata, $menu_nav_config[$row_count], $menu_nav_config[$row_count]['auth_view_group'] ); - if ( $is_auth_ary[auth_view] ) - { - - if ( !$mx_show_cat ) - { - $template->assign_block_vars( "catrow", array( "CAT_ID" => intval( $cat_id ), - "BLOCK_ID" => intval( $block_id ), - "CATEGORY" => $catt, - "U_URL" => append_sid( PORTAL_URL . 'index.' . $phpEx . '?block_id=' . $block_id ), - "U_CAT_ICON" => $cat_icon, - "U_CAT_NAV" => $cat_nav_icon_url, - "U_URL_SHOW" => $cat_url, - "DESCRIPTION" => $cat_desc - ) ); - // Generate the fold/unfold categories switches - if ( ( $HTTP_COOKIE_VARS['phpbbCategory_' . $block_id . $cat_id] ) != '' ) - { - $cat_on = $HTTP_COOKIE_VARS['phpbbCategory_' . $block_id . $cat_id]; - } - else - { - $cat_on = $menu_cat_config[$catrow_count]['cat_show'] == 1; - } - - if ( $cat_on ) - { - $template->assign_block_vars( 'catrow.switch_cat_on', array() ); - } - else - { - $template->assign_block_vars( 'catrow.switch_cat_off', array() ); - } - $mx_show_cat = true; - } - - $row_color = ( !( $row_count % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; - $row_class = ( !( $row_count % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $action = $menu_nav_config[$row_count][menu_name]; ! $action = ( !empty( $lang[$action] ) ? $lang[$action] : $action ); ! $desc = $menu_nav_config[$row_count][menu_desc]; ! $desc = ( !empty( $lang[$desc] ) ? $lang[$desc] : $desc ); ! $bbcode_uid = $menu_nav_config[$row_count]['bbcode_uid']; ! $action = mx_decode( $action, $bbcode_uid ) ; ! if ( $menu_page_sync ) { ! $style = ( $menu_nav_config[$row_count][block_id] == $HTTP_GET_VARS['dynamic_block'] ) ? 'cattitle': ( ( $menu_nav_config[$row_count][block_id] == 0 && $menu_nav_config[$row_count][page_id] == $page_id ) ? 'cattitle': 'genmed' ); } else { ! $style = 'genmed'; } ! $icon_tmp = ( file_exists( $mx_root_path . TEMPLATE_ROOT_PATH . 'images/menu_icons/' . $menu_nav_config[$row_count][menu_icon] ) ? $menu_nav_config[$row_count][menu_icon] : 'update.gif' ); ! ! $icon_url_hot = str_replace( '.gif', '_hot.gif', 'menu_icons/' . $icon_tmp ); ! if ( file_exists( $mx_root_path . TEMPLATE_ROOT_PATH . 'images/' . $icon_url_hot ) ) ! { ! $icon_url = ( $style == 'cattitle' ) ? $icon_url_hot : 'menu_icons/' . $icon_tmp; ! } ! else ! { ! $icon_url = 'menu_icons/' . $icon_tmp ; ! } ! $menu_icon = ( !empty( $menu_nav_config[$row_count][menu_icon] ) && $menu_nav_config[$row_count][menu_icon] != 'none' ) ? '<img border="0" align="absmiddle" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/' . $icon_url . '" alt="' . $desc . '" /> ' : ""; ! $temp_menu_url = substr_count( $menu_nav_config[$row_count][menu_links], "http://" ) == 0 ? PORTAL_URL . $menu_nav_config[$row_count][menu_links] : $menu_nav_config[$row_count][menu_links]; ! ! if ( $menu_nav_config[$row_count][page_id] != 0 && $menu_nav_config[$row_count][block_id] == 0 && $menu_nav_config[$row_count][link_target] != 2 ) ! { ! $menu_link = append_sid( 'index.php?page=' . $menu_nav_config[$row_count][page_id] ) ; ! } ! else if ( $menu_nav_config[$row_count][page_id] != 0 && $menu_nav_config[$row_count][link_target] == 2 ) ! { ! $menu_link = append_sid( 'index.php?page=' . $menu_nav_config[$row_count][page_id] . '&' . $menu_nav_config[$row_count][menu_links] ) ; ! } ! else if ( $menu_nav_config[$row_count][link_target] == 2 ) ! { ! $menu_link = append_sid( 'index.php?page=' . $page_id . '&' . $menu_nav_config[$row_count][menu_links] ) ; ! } ! else if ( $menu_nav_config[$row_count][menu_links] != '' ) ! { ! $menu_link = $temp_menu_url ; ! } ! else if ( $menu_nav_config[$row_count][page_id] == 0 && $menu_nav_config[$row_count][block_id] != 0 ) ! { ! $menu_link = append_sid( 'index.php?page=' . $page_id . '&dynamic_block=' . $menu_nav_config[$row_count][block_id] ) ; ! } ! else if ( $menu_nav_config[$row_count][page_id] != 0 && $menu_nav_config[$row_count][block_id] != 0 ) ! { ! $menu_link = append_sid( 'index.php?page=' . $menu_nav_config[$row_count][page_id] . '&dynamic_block=' . $menu_nav_config[$row_count][block_id] ) ; ! } ! else ! { ! $sql = "SELECT module_path, function_file ! FROM " . FUNCTION_TABLE . " fnc, ! " . MODULE_TABLE . " mdl ! WHERE fnc.function_id = " . $menu_nav_config[$row_count][function_id] . " ! AND fnc.module_id = mdl.module_id"; ! if ( !$result = $db->sql_query( $sql ) ) ! { ! mx_message_die( GENERAL_ERROR, "Could not query modules information", "", __LINE__, __FILE__, $sql ); ! } ! $row = $db->sql_fetchrow( $result ); ! $menu_link = append_sid( $row['module_path'] . $row['function_file'] ) ; ! } ! $link_target = ( $menu_nav_config[$row_count][link_target] == 0 || $menu_nav_config[$row_count][link_target] == 2 ) ? '' : '_blank'; ! $template->assign_block_vars( "catrow.modulerow", array( "ROW_COLOR" => "#" . $row_color, ! "ROW_CLASS" => $row_class, ! "MENU_NAME" => $action, ! "MENU_STYLE" => $style, ! "MENU_DESC" => $desc, ! "U_MENU_MODULE" => $menu_link, ! "U_LINK_TARGET" => $link_target, ! "U_MENU_ICON" => $menu_icon ! ) ); } } } ! $template->pparse( "body" ); ?> \ No newline at end of file --- 136,286 ---- $cat_target = ( $menu_cat_config[$catrow_count]['cat_target'] == 0 ) ? '' : '_blank'; ! $cat_url_tmp = append_sid(PORTAL_URL . 'index.php?page=' . $menu_cat_config[$catrow_count]['cat_url']); $catt = ( $menu_cat_config[$catrow_count]['cat_url'] != 0 ) ? '<a class="genmed" href="' . $cat_url_tmp . '" target="' . $cat_target . '" /><span class="genmed">' . $cat . '</span></a>' : $cat; ! $sql = "SELECT * ! FROM " . MENU_NAV_TABLE . " ! WHERE cat_id = " . $cat_id . " ! ORDER BY menu_order, menu_id"; ! if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(GENERAL_ERROR, 'Could not obtain menu navigation configuration', '', __LINE__, __FILE__, $sql); } $mx_show_cat = false; ! $menu_nav_config = $db->sql_fetchrowset($result); ! for( $row_count = 0; $row_count < count($menu_nav_config); $row_count++ ) ! { ! $menu_id = $menu_nav_config[$row_count]['menu_id']; ! // ! // Find if user is allowed for view ! // ! $is_auth_ary = menu_auth(AUTH_VIEW, $menu_id, $userdata, $menu_nav_config[$row_count], $menu_nav_config[$row_count]['auth_view_group']); ! if ( !$is_auth_ary['auth_view'] ) ! { ! continue; ! } ! if ( !$mx_show_cat ) ! { ! $template->assign_block_vars('catrow', array( ! 'CAT_ID' => intval($cat_id), ! 'BLOCK_ID' => intval($block_id), ! 'CATEGORY' => $catt, ! 'U_URL' => append_sid(PORTAL_URL . 'index.' . $phpEx . '?block_id=' . $block_id), ! 'U_CAT_ICON' => $cat_icon, ! 'U_CAT_NAV' => $cat_nav_icon_url, ! 'U_URL_SHOW' => $cat_url, ! 'DESCRIPTION' => $cat_desc ! )); ! ! // Generate the fold/unfold categories switches ! if ( !empty($HTTP_COOKIE_VARS['phpbbCategory_' . $block_id . $cat_id]) ) { ! $cat_on = $HTTP_COOKIE_VARS['phpbbCategory_' . $block_id . $cat_id]; } else { ! $cat_on = ( $menu_cat_config[$catrow_count]['cat_show'] == 1 ); } ! $template->assign_block_vars('catrow.switch_cat_' . ( $cat_on ? 'on' : 'off' ), array()); ! $mx_show_cat = true; ! } ! $row_color = ( !( $row_count % 2 ) ) ? $theme['td_color1'] : $theme['td_color2']; ! $row_class = ( !( $row_count % 2 ) ) ? $theme['td_class1'] : $theme['td_class2']; ! $action = $menu_nav_config[$row_count]['menu_name']; ! $action = ( !empty($lang[$action]) ? $lang[$action] : $action ); ! $desc = $menu_nav_config[$row_count]['menu_desc']; ! $desc = ( !empty($lang[$desc]) ? $lang[$desc] : $desc ); ! $bbcode_uid = $menu_nav_config[$row_count]['bbcode_uid']; ! $action = mx_decode($action, $bbcode_uid); ! if ( $menu_page_sync ) ! { ! $style = ( $menu_nav_config[$row_count]['block_id'] == $HTTP_GET_VARS['dynamic_block'] ) ? 'cattitle' : ( ( $menu_nav_config[$row_count]['block_id'] == 0 && $menu_nav_config[$row_count]['page_id'] == $page_id ) ? 'cattitle' : 'genmed' ); ! } ! else ! { ! $style = 'genmed'; ! } ! $icon_tmp = ( file_exists($mx_root_path . TEMPLATE_ROOT_PATH . 'images/menu_icons/' . $menu_nav_config[$row_count]['menu_icon']) ? $menu_nav_config[$row_count]['menu_icon'] : 'update.gif' ); ! $icon_url_hot = str_replace('.gif', '_hot.gif', 'menu_icons/' . $icon_tmp); ! ! if ( file_exists($mx_root_path . TEMPLATE_ROOT_PATH . 'images/' . $icon_url_hot) ) ! { ! $icon_url = ( $style == 'cattitle' ) ? $icon_url_hot : 'menu_icons/' . $icon_tmp; ! } ! else ! { ! $icon_url = 'menu_icons/' . $icon_tmp; ! } ! ! $menu_icon = ( !empty($menu_nav_config[$row_count]['menu_icon']) && $menu_nav_config[$row_count]['menu_icon'] != 'none' ) ? '<img border="0" align="absmiddle" src="' . PORTAL_URL . TEMPLATE_ROOT_PATH . 'images/' . $icon_url . '" alt="' . $desc . '" /> ' : ''; ! ! if ( $menu_nav_config[$row_count]['page_id'] != 0 && $menu_nav_config[$row_count]['block_id'] == 0 && $menu_nav_config[$row_count]['link_target'] != 2 ) ! { ! $menu_link = append_sid(PORTAL_URL . 'index.php?page=' . $menu_nav_config[$row_count]['page_id']); } + else if ( $menu_nav_config[$row_count]['page_id'] != 0 && $menu_nav_config[$row_count]['link_target'] == 2 ) + { + $menu_link = append_sid(PORTAL_URL . 'index.php?page=' . $menu_nav_config[$row_count]['page_id'] . '&' . $menu_nav_config[$row_count]['menu_links']); + } + else if ( $menu_nav_config[$row_count]['link_target'] == 2 ) + { + $menu_link = append_sid(PORTAL_URL . 'index.php?page=' . $page_id . '&' . $menu_nav_config[$row_count]['menu_links']); + } + else if ( $menu_nav_config[$row_count]['menu_links'] != '' ) + { + $menu_link = ( substr_count($menu_nav_config[$row_count]['menu_links'], 'http://') == 0 ? PORTAL_URL . $menu_nav_config[$row_count]['menu_links'] : $menu_nav_config[$row_count]['menu_links'] ); + } + else if ( $menu_nav_config[$row_count]['page_id'] == 0 && $menu_nav_config[$row_count]['block_id'] != 0 ) + { + $menu_link = append_sid(PORTAL_URL . 'index.php?page=' . $page_id . '&dynamic_block=' . $menu_nav_config[$row_count]['block_id']); + } + else if ( $menu_nav_config[$row_count]['page_id'] != 0 && $menu_nav_config[$row_count]['block_id'] != 0 ) + { + $menu_link = append_sid(PORTAL_URL . 'index.php?page=' . $menu_nav_config[$row_count]['page_id'] . '&dynamic_block=' . $menu_nav_config[$row_count]['block_id']); + } + else + { + $sql = "SELECT module_path, function_file + FROM " . FUNCTION_TABLE . " fnc, + " . MODULE_TABLE . " mdl + WHERE fnc.function_id = " . $menu_nav_config[$row_count]['function_id'] . " + AND fnc.module_id = mdl.module_id"; + if ( !($result = $db->sql_query($sql)) ) + { + mx_message_die(GENERAL_ERROR, "Could not query modules information", '', __LINE__, __FILE__, $sql); + } + $row = $db->sql_fetchrow($result); + $menu_link = append_sid(PORTAL_URL . $row['module_path'] . $row['function_file']); + } + + $link_target = ( $menu_nav_config[$row_count]['link_target'] == 0 || $menu_nav_config[$row_count]['link_target'] == 2 ) ? '' : '_blank'; + + $template->assign_block_vars('catrow.modulerow', array( + 'ROW_COLOR' => '#' . $row_color, + 'ROW_CLASS' => $row_class, + 'MENU_NAME' => $action, + 'MENU_STYLE' => $style, + 'MENU_DESC' => $desc, + 'U_MENU_MODULE' => $menu_link, + 'U_LINK_TARGET' => $link_target, + 'U_MENU_ICON' => $menu_icon + )); } } ! $template->pparse('body'); ?> \ No newline at end of file |