From 6f1a781f5715ee4acabd77bdd3e556f8d8dce76e Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 9 Mar 2009 21:14:06 +0100 Subject: [PATCH] [svn r18890] Minor - fixing when no data is available in the Social profile (partial FS#3751) --- main/social/profile.php | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/main/social/profile.php b/main/social/profile.php index beaeed5462..1ad6e78b64 100644 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -625,14 +625,24 @@ echo '
'; } //-----Announcements - api_display_tool_title(get_lang('Announcements')); - foreach ($course_list_code as $course) { - echo '

'.$course['title'].'

'; - echo '
'; - get_all_annoucement_by_user_course($course['dbName'],$user_id); - echo '
'; - echo '
'; - } + + + $announcement_content = ''; + foreach ($course_list_code as $course) { + $content = get_all_annoucement_by_user_course($course['dbName'],$user_id); + if (!empty($content)) { + $announcement_content.= '

'.$course['title'].'

'; + $announcement_content.= '
'; + $announcement_content.= $content; + $announcement_content.= '
'; + $announcement_content.= '
'; + } + } + + if(!empty($announcement_content)) { + api_display_tool_title(get_lang('Announcements')); + echo $announcement_content; + } } echo '
'; @@ -675,11 +685,11 @@ echo '
'; echo '

'; // COURSES LIST - if ($show_full_profile) { - api_display_tool_title(ucfirst(get_lang('Courses'))); + if ($show_full_profile) { //print_r($personal_course_list); //echo '
';
 				if ( is_array($list) ) {
+					api_display_tool_title(ucfirst(get_lang('Courses')));
 					//Courses whithout sessions
 					$old_user_category = 0;
 					$i=1;