Minor - format code

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 067e0283bf
commit 2252c440de
  1. 6
      main/inc/lib/api.lib.php
  2. 11
      main/inc/lib/banner.lib.php

@ -2901,9 +2901,9 @@ function api_is_allowed_to_edit(
$session_coach = false, $session_coach = false,
$check_student_view = true $check_student_view = true
) { ) {
$my_session_id = api_get_session_id(); $sessionId = api_get_session_id();
$is_allowed_coach_to_edit = api_is_coach(null, null, $check_student_view); $is_allowed_coach_to_edit = api_is_coach(null, null, $check_student_view);
$session_visibility = api_get_session_visibility($my_session_id); $session_visibility = api_get_session_visibility($sessionId);
// Admins can edit anything. // Admins can edit anything.
if (api_is_platform_admin(false)) { if (api_is_platform_admin(false)) {
@ -2944,7 +2944,7 @@ function api_is_allowed_to_edit(
// Check if the student_view is enabled, and if so, if it is activated. // Check if the student_view is enabled, and if so, if it is activated.
if (api_get_setting('student_view_enabled') == 'true') { if (api_get_setting('student_view_enabled') == 'true') {
if (!empty($my_session_id)) { if (!empty($sessionId)) {
// Check if session visibility is read only for coaches. // Check if session visibility is read only for coaches.
if ($session_visibility == SESSION_VISIBLE_READ_ONLY) { if ($session_visibility == SESSION_VISIBLE_READ_ONLY) {
$is_allowed_coach_to_edit = false; $is_allowed_coach_to_edit = false;

@ -545,7 +545,6 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools)
$my_session_name = is_null($session_name) ? '' : ' ('.$session_name.')'; $my_session_name = is_null($session_name) ? '' : ' ('.$session_name.')';
if (!empty($_course) && !isset($_GET['hide_course_breadcrumb'])) { if (!empty($_course) && !isset($_GET['hide_course_breadcrumb'])) {
$navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : ''); $navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : '');
$_course['name'] = api_htmlentities($_course['name']); $_course['name'] = api_htmlentities($_course['name']);
$course_title = cut($_course['name'], MAX_LENGTH_BREADCRUMB); $course_title = cut($_course['name'], MAX_LENGTH_BREADCRUMB);
@ -668,8 +667,13 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools)
/* Part 4 . Show the teacher view/student view button at the right of the breadcrumb */ /* Part 4 . Show the teacher view/student view button at the right of the breadcrumb */
$view_as_student_link = null; $view_as_student_link = null;
if ($user_id && isset($course_id)) { if ($user_id && isset($course_id)) {
if ((api_is_course_admin() || api_is_platform_admin() || api_is_coach(null, null, false)) && if ((
api_get_setting('student_view_enabled') === 'true' && api_get_course_info()) { api_is_course_admin() ||
api_is_platform_admin() ||
api_is_coach(null, null, false)
) &&
api_get_setting('student_view_enabled') === 'true' && api_get_course_info()
) {
$view_as_student_link = api_display_tool_view_option(); $view_as_student_link = api_display_tool_view_option();
} }
} }
@ -715,7 +719,6 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools)
if (!empty($lis)) { if (!empty($lis)) {
$html .= Display::tag('ul', $lis, array('class'=>'breadcrumb')); $html .= Display::tag('ul', $lis, array('class'=>'breadcrumb'));
} }
} }
return $html; return $html;
} }

Loading…
Cancel
Save