Quellcode durchsuchen

Fix for codeclimate

- Line sizes
- Closing parenthesis
Satyan JACQUENS vor 8 Jahren
Ursprung
Commit
fad13f512d
2 geänderte Dateien mit 36 neuen und 13 gelöschten Zeilen
  1. 16 9
      main/auth/courses_categories.php
  2. 20 4
      main/inc/lib/course.lib.php

+ 16 - 9
main/auth/courses_categories.php

@@ -387,11 +387,14 @@ function return_description_button($course)
     $html = '';
     if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
         $html = Display::url(
-        Display::returnFontAwesomeIcon('info-circle'),
-        api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'],
-        array('class' => 'ajax btn btn-default btn-sm', 'data-title' => $title,'title' => get_lang('Description'), 'aria-label' => get_lang('Description')));
-        /*$html = '<a data-title="' . $title . '" class="ajax btn btn-default btn-sm" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="' . get_lang('Description') . '">' .
-        Display::returnFontAwesomeIcon('info-circle') . '</a>';*/
+            Display::returnFontAwesomeIcon('info-circle'),
+            api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'],
+            array(
+                'class' => 'ajax btn btn-default btn-sm',
+                'data-title' => $title,'title' => get_lang('Description'),
+                'aria-label' => get_lang('Description')
+            )
+        );
     }
 
     return $html;
@@ -450,8 +453,10 @@ function return_register_button($course, $stok, $code, $search_term)
     $title = get_lang('Subscribe');
     $html = Display::url(
         Display::returnFontAwesomeIcon('sign-in'),
-        api_get_self() . '?action=subscribe_course&sec_token=' . $stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code,
-        array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title));
+        api_get_self() . '?action=subscribe_course&sec_token=' . $stok.
+        '&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code,
+        array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title)
+    );
     return $html;
 }
 
@@ -469,7 +474,9 @@ function return_unregister_button($course, $stok, $search_term, $code)
     $title = get_lang('Unsubscribe');
     $html = Display::url(
         Display::returnFontAwesomeIcon('sign-in'),
-        api_get_self() . '?action=unsubscribe&sec_token='.$stok.'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code,
-        array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title));
+        api_get_self() . '?action=unsubscribe&sec_token='.$stok
+        .'&unsubscribe='.$course['code'].'&search_term='.$search_term.'&category_code='.$code,
+        array('class' => 'btn btn-success btn-sm', 'title' => $title, 'aria-label' => $title)
+    );
     return $html;
 }

+ 20 - 4
main/inc/lib/course.lib.php

@@ -4871,7 +4871,12 @@ class CourseManager
                     get_lang('Subscribe') . ' ' .
                     Display::returnFontAwesomeIcon('sign-in'),
                     api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php?action=subscribe&sec_token=' . $stok,
-                    array('class' => 'btn btn-success btn-sm', 'title' => get_lang('Subscribe'), 'aria-label' => get_lang('Subscribe')));
+                    array(
+                        'class' => 'btn btn-success btn-sm',
+                        'title' => get_lang('Subscribe'), 
+                        'aria-label' => get_lang('Subscribe')
+                    )
+                );
 
             }
 
@@ -4882,7 +4887,12 @@ class CourseManager
                     get_lang('GoToCourse'). ' ' .
                     Display::returnFontAwesomeIcon('share'),
                     api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php',
-                    array('class' => 'btn btn-default btn-sm', 'title' => get_lang('GoToCourse'), 'aria-label' => get_lang('GoToCourse')));
+                    array(
+                        'class' => 'btn btn-default btn-sm',
+                        'title' => get_lang('GoToCourse'), 
+                        'aria-label' => get_lang('GoToCourse')
+                    )
+                );
 
             }
 
@@ -4890,8 +4900,14 @@ class CourseManager
                 $my_course['unsubscribe_button'] = Display::url(
                     get_lang('Unreg') . ' ' .
                     Display::returnFontAwesomeIcon('sign-out'),
-                    api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode . '&sec_token=' . $stok . '&category_code=' . $categoryCode,
-                    array('class' => 'btn btn-danger btn-sm', 'title' => get_lang('Unreg'), 'aria-label' => get_lang('Unreg')));
+                    api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe=' . $courseCode 
+                    . '&sec_token=' . $stok . '&category_code=' . $categoryCode,
+                    array(
+                        'class' => 'btn btn-danger btn-sm', 
+                        'title' => get_lang('Unreg'), 
+                        'aria-label' => get_lang('Unreg')
+                    )
+                );
 
             }