From d0b2368fc1adbf77886018b29ee1c2398990f1ad Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 31 May 2010 12:41:15 +0200 Subject: [PATCH] Adding message if teacher have no courses --- main/mySpace/index.php | 58 +++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/main/mySpace/index.php b/main/mySpace/index.php index 45c6344307..43920230d7 100755 --- a/main/mySpace/index.php +++ b/main/mySpace/index.php @@ -1,4 +1,4 @@ -'.get_lang('Sessions').''; } -// actions menu -echo '
'; +// Actions menu $nb_menu_items = count($menu_items); -if ($nb_menu_items > 1) { - foreach ($menu_items as $key => $item) { - echo $item; - if ($key != $nb_menu_items - 1) { - echo ' | '; + + +if ($nb_teacher_courses > 0 ) { + echo '
'; + if ($nb_menu_items > 1) { + foreach ($menu_items as $key => $item) { + echo $item; + if ($key != $nb_menu_items - 1) { + echo ' | '; + } } + } + echo '   '.get_lang('Print').' '; + if ($view == 'admin') { + echo (isset($_GET['display']) && $_GET['display'] == 'useroverview')? ' '.get_lang('ExportAsCSV').'' : ''; + } else { + echo (isset($_GET['display']) && $_GET['display'] == 'useroverview')? '' : ' '.get_lang('ExportAsCSV').''; } -} - -echo '   '.get_lang('Print').' '; -if ($view == 'admin') { - echo (isset($_GET['display']) && $_GET['display'] == 'useroverview')? ' '.get_lang('ExportAsCSV').'' : ''; + echo '
'; } else { - echo (isset($_GET['display']) && $_GET['display'] == 'useroverview')? '' : ' '.get_lang('ExportAsCSV').''; + Display::display_warning_message(get_lang('HaveNoCourse')); } -echo '
'; + echo '

'.$title.'

'; if (($is_drh && $view == 'drh') || $_GET['display'] == 'yourstudents') { @@ -383,9 +389,9 @@ if ($view == 'coach' || $view == 'drh') { } if ($view == 'coach') { - /**************************************** + /** * Infos about sessions of the coach - ****************************************/ + **/ $sessions = Tracking :: get_sessions_coached_by_user($_user['user_id']); $nb_sessions = count($sessions); $nb_sessions_past = $nb_sessions_future = $nb_sessions_current = 0;