use_ke_calendar) { $subject_filter = array('subjects'=>split(",",$vars['entity']->subjects)); } if ($vars['entity']->subjects) { $subjects = $vars['entity']->subjects; } else { $user_id = get_loggedin_user()->getGUID(); $uo = get_user($user_id); $subjects = $uo->subjects; // If there are no subjects coming from user side, set it not to use filter at all if ($subjects) { // See if the value is an array of subjects or just a string if (is_array($subjects)) $subject_filter = array('subjects' => $subjects); else $subject_filter = array('subjects' => array($subjects)); } else { $subject_filter = array(); } } echo elgg_view("koolielu/calendar_view", array("year" => date("Y", time()), "month" => date("n", time()), "is_small" => true, "subject_filter" => $subject_filter, "is_scrollable" => true) ); ?>