?'; $htitle = elgg_echo('koolielu:'.$id); $help .= '
'; /*translation:Help*/ $help .= '
'.elgg_echo('koolielu:Help').'
'; $help .= '
'; $help .= '
'.$htitle.'
'; $help .= $text.'
'; $help .= '
'; return $help; } $w = waramu_get(); $c .= << function clearAllFields() { var flds = $('#searchform input, #searchform select'); var values = {}; flds.each(function() { if (jQuery.inArray(this.name, Array("fti_search_input","keywords","creator"))>=0) { this.value=""; } if (jQuery.inArray(this.name, Array("language","lotype","license","curriculumSubject"))>=0) { $('#'+this.name).children(':first').attr('selected','selected'); } if (jQuery.inArray(this.name, Array("competition","quality","independent","tiigrisupport"))>=0) { this.checked=""; } if (jQuery.inArray(this.name, Array("not_newer_than","not_older_than"))>=0) { this.value=""; $('#day_'+this.name).children(':first').attr('selected','selected'); $('#month_'+this.name).children(':first').attr('selected','selected'); $('#year_'+this.name).children(':first').attr('selected','selected'); } }); } EOD; // fti $fti_val = ""; if ( isset($_SESSION['searchTerm']) && $_SESSION['searchTerm']) $fti_val = $_SESSION['searchTerm']; $c .= elgg_view('input/text', array('internalname' => 'fti_search_input', 'value' => $fti_val, 'class' => 'fti_search_input')); $exclude = array('LREkeywords','mdLanguage','intendedEndUserRole','context','difficulty','lifestatus','interactionType'); $fields = getCombinedFieldList(); $combine = array(array('min', 'max')); $c .= ""; foreach ( $fields as $name => $field ) { $skipme = false; foreach($combine as $co) { if ( in_array($name, $co)) { $skipme = true; break; } } if ( $skipme || in_array($name, $exclude) ) continue; $printable = $field[0]; if ( $cls == "odd" ) { $cls = "even"; } else { $cls = "odd"; } $c .= ""; $trans = elgg_echo("koolielu:".$name); if ( $trans == "koolielu:".$name ) $trans = $printable; $helptext = elgg_echo('koolielu:'.$name.'_search_helptext'); $c .= ""; $c .= ""; } $cr = ''; /*translation:Creator search helptext*/ $helptext = elgg_echo("koolielu:creator_search_helptext"); /*translation:Creator*/ $cr .= ''; $cr .= ''; $c .= $cr; //creator // Author $cr = ''; /*translation:Author search helptext*/ $helptext = elgg_echo("koolielu:author_search_helptext"); /*translation:Author*/ $cr .= ''; $cr .= ''; $c .= $cr; //author $nn = ''; /*translation:Created search helptext*/ $helptext = elgg_echo("koolielu:created_search_helptext"); /*translation:Created*/ $nn .= ''; $nn .= ''; $nn .= ''; $c .= $nn; //TODO patch waramu $c .= $nn; $c .= "
".elgg_echo($trans).":".fieldhelp($name, $helptext).""; $ftype = $field['@attributes']['type']; $voc = $field['@attributes']['vocabulary']; $autoval = $field['@attributes']['autovalue']; $fixedVoc = $field['@attributes']['fixedVocabulary']; $lang = null; $obj = null; $params = array( 'mode' => 'search', 'waramu' => $w, 'fieldname' => $name, 'fieldtype' => $ftype, 'fixedVocabulary' => $fixedVoc, 'vocabulary' => $voc, 'language' => $lang, 'object' => $obj ); if ( elgg_view_exists('waramu/field_'.$name) ) { $c .= elgg_view('waramu/field_'.$name, $params); } else { $c .= elgg_view('waramu/field_'.$ftype, $params); } $c .= "
'.elgg_echo("koolielu:Creator").':'.fieldhelp("Creator", $helptext).''; $sdb = ""; if ($_SESSION['creator']) { $sdb = $_SESSION['creator']; } $lang = null; $obj = null; $params = array( 'mode' => 'search', 'waramu' => $w, 'fieldname' => "creator", 'fieldtype' => "creator", //'fixedVocabulary' => $fixedVoc, //'vocabulary' => $voc, 'language' => $lang, 'object' => $obj ); $cr .= elgg_view('waramu/field_creator', $params); $cr .= '
'.elgg_echo("koolielu:vauthor").':'.fieldhelp("Author", $helptext).''; $sdb = ""; if ($_SESSION['author']) { $sdb = $_SESSION['author']; } $lang = null; $obj = null; $params = array( 'mode' => 'search', 'waramu' => $w, 'fieldname' => "vauthor", 'fieldtype' => "vcard", //'fixedVocabulary' => $fixedVoc, //'vocabulary' => $voc, 'language' => $lang, 'object' => $obj ); $cr .= elgg_view('waramu/field_vCard', $params); $cr .= '
'.elgg_echo("koolielu:created").':'.fieldhelp("created", $helptext).''; $sdb = ""; //strtotime("-3 year"); if ($_SESSION['not_older_than']) { $sdb = $_SESSION['not_older_than']; } $nn .= elgg_view('input/dateselection', array('only_historic' => true, 'reverse' => true, 'internalname' => 'not_older_than', 'value' => $sdb)); /*translation:till*/ $nn .= " ".elgg_echo("koolielu:till")." "; $sdb = ""; //strtotime("NOW"); if ($_SESSION['not_newer_than']) { $sdb = $_SESSION['not_newer_than']; } $nn .= elgg_view('input/dateselection', array('only_historic' => true, 'reverse' => true, 'internalname' => 'not_newer_than', 'value' => $sdb)); $nn .= '
"; $ki .= '
'; $ki .= '
'; $ki .= '
'; $ki .= '
'; $ki .= '
'; $ki .= '
'; $ki .= ' elgg_echo('koolielu:Agerange').':?', 'min' => 0, 'max' => 20, 'left' => $s_min, 'right' => $s_max, 'object' => false, 'mode' => 'edit', 'ranges' => $class_from_age_range ); /*translation:Agerange helptext*/ $helptext = elgg_echo("koolielu:agerange_search_helptext"); $c .= fieldhelp('agerange', $helptext, false); $c .= '
'; /*translation:Agerange*/ $c .= "" . elgg_view('input/rangeselection', $viewParams) . ""; $c .= '
'; //buttons /*translation:Search*/ $c .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('koolielu:Search'))); /*translation:Clear fields*/ $c .= ""; echo elgg_view('input/form', array('action' => "{$CONFIG->wwwroot}action/waramu/advsearch", 'body' => $c, 'internalid'=>'searchform')); ?>