Fixing report tab

skala
Julio Montoya 14 years ago
parent 613ac3ddba
commit 9d479267e1
  1. 5
      main/inc/lib/banner.lib.php
  2. 17
      main/inc/lib/userportal.lib.php

@ -18,6 +18,8 @@
function get_tabs() { function get_tabs() {
global $_course; global $_course;
$navigation = array();
// Campus Homepage // Campus Homepage
$navigation[SECTION_CAMPUS]['url'] = api_get_path(WEB_PATH).'index.php'; $navigation[SECTION_CAMPUS]['url'] = api_get_path(WEB_PATH).'index.php';
$navigation[SECTION_CAMPUS]['title'] = get_lang('CampusHomepage'); $navigation[SECTION_CAMPUS]['title'] = get_lang('CampusHomepage');
@ -33,7 +35,6 @@ function get_tabs() {
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php'; $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
$navigation['mycourses']['title'] = get_lang('MyCourses'); $navigation['mycourses']['title'] = get_lang('MyCourses');
} }
} else { } else {
// Link to my courses // Link to my courses
$navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php'; $navigation['mycourses']['url'] = api_get_path(WEB_PATH).'user_portal.php';
@ -303,12 +304,14 @@ function return_navigation_array() {
} }
// Reports // Reports
if (!empty($possible_tabs['reports'])) {
if (api_get_setting('show_tabs', 'reports') == 'true') { if (api_get_setting('show_tabs', 'reports') == 'true') {
if ((api_is_platform_admin() || api_is_drh() || api_is_session_admin()) && Rights::hasRight('show_tabs:reports')) { if ((api_is_platform_admin() || api_is_drh() || api_is_session_admin()) && Rights::hasRight('show_tabs:reports')) {
$navigation['reports'] = $possible_tabs['reports']; $navigation['reports'] = $possible_tabs['reports'];
} }
} else { } else {
$menu_navigation['reports'] = $possible_tabs['reports']; $menu_navigation['reports'] = $possible_tabs['reports'];
}
} }
// Custom tabs // Custom tabs

@ -412,7 +412,7 @@ class IndexManager {
break; break;
} }
} }
return '<div id="login_fail">'.$message.'</div>'; return Display::return_message($message, 'error');
} }
/** /**
@ -848,20 +848,21 @@ class IndexManager {
if (api_get_setting('allow_social_tool') == 'true') { if (api_get_setting('allow_social_tool') == 'true') {
unset($this->tpl->menu_navigation['myprofile']); unset($this->tpl->menu_navigation['myprofile']);
} }
var_dump($this->tpl->menu_navigation);
// Main navigation section. // Main navigation section.
// Tabs that are deactivated are added here. // Tabs that are deactivated are added here.
if (!empty($this->tpl->menu_navigation)) { if (!empty($this->tpl->menu_navigation)) {
$main_navigation_content .= '<ul class="menulist">'; $content = '<ul class="menulist">';
foreach ($this->tpl->menu_navigation as $section => $navigation_info) { foreach ($this->tpl->menu_navigation as $section => $navigation_info) {
$current = $section == $GLOBALS['this_section'] ? ' id="current"' : ''; $current = $section == $GLOBALS['this_section'] ? ' id="current"' : '';
$main_navigation_content .= '<li'.$current.'>'; $content .= '<li'.$current.'>';
$main_navigation_content .= '<a href="'.$navigation_info['url'].'" target="_self">'.$navigation_info['title'].'</a>'; $content .= '<a href="'.$navigation_info['url'].'" target="_self">'.$navigation_info['title'].'</a>';
$main_navigation_content .= '</li>'; $content .= '</li>';
} }
$main_navigation_content .= '</ul>'; $content .= '</ul>';
$html = self::show_right_block(get_lang('MainNavigation'), $main_navigation_content);
$html = self::show_right_block(get_lang('MainNavigation'), $content);
} }
return $html; return $html;
} }

Loading…
Cancel
Save