diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php
index 6ec462c420..fe2fa0fd29 100755
--- a/main/inc/lib/course.lib.php
+++ b/main/inc/lib/course.lib.php
@@ -3133,6 +3133,9 @@ class CourseManager
/**
* Builds the course block in user_portal.php
* @todo use Twig
+ *
+ * @param array $params
+ * @return string
*/
public static function course_item_html_no_icon($params)
{
@@ -3167,6 +3170,11 @@ class CourseManager
return $html;
}
+ /**
+ * @param $params
+ * @param bool|false $is_sub_content
+ * @return string
+ */
public static function session_items_html($params, $is_sub_content = false)
{
$html = '';
@@ -3192,6 +3200,9 @@ class CourseManager
/**
* Builds the course block in user_portal.php
* @todo use Twig
+ * @param array $params
+ * @param bool|false $is_sub_content
+ * @return string
*/
public static function course_item_html($params, $is_sub_content = false)
{
@@ -3216,9 +3227,9 @@ class CourseManager
}
$html .= '';
- $notifications = isset($params['notifications']) ? $params['notifications'] : null;
- $param_class = isset($params['class']) ? $params['class'] : null;
- $params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null;
+ $notifications = isset($params['notifications']) ? $params['notifications'] : '';
+ $param_class = isset($params['class']) ? $params['class'] : '';
+ $params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : '';
$html .= '
';
$html .= '
' . $params['right_actions'] . '
';
@@ -3231,12 +3242,14 @@ class CourseManager
$html .= '
' . $params['subtitle'] . '
';
}
if (!empty($params['teachers'])) {
- $html .= '
' . Display::return_icon('teacher.png', get_lang('Teacher'), array(),
- ICON_SIZE_TINY) . $params['teachers'] . '
';
+ $html .= '
' .
+ Display::return_icon('teacher.png', get_lang('Teacher'), array(), ICON_SIZE_TINY) .
+ $params['teachers'] . '
';
}
if (!empty($params['coaches'])) {
- $html .= '
' . Display::return_icon('teacher.png', get_lang('Coach'), array(),
- ICON_SIZE_TINY) . $params['coaches'] . '
';
+ $html .= '
' .
+ Display::return_icon('teacher.png', get_lang('Coach'), array(), ICON_SIZE_TINY) .
+ $params['coaches'] . '
';
}
$html .= '
';
@@ -3520,7 +3533,6 @@ class CourseManager
$sql .= " ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC";
$result = Database::query($sql);
- $status_icon = '';
$html = '';
$course_list = array();
@@ -3605,8 +3617,6 @@ class CourseManager
}
}
- $course_title = $course_info['title'];
-
$course_title_url = '';
if ($course_info['visibility'] != COURSE_VISIBILITY_CLOSED || $course['status'] == COURSEMANAGER) {
$course_title_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?id_session=0';
@@ -3638,11 +3648,11 @@ class CourseManager
$params['notifications'] = $show_notification;
}
- $isSubcontent = true;
+ $isSubContent = true;
if (empty($user_category_id)) {
- $isSubcontent = false;
+ $isSubContent = false;
}
- $html .= self::course_item_html($params, $isSubcontent);
+ $html .= self::course_item_html($params, $isSubContent);
}
return [
diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php
index 9ac9b2bd41..02fcc100e1 100755
--- a/main/inc/lib/userportal.lib.php
+++ b/main/inc/lib/userportal.lib.php
@@ -941,7 +941,11 @@ class IndexManager
$my_account_content .= '';
if (!empty($my_account_content)) {
- $html = self::show_right_block(get_lang('Courses'), $my_account_content, 'course_block');
+ $html = self::show_right_block(
+ get_lang('Courses'),
+ $my_account_content,
+ 'course_block'
+ );
}
return $html;
}
@@ -967,9 +971,7 @@ class IndexManager
}
$html = '';
-
// Showing history title
-
if ($load_history) {
$html .= Display::page_subheader(get_lang('HistoryTrainingSession'));
if (empty($session_categories)) {
@@ -1294,7 +1296,7 @@ class IndexManager
}
return [
- 'html' => $sessions_with_category . $sessions_with_no_category . $courses_html . $special_courses,
+ 'html' => $sessions_with_category.$sessions_with_no_category.$courses_html.$special_courses,
'session_count' => $sessionCount,
'course_count' => $courseCount
];
diff --git a/user_portal.php b/user_portal.php
index acfa80bcf7..847c00ac8e 100755
--- a/user_portal.php
+++ b/user_portal.php
@@ -94,9 +94,9 @@ $nameTools = get_lang('MyCourses');
Include the HTTP, HTML headers plus the top banner.
*/
if ($load_dirs) {
- $url = api_get_path(WEB_AJAX_PATH).'document.ajax.php?a=document_preview';
- $folder_icon = api_get_path(WEB_IMG_PATH).'icons/22/folder.png';
- $close_icon = api_get_path(WEB_IMG_PATH).'loading1.gif';
+ $url = api_get_path(WEB_AJAX_PATH).'document.ajax.php?a=document_preview';
+ $folder_icon = api_get_path(WEB_IMG_PATH).'icons/22/folder.png';
+ $close_icon = api_get_path(WEB_IMG_PATH).'loading1.gif';
$htmlHeadXtra[] = '';
}
-
-
//Show the chamilo mascot
if (empty($courseAndSessions['html']) && !isset($_GET['history'])) {
$controller->tpl->assign('welcome_to_course_block', $controller->return_welcome_to_course_block());