Fix for codeclimate

- Line sizes
- Closing parenthesis
remotes/angel/1.11.x
Satyan JACQUENS 8 years ago
parent f965fd5b79
commit fad13f512d
  1. 21
      main/auth/courses_categories.php
  2. 24
      main/inc/lib/course.lib.php

@ -389,9 +389,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,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;
}

@ -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')
)
);
}

Loading…
Cancel
Save