Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/main/upload/form.scorm.php

107 lines
3.8 KiB

<?php //$id: $
/**
* Display part of the SCORM sub-process for upload. This script MUST BE included by upload/index.php
* as it prepares most of the variables needed here.
* @package dokeos.upload
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
/**
* Small function to list files in archive/
*/
function get_zip_files_in_garbage(){
$list = array();
$dh = opendir(api_get_path(SYS_ARCHIVE_PATH));
if($dh === false){
//ignore
}else{
while($entry = readdir($dh)){
if(substr($entry,0,1) == '.'){/*ignore files starting with . */}
else
{
if(preg_match('/^.*\.zip$/i',$entry)){
$list[] = $entry;
}
}
}
natcasesort($list);
closedir($dh);
}
return $list;
}
/**
* Just display the form needed to upload a SCORM and give its settings
*/
$nameTools = get_lang("FileUpload");
$interbreadcrumb[]= array ("url"=>"../newscorm/lp_controller.php?action=list", "name"=> get_lang("Learnpath"));
Display::display_header($nameTools,"Path");
//show the title
//api_display_tool_title(get_lang("Learnpath")." - ".$nameTools.$add_group_to_title);
[svn r17550] search: refactor search engine index and search interface and let learnpath follow it Search engine: - Index - use wrapper methods instead on calling xapian.php directly in most of callings - improve dokeos xapian-API - XapianIndexer - new methods: - replace_document() - remove_term_from_doc() - add_term_to_doc() - DokeosIndexer - new methods: - dokeos_preprocess_results() - Preprocess all results depending on the toolid - set_terms() - general interface for getting, comparing and set search engine terms - get_terms_on_db() - Get the terms stored at database (normal, no xapian) - more wrappers for XapianIndexer methods: dokeos_query_query(), dokeos_query_query(), dokeos_get_boolean_query(), dokeos_join_queries() - remove tags search engine feature to replace it with a new generic feature: specific fields - it let define xapian prefix terms dinamically to be included across dokeos index on each tool - move search engine document ID field from lp item table to a general man db table search_engine_ref - Search - use search_engine processor classes to change how process results depending of the dokeos tool - change interface for terms select at search: now use one multiple select foreach specific field instead of jquery thickbox plugin only for tags - search ajax suggestion feature to query terms on db - it need some work Learnpath: - refactor search engine pieces to use new tables search_engine_ref, specific_field and specific_field_values - add scorm and woogie index - remove search widget from lp list and use it from main/search - also, there are part on audios on lp items feature added
16 years ago
//TODO: Include right language file
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
include('../newscorm/content_makers.inc.php');
[svn r17550] search: refactor search engine index and search interface and let learnpath follow it Search engine: - Index - use wrapper methods instead on calling xapian.php directly in most of callings - improve dokeos xapian-API - XapianIndexer - new methods: - replace_document() - remove_term_from_doc() - add_term_to_doc() - DokeosIndexer - new methods: - dokeos_preprocess_results() - Preprocess all results depending on the toolid - set_terms() - general interface for getting, comparing and set search engine terms - get_terms_on_db() - Get the terms stored at database (normal, no xapian) - more wrappers for XapianIndexer methods: dokeos_query_query(), dokeos_query_query(), dokeos_get_boolean_query(), dokeos_join_queries() - remove tags search engine feature to replace it with a new generic feature: specific fields - it let define xapian prefix terms dinamically to be included across dokeos index on each tool - move search engine document ID field from lp item table to a general man db table search_engine_ref - Search - use search_engine processor classes to change how process results depending of the dokeos tool - change interface for terms select at search: now use one multiple select foreach specific field instead of jquery thickbox plugin only for tags - search ajax suggestion feature to query terms on db - it need some work Learnpath: - refactor search engine pieces to use new tables search_engine_ref, specific_field and specific_field_values - add scorm and woogie index - remove search widget from lp list and use it from main/search - also, there are part on audios on lp items feature added
16 years ago
require_once(api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php');
echo '<div class="actions">';
echo '<a href="../newscorm/lp_controller.php?cidReq='.$_course['sysCode'].'">'.Display::return_icon('scorm.gif',get_lang('ReturnToLearningPaths')).' '.get_lang('ReturnToLearningPaths').'</a>';
echo '</div>';
$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;"');
$form->addElement('header', '', $nameTools);
$form->addElement('hidden', 'curdirpath', $path);
$form->addElement('hidden', 'tool', $my_tool);
$form->addElement('file','user_file',get_lang('FileToUpload'));
$select_content_marker = &$form->addElement('select','content_maker',get_lang('ContentMaker'));
foreach($content_origins as $index => $origin){
$select_content_marker->addOption($origin,$origin);
}
$select_content_proximity = &$form->addElement('select','content_proximity',get_lang('ContentProximity'));
$select_content_proximity->addOption(get_lang('Local'),"local");
$select_content_proximity->addOption(get_lang('Remote'),"remote");
$select_content_proximity -> setSelected("local");
[svn r17550] search: refactor search engine index and search interface and let learnpath follow it Search engine: - Index - use wrapper methods instead on calling xapian.php directly in most of callings - improve dokeos xapian-API - XapianIndexer - new methods: - replace_document() - remove_term_from_doc() - add_term_to_doc() - DokeosIndexer - new methods: - dokeos_preprocess_results() - Preprocess all results depending on the toolid - set_terms() - general interface for getting, comparing and set search engine terms - get_terms_on_db() - Get the terms stored at database (normal, no xapian) - more wrappers for XapianIndexer methods: dokeos_query_query(), dokeos_query_query(), dokeos_get_boolean_query(), dokeos_join_queries() - remove tags search engine feature to replace it with a new generic feature: specific fields - it let define xapian prefix terms dinamically to be included across dokeos index on each tool - move search engine document ID field from lp item table to a general man db table search_engine_ref - Search - use search_engine processor classes to change how process results depending of the dokeos tool - change interface for terms select at search: now use one multiple select foreach specific field instead of jquery thickbox plugin only for tags - search ajax suggestion feature to query terms on db - it need some work Learnpath: - refactor search engine pieces to use new tables search_engine_ref, specific_field and specific_field_values - add scorm and woogie index - remove search widget from lp list and use it from main/search - also, there are part on audios on lp items feature added
16 years ago
if(api_get_setting('search_enabled')=='true')
{
$form -> addElement ('checkbox', 'index_document','', get_lang('SearchFeatureDoIndexDocument'));
$specific_fields = get_specific_field_list();
foreach ($specific_fields as $specific_field) {
$form -> addElement ('text', $specific_field['code'], $specific_field['name'].' : ');
}
}
$form->addElement('style_submit_button','submit', get_lang('Send'),'class="save"');
$form->addElement('html', '<br /><br /><br />');
/*$list = get_zip_files_in_garbage();
if(count($list)>0){
$select_file_name = &$form->addElement('select','file_name',get_lang('Or').' '.api_strtolower(get_lang('UploadLocalFileFromGarbageDir')));
foreach($list as $file){
$select_file_name->addOption($file,$file);
}
$form->addElement('submit', 'submit', get_lang('Download'));
}
else{
$text_empty = &$form->addElement('text', 'empty', get_lang('Or').' '.api_strtolower(get_lang('UploadLocalFileFromGarbageDir')));
$defaults["empty"] = get_lang('Empty');
$text_empty->freeze();
}*/
$form->add_real_progress_bar('uploadScorm','user_file');
// the rules for the form
$form->addRule('user_file', '<div class="required">'.get_lang('ThisFieldIsRequired'), 'required');
// the default values for the form
[svn r17550] search: refactor search engine index and search interface and let learnpath follow it Search engine: - Index - use wrapper methods instead on calling xapian.php directly in most of callings - improve dokeos xapian-API - XapianIndexer - new methods: - replace_document() - remove_term_from_doc() - add_term_to_doc() - DokeosIndexer - new methods: - dokeos_preprocess_results() - Preprocess all results depending on the toolid - set_terms() - general interface for getting, comparing and set search engine terms - get_terms_on_db() - Get the terms stored at database (normal, no xapian) - more wrappers for XapianIndexer methods: dokeos_query_query(), dokeos_query_query(), dokeos_get_boolean_query(), dokeos_join_queries() - remove tags search engine feature to replace it with a new generic feature: specific fields - it let define xapian prefix terms dinamically to be included across dokeos index on each tool - move search engine document ID field from lp item table to a general man db table search_engine_ref - Search - use search_engine processor classes to change how process results depending of the dokeos tool - change interface for terms select at search: now use one multiple select foreach specific field instead of jquery thickbox plugin only for tags - search ajax suggestion feature to query terms on db - it need some work Learnpath: - refactor search engine pieces to use new tables search_engine_ref, specific_field and specific_field_values - add scorm and woogie index - remove search widget from lp list and use it from main/search - also, there are part on audios on lp items feature added
16 years ago
$defaults = array('index_document'=>'checked="checked"');
$form->setDefaults($defaults);
$form->display();
// footer
Display::display_footer();
?>