Fix for codeclimate

- Line sizes
- Closing parenthesis
remotes/angel/1.11.x
Satyan JACQUENS 8 years ago
parent 7ae6411c4d
commit e9d3cf68f4
  1. 19
      main/auth/courses_categories.php
  2. 9
      main/inc/lib/course.lib.php

@ -387,9 +387,12 @@ function return_description_button($course)
$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>';*/
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,8 @@ 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,
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;
@ -471,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;
}

@ -4886,23 +4886,18 @@ class CourseManager
get_lang('GoToCourse'). ' ' .
Display::returnFontAwesomeIcon('share'),
api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/index.php',
<<<<<<< HEAD
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')));
>>>>>>> Add aria label for icon buttons
}
if ($access_link && in_array('unsubscribe', $access_link)) {
$my_course['unsubscribe_button'] = Display::url(
get_lang('Unreg') . ' ' .
Display::returnFontAwesomeIcon('sign-out'),
<<<<<<< HEAD
api_get_path(WEB_CODE_PATH) . 'auth/courses.php?action=unsubscribe&unsubscribe='
. $courseCode . '&sec_token=' . $stok . '&category_code=' . $categoryCode,
array(
@ -4911,10 +4906,6 @@ class CourseManager
'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')));
>>>>>>> Add aria label for icon buttons
}
// start buycourse validation

Loading…
Cancel
Save