From fad13f512d2b3bbb71e477c642a4df40d39a74aa Mon Sep 17 00:00:00 2001 From: Satyan JACQUENS Date: Sun, 16 Apr 2017 13:03:27 +0200 Subject: [PATCH] Fix for codeclimate - Line sizes - Closing parenthesis --- main/auth/courses_categories.php | 25 ++++++++++++++++--------- main/inc/lib/course.lib.php | 24 ++++++++++++++++++++---- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/main/auth/courses_categories.php b/main/auth/courses_categories.php index 8e9abc0f8e..43c015dc0d 100755 --- a/main/auth/courses_categories.php +++ b/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 = '' . - Display::returnFontAwesomeIcon('info-circle') . '';*/ + 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; } diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 364ef8e0d5..96e19e7136 100755 --- a/main/inc/lib/course.lib.php +++ b/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') + ) + ); }