?'; $htitle = elgg_echo('koolielu:'.$id); $help .= '
'; /*translation:Help*/ $help .= '
'.elgg_echo('koolielu:Help').'
'; $help .= '
'; $help .= '
'.$htitle.'
'; $help .= $text.'
'; $help .= '
'; return $help; } $c = << function clearAllFields() { $('#searchform input[type=text]').val(''); $('#searchform select').attr('selectedIndex', '0'); $('#searchform input[type=checkbox]').attr('checked', false); $('#not_older_than').val(''); $('#not_newer_than').val(''); } EOD; $creator_field = array('description' => array( '@attributes'=> array( 'type' => 'creator', 'vocabulary' => 0, 'autovalue' => 0, 'fixedVocabulary' => 0), /*translation:Creator*/ 'title' => array(array(elgg_echo("koolielu:Creator"))))); $fnames = array('language', 'keywords', 'lotype', 'license', 'curriculumSubject', 'creator', 'vauthor'); $c .= elgg_view('input/text', array('internalname' => '_fulltext', 'value' => $b->get('_fulltext'), 'class' => 'fti_search_input')); $c .= ""; $w = waramu_get(); foreach ($fnames as $name) { if ($name == 'creator') $field = $creator_field; else $field = waramu_getField($name); $c .= ""; $trans = elgg_echo("koolielu:".$name); if ( $trans == "koolielu:".$name ) $trans = $field['description']['title'][0][0]; $helptext = elgg_echo('koolielu:'.$name.'_search_helptext'); $c .= ""; $c .= ""; } $nn = ''; /*translation:Created search helptext*/ $helptext = elgg_echo("koolielu:created_search_helptext"); /*translation:Created*/ $nn .= ''; $nn .= ''; $nn .= ''; $c .= $nn; /*tra nslation:Types*/ /* $c .= ''; */ $c .= "
".elgg_echo($trans).":".fieldhelp($name, $helptext).""; $ftype = $field['description']['@attributes']['type']; $voc = $field['description']['@attributes']['vocabulary']; $autoval = $field['description']['@attributes']['autovalue']; $fixedVoc = $field['description']['@attributes']['fixedVocabulary']; $lang = null; $obj = null; $params = array( 'mode' => 'search', 'waramu' => $w, 'fieldname' => $name, 'fieldtype' => $ftype, 'fixedVocabulary' => $fixedVoc, 'vocabulary' => $voc, 'language' => $lang, 'object' => $obj, 'b' => $b ); if ( elgg_view_exists('waramu/field_'.$name) ) { $c .= elgg_view('waramu/field_'.$name, $params); } else if (elgg_view_exists('waramu/field_'.$ftype)) { $c .= elgg_view('waramu/field_'.$ftype, $params); } else { $c .="oops".$ftype; } $c .= "
'.elgg_echo("koolielu:created").':'.fieldhelp("created", $helptext).''; $sdb = $b->get('not_older_than'); if (!$sdb) $sdb = ''; $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 = $b->get('not_newer_than'); if (!$sdb) $sdb = ''; $nn .= elgg_view('input/dateselection', array('only_historic' => true, 'reverse' => true, 'internalname' => 'not_newer_than', 'value' => $sdb)); $nn .= '
'.elgg_echo('koolielu:advsearch_types').':'; $c .= '
'; $filters = $CONFIG->curriculum_config['filters']; foreach ($filters as $filter) { if (!$filter['active']) continue; $checked = ""; if ( !$b->get('filter') || $b->isFilter($filter['code'])) $checked = 'checked="checked" '; $c .= "
"; $c .= ''; $c .= elgg_echo($filter['title']); $c .= "
"; } $c .= '
"; $c .= '
'; foreach ($CONFIG->curriculum_config['annotations'] as $name => $anno) { if (!$anno['search']) continue; $c .= "
"; $checked = ''; if ($b->get(':'.$name)) $checked = 'checked="checked" '; $c .= ' '; $c .= elgg_echo($anno['title']); $c .= fieldhelp($name, elgg_echo($anno['help'])); $c .= "
"; } $c .= '
'; $class_from_age_range = array( /*translation:pre-school education*/ elgg_echo('koolielu:preschool'), /*translation:pre-school education*/ elgg_echo('koolielu:preschool'), /*translation:pre-school education*/ elgg_echo('koolielu:preschool'), /*translation:pre-school education*/ elgg_echo('koolielu:preschool'), /*translation:pre-school education*/ elgg_echo('koolielu:preschool'), /*translation:pre-school education*/ elgg_echo('koolielu:preschool'), /*translation:pre-school education*/ elgg_echo('koolielu:preschool'), /*translation:1st grade*/ elgg_echo('koolielu:1st_grade'), /*translation:2nd grade*/ elgg_echo('koolielu:2nd_grade'), /*translation:3rd grade*/ elgg_echo('koolielu:3rd_grade'), /*translation:4th grade*/ elgg_echo('koolielu:4th_grade'), /*translation:5th grade*/ elgg_echo('koolielu:5th_grade'), /*translation:6th grade*/ elgg_echo('koolielu:6th_grade'), /*translation:7th grade*/ elgg_echo('koolielu:7th_grade'), /*translation:8th grade*/ elgg_echo('koolielu:8th_grade'), /*translation:9th grade*/ elgg_echo('koolielu:9th_grade'), /*translation:10th grade*/ elgg_echo('koolielu:10th_grade'), /*translation:11th grade*/ elgg_echo('koolielu:11th_grade'), /*translation:12th grade*/ elgg_echo('koolielu:12th_grade'), /*translation:adult education*/ elgg_echo('koolielu:adult_educ'), /*translation:adult education*/ elgg_echo('koolielu:adult_educ') ); $s_min = 0; if ( $_SESSION['min'] ) $s_min = $_SESSION['min']; $s_max = 20; if ( $_SESSION['max'] ) $s_max = $_SESSION['max']; $viewParams = array( /*translation:Agerange*/ 'label' => elgg_echo('koolielu:Agerange').':?', 'min' => 0, 'max' => 20, 'left' => $s_min, 'right' => $s_max, 'object' => false, 'mode' => 'edit', 'ranges' => $class_from_age_range, 'b' => $b ); /*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 .= '
'; /*translation:Search*/ $c .= elgg_view('input/submit', array('internalname' => 'submit', 'value' => elgg_echo('koolielu:Search'))); /*translation:Clear fields*/ $c .= ""; $f = elgg_view('input/form', array('action' => "{$CONFIG->wwwroot}action/waramu/advsearchx", 'body' => $c, 'internalid'=>'searchform')); echo $f; ?>