Completed
Push — 1.10.x ( 476467...5d84c5 )
by Angel Fernando Quiroz
44:46
created
main/inc/lib/userportal.lib.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $exercise_list = array();
46 46
         if (!empty($personal_course_list)) {
47
-            foreach($personal_course_list as  $course_item) {
47
+            foreach ($personal_course_list as  $course_item) {
48 48
                 $course_code = $course_item['c'];
49 49
                 $session_id = $course_item['id_session'];
50 50
 
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
                     $session_id
54 54
                 );
55 55
 
56
-                foreach($exercises as $exercise_item) {
57
-                    $exercise_item['course_code']     = $course_code;
58
-                    $exercise_item['session_id']     = $session_id;
59
-                    $exercise_item['tms']     = api_strtotime($exercise_item['end_time'], 'UTC');
56
+                foreach ($exercises as $exercise_item) {
57
+                    $exercise_item['course_code'] = $course_code;
58
+                    $exercise_item['session_id'] = $session_id;
59
+                    $exercise_item['tms'] = api_strtotime($exercise_item['end_time'], 'UTC');
60 60
 
61 61
                     $exercise_list[] = $exercise_item;
62 62
                 }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 }
172 172
             }
173 173
 
174
-            if ($show_menu && ($show_create_link || $show_course_link )) {
174
+            if ($show_menu && ($show_create_link || $show_course_link)) {
175 175
                 $show_menu = true;
176 176
             } else {
177 177
                 $show_menu = false;
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
         if ($show_menu) {
184 184
             $html .= '<ul class="nav nav-pills nav-stacked">';
185 185
             if ($show_create_link) {
186
-                $html .= '<li class="add-course"><a href="' . api_get_path(WEB_CODE_PATH) . 'create_course/add_course.php">'.Display::return_icon('new-course.png',  get_lang('CourseCreate')).(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>';
186
+                $html .= '<li class="add-course"><a href="'.api_get_path(WEB_CODE_PATH).'create_course/add_course.php">'.Display::return_icon('new-course.png', get_lang('CourseCreate')).(api_get_setting('course_validation') == 'true' ? get_lang('CreateCourseRequest') : get_lang('CourseCreate')).'</a></li>';
187 187
             }
188 188
 
189 189
             if ($show_course_link) {
190 190
                 if (!api_is_drh() && !api_is_session_admin()) {
191
-                    $html .=  '<li class="list-course"><a href="'. api_get_path(WEB_CODE_PATH) . 'auth/courses.php">'. Display::return_icon('catalog-course.png', get_lang('CourseCatalog')) .get_lang('CourseCatalog').'</a></li>';
191
+                    $html .= '<li class="list-course"><a href="'.api_get_path(WEB_CODE_PATH).'auth/courses.php">'.Display::return_icon('catalog-course.png', get_lang('CourseCatalog')).get_lang('CourseCatalog').'</a></li>';
192 192
                 } else {
193
-                    $html .= '<li><a href="' . api_get_path(WEB_CODE_PATH) . 'dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
193
+                    $html .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
194 194
                 }
195 195
             }
196 196
             $html .= '</ul>';
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $html = '';
215 215
 
216 216
         if (!empty($_GET['include']) && preg_match('/^[a-zA-Z0-9_-]*\.html$/', $_GET['include'])) {
217
-            $open = @(string)file_get_contents(api_get_path(SYS_PATH).$this->home.$_GET['include']);
217
+            $open = @(string) file_get_contents(api_get_path(SYS_PATH).$this->home.$_GET['include']);
218 218
             $html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
219 219
         } else {
220 220
             // Hiding home top when user not connected.
@@ -244,15 +244,15 @@  discard block
 block discarded – undo
244 244
                     $home_top_temp = file_get_contents($this->home.'home_top.html');
245 245
                 } else {
246 246
                     if (file_exists($this->default_home.'home_top.html')) {
247
-                        $home_top_temp = file_get_contents($this->default_home . 'home_top.html');
247
+                        $home_top_temp = file_get_contents($this->default_home.'home_top.html');
248 248
                     }
249 249
                 }
250 250
             }
251 251
 
252 252
 			if (trim($home_top_temp) == '' && api_is_platform_admin()) {
253
-				$home_top_temp = '<div class="welcome-mascot">' . get_lang('PortalHomepageDefaultIntroduction') . '</div>';
253
+				$home_top_temp = '<div class="welcome-mascot">'.get_lang('PortalHomepageDefaultIntroduction').'</div>';
254 254
 			} else {
255
-				$home_top_temp = '<div class="welcome-home-top-temp">' . $home_top_temp . '</div>';
255
+				$home_top_temp = '<div class="welcome-home-top-temp">'.$home_top_temp.'</div>';
256 256
 			}
257 257
 			$open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top_temp);
258 258
 			$html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
@@ -268,9 +268,9 @@  discard block
 block discarded – undo
268 268
 
269 269
         $html = '';
270 270
         // Notice
271
-        $home_notice = @(string)file_get_contents($sys_path.$this->home.'home_notice_'.$user_selected_language.'.html');
271
+        $home_notice = @(string) file_get_contents($sys_path.$this->home.'home_notice_'.$user_selected_language.'.html');
272 272
         if (empty($home_notice)) {
273
-            $home_notice = @(string)file_get_contents($sys_path.$this->home.'home_notice.html');
273
+            $home_notice = @(string) file_get_contents($sys_path.$this->home.'home_notice.html');
274 274
         }
275 275
 
276 276
         if (!empty($home_notice)) {
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         }
303 303
 
304 304
         $html = null;
305
-        $home_menu = @(string)file_get_contents($sys_path.$this->home.'home_menu_'.$user_selected_language.'.html');
305
+        $home_menu = @(string) file_get_contents($sys_path.$this->home.'home_menu_'.$user_selected_language.'.html');
306 306
         if (!empty($home_menu)) {
307 307
             $home_menu_content = '<ul class="nav nav-pills nav-stacked">';
308 308
             $home_menu_content .= api_to_system_encoding($home_menu, api_detect_encoding(strip_tags($home_menu)));
@@ -332,9 +332,9 @@  discard block
 block discarded – undo
332 332
         if (!api_is_anonymous()) {
333 333
             $certificatesItem = Display::tag(
334 334
                 'li',
335
-                Display::url(Display::return_icon('graduation.png',get_lang('MyCertificates'),null,ICON_SIZE_SMALL).
335
+                Display::url(Display::return_icon('graduation.png', get_lang('MyCertificates'), null, ICON_SIZE_SMALL).
336 336
                     get_lang('MyCertificates'),
337
-                    api_get_path(WEB_CODE_PATH) . "gradebook/my_certificates.php"
337
+                    api_get_path(WEB_CODE_PATH)."gradebook/my_certificates.php"
338 338
                 )
339 339
             );
340 340
         }
@@ -344,29 +344,29 @@  discard block
 block discarded – undo
344 344
         if (api_get_setting('allow_public_certificates') == 'true') {
345 345
             $searchItem = Display::tag(
346 346
                 'li',
347
-                Display::url(Display::return_icon('search_graduation.png',get_lang('Search'),null,ICON_SIZE_SMALL).
347
+                Display::url(Display::return_icon('search_graduation.png', get_lang('Search'), null, ICON_SIZE_SMALL).
348 348
                     get_lang('Search'),
349
-                    api_get_path(WEB_CODE_PATH) . "gradebook/search.php"
349
+                    api_get_path(WEB_CODE_PATH)."gradebook/search.php"
350 350
                 )
351 351
             );
352 352
         }
353 353
 
354 354
         if (empty($certificatesItem) && empty($searchItem)) {
355 355
             return null;
356
-        }else{
357
-            $content.= $certificatesItem;
358
-            $content.= $searchItem;
356
+        } else {
357
+            $content .= $certificatesItem;
358
+            $content .= $searchItem;
359 359
         }
360 360
 
361 361
         if (api_get_setting('allow_skills_tool') == 'true') {
362 362
 
363
-            $content .= Display::tag('li', Display::url(Display::return_icon('skill-badges.png',get_lang('MySkills'),null,ICON_SIZE_SMALL).get_lang('MySkills'), api_get_path(WEB_CODE_PATH).'social/my_skills_report.php'));
363
+            $content .= Display::tag('li', Display::url(Display::return_icon('skill-badges.png', get_lang('MySkills'), null, ICON_SIZE_SMALL).get_lang('MySkills'), api_get_path(WEB_CODE_PATH).'social/my_skills_report.php'));
364 364
             $allowSkillsManagement = api_get_setting('allow_hr_skills_management') == 'true';
365 365
             if (($allowSkillsManagement && api_is_drh()) || api_is_platform_admin()) {
366 366
                 $content .= Display::tag('li',
367 367
                     Display::url(Display::return_icon('edit-skill.png', get_lang('MySkills'), null,
368
-                            ICON_SIZE_SMALL) . get_lang('ManageSkills'),
369
-                        api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php'));
368
+                            ICON_SIZE_SMALL).get_lang('ManageSkills'),
369
+                        api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php'));
370 370
             }
371 371
         }
372 372
         $content .= '</ul>';
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 
419 419
         // Get list of courses in category $category.
420 420
         $sql_get_course_list = "SELECT * FROM $main_course_table cours
421
-                                    WHERE category_code = '" . $category . "'
421
+                                    WHERE category_code = '".$category."'
422 422
                                     ORDER BY title, UPPER(visual_code)";
423 423
 
424 424
         // Showing only the courses of the current access_url_id.
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                     FROM $main_category_table t1
466 466
                     LEFT JOIN $main_category_table t2 ON t1.code=t2.parent_id
467 467
                     LEFT JOIN $main_course_table t3 ON (t3.category_code = t1.code $platform_visible_courses)
468
-                    WHERE t1.parent_id ". (empty ($category) ? "IS NULL" : "='$category'")."
468
+                    WHERE t1.parent_id ".(empty ($category) ? "IS NULL" : "='$category'")."
469 469
                     GROUP BY t1.name,t1.code,t1.parent_id,t1.children_count ORDER BY t1.tree_pos, t1.name";
470 470
 
471 471
         // Showing only the category of courses of the current access_url_id
@@ -542,10 +542,10 @@  discard block
 block discarded – undo
542 542
         }
543 543
         $result .= $htmlTitre;
544 544
         if ($thereIsSubCat) {
545
-            $result .=  $htmlListCat;
545
+            $result .= $htmlListCat;
546 546
         }
547 547
         while ($categoryName = Database::fetch_array($resCats)) {
548
-            $result .= '<h3>' . $categoryName['name'] . "</h3>\n";
548
+            $result .= '<h3>'.$categoryName['name']."</h3>\n";
549 549
         }
550 550
         $numrows = Database::num_rows($sql_result_courses);
551 551
         $courses_list_string = '';
@@ -643,12 +643,12 @@  discard block
 block discarded – undo
643 643
         if ($courses_shown > 0) {
644 644
             // Only display the list of courses and categories if there was more than
645 645
                     // 0 courses visible to the world (we're in the anonymous list here).
646
-            $result .=  $courses_list_string;
646
+            $result .= $courses_list_string;
647 647
         }
648 648
         if ($category != '') {
649
-            $result .=  '<p><a href="'.api_get_self().'"> ' .
649
+            $result .= '<p><a href="'.api_get_self().'"> '.
650 650
                 Display :: return_icon('back.png', get_lang('BackToHomePage')).
651
-                get_lang('BackToHomePage') . '</a></p>';
651
+                get_lang('BackToHomePage').'</a></p>';
652 652
         }
653 653
         return $result;
654 654
     }
@@ -725,14 +725,14 @@  discard block
 block discarded – undo
725 725
     ) {
726 726
         if (!empty($idAccordion)) {
727 727
             $html = null;
728
-            $html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">' . PHP_EOL;
729
-            $html .= '<div class="panel panel-default" id="'.$id.'">' . PHP_EOL;
730
-            $html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">' . PHP_EOL;
731
-            $html .= '<a role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollapse.'" aria-expanded="true" aria-controls="'.$idCollapse.'">'.$title.'</a>' . PHP_EOL;
732
-            $html .= '</h4></div>' . PHP_EOL;
733
-            $html .= '<div id="'.$idCollapse.'" class="panel-collapse collapse in" role="tabpanel">' . PHP_EOL;
734
-            $html .= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
735
-            $html .= '</div></div></div>' . PHP_EOL;
728
+            $html .= '<div class="panel-group" id="'.$idAccordion.'" role="tablist" aria-multiselectable="true">'.PHP_EOL;
729
+            $html .= '<div class="panel panel-default" id="'.$id.'">'.PHP_EOL;
730
+            $html .= '<div class="panel-heading" role="tab"><h4 class="panel-title">'.PHP_EOL;
731
+            $html .= '<a role="button" data-toggle="collapse" data-parent="#'.$idAccordion.'" href="#'.$idCollapse.'" aria-expanded="true" aria-controls="'.$idCollapse.'">'.$title.'</a>'.PHP_EOL;
732
+            $html .= '</h4></div>'.PHP_EOL;
733
+            $html .= '<div id="'.$idCollapse.'" class="panel-collapse collapse in" role="tabpanel">'.PHP_EOL;
734
+            $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL;
735
+            $html .= '</div></div></div>'.PHP_EOL;
736 736
 
737 737
         } else {
738 738
             if (!empty($id)) {
@@ -741,9 +741,9 @@  discard block
 block discarded – undo
741 741
             $params['class'] = 'panel panel-default';
742 742
             $html = null;
743 743
             if (!empty($title)) {
744
-                $html .= '<div class="panel-heading">'.$title.'</div>' . PHP_EOL;
744
+                $html .= '<div class="panel-heading">'.$title.'</div>'.PHP_EOL;
745 745
             }
746
-            $html.= '<div class="panel-body">'.$content.'</div>' . PHP_EOL;
746
+            $html .= '<div class="panel-body">'.$content.'</div>'.PHP_EOL;
747 747
             $html = Display::div($html, $params);
748 748
         }
749 749
         return $html;
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
             $usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
790 790
             $classes = '';
791 791
             if (!empty($usergroup_list)) {
792
-                foreach($usergroup_list as $group_id) {
792
+                foreach ($usergroup_list as $group_id) {
793 793
                     $data = $usergroup->get($group_id);
794 794
                     $data['name'] = Display::url($data['name'], api_get_path(WEB_CODE_PATH).'user/classes.php?id='.$data['id']);
795 795
                     $classes .= Display::tag('li', $data['name']);
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
             if (api_is_platform_admin()) {
799 799
                 $classes .= Display::tag(
800 800
                     'li',
801
-                    Display::url(get_lang('AddClasses') ,api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add')
801
+                    Display::url(get_lang('AddClasses'), api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add')
802 802
                 );
803 803
             }
804 804
             if (!empty($classes)) {
@@ -820,11 +820,11 @@  discard block
 block discarded – undo
820 820
             $content = null;
821 821
 
822 822
             if (api_get_setting('allow_social_tool') == 'true') {
823
-                $content .= '<a style="text-align:center" href="' . api_get_path(WEB_PATH) . 'main/social/home.php">
824
-                <img class="img-circle" src="' . $userPicture . '" ></a>';
823
+                $content .= '<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/social/home.php">
824
+                <img class="img-circle" src="' . $userPicture.'" ></a>';
825 825
             } else {
826
-                $content .= '<a style="text-align:center" href="' . api_get_path(WEB_PATH) . 'main/auth/profile.php">
827
-                <img class="img-circle" title="' . get_lang('EditProfile') . '" src="' . $userPicture. '" ></a>';
826
+                $content .= '<a style="text-align:center" href="'.api_get_path(WEB_PATH).'main/auth/profile.php">
827
+                <img class="img-circle" title="' . get_lang('EditProfile').'" src="'.$userPicture.'" ></a>';
828 828
             }
829 829
 
830 830
             $html = self::show_right_block(
@@ -876,12 +876,12 @@  discard block
 block discarded – undo
876 876
             if (api_get_setting('allow_social_tool') == 'true') {
877 877
                 $link = '?f=social';
878 878
             }
879
-            $profile_content .= '<li class="inbox-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'">'.Display::return_icon('inbox.png',get_lang('Inbox'),null,ICON_SIZE_SMALL).get_lang('Inbox').$cant_msg.' </a></li>';
880
-            $profile_content .= '<li class="new-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'">'.Display::return_icon('new-message.png',get_lang('Compose'),null,ICON_SIZE_SMALL).get_lang('Compose').' </a></li>';
879
+            $profile_content .= '<li class="inbox-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'">'.Display::return_icon('inbox.png', get_lang('Inbox'), null, ICON_SIZE_SMALL).get_lang('Inbox').$cant_msg.' </a></li>';
880
+            $profile_content .= '<li class="new-message-social"><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'">'.Display::return_icon('new-message.png', get_lang('Compose'), null, ICON_SIZE_SMALL).get_lang('Compose').' </a></li>';
881 881
 
882 882
             if (api_get_setting('allow_social_tool') == 'true') {
883 883
                 $total_invitations = Display::badge($total_invitations);
884
-                $profile_content .= '<li class="invitations-social"><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('invitations.png',get_lang('PendingInvitations'),null,ICON_SIZE_SMALL).get_lang('PendingInvitations').$total_invitations.'</a></li>';
884
+                $profile_content .= '<li class="invitations-social"><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('invitations.png', get_lang('PendingInvitations'), null, ICON_SIZE_SMALL).get_lang('PendingInvitations').$total_invitations.'</a></li>';
885 885
             }
886 886
 
887 887
             if (isset($_configuration['allow_my_files_link_in_homepage']) && $_configuration['allow_my_files_link_in_homepage']) {
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 
898 898
         $editProfileUrl = Display::getProfileEditionLink($user_id);
899 899
 
900
-        $profile_content .= '<li class="profile-social"><a href="' . $editProfileUrl . '">'.Display::return_icon('edit-profile.png',get_lang('EditProfile'),null,ICON_SIZE_SMALL).get_lang('EditProfile').'</a></li>';
900
+        $profile_content .= '<li class="profile-social"><a href="'.$editProfileUrl.'">'.Display::return_icon('edit-profile.png', get_lang('EditProfile'), null, ICON_SIZE_SMALL).get_lang('EditProfile').'</a></li>';
901 901
         $profile_content .= '</ul>';
902 902
         $html = self::show_right_block(
903 903
             get_lang('Profile'),
@@ -972,17 +972,17 @@  discard block
 block discarded – undo
972 972
         if ($show_create_link) {
973 973
             $my_account_content .= '<li class="add-course"><a href="main/create_course/add_course.php">';
974 974
             if (api_get_setting('course_validation') == 'true' && !api_is_platform_admin()) {
975
-                $my_account_content .= Display::return_icon('new-course.png',get_lang('CreateCourseRequest'),null,ICON_SIZE_SMALL);
975
+                $my_account_content .= Display::return_icon('new-course.png', get_lang('CreateCourseRequest'), null, ICON_SIZE_SMALL);
976 976
                 $my_account_content .= get_lang('CreateCourseRequest');
977 977
             } else {
978
-                $my_account_content .= Display::return_icon('new-course.png',get_lang('CourseCreate'),null,ICON_SIZE_SMALL);
978
+                $my_account_content .= Display::return_icon('new-course.png', get_lang('CourseCreate'), null, ICON_SIZE_SMALL);
979 979
                 $my_account_content .= get_lang('CourseCreate');
980 980
             }
981 981
             $my_account_content .= '</a></li>';
982 982
 
983 983
             if (SessionManager::allowToManageSessions()) {
984 984
                 $my_account_content .= '<li class="add-course"><a href="main/session/session_add.php">';
985
-                $my_account_content .= Display::return_icon('session.png',get_lang('AddSession'),null,ICON_SIZE_SMALL);
985
+                $my_account_content .= Display::return_icon('session.png', get_lang('AddSession'), null, ICON_SIZE_SMALL);
986 986
                 $my_account_content .= get_lang('AddSession');
987 987
                 $my_account_content .= '</a></li>';
988 988
             }
@@ -990,21 +990,21 @@  discard block
 block discarded – undo
990 990
 
991 991
         //Sort courses
992 992
         $url = api_get_path(WEB_CODE_PATH).'auth/courses.php?action=sortmycourses';
993
-        $img_order= Display::return_icon('order-course.png',get_lang('SortMyCourses'),null,ICON_SIZE_SMALL);
993
+        $img_order = Display::return_icon('order-course.png', get_lang('SortMyCourses'), null, ICON_SIZE_SMALL);
994 994
         $my_account_content .= '<li class="order-course">'.Display::url($img_order.get_lang('SortMyCourses'), $url, array('class' => 'sort course')).'</li>';
995 995
 
996 996
         // Session history
997 997
         if (isset($_GET['history']) && intval($_GET['history']) == 1) {
998
-            $my_account_content .= '<li class="history-course"><a href="user_portal.php">'.Display::return_icon('history-course.png',get_lang('DisplayTrainingList'),null,ICON_SIZE_SMALL).get_lang('DisplayTrainingList').'</a></li>';
998
+            $my_account_content .= '<li class="history-course"><a href="user_portal.php">'.Display::return_icon('history-course.png', get_lang('DisplayTrainingList'), null, ICON_SIZE_SMALL).get_lang('DisplayTrainingList').'</a></li>';
999 999
         } else {
1000
-            $my_account_content .= '<li class="history-course"><a href="user_portal.php?history=1" >'.Display::return_icon('history-course.png',get_lang('HistoryTrainingSessions'),null,ICON_SIZE_SMALL).get_lang('HistoryTrainingSessions').'</a></li>';
1000
+            $my_account_content .= '<li class="history-course"><a href="user_portal.php?history=1" >'.Display::return_icon('history-course.png', get_lang('HistoryTrainingSessions'), null, ICON_SIZE_SMALL).get_lang('HistoryTrainingSessions').'</a></li>';
1001 1001
         }
1002 1002
 
1003 1003
         // Course catalog
1004 1004
 
1005 1005
         if ($show_course_link) {
1006 1006
             if (!api_is_drh()) {
1007
-                $my_account_content .= '<li class="list-course"><a href="main/auth/courses.php" >'.Display::return_icon('catalog-course.png',get_lang('CourseCatalog'),null,ICON_SIZE_SMALL).get_lang('CourseCatalog').'</a></li>';
1007
+                $my_account_content .= '<li class="list-course"><a href="main/auth/courses.php" >'.Display::return_icon('catalog-course.png', get_lang('CourseCatalog'), null, ICON_SIZE_SMALL).get_lang('CourseCatalog').'</a></li>';
1008 1008
             } else {
1009 1009
                 $my_account_content .= '<li><a href="main/dashboard/index.php">'.get_lang('Dashboard').'</a></li>';
1010 1010
             }
@@ -1183,10 +1183,10 @@  discard block
 block discarded – undo
1183 1183
 
1184 1184
                             $extra_info = !empty($session_box['coach']) ? $session_box['coach'] : null;
1185 1185
                             $extra_info .= !empty($session_box['coach'])
1186
-                                ? ' - ' . $session_box['dates']
1186
+                                ? ' - '.$session_box['dates']
1187 1187
                                 : $session_box['dates'];
1188 1188
                             $extra_info .= isset($session_box['duration'])
1189
-                                ? ' ' . $session_box['duration']
1189
+                                ? ' '.$session_box['duration']
1190 1190
                                 : null;
1191 1191
 
1192 1192
                             $params['extra_fields'] = $session_box['extra_fields'];
@@ -1308,8 +1308,8 @@  discard block
 block discarded – undo
1308 1308
                                 $sessionParams['course_list_session_style'] = $coursesListSessionStyle;
1309 1309
                                 $sessionParams['title'] = $session_box['title'];
1310 1310
                                 $sessionParams['subtitle'] = (!empty($session_box['coach'])
1311
-                                    ? $session_box['coach'] . ' | '
1312
-                                    : '') . $session_box['dates'];
1311
+                                    ? $session_box['coach'].' | '
1312
+                                    : '').$session_box['dates'];
1313 1313
                                 $sessionParams['show_actions'] = api_is_platform_admin();
1314 1314
                                 $sessionParams['courses'] = $html_courses_session;
1315 1315
                                 $sessionParams['show_simple_session_info'] = false;
@@ -1359,14 +1359,14 @@  discard block
 block discarded – undo
1359 1359
                                 !empty($session_category_start_date) &&
1360 1360
                                 $session_category_start_date != '0000-00-00'
1361 1361
                             ) {
1362
-                                $categoryParams['subtitle'] = get_lang('From') . ' ' . $session_category_start_date;
1362
+                                $categoryParams['subtitle'] = get_lang('From').' '.$session_category_start_date;
1363 1363
                             }
1364 1364
 
1365 1365
                             if (
1366 1366
                                 !empty($session_category_end_date) &&
1367 1367
                                 $session_category_end_date != '0000-00-00'
1368 1368
                             ) {
1369
-                                $categoryParams['subtitle'] = get_lang('Until') . ' ' . $session_category_end_date;
1369
+                                $categoryParams['subtitle'] = get_lang('Until').' '.$session_category_end_date;
1370 1370
                             }
1371 1371
                         }
1372 1372
 
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
         if ($load_history) {
1441 1441
             $html .= Display::page_subheader(get_lang('HistoryTrainingSession'));
1442 1442
             if (empty($session_categories)) {
1443
-                $html .=  get_lang('YouDoNotHaveAnySessionInItsHistory');
1443
+                $html .= get_lang('YouDoNotHaveAnySessionInItsHistory');
1444 1444
             }
1445 1445
         }
1446 1446
 
@@ -1513,7 +1513,7 @@  discard block
 block discarded – undo
1513 1513
                     } else {
1514 1514
                         $htmlCategory .= '<div class="session-view-row" >';
1515 1515
                     }
1516
-                    $coursesInfo =  $listCourse['course'];
1516
+                    $coursesInfo = $listCourse['course'];
1517 1517
 
1518 1518
                     $htmlCategory .= self::getHtmlForCourse(
1519 1519
                         $coursesInfo,
@@ -1530,7 +1530,7 @@  discard block
 block discarded – undo
1530 1530
                             $listCategorySession['catSessionName']
1531 1531
                         );
1532 1532
                         // list of session
1533
-                        $htmlSession = '';    // start
1533
+                        $htmlSession = ''; // start
1534 1534
                         foreach ($listCategorySession['sessionList'] as $k => $listSession) {
1535 1535
                             // add session
1536 1536
                             $htmlSession .= '<div class="session-view-row">';
@@ -1547,8 +1547,8 @@  discard block
 block discarded – undo
1547 1547
                         $htmlSessionCategory .= $htmlSession;
1548 1548
                     }
1549 1549
                     $htmlSessionCategory .= '</div>'; // end session cat block
1550
-                    $htmlCategory .=  $htmlSessionCategory .'</div>' ;
1551
-                    $htmlCategory .= '';   // end course block
1550
+                    $htmlCategory .= $htmlSessionCategory.'</div>';
1551
+                    $htmlCategory .= ''; // end course block
1552 1552
                 }
1553 1553
                 $userCategoryHtml .= $htmlCategory;
1554 1554
             }
@@ -1573,11 +1573,11 @@  discard block
 block discarded – undo
1573 1573
                 }
1574 1574
             }
1575 1575
             $htmlCategory .= '';
1576
-            $userCategoryHtml .= $htmlCategory;   // end user cat block
1576
+            $userCategoryHtml .= $htmlCategory; // end user cat block
1577 1577
             if ($userCategoryId != 0) {
1578 1578
                 $userCategoryHtml .= '</div>';
1579 1579
             }
1580
-            $html .= $userCategoryHtml;   //
1580
+            $html .= $userCategoryHtml; //
1581 1581
         }
1582 1582
         $html .= '</div>';
1583 1583
 
@@ -1718,11 +1718,11 @@  discard block
 block discarded – undo
1718 1718
         $html = '';
1719 1719
 
1720 1720
         if ($categorySessionId == 0) {
1721
-            $class1 = 'session-view-lvl-2';    // session
1722
-            $class2 = 'session-view-lvl-4';    // got to course in session link
1721
+            $class1 = 'session-view-lvl-2'; // session
1722
+            $class2 = 'session-view-lvl-4'; // got to course in session link
1723 1723
         } else {
1724
-            $class1 = 'session-view-lvl-3';    // session
1725
-            $class2 = 'session-view-lvl-5';    // got to course in session link
1724
+            $class1 = 'session-view-lvl-3'; // session
1725
+            $class2 = 'session-view-lvl-5'; // got to course in session link
1726 1726
         }
1727 1727
 
1728 1728
         $icon = Display::return_icon(
@@ -1750,7 +1750,7 @@  discard block
 block discarded – undo
1750 1750
         if ($listA['userCatTitle'] == $listB['userCatTitle']) {
1751 1751
             if ($listA['title'] == $listB['title']) {
1752 1752
                 return 0;
1753
-            } else if($listA['title'] > $listB['title']) {
1753
+            } else if ($listA['title'] > $listB['title']) {
1754 1754
                 return 1;
1755 1755
             } else {
1756 1756
                 return -1;
@@ -1771,7 +1771,7 @@  discard block
 block discarded – undo
1771 1771
     {
1772 1772
         if ($listA['title'] == $listB['title']) {
1773 1773
             return 0;
1774
-        } else if($listA['title'] > $listB['title']) {
1774
+        } else if ($listA['title'] > $listB['title']) {
1775 1775
             return 1;
1776 1776
         } else {
1777 1777
             return -1;
Please login to merge, or discard this patch.