dokeos-upload
[ class tree: dokeos-upload ] [ index: dokeos-upload ] [ all elements ]

Source for file form.scorm.php

Documentation is available at form.scorm.php

  1. <?php //$id: $
  2. /**
  3.  * Display part of the SCORM sub-process for upload. This script MUST BE included by upload/index.php
  4.  * as it prepares most of the variables needed here.
  5.  * @package dokeos.upload
  6.  * @author Yannick Warnier <ywarnier@beeznest.org>
  7.  */
  8. /**
  9.  * Small function to list files in garbage/
  10.  */
  11.     $list array();
  12.     $dh opendir(api_get_path(SYS_CODE_PATH).'garbage/');
  13.     if($dh === false){
  14.         //ignore
  15.     }else{
  16.         while($entry readdir($dh)){
  17.             if(substr($entry,0,1== '.'){/*ignore files starting with . */}
  18.             else
  19.             {
  20.                 if(preg_match('/^.*\.zip$/i',$entry)){
  21.                     $list[$entry;
  22.                 }
  23.             }
  24.         }
  25.         natcasesort($list);
  26.         closedir($dh);
  27.     }
  28.     return $list;
  29. }
  30. /**
  31.  * Just display the form needed to upload a SCORM and give its settings
  32.  */
  33. $nameTools get_lang("FileUpload");
  34. $interbreadcrumb[]array ("url"=>"../newscorm/lp_controller.php?action=list""name"=> get_lang("Learnpath"));
  35. Display::display_header($nameTools,"Path");
  36. //show the title
  37. api_display_tool_title(get_lang("Learnpath")." - ".$nameTools.$add_group_to_title);
  38.  
  39. require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  40. include('../newscorm/content_makers.inc.php');
  41.  
  42. $form new FormValidator('','POST','upload.php','','id="upload_form" enctype="multipart/form-data" style="background-image: url(\'../img/scorm.jpg\'); background-repeat: no-repeat; background-position: 600px;"');
  43.  
  44. $form->addElement('hidden''curdirpath'$path);
  45. $form->addElement('hidden''tool'$my_tool);
  46.  
  47. $form->addElement('file','user_file',get_lang('FileToUpload'));
  48.  
  49. $select_content_marker &$form->addElement('select','content_maker',get_lang('ContentMaker'));
  50.  
  51. foreach($content_origins as $index => $origin){
  52.     $select_content_marker->addOption($origin,$origin);
  53. }
  54.  
  55. $select_content_proximity &$form->addElement('select','content_proximity',get_lang('ContentProximity'));
  56.     $select_content_proximity->addOption(get_lang('Local'),"local");
  57.     $select_content_proximity->addOption(get_lang('Remote'),"remote");
  58.     $select_content_proximity -> setSelected("local");
  59.  
  60. $form->addElement('submit''submit'get_lang('Send'));
  61.  
  62. $form->addElement('html''<br><br><br>');
  63. /*$list = get_zip_files_in_garbage();
  64. if(count($list)>0){
  65.     $select_file_name = &$form->addElement('select','file_name',get_lang('Or').' '.strtolower(get_lang('UploadLocalFileFromGarbageDir')));
  66.     foreach($list as $file){
  67.         $select_file_name->addOption($file,$file);
  68.     }
  69.     $form->addElement('submit', 'submit', get_lang('Download'));
  70. }
  71. else{
  72.     $text_empty = &$form->addElement('text', 'empty', get_lang('Or').' '.strtolower(get_lang('UploadLocalFileFromGarbageDir')));
  73.     $defaults["empty"] = get_lang('Empty');
  74.     $text_empty->freeze();
  75. }*/
  76.  
  77. $form->add_real_progress_bar('uploadScorm','user_file');
  78.  
  79. $form->setDefaults($defaults);
  80. $form->display();
  81.  
  82. ?>
  83.  
  84. <br/>
  85. <?php
  86. /*
  87. ==============================================================================
  88.         FOOTER
  89. ==============================================================================
  90. */
  91. ?>

Documentation generated on Thu, 12 Jun 2008 13:30:14 -0500 by phpDocumentor 1.4.1