diff --git a/index.php b/index.php
index 01efd37d10..02786353ce 100755
--- a/index.php
+++ b/index.php
@@ -114,9 +114,8 @@ if (!api_is_anonymous()) {
}
}
-$hot_courses = null;
-$announcements_block = null;
-
+$hot_courses = '';
+$announcements_block = '';
// Display the Site Use Cookie Warning Validation
$useCookieValidation = api_get_setting('cookie_warning');
diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php
index e52dca7d75..67b4ee4b07 100755
--- a/main/inc/lib/userportal.lib.php
+++ b/main/inc/lib/userportal.lib.php
@@ -98,7 +98,7 @@ class IndexManager
*/
public function return_announcements($show_slide = true)
{
- //// Display System announcements
+ // Display System announcements
$hideAnnouncements = api_get_setting('hide_global_announcements_when_not_connected');
$currentUserId = api_get_user_id();
if ($hideAnnouncements == 'true' && empty($currentUserId)) {
@@ -214,12 +214,14 @@ class IndexManager
if ($show_menu) {
$html .= '
';
if ($show_create_link) {
- $html .= '- '.Display::return_icon('new-course.png', get_lang('CourseCreate')).(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'
';
+ $html .= '- '.
+ Display::return_icon('new-course.png', get_lang('CourseCreate')).(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'
';
}
if ($show_course_link) {
if (!api_is_drh() && !api_is_session_admin()) {
- $html .= '- '. Display::return_icon('catalog-course.png', get_lang('CourseCatalog')) .get_lang('CourseCatalog').'
';
+ $html .= '- '.
+ Display::return_icon('catalog-course.png', get_lang('CourseCatalog')) .get_lang('CourseCatalog').'
';
} else {
$html .= '- '.get_lang('Dashboard').'
';
}
@@ -250,7 +252,6 @@ class IndexManager
$userId = api_get_user_id();
// Including the page for the news
$html = '';
-
if (!empty($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/', $_GET['include'])) {
$open = @(string)file_get_contents($this->home.$_GET['include']);
$html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
@@ -299,6 +300,9 @@ class IndexManager
return $html;
}
+ /**
+ * @return string
+ */
public function return_notice()
{
$user_selected_language = api_get_interface_language();
@@ -312,7 +316,6 @@ class IndexManager
if (!empty($home_notice)) {
$home_notice = api_to_system_encoding($home_notice, api_detect_encoding(strip_tags($home_notice)));
- //$home_notice = Display::div($home_notice, array('class' => 'homepage_notice'));
$html = self::show_right_block(
get_lang('Notice'),
$home_notice,
@@ -322,9 +325,13 @@ class IndexManager
'noticesCollapse'
);
}
+
return $html;
}
+ /**
+ * @return string
+ */
public function return_help()
{
$user_selected_language = api_get_interface_language();
@@ -332,12 +339,11 @@ class IndexManager
// Help section.
/* Hide right menu "general" and other parts on anonymous right menu. */
-
if (!isset($user_selected_language)) {
$user_selected_language = $platformLanguage;
}
- $html = null;
+ $html = '';
$home_menu = @(string)file_get_contents($this->home.'home_menu_'.$user_selected_language.'.html');
if (!empty($home_menu)) {
$home_menu_content = '