|
From: Jon O. <jon...@us...> - 2007-11-19 16:40:07
|
Update of /cvsroot/mxbb/core/modules/mx_navmenu/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1046/modules/mx_navmenu/includes Modified Files: navmenu_functions.php Log Message: This and that, while updating my work site... Index: navmenu_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_navmenu/includes/navmenu_functions.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** navmenu_functions.php 21 Jul 2007 23:09:03 -0000 1.7 --- navmenu_functions.php 19 Nov 2007 16:39:56 -0000 1.8 *************** *** 283,286 **** --- 283,287 ---- if ( isset( $mx_page->subpage_rowset[$page_parent] ) ) { + $first_menu = true; foreach( $mx_page->subpage_rowset[$page_parent] as $subpage_id => $page_data ) { *************** *** 292,295 **** --- 293,297 ---- { $cat = $page_data['page_name']; + $desc = $page_data['page_desc']; // *************** *** 331,335 **** // For overall_header navigation // - is this current page category? ! $current_parent_page = ($mx_page->page_id == $page_data['page_id'] || has_active_subpage($subpage_id) || ( isset($_GET['cat_link']) ? intval($_GET['cat_link']) == $page_data['page_id'] : false) ) ? true : false; // --- 333,338 ---- // For overall_header navigation // - is this current page category? ! //$current_parent_page = ($mx_page->page_id == $page_data['page_id'] || has_active_subpage($subpage_id) || ( isset($_GET['cat_link']) ? intval($_GET['cat_link']) == $page_data['page_id'] : false) ) ? true : false; ! $current_parent_page = ($mx_page->page_id == $page_data['page_id'] || has_active_subpage($subpage_id) ) ? true : false; // *************** *** 358,431 **** 'CAT_SHOW' => $cat_on ? '' : 'none', 'U_MENU_ICON' => $menu_icon, ! 'CURRENT' => $current_parent_page ? '-current' : '' )); generate_site_menu( $subpage_id, $depth + 1, $current_parent_page ); } else { ! $is_current = $mx_page->page_id == $page_data['page_id']; ! $action = $page_data['page_name']; ! $action = ( !empty($lang[$action]) ? $lang[$action] : $action ); ! $style = $is_current ? 'cattitle' : 'genmed'; ! // ! // Get menu icon ! // ! if (true) ! { ! $icon_tmp = ( file_exists($mx_root_path . $images['mx_graphics']['menu_icons'] . '/' . $page_data['menu_icon']) ? $page_data['menu_icon'] : 'icon_blank.gif' ); ! $icon_url_hot = str_replace('.gif', '_hot.gif', $icon_tmp); ! if ( file_exists($mx_root_path . $images['mx_graphics']['menu_icons'] . '/' . $icon_url_hot) ) ! { ! $icon_url = ( $page_data['is_current'] ) ? $icon_url_hot : $icon_tmp; ! $icon_style = ( $page_data['is_current'] ) ? 'mx_icon_hot' : 'mx_icon'; ! } ! else ! { ! $icon_url = $icon_tmp; ! $icon_style = ''; ! } ! $menu_icon = ( !empty($page_data['menu_icon']) && $page_data['menu_icon'] != 'none' ) ? '<img class="'.$icon_style.'" border="0" align="absmiddle" src="' . PORTAL_URL . $images['mx_graphics']['menu_icons'] . '/' . $icon_url . '" alt="' . $desc . '" /> ' : ''; ! } ! else ! { ! $icon_url = ( $is_current ) ? (!empty($page_data['menu_alt_icon_hot']) ? $page_data['menu_alt_icon_hot'] : $page_data['menu_alt_icon']) : $page_data['menu_alt_icon']; ! $menu_icon = '<img border="0" align="absmiddle" src="' . $icon_url . '" alt="' . $desc . '" /> '; ! } ! // ! // Generate Links ! // ! $menu_link = mx_append_sid(PORTAL_URL . 'index.php?page=' . $page_data['page_id']); ! $link_target = ( true ) ? '' : '_blank'; ! $row_color_over = $theme['tr_color2']; ! $menu_array = array( ! 'ROW_COLOR_OVER' => '#' . $row_color_over, ! '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->assign_block_vars('catrow.modulerow', $menu_array); ! if ($current_parent_page) ! { ! $template->assign_block_vars('modulerow', $menu_array); ! } ! } ! } // End Auth ! } ! return; } - return; } --- 361,479 ---- 'CAT_SHOW' => $cat_on ? '' : 'none', 'U_MENU_ICON' => $menu_icon, ! 'CURRENT' => $current_parent_page ? '-current' : '', ! ! // ! // Overall Nav ! // ! 'U_MENU_MODULE' => $cat_url, ! 'U_LINK_TARGET' => $link_target, ! 'MENU_NAME' => $cat, ! 'MENU_DESC' => $desc, ! 'MENU_STYLE' => $style, ! )); + if ($current_parent_page) + { + // + // Overall Nav + // + $is_current = $mx_page->page_id == $page_data['page_id']; + $style = $is_current ? 'cattitle' : 'genmed'; + $link_target = ( true ) ? '' : '_blank'; + + $template->assign_block_vars('modulerow_cat', array( + // + // Overall Nav + // + 'U_MENU_MODULE' => $cat_url, + 'U_LINK_TARGET' => $link_target, + 'MENU_NAME' => $cat, + 'MENU_DESC' => $desc, + 'MENU_STYLE' => $style, + + )); + } + + // Recursive call generate_site_menu( $subpage_id, $depth + 1, $current_parent_page ); } else { ! output_menu($page_data, $current_parent_page); ! } ! } // End Auth ! } ! return; ! } ! return; ! } ! function output_menu($page_data, $current_parent_page) ! { ! global $mx_page, $template, $phpEx, $images, $block_id, $mx_root_path; ! $row_color_over = $theme['tr_color2']; ! $is_current = $mx_page->page_id == $page_data['page_id']; ! $action = $page_data['page_name']; ! $action = ( !empty($lang[$action]) ? $lang[$action] : $action ); ! $desc = $page_data['page_desc']; ! $style = $is_current ? 'cattitle' : 'genmed'; ! $menu_sep = $first_menu ? '' : '|'; ! $first_menu = false; + // + // Get menu icon + // + if (true) + { + $icon_tmp = ( file_exists($mx_root_path . $images['mx_graphics']['menu_icons'] . '/' . $page_data['menu_icon']) ? $page_data['menu_icon'] : 'icon_blank.gif' ); + $icon_url_hot = str_replace('.gif', '_hot.gif', $icon_tmp); ! if ( file_exists($mx_root_path . $images['mx_graphics']['menu_icons'] . '/' . $icon_url_hot) ) ! { ! $icon_url = ( $page_data['is_current'] ) ? $icon_url_hot : $icon_tmp; ! $icon_style = ( $page_data['is_current'] ) ? 'mx_icon_hot' : 'mx_icon'; ! } ! else ! { ! $icon_url = $icon_tmp; ! $icon_style = ''; ! } ! $menu_icon = ( !empty($page_data['menu_icon']) && $page_data['menu_icon'] != 'none' ) ? '<img class="'.$icon_style.'" border="0" align="absmiddle" src="' . PORTAL_URL . $images['mx_graphics']['menu_icons'] . '/' . $icon_url . '" alt="' . $desc . '" /> ' : ''; ! } ! else ! { ! $icon_url = ( $is_current ) ? (!empty($page_data['menu_alt_icon_hot']) ? $page_data['menu_alt_icon_hot'] : $page_data['menu_alt_icon']) : $page_data['menu_alt_icon']; ! $menu_icon = '<img border="0" align="absmiddle" src="' . $icon_url . '" alt="' . $desc . '" /> '; ! } ! // ! // Generate Links ! // ! $menu_link = mx_append_sid(PORTAL_URL . 'index.php?page=' . $page_data['page_id']); ! $link_target = ( true ) ? '' : '_blank'; ! ! $menu_array = array( ! 'ROW_COLOR_OVER' => '#' . $row_color_over, ! 'MENU_NAME' => $action, ! 'MENU_STYLE' => $style, ! 'MENU_DESC' => $desc, ! 'MENU_SEP' => $menu_sep, ! 'U_MENU_MODULE' => $menu_link, ! 'U_LINK_TARGET' => $link_target, ! 'U_MENU_ICON' => $menu_icon ! ); ! ! $template->assign_block_vars('catrow.modulerow', $menu_array); ! ! if ($current_parent_page) ! { ! $template->assign_block_vars('modulerow', $menu_array); } } |