Minor - format code

pull/2472/head
jmontoyaa 8 years ago
parent 8a465b29dd
commit 05debb857e
  1. 6
      main/coursecopy/create_backup.php
  2. 5
      src/Chamilo/CourseBundle/Component/CourseCopy/Course.php
  3. 5
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseArchiver.php
  4. 17
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php

@ -46,8 +46,6 @@ Display::display_header($nameTools);
// Display the tool title
echo Display::page_header($nameTools);
/* MAIN CODE */
if (Security::check_token('post') && (
(
isset($_POST['action']) &&
@ -70,7 +68,9 @@ if (Security::check_token('post') && (
$zip_file = CourseArchiver::createBackup($course);
echo Display::return_message(get_lang('BackupCreated'), 'confirm');
echo '<br /><a class="btn btn-primary btn-large" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'">
echo '<br />
<a class="btn btn-primary btn-large"
href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.$zip_file.'&'.api_get_cidreq().'">
'.get_lang('Download').'</a>';
} elseif (Security::check_token('post') && (
isset($_POST['backup_option']) &&

@ -92,7 +92,8 @@ class Course
/**
* Returns sample text based on the imported course content.
* This sample text is to be used for course language or encoding detection if there is missing (meta)data in the archive.
* This sample text is to be used for course language or encoding
* detection if there is missing (meta)data in the archive.
*
* @return string the resulting sample text extracted from some common resources' data fields
*/
@ -283,7 +284,7 @@ class Course
$resource->question = api_to_system_encoding($resource->question, $this->encoding);
$resource->description = api_to_system_encoding($resource->description, $this->encoding);
if (is_array($resource->answers) && count($resource->answers) > 0) {
foreach ($resource->answers as $index => &$answer) {
foreach ($resource->answers as &$answer) {
$answer['answer'] = api_to_system_encoding($answer['answer'], $this->encoding);
$answer['comment'] = api_to_system_encoding($answer['comment'], $this->encoding);
}

@ -210,7 +210,10 @@ class CourseArchiver
$date = $file_parts[0];
$ext = isset($file_parts[1]) ? $file_parts[1] : null;
if ($ext == 'zip' && ($user_id != null && $owner_id == $user_id || $user_id == null)) {
$date = substr($date, 0, 4).'-'.substr($date, 4, 2).'-'.substr($date, 6, 2).' '.substr($date, 9, 2).':'.substr($date, 11, 2).':'.substr($date, 13, 2);
$date =
substr($date, 0, 4).'-'.substr($date, 4, 2).'-'.
substr($date, 6, 2).' '.substr($date, 9, 2).':'.
substr($date, 11, 2).':'.substr($date, 13, 2);
$backup_files[] = [
'file' => $file,
'date' => $date,

@ -370,7 +370,10 @@ class CourseSelectForm
switch ($type) {
case RESOURCE_QUIZQUESTION:
foreach ($resources as $id => $resource) {
echo '<input type="hidden" name="resource['.RESOURCE_QUIZQUESTION.']['.$id.']" id="resource['.RESOURCE_QUIZQUESTION.']['.$id.']" value="On" />';
echo '<input
type="hidden"
name="resource['.RESOURCE_QUIZQUESTION.']['.$id.']"
id="resource['.RESOURCE_QUIZQUESTION.']['.$id.']" value="On" />';
}
break;
}
@ -390,7 +393,10 @@ class CourseSelectForm
switch ($type) {
case RESOURCE_SCORM:
foreach ($resources as $id => $resource) {
echo '<input type="hidden" name="resource['.RESOURCE_SCORM.']['.$id.']" id="resource['.RESOURCE_SCORM.']['.$id.']" value="On" />';
echo '<input
type="hidden"
name="resource['.RESOURCE_SCORM.']['.$id.']"
id="resource['.RESOURCE_SCORM.']['.$id.']" value="On" />';
}
break;
}
@ -702,7 +708,8 @@ class CourseSelectForm
}
}
if ($avoid_serialize) {
//Documents are avoided due the huge amount of memory that the serialize php function "eats" (when there are directories with hundred/thousand of files)
// Documents are avoided due the huge amount of memory that the serialize php
// function "eats" (when there are directories with hundred/thousand of files)
// this is a known issue of serialize
$course->resources['document'] = null;
}
@ -713,7 +720,9 @@ class CourseSelectForm
echo '<input type="hidden" name="'.$key.'" value="'.$value.'"/>';
}
}
echo '<br /><button class="save" type="submit" onclick="checkLearnPath(\''.addslashes(get_lang('DocumentsWillBeAddedToo')).'\')">'.get_lang('Ok').'</button>';
echo '<br /><button class="save" type="submit"
onclick="checkLearnPath(\''.addslashes(get_lang('DocumentsWillBeAddedToo')).'\')">'.
get_lang('Ok').'</button>';
self::display_hidden_quiz_questions($course);
self::display_hidden_scorm_directories($course);
echo '</form>';

Loading…
Cancel
Save