Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent 16d7eb3339
commit 3da3ab7435
  1. 24
      main/coursecopy/classes/CourseSelectForm.class.php
  2. 16
      main/coursecopy/recycle_course.php

@ -146,7 +146,11 @@ class CourseSelectForm
echo '<form method="post" id="upload_form" name="course_select_form" onsubmit="javascript: myUpload.start(\'dynamic_div\',\''.api_get_path(WEB_CODE_PATH).'img/progress_bar.gif\',\''.get_lang('PleaseStandBy', '').'\',\'upload_form\')">';
echo '<input type="hidden" name="action" value="course_select_form"/>';
if (!empty($hidden_fields['destination_course']) && !empty($hidden_fields['origin_course']) && !empty($hidden_fields['destination_session']) && !empty($hidden_fields['origin_session']) ) {
if (!empty($hidden_fields['destination_course']) &&
!empty($hidden_fields['origin_course']) &&
!empty($hidden_fields['destination_session']) &&
!empty($hidden_fields['origin_session'])
) {
echo '<input type="hidden" name="destination_course" value="'.$hidden_fields['destination_course'].'"/>';
echo '<input type="hidden" name="origin_course" value="'.$hidden_fields['origin_course'].'"/>';
echo '<input type="hidden" name="destination_session" value="'.$hidden_fields['destination_session'].'"/>';
@ -314,8 +318,11 @@ class CourseSelectForm
echo '<div id="dynamic_div" style="display:block;margin-left:40%;margin-top:10px;height:50px;"></div>';
}
static function display_hidden_quiz_questions($course) {
/**
* @param $course
*/
static function display_hidden_quiz_questions($course)
{
if(is_array($course->resources)){
foreach ($course->resources as $type => $resources) {
if (count($resources) > 0) {
@ -331,7 +338,11 @@ class CourseSelectForm
}
}
static function display_hidden_scorm_directories($course) {
/**
* @param $course
*/
static function display_hidden_scorm_directories($course)
{
if (is_array($course->resources)){
foreach ($course->resources as $type => $resources) {
if (count($resources) > 0) {
@ -521,7 +532,8 @@ class CourseSelectForm
* @param array $hidden_fiels Hidden fields to add to the form.
* @param boolean the document array will be serialize. This is used in the course_copy.php file
*/
function display_form_session_export($list_course, $hidden_fields = null, $avoid_serialize=false) {
function display_form_session_export($list_course, $hidden_fields = null, $avoid_serialize=false)
{
?>
<script>
function exp(item) {
@ -620,4 +632,4 @@ class CourseSelectForm
echo '</form>';
echo '<div id="dynamic_div" style="display:block;margin-left:40%;margin-top:10px;height:50px;"></div>';
}
}
}

@ -26,7 +26,10 @@ if (!api_is_allowed_to_edit()) {
$this_section = SECTION_COURSES;
// Breadcrumbs
$interbreadcrumb[] = array('url' => '../course_info/maintenance.php', 'name' => get_lang('Maintenance'));
$interbreadcrumb[] = array(
'url' => api_get_path(WEB_CODE_PATH).'course_info/maintenance.php',
'name' => get_lang('Maintenance')
);
// Displaying the header
$nameTools = get_lang('RecycleCourse');
@ -49,21 +52,20 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
} else {
$cb = new CourseBuilder();
$course = $cb->build();
}
}
$recycle_type = "";
if (isset($_POST['recycle_option']) && $_POST['recycle_option'] == 'full_backup') {
$recycle_type = 'full_backup';
}
else if (isset($_POST['action']) && $_POST['action'] == 'course_select_form') {
} else if (isset($_POST['action']) && $_POST['action'] == 'course_select_form') {
$recycle_type = 'select_items';
}
$cr = new CourseRecycler($course);
$cr->recycle($recycle_type);
Display::display_confirmation_message(get_lang('RecycleFinished'));
} elseif (isset($_POST['recycle_option']) && $_POST['recycle_option'] == 'select_items') {
$cb = new CourseBuilder();
$course = $cb->build();
$course = $cb->build();
CourseSelectForm::display_form($course);
} else {
$cb = new CourseBuilder();
@ -74,10 +76,8 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
Display::display_warning_message(get_lang('RecycleWarning'), false);
$form = new FormValidator('recycle_course', 'post', 'recycle_course.php?'.api_get_cidreq());
$form->addElement('header', get_lang('SelectOptionForBackup'));
$form->addElement('radio', 'recycle_option', null, get_lang('FullRecycle'), 'full_backup');
$form->addElement('radio', 'recycle_option', null, get_lang('LetMeSelectItems'), 'select_items');
$form->addElement('style_submit_button', 'submit', get_lang('RecycleCourse'), 'class="save"');
$form->setDefaults(array('recycle_option' => 'select_items'));
$form->display();

Loading…
Cancel
Save