getNumberOfAttachments() > 0) { $show_all_download = true; } } class CollectionView extends FieldsView { public function generate_view($obj, $parts = null) { global $show_all_download, $CONFIG; $c = ""; /*description begin*/ // TODO: if desc in current lang is empty but filled in some other... $ed = $obj->get("educationalDescription", get_current_language()); $trans = elgg_echo("koolielu:educationalDescription"); if ( $trans == "koolielu:educationalDescription" ) $trans = 'Educational description'; $c .= '
'; $c .= ''; $c .= '
'; $c .= $ed[0]; $c .= '
'; $c .= '
'; /*description end*/ $c .= '
'; $fi = $obj->getItems(); $ids = array_keys($fi); $wl = waramu_list_resources($ids, true, false, array('silent_err'=>1, 'cp' => mycp, 'showall' => true )); if (!$wl) { $c .= '

'; /*translation:There are no resources in this collection!*/ $c .= ''.elgg_echo("koolielu:no_resources_in_collection").''; $c .= '

'; } else { $c .= $wl; } $c .= '
'; if ($show_all_download) { /*translation:Download collection*/ $c .= "url."mod/waramu/download.php?rid=".$obj->uid."&all=1\" title=\"".elgg_echo("koolielu:download_collection")."\">"; $c .= elgg_echo("koolielu:download_collection").""; } /* keywords begin */ $kws = $obj->get("keywords", get_current_language()); $trans = elgg_echo("koolielu:keywords"); if ( $trans == "koolielu:keywords" ) $trans = 'Keywords'; $c .= '
'; $c .= ''; $c .= '
'; $x = 0; foreach ($kws as $kw) { $c .= $kw[0]; if ($x+1!=count($kws)) $c .= ", "; $x = $x + 1; } $c .= '
'; $c .= '
'; /* keywords end */ /* curriculumSubject begin */ $name = 'curriculumSubject'; $w = waramu_get(); $ftype = 'MultiInteger'; $fixedVoc = 0; $voc = 0; $lang = null; $c .= '
'; $trans = elgg_echo("koolielu:".$name); if ( $trans == "koolielu:".$name ) $trans = 'Curriculum subject'; $c .= ''; $c .= '
'; $viewParams = array( 'mode' => 'view', '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, $viewParams); } else { $c .= elgg_view('waramu/field_'.$ftype, $viewParams); } $c .= '
'; $c .= '
'; /*curriculumSubject end*/ /*agerange begins */ $fname = 'minmax'; $viewParams = array( 'object' => $obj, 'left' => waramu_getField('min'), 'right' => waramu_getField('max'), 'mode' => 'view' ); $c .= '
'; /*translation:Agerange: minimum and maximum*/ $c .= ''; $c .= '
'; $c .= elgg_view('waramu/field_'.$fname, $viewParams); $c .= '
'; $c .= '
'; /*agerange ends */ $c .= $parts['files']; return $c; } public function comments_and_moderate($obj) { if ( !$obj->isPublished() && (isModerator($obj_subjects))) { return "

" . elgg_view('koolielu/ke_review_object', array('action' => 'waramu/reviewPending', 'resourceid' => $obj->uid)) . "

"; } } } ?>