[svn r11389] use quickForm for the backup 'Create a complete backup of this course'

add a simple progress bar for the selective backup
skala
Julian Prud'homme 18 years ago
parent 8307fb880a
commit 6bcd7ea37c
  1. 10
      main/coursecopy/classes/CourseSelectForm.class.php
  2. 35
      main/coursecopy/create_backup.php

@ -1,5 +1,5 @@
<?php
// $Id: CourseSelectForm.class.php 9773 2006-10-25 14:39:14Z yannoo $
// $Id: CourseSelectForm.class.php 11389 2007-03-05 10:46:21Z elixir_julian $
/*
==============================================================================
Dokeos - elearning and course management software
@ -77,7 +77,12 @@ class CourseSelectForm
echo '<p>';
echo get_lang('SelectResources');
echo '</p>';
echo '<form method="post" name="course_select_form">';
echo '<script language="javascript" src="'.api_get_path(WEB_CODE_PATH).'inc/lib/javascript/upload.js" type="text/javascript"></script>';
echo '<script type="text/javascript">var myUpload = new upload(1000);</script>';
echo '<form method="post" id="upload_form" name="course_select_form" onsubmit="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"/>';
echo '<input type="hidden" name="course" value="'.base64_encode(serialize($course)).'"/>';
foreach ($course->resources as $type => $resources)
@ -124,6 +129,7 @@ class CourseSelectForm
}
echo '<br/><input type="submit" value="'.get_lang('Ok').'"/>';
echo '</form>';
echo '<div id="dynamic_div" style="display:block;margin-left:40%;margin-top:10px;height:50px;"></div>';
}
/**
* Get the posted course

@ -1,5 +1,5 @@
<?php
// $Id: create_backup.php 11374 2007-03-03 22:32:33Z yannoo $
// $Id: create_backup.php 11389 2007-03-05 10:46:21Z elixir_julian $
/*
==============================================================================
Dokeos - elearning and course management software
@ -99,21 +99,24 @@ else
}
else
{
echo get_lang('SelectOptionForBackup')
?>
<form method="post">
<input type="radio" class="checkbox" id="backup_option_1" name="backup_option" value="full_backup" checked="checked"/>
<label for="backup_option_1"><?php echo get_lang('CreateFullBackup') ?></label>
<br/>
<input type="radio" class="checkbox" id="backup_option_2" name="backup_option" value="select_items"/>
<label for="backup_option_2"><?php echo get_lang('LetMeSelectItems') ?></label>
<br/>
<br/>
<input type="submit" value="<?php echo get_lang('CreateBackup') ?>"/>
</form>
<?php
}
echo get_lang('SelectOptionForBackup');
include (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
$form = new FormValidator('create_backup_form','POST');
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<div>{element}</div> ');
$form->addElement('radio', 'backup_option', '', get_lang('CreateFullBackup'), 'full_backup');
$form->addElement('radio', 'backup_option', '', get_lang('LetMeSelectItems'), 'select_items');
$form->addElement('html','<br/>');
$form->addElement('submit', null, get_lang('CreateBackup'));
$form->add_progress_bar();
$values['backup_option'] = 'full_backup';
$form->setDefaults($values);
$form->display();
}
}
/*
==============================================================================

Loading…
Cancel
Save