Minor - format code.

pull/2487/head
jmontoyaa 8 years ago
parent 0d172d0d83
commit c60f63f049
  1. 29
      main/lp/blank.php
  2. 31
      main/mySpace/myStudents.php
  3. 16
      main/session/add_students_to_session.php
  4. 28
      main/session/add_teachers_to_session.php
  5. 28
      tests/scripts/fix_course_index.php

@ -21,24 +21,39 @@ $message = '';
if (isset($_GET['error'])) { if (isset($_GET['error'])) {
switch ($_GET['error']) { switch ($_GET['error']) {
case 'document_deleted': case 'document_deleted':
$message = Display::return_message(get_lang('DocumentHasBeenDeleted'), 'error'); $message = Display::return_message(
get_lang('DocumentHasBeenDeleted'),
'error'
);
break; break;
case 'prerequisites': case 'prerequisites':
$message = Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning'); $message = Display::return_message(
get_lang('LearnpathPrereqNotCompleted'),
'warning'
);
break; break;
case 'document_not_found': case 'document_not_found':
$message = Display::return_message(get_lang('FileNotFound'), 'warning'); $message = Display::return_message(
get_lang('FileNotFound'),
'warning'
);
break; break;
case 'reached_one_attempt': case 'reached_one_attempt':
$message = Display::return_message(get_lang('ReachedOneAttempt'), 'warning'); $message = Display::return_message(
get_lang('ReachedOneAttempt'),
'warning'
);
break; break;
case 'x_frames_options': case 'x_frames_options':
$src = Session::read('x_frame_source'); $src = Session::read('x_frame_source');
if (!empty($src)) { if (!empty($src)) {
$icon = '<em class="icon-play-sign icon-2x" aria-hidden="true"></em> '; $icon = '<em class="icon-play-sign icon-2x" aria-hidden="true"></em>';
$message = Display::return_message( $message = Display::return_message(
Display::url($icon.$src, $src, ['class' => 'btn generated', 'target' => '_blank']), Display::url(
$icon.$src,
$src,
['class' => 'btn generated', 'target' => '_blank']
),
'normal', 'normal',
false false
); );

@ -588,18 +588,20 @@ $userGroups = $userGroupManager->getNameListByUser(
if (!empty($course_code)) { if (!empty($course_code)) {
?> ?>
<tr> <tr>
<td colspan="2"><?php <td colspan="2">
echo Display::url( <?php
get_lang('SeeAccesses'), echo Display::url(
'access_details.php?'.http_build_query([ get_lang('SeeAccesses'),
'student' => $student_id, 'access_details.php?'.http_build_query([
'course' => $course_code, 'student' => $student_id,
'origin' => $origin, 'course' => $course_code,
'cidReq' => $course_code, 'origin' => $origin,
'id_session' => $sessionId 'cidReq' => $course_code,
]) 'id_session' => $sessionId
); ])
?></td> );
?>
</td>
</tr> </tr>
<?php <?php
} }
@ -689,7 +691,10 @@ $userGroups = $userGroupManager->getNameListByUser(
$isBoss = UserManager::userIsBossOfStudent(api_get_user_id(), $student_id); $isBoss = UserManager::userIsBossOfStudent(api_get_user_id(), $student_id);
if ($isBoss || api_is_platform_admin()) { if ($isBoss || api_is_platform_admin()) {
$extraFieldValue = new ExtraFieldValue('user'); $extraFieldValue = new ExtraFieldValue('user');
$value = $extraFieldValue->get_values_by_handler_and_field_variable($student_id, 'legal_accept'); $value = $extraFieldValue->get_values_by_handler_and_field_variable(
$student_id,
'legal_accept'
);
$icon = Display::return_icon('accept_na.png'); $icon = Display::return_icon('accept_na.png');
if (isset($value['value'])) { if (isset($value['value'])) {
list($legalId, $legalLanguageId, $legalTime) = explode(':', $value['value']); list($legalId, $legalLanguageId, $legalTime) = explode(':', $value['value']);

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @package chamilo.admin * @package chamilo.admin
*/ */
@ -13,7 +14,10 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
// setting breadcrumbs // setting breadcrumbs
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); $interbreadcrumb[] = array(
'url' => 'session_list.php',
'name' => get_lang('SessionList')
);
// Setting the name of the tool // Setting the name of the tool
$tool_name = get_lang('SubscribeStudentsToSession'); $tool_name = get_lang('SubscribeStudentsToSession');
@ -24,17 +28,19 @@ if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
$form_sent = 0; $form_sent = 0;
$errorMsg = ''; $errorMsg = '';
$users = $sessions = array(); $users = $sessions = array();
$id = isset($_GET['id']) ? intval($_GET['id']) : null; $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
SessionManager::protectSession($id); SessionManager::protectSession($id);
$htmlResult = null; $htmlResult = '';
if (isset($_POST['form_sent']) && $_POST['form_sent']) { if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent']; $form_sent = $_POST['form_sent'];
if ($form_sent == 1) { if ($form_sent == 1) {
$sessionSourceList = $_POST['sessions']; $sessionSourceList = $_POST['sessions'];
$sessionDestinationList = $_POST['sessions_destination']; $sessionDestinationList = $_POST['sessions_destination'];
$result = SessionManager::copyStudentsFromSession($sessionSourceList, $sessionDestinationList); $result = SessionManager::copyStudentsFromSession(
$sessionSourceList,
$sessionDestinationList
);
foreach ($result as $message) { foreach ($result as $message) {
$htmlResult .= $message; $htmlResult .= $message;
} }

@ -1,5 +1,6 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @package chamilo.admin * @package chamilo.admin
*/ */
@ -9,32 +10,37 @@ $cidReset = true;
// including some necessary files // including some necessary files
require_once __DIR__.'/../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
// setting the section (for the tabs) // Setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN; $this_section = SECTION_PLATFORM_ADMIN;
// setting breadcrumbs // Setting breadcrumbs
//$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array(
$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); 'url' => 'session_list.php',
'name' => get_lang('SessionList')
);
// Setting the name of the tool // Setting the name of the tool
$tool_name = get_lang('EnrollTrainersFromExistingSessions'); $tool_name = get_lang('EnrollTrainersFromExistingSessions');
$form_sent = 0; $form_sent = 0;
$errorMsg = ''; $errorMsg = '';
$id = intval($_GET['id']); $id = intval($_GET['id']);
SessionManager::protectSession($id); SessionManager::protectSession($id);
$htmlResult = null; $htmlResult = '';
if (isset($_POST['form_sent']) && $_POST['form_sent']) { if (isset($_POST['form_sent']) && $_POST['form_sent']) {
$form_sent = $_POST['form_sent']; $form_sent = $_POST['form_sent'];
if ($form_sent == 1 && isset($_POST['sessions']) && isset($_POST['courses'])) { if ($form_sent == 1 &&
isset($_POST['sessions']) && isset($_POST['courses'])
) {
$sessions = $_POST['sessions']; $sessions = $_POST['sessions'];
$courses = $_POST['courses']; $courses = $_POST['courses'];
$htmlResult = SessionManager::copyCoachesFromSessionToCourse(
$htmlResult = SessionManager::copyCoachesFromSessionToCourse($sessions, $courses); $sessions,
$courses
);
} }
} }

@ -1,7 +1,7 @@
<?php <?php
/* For license terms, see /license.txt */ /* For license terms, see /license.txt */
/** /**
* This script allows you to update all the paths in the * This script allows you to update all the paths in the
* courses/[CODE]/index.php files when you change your Chamilo installation * courses/[CODE]/index.php files when you change your Chamilo installation
* or create a copy somewhere. * or create a copy somewhere.
* How to use: * How to use:
@ -20,17 +20,17 @@ $list = scandir($dir);
$originalPath = 'original.path.com'; $originalPath = 'original.path.com';
$destinationPath = 'destination.path.com'; $destinationPath = 'destination.path.com';
foreach ($list as $entry) { foreach ($list as $entry) {
if (substr($entry, 0, 1) == '.') { if (substr($entry, 0, 1) == '.') {
continue; continue;
} }
if (!is_dir($dir . '/' . $entry)) { if (!is_dir($dir.'/'.$entry)) {
continue; continue;
} }
if (!is_file($dir . '/' . $entry . '/index.php')) { if (!is_file($dir.'/'.$entry.'/index.php')) {
continue; continue;
} }
$file = file_get_contents($dir . '/' . $entry . '/index.php'); $file = file_get_contents($dir.'/'.$entry.'/index.php');
$file = preg_replace('/' . $originalPath . '/', $destinationPath, $file); $file = preg_replace('/'.$originalPath.'/', $destinationPath, $file);
file_put_contents($dir . '/' . $entry . '/index.php', $file); file_put_contents($dir.'/'.$entry.'/index.php', $file);
//die($entry); //die($entry);
} }

Loading…
Cancel
Save