|
|
|
@ -44,7 +44,7 @@ require_once 'classes/CourseRestorer.class.php'; |
|
|
|
require_once 'classes/CourseSelectForm.class.php'; |
|
|
|
require_once 'classes/CourseSelectForm.class.php'; |
|
|
|
|
|
|
|
|
|
|
|
// Display the tool title |
|
|
|
// Display the tool title |
|
|
|
api_display_tool_title($nameTools); |
|
|
|
echo Display::page_header($nameTools); |
|
|
|
|
|
|
|
|
|
|
|
/* MAIN CODE */ |
|
|
|
/* MAIN CODE */ |
|
|
|
|
|
|
|
|
|
|
|
@ -57,38 +57,25 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is |
|
|
|
} |
|
|
|
} |
|
|
|
$zip_file = CourseArchiver :: write_course($course); |
|
|
|
$zip_file = CourseArchiver :: write_course($course); |
|
|
|
Display::display_confirmation_message(get_lang('BackupCreated')); |
|
|
|
Display::display_confirmation_message(get_lang('BackupCreated')); |
|
|
|
echo '<br /><a class="a_button orange medium" href="../course_info/download.php?archive='.$zip_file.'">'.get_lang('Download').'</a>'; |
|
|
|
echo '<br /><a class="btn btn-primary btn-large" href="../course_info/download.php?archive='.$zip_file.'">'.get_lang('Download').'</a>'; |
|
|
|
|
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
|
<!-- Manual download <script language="JavaScript"> |
|
|
|
|
|
|
|
setTimeout('download_backup()',2000); |
|
|
|
|
|
|
|
function download_backup() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
window.location="../course_info/download.php?archive=<?php echo $zip_file; ?>";
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</script> //--> |
|
|
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} elseif (isset($_POST['backup_option']) && $_POST['backup_option'] == 'select_items') { |
|
|
|
} elseif (isset($_POST['backup_option']) && $_POST['backup_option'] == 'select_items') { |
|
|
|
$cb = new CourseBuilder('partial'); |
|
|
|
$cb = new CourseBuilder('partial'); |
|
|
|
$course = $cb->build(); |
|
|
|
$course = $cb->build(); |
|
|
|
|
|
|
|
|
|
|
|
CourseSelectForm :: display_form($course); |
|
|
|
CourseSelectForm :: display_form($course); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$cb = new CourseBuilder(); |
|
|
|
$cb = new CourseBuilder(); |
|
|
|
$course = $cb->build(); |
|
|
|
$course = $cb->build(); |
|
|
|
if (!$course->has_resources()) { |
|
|
|
if (!$course->has_resources()) { |
|
|
|
echo get_lang('NoResourcesToBackup'); |
|
|
|
echo get_lang('NoResourcesToBackup'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
echo '<span id="page_title">'.get_lang('SelectOptionForBackup').'</span><br /><br />'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'; |
|
|
|
|
|
|
|
$form = new FormValidator('create_backup_form', 'post'); |
|
|
|
$form = new FormValidator('create_backup_form', 'post'); |
|
|
|
$renderer = $form->defaultRenderer(); |
|
|
|
$form->addElement('header',get_lang('SelectOptionForBackup')); |
|
|
|
$renderer->setElementTemplate('<div>{element}</div> '); |
|
|
|
|
|
|
|
$form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup'); |
|
|
|
$form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup'); |
|
|
|
$form->addElement('radio', 'backup_option', '', get_lang('LetMeSelectItems'), 'select_items'); |
|
|
|
$form->addElement('radio', 'backup_option', '', get_lang('LetMeSelectItems'), 'select_items'); |
|
|
|
$form->addElement('html', '<br />'); |
|
|
|
|
|
|
|
$form->addElement('style_submit_button', null, get_lang('CreateBackup'), 'class="save"'); |
|
|
|
$form->addElement('style_submit_button', null, get_lang('CreateBackup'), 'class="save"'); |
|
|
|
|
|
|
|
|
|
|
|
$form->add_progress_bar(); |
|
|
|
$form->add_progress_bar(); |
|
|
|
|