'1', 'subjects' => $subject, 'archived' => '0'), 'object', array('course'), '', 999999); } else { $objs = get_entities_from_metadata_and_subtypes(array('approved' => '1', 'archived' => '0'), 'object', array('course'), '', 999999); } // filter results $current_objs = array(); $current_time = time(); foreach($objs as $obj) { $obj_begin = $obj->beginning_date; $obj_end = $obj->ending_date; if ($begin && !$end) { // if only begin time given if ($obj_begin && ($obj_begin >= $begin)) $current_objs[] = $obj; } else if ($end && !$begin) { // if only end time given if ($obj_end && ($obj_end <= $end)) $current_objs[] = $obj; } else if ($begin && $end) { //if full period given if ($obj_begin && $obj_end && ($obj_begin >= $begin) && ($obj_end <= $end)) $current_objs[] = $obj; } else { //show all $current_objs[] = $obj; } } // display course subjects tagcloud $tagcloud = "
" . ke_display_tagcloud($view='output/subjects_tagcloud', $threshold=0, $limit=30, $metadata_name = "subjects", $entity_type="object", $entity_subtype="course", $owner_guid = "", $site_guid = -1, $only_approved = true) . "

"; $area2 .= $tagcloud; if ($subject) { $subjectobj = getSubject($subject); $subjectname = $subjectobj->title; /*translation:Browse by subject*/ $area2 .= elgg_echo("koolielu:Browse_by_subject") . ": " . $subjectname . "

"; } // let user choose period $period = "

"; /*translation:Period begins*/ $period .= elgg_echo("koolielu:label_period_begins") . "
"; $period .= elgg_view('input/dateselection', array('internalname' => 'begin', 'value' => $begin)); $period .= "

"; $period .= "

"; /*translation:Period ends*/ $period .= elgg_echo("koolielu:label_period_ends") . "
"; $period .= elgg_view('input/dateselection', array('internalname' => 'end', 'value' => $end)); $period .= "
"; $period .= elgg_view('input/hidden', array('internalname' => 'subject', 'value' => $subject)); /*translation:Filter*/ $period .= elgg_view('input/submit', array('internalname' => 'filter_button', 'value' => elgg_echo('koolielu:button_filter'))); /*translation:Reset filter*/ $period .= " " . elgg_view('input/submit', array('internalname' => 'reset_button', 'value' => elgg_echo('koolielu:button_reset_filter'))); $period .= "

"; $area2 .= elgg_view('input/form', array('action' => "{$CONFIG->wwwroot}action/poster/filter", 'body' => $period)); if (!empty($current_objs)) { $area2 .= elgg_view("koolielu/ke_rss_link_view"); $offset = get_input('offset'); if (!$offset) $offset = 0; $limit = 10; $slice = array_slice($current_objs, $offset, $limit); $area2 .= elgg_view_entity_list($slice, count($current_objs), $offset, 10, false, true, true); } /*translation:Courses*/ $page_title = elgg_echo('koolielu:Courses'); page_draw($page_title, elgg_view_layout("two_column_left_sidebar", $area1, $area2)) ?>