[svn r10782] replace the old form by a form validator (to add a real progress bar)

skala
Julian Prud'homme 19 years ago
parent 12643ce446
commit 1ac66b03fb
  1. 4
      main/newscorm/content_makers.inc.php
  2. 94
      main/upload/form.scorm.php

@ -39,8 +39,6 @@
'Skillsoft', 'Skillsoft',
'Thomson-NETg', 'Thomson-NETg',
'U&I Learning', 'U&I Learning',
'WebCT', 'WebCT'
'Microsoft Powerpoint',
'Open Office Impress'
); );
?> ?>

@ -36,61 +36,55 @@ $interbreadcrumb[]= array ("url"=>"../newscorm/lp_controller.php?action=list", "
Display::display_header($nameTools,"Path"); Display::display_header($nameTools,"Path");
//show the title //show the title
api_display_tool_title(get_lang("learnpath")." - ".$nameTools.$add_group_to_title); api_display_tool_title(get_lang("learnpath")." - ".$nameTools.$add_group_to_title);
?>
<div id="dynamic_div" style="display:block;margin-left:40%;margin-top:10px;height:50px;"> require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
</div> include('../newscorm/content_makers.inc.php');
<div id="upload_form_div" name="form_div" style="display:block;">
<table border="0"> $form = new FormValidator('','POST','upload.php','','id="upload_form" enctype="multipart/form-data"');
<form method="POST" action="upload.php" id="upload_form" enctype="multipart/form-data" onsubmit="myUpload.start('dynamic_div','../img/progress_bar.gif','<?php echo(get_lang('Uploading'));?>','upload_form_div');">
<input type="hidden" name="curdirpath" value="<?php echo $path; ?>"> $form->addElement('hidden', 'curdirpath', $path);
<input type="hidden" name="tool" value="<?php echo $my_tool; ?>"> $form->addElement('hidden', 'tool', $my_tool);
<tr>
<?php $form->addElement('file','user_file',get_lang('FileToUpload'));
echo '<td>'.get_lang('FileToUpload').'</td>'."\n";
echo '<td><input type="file" name="user_file"></td>'."\n"; $select_content_marker = &$form->addElement('select','content_maker',get_lang('ContentMaker'));
echo '</tr><tr>'."\n";
echo '<td>'.get_lang('ContentMaker').'</td>'."\n"; foreach($content_origins as $index => $origin){
include('../newscorm/content_makers.inc.php'); $select_content_marker->addOption($origin,$origin);
echo '<td><select name="content_maker">'."\n"; if($index == 1){
foreach($content_origins as $indx => $origin){ $select_content_marker -> setSelected($origin);
if($indx == 1){
echo ' <option value="'.$origin.'" selected="selected">'.$origin.'</option>';
}else{
echo ' <option value="'.$origin.'">'.$origin.'</option>';
}
} }
echo " </<select></td>\n"; }
echo '</tr><tr>'."\n";
echo '<td>'.get_lang('ContentProximity').'</td>'."\n"; $select_content_proximity = &$form->addElement('select','content_proximity',get_lang('ContentProximity'));
echo ' <td><select name="content_proximity">'."\n" . $select_content_proximity->addOption(get_lang('Local'),"local");
' <option value="local" selected="selected">'.get_lang('Local').'</option>' . $select_content_proximity->addOption(get_lang('Remote'),"remote");
' <option value="remote">'.get_lang('Remote').'</option>' . $select_content_proximity -> setSelected("local");
" </select></td>\n" ;
echo '</tr><tr>'."\n"; $form->addElement('submit', 'submit', get_lang('Download'));
echo '<td colspan="2" align="right"><input type="submit" name="submit" value="'.get_lang('Download').'"></td>';
echo '</tr><tr>'."\n"; $form->addElement('html', '<br><br><br>');
echo '<td colspan="2">&nbsp;</td>'."\n"; $list = get_zip_files_in_garbage();
echo '</tr><tr>'."\n"; if(count($list)>0){
echo '<td>'.get_lang('Or').' '.strtolower(get_lang('UploadLocalFileFromGarbageDir')).'</td>'."\n"; $select_file_name = &$form->addElement('select','file_name',get_lang('Or').' '.strtolower(get_lang('UploadLocalFileFromGarbageDir')));
$list = get_zip_files_in_garbage();
if(count($list)>0){
echo '<td><select name="file_name">'."\n";
foreach($list as $file){ foreach($list as $file){
echo ' <option value="'.$file.'">'.$file.'</option>'."\n"; $select_file_name->addOption($file,$file);
} }
echo '</select></td>'."\n"; $form->addElement('submit', 'submit', get_lang('Download'));
echo '</tr><tr>'."\n"; }
echo '<td colspan="2" align="right"><input type="submit" name="submit" value="'.get_lang('Download').'"></td>'; else{
echo '<td></td>'."\n"; $text_empty = &$form->addElement('text', 'empty', get_lang('Or').' '.strtolower(get_lang('UploadLocalFileFromGarbageDir')));
}else{ $defaults["empty"] = get_lang('Empty');
echo '<td align="center">{'.get_lang('Empty').'}</td>'; $text_empty->freeze();
} }
echo '</tr>'."\n";
$form->add_real_progress_bar('uploadScorm','user_file');
$form->setDefaults($defaults);
$form->display();
?> ?>
</form>
</table>
</div>
<br/> <br/>
<?php <?php
/* /*

Loading…
Cancel
Save