コード例 #1
0
ファイル: search.php プロジェクト: nadavkav/MoodleTAO
         }
     }
 }
 $mform->set_data($fromform);
 $mform->display();
 $fromform->search = isset($fromform->search) ? clean_param($fromform->search, PARAM_CLEAN) : clean_param(optional_param('search', '', PARAM_RAW), PARAM_CLEAN);
 $fromform->section = $section;
 $resources = array();
 // if we have an id then we must have come here from the add page
 if (!empty($fromform->id)) {
     $resources[] = taoresource_entry::get_by_id($fromform->id);
 } else {
     if ($id) {
         $resources[] = taoresource_entry::get_by_id($id);
     } else {
         $resources = taoresource_entry::search($fromform);
     }
 }
 //output results in same format as ims finder.php
 if ($resources) {
     $totalcount = count($resources);
     $baseurl = $CFG->wwwroot . "/mod/taoresource/search.php?course={$course->id}&section={$section}&type={$type}&add=taoresource&return={$return}&";
     // serialise the search query and append to the paging URI
     $search_parameters = '';
     foreach ($fromform as $fld => $val) {
         if (!in_array($fld, $exclude_inputs)) {
             if ($val === true) {
                 $val = 'true';
             } else {
                 if ($val === false) {
                     $val = 'false';