From 0ef3dedbda4e212592a8368335d4c95a18a3bb31 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 6 Feb 2012 17:03:33 +0100 Subject: [PATCH] Fixing bug when hiding tabs see #4269 (bis) --- main/inc/lib/banner.lib.php | 3 +-- main/inc/lib/template.lib.php | 4 ++-- main/inc/lib/userportal.lib.php | 8 +++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/main/inc/lib/banner.lib.php b/main/inc/lib/banner.lib.php index 2a3375e9c5..22c419fca5 100644 --- a/main/inc/lib/banner.lib.php +++ b/main/inc/lib/banner.lib.php @@ -358,8 +358,7 @@ function return_navigation_array() { return array('menu_navigation' => $menu_navigation, 'navigation' => $navigation, 'possible_tabs' => $possible_tabs); } function show_header_3() { - $navigation = return_navigation_array(); - + $navigation = return_navigation_array(); //$menu_navigation = $navigation['menu_navigation']; $navigation = $navigation['navigation']; //$possible_tabs = $navigation['possible_tabs']; diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 85f5be2c29..a1adfa9a50 100644 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -11,7 +11,7 @@ class Template extends Smarty { var $show_header; var $show_footer; var $help; - var $navigation = null; + var $menu_navigation = array(); function __construct($title = '', $show_header = true, $show_footer = true) { parent::__construct(); @@ -198,7 +198,7 @@ class Template extends Smarty { global $httpHeadXtra, $htmlHeadXtra, $_course, $_user, $text_dir, $plugins, $_user, $_cid, $interbreadcrumb, $charset, $language_file, $noPHP_SELF; - $navigation = return_navigation_array(); + $navigation = return_navigation_array(); $this->menu_navigation = $navigation['menu_navigation']; global $_configuration, $show_learn_path; diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index fdafe41faf..d075b19ef3 100644 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -18,9 +18,10 @@ class IndexManager { if ($load_template) { $this->tpl = new Template($title); } - $this->home = api_get_home_path(); - $this->user_id = api_get_user_id(); + $this->home = api_get_home_path(); + $this->user_id = api_get_user_id(); $this->load_directories_preview = false; + if (api_get_setting('show_documents_preview') == 'true') { $this->load_directories_preview = true; } @@ -896,11 +897,12 @@ class IndexManager { if (api_get_setting('allow_social_tool') == 'true') { unset($this->tpl->menu_navigation['myprofile']); } - + // Main navigation section. // Tabs that are deactivated are added here. if (!empty($this->tpl->menu_navigation)) { $main_navigation_content .= '