Using formvalidator instead HTML

skala
Julio Montoya 13 years ago
parent d137b87ea8
commit bd0b24f147
  1. 59
      main/coursecopy/copy_course.php

@ -77,40 +77,31 @@ if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (is
if (Database::num_rows($res) == 0) { if (Database::num_rows($res) == 0) {
Display::display_normal_message(get_lang('NoDestinationCoursesAvailable')); Display::display_normal_message(get_lang('NoDestinationCoursesAvailable'));
} else { } else {
?> $options = array();
<form method="post" action="copy_course.php"> while ($obj = Database::fetch_object($res)) {
<?php $options[$obj->code] = $obj->title;
echo get_lang('SelectDestinationCourse'); }
echo ' <select name="destination_course"/>';
while ($obj = Database::fetch_object($res)) { $form = new FormValidator('copy_course', 'post', 'copy_course.php');
echo '<option value="'.$obj->code.'">'.$obj->title.'</option>'; $form->addElement('header','' );
} $form->addElement('select','destination_course', get_lang('SelectDestinationCourse'), $options);
echo '</select>';
?> $group = array();
<br/> $group[] = $form->createElement('radio', 'copy_option', null, get_lang('FullCopy'), 'full_copy');
<br/> $group[] = $form->createElement('radio', 'copy_option', null, get_lang('LetMeSelectItems'), 'select_items');
<input type="radio" class="checkbox" id="copy_option_1" name="copy_option" value="full_copy"/> $form->addGroup($group, '', get_lang('SelectOptionForBackup'));
<label for="copy_option_1"><?php echo get_lang('FullCopy'); ?></label>
<br/> $group = array();
<input type="radio" class="checkbox" id="copy_option_2" name="copy_option" value="select_items" checked="checked"/> $group[] = $form->createElement('radio', 'same_file_name_option', null, get_lang('SameFilenameSkip'), FILE_SKIP);
<label for="copy_option_2"><?php echo get_lang('LetMeSelectItems'); ?></label> $group[] = $form->createElement('radio', 'same_file_name_option', null, get_lang('SameFilenameRename'), FILE_RENAME);
<br/> $group[] = $form->createElement('radio', 'same_file_name_option', null, get_lang('SameFilenameOverwrite'), FILE_OVERWRITE);
<br/> $form->addGroup($group, '', get_lang('SameFilename'));
<?php echo get_lang('SameFilename'); ?>
<blockquote> $form->addElement('style_submit_button', 'submit', get_lang('CopyCourse'),'class="save"');
<input type="radio" class="checkbox" id="same_file_name_option_1" name="same_file_name_option" value="<?php echo FILE_SKIP; ?>"/>
<label for="same_file_name_option_1"><?php echo get_lang('SameFilenameSkip'); ?></label> $form->setDefaults(array('copy_option' =>'select_items','same_file_name_option' => FILE_OVERWRITE));
<br/> $form->display();
<input type="radio" class="checkbox" id="same_file_name_option_2" name="same_file_name_option" value="<?php echo FILE_RENAME; ?>"/>
<label for="same_file_name_option_2"><?php echo get_lang('SameFilenameRename'); ?></label>
<br/>
<input type="radio" class="checkbox" id="same_file_name_option_3" name="same_file_name_option" value="<?php echo FILE_OVERWRITE; ?>" checked="checked"/>
<label for="same_file_name_option_3"><?php echo get_lang('SameFilenameOverwrite'); ?></label>
</blockquote>
<br/>
<button class="save" type="submit"><?php echo get_lang('CopyCourse'); ?></button>
</form>
<?php
} }
} }

Loading…
Cancel
Save