"; $c .= "wwwroot}pg/waramu/browse/curriculumSubject/{$css->eid}\">" . $css->title . ""; } $c .= "
"; $c .= '
'.getCurriculumDescription($page[2]).'
'; } $browsed_by = false; $w = waramu_get(); $browser_subject = null; /* have field to browse by */ if ( count($page) > 1 && strlen($page[1]) > 0) { $c .= "
"; /*translation:Browsing by */ //$c .= elgg_echo("koolielu:lr_browse_by"); //$c .= " "; $showVocabulary = false; $showList = false; $vocField = ""; $sort = ""; $sort_val = "created"; //default sort term if ( get_input('sortValue') ) { $sort_val = get_input('sortValue'); $_SESSION['sortTerm'] = $sort_val; } else if ( $_SESSION['sortTerm'] ){ $sort_val = $_SESSION['sortTerm']; } if ($sort_val == "created") { // if sorting by date, get newest before $sort = "<_sort param=\"descending\">".$sort_val.""; } else if ($sort_val == "title") { $sort = "<_sort lang=\"et\">".$sort_val.""; } $q = '<'.'?xml version="1.0" encoding="UTF-8"?'.'>'; // // 317250 // 322601 // $q = ''; for ($i=1; $icount($page) ) { $showVocabulary = true; $vocField = $fname; } else { if ( $fname == 'curriculumSubject' ) { $cs = getCurriculumSubject($fval); $cs = $cs[0]; $browser_subject = $cs->eid; $q .= '\t'.(($cs->eid)-1).'\n'; $q .= '\t'.$cs->end.'\n'; $browsed_by = 'curriculumSubject/'.$fval; } else { $q .= "\t<".$fname.">".$fval."\n"; $browsed_by = $fval; } $showList = true; } } $q .= $sort; $q .= "*"; $q .= ''; $c .= "
"; if ( $showVocabulary ) { //$c .= "showing tagcloud for field: ".$vocField; $vocLink = $vocField."/"; if ( $fval ) { $vocLink = ""; $lvoc = getCurriculumChildren($fval); if ($lvoc) { $subcount = array(); foreach ( $lvoc as $v ) { $qc = ''; $qc .= "".($v->start-2).""; $qc .= "".($v->end+1).""; $qc .= "*"; $qc .= ""; $resp = $w->listIdentifiers("", $qc); $idefs = (int)$resp['count'][0][0]; if ( $idefs > $smax ) $smax = $idefs; if ( $idefs < $smin ) $smin = $idefs; $subcount[] = array($idefs, $v, $v->title, $idefs); } foreach($subcount as $sub) { $tag = $sub[2]; $tac = $sub[0]; $siz = round((log($tac) / log($smax)) * 100) + 60; $c .= "wwwroot . "pg/waramu/browse/curriculumSubject/".$sub[1]->eid."\" style=\"font-size:".$siz."%\" title=\"{$tag} ({$sub[3]})\">".$tag." ({$sub[3]})"; $c .= " "; } $c .= "

"; } } else { // main subjects $mainsubjects .= "
"; $subcount = array(); $smax = -1; $smin = 9999999; foreach( getSubjects() as $sub => $v) { $s = getCurriculumSubject($sub); $q = ''; $q .= "".$s[0]->start.""; $q .= "".$s[0]->end.""; $q .= "*"; $q .= ""; $resp = $w->listIdentifiers("", $q); $idefs = (int)$resp['count'][0][0]; if ( $idefs > $smax ) $smax = $idefs; if ( $idefs < $smin ) $smin = $idefs; $subcount[] = array($idefs, $sub, $s[0]->title, $idefs); } foreach($subcount as $sub) { $tag = $sub[2]; $tac = $sub[0]; $siz = round((log($tac) / log($smax)) * 100) + 60; $mainsubjects .= "wwwroot . "pg/waramu/browse/curriculumSubject/".$sub[1]."\" style=\"font-size:".$siz."%\" title=\"{$tag} ({$sub[3]})\">".$tag." ({$sub[3]})"; $mainsubjects .= " "; } $mainsubjects .= "
"; $c .= $mainsubjects; //$lvoc = getCurriculumChildren(); // SEARCH $c .= elgg_view('object/search'); $c .= elgg_view('waramu/latest'); } } if ( $showList ) { $rawids = $w->listIdentifiers("", $q); $rids = $rawids['identifiers'][0]['id']; $new_ids = array(); foreach ($rids as $rid) { $new_ids []= $rid[0]; } $sort_vals = array('created', 'download', 'favorites', 'title'); $c .= elgg_view('object/listing_header',array('ids'=>$new_ids, 'sort_val'=>$sort_val, 'sort_vals'=>$sort_vals, 'show_count'=>1)); if ( $vocField == 'curriculumSubject' ) { } else { } } $c .= "
"; $c .= "
"; } $t = elgg_view("waramu/subjectBrowser", array('selected' => $browser_subject)); $body = elgg_view_layout('two_column_left_sidebar', "", $c, $t); page_draw($title, $body); ?>