From 280fd7ed6ecf5b5a491a7e777324ccf392efe2bd Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 7 Oct 2010 15:37:30 +0200 Subject: [PATCH] Hiding announcements when showing a custom tab see BT#1648 --- index.php | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/index.php b/index.php index f18ba05dba..858a9a65cc 100755 --- a/index.php +++ b/index.php @@ -199,19 +199,20 @@ if (!empty($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/', $_GET['in echo $open; } -// Display System announcements -$announcement = isset($_GET['announcement']) ? $_GET['announcement'] : -1; -$announcement = intval($announcement); - -if (isset($_user['user_id'])) { - $visibility = api_is_allowed_to_create_course() ? VISIBLE_TEACHER : VISIBLE_STUDENT; - SystemAnnouncementManager :: display_announcements($visibility, $announcement); -} else { - SystemAnnouncementManager :: display_announcements(VISIBLE_GUEST, $announcement); -} - // Display courses and category list if (!$page_included) { + + // Display System announcements + $announcement = isset($_GET['announcement']) ? $_GET['announcement'] : -1; + $announcement = intval($announcement); + + if (isset($_user['user_id'])) { + $visibility = api_is_allowed_to_create_course() ? VISIBLE_TEACHER : VISIBLE_STUDENT; + SystemAnnouncementManager :: display_announcements($visibility, $announcement); + } else { + SystemAnnouncementManager :: display_announcements(VISIBLE_GUEST, $announcement); + } + if (api_get_setting('display_categories_on_homepage') == 'true') { echo '
'; display_anonymous_course_list(); @@ -225,14 +226,10 @@ echo ''; -/* - Footer -*/ +/* Footer */ Display :: display_footer(); -/* - Functions -*/ +/* Functions */ /** * This function handles the logout and is called whenever there is a $_GET['logout']