getGUID(); set_page_owner($user_guid); if ($tag) { $tag = urldecode($tag); $rcids = get_entities_from_metadata("tags", $tag, "object", "collection", $user_guid, 9999); } else { $rcids = get_entities("object", "collection", $user_guid, "", 9999); } } else { if ($tag) { $tag = urldecode($tag); $rcids = get_entities_from_metadata("tags", $tag, "object", "collection", 0, 9999); } else if ($wid) { $rcids = get_entities_from_metadata("resources", $wid, "object", "collection", 0, 9999); } else { $rcids = get_entities("object", "collection", 0, "", 9999); } } $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']; } $cids = array(); $acids = array(); foreach ($rcids as $rcid) { $cids []= array('entity'=>$rcid, 'created'=>$rcid->time_created, 'updated'=>$rcid->time_updated, 'title'=>$rcid->title, 'resources'=>count($rcid->resources)); } $desc = false; if ($sort_val == 'title') $desc = true; sksort($cids, $sort_val, $desc); $scids = array(); foreach ($cids as $scid) { $scids []= $scid['entity']; } $sort_opts = array( /*translation:Created*/ 'created'=>elgg_echo('koolielu:sortby_Created'), /*translation:Updated*/ 'updated'=>elgg_echo('koolielu:sortby_Updated'), /*translation:Resources*/ 'resources'=>elgg_echo('koolielu:sortby_Resources'), /*translation:Title*/ 'title'=>elgg_echo('koolielu:sortby_Title') ); $collections = ""; /*translation:Collection collection has*/ $collections .= "
".elgg_echo("koolielu:collection_collection_has").": ".count($scids)."
"; /*translation:Sorted by*/ $collections .= "
".elgg_echo("koolielu:sortedby").": "; foreach ($sort_opts as $sot => $so) { if ($sort_val == $sot) $collections .= "".$so." "; else $collections .= "".$so." "; $soi++; } $collections .= "
"; $collections .= ""; $d_f = ""; $collections .= elgg_view('input/form', array('action' => "", "body" => $d_f, "internalname" => "sortform")); $offset = 0; if (get_input("offset")) $offset = get_input("offset"); $ents = array_slice($scids, $offset, 10); $collections .= elgg_view_entity_list($ents, count($scids), $offset, 10, 0, 0, 1); if (!$user_name && !$wid) { $url = $CONFIG->wwwroot . "pg/waramu/collections"; // display collections tagcloud $tagcloud = "
".ke_display_tagcloud($view='output/collections_tagcloud', $treshold=0, $limit=30, $metadata_name = "tags", $entity_type="object", $entity_subtype="collection")."

"; } if ($wid) { $obj = waramu_getResource('', $wid); $obj_url = $CONFIG->wwwroot . "pg/waramu/view/".$wid; /*translation:Resource*/ $text = "

".elgg_echo("koolielu:Resource"); $text .= " ". $obj->getTitle() . " "; /*translation:collections*/ $text .= elgg_echo("koolielu:collections") . "

"; $offset = 0; if (get_input("offset")) $offset = get_input("offset"); $ents = array_slice($scids, $offset, 10); $collections = $text . elgg_view_entity_list($ents, count($scids), $offset, 10, 0, 0, 1); } set_context('collections'); $body = elgg_view_layout('two_column_left_sidebar', '', $tagcloud . $collections); page_draw(NULL, $body); ?>