/** * Renders a human-readable representation of a river item * * @param ElggRiverItem $item A river item object * @param array $vars An array of variables for the view * * @return string returns empty string if could not be rendered */ function elgg_view_river_item($item, array $vars = array()) { if (!$item instanceof ElggRiverItem) { return ''; } // checking default viewtype since some viewtypes do not have unique views per item (rss) $view = $item->getView(); if (!$view || !elgg_view_exists($view, 'default')) { return ''; } $subject = $item->getSubjectEntity(); $object = $item->getObjectEntity(); if (!$subject || !$object) { // subject is disabled or subject/object deleted return ''; } // @todo this needs to be cleaned up // Don't hide objects in closed groups that a user can see. // see https://github.com/elgg/elgg/issues/4789 // else { // // hide based on object's container // $visibility = Elgg_GroupItemVisibility::factory($object->container_guid); // if ($visibility->shouldHideItems) { // return ''; // } // } $vars['item'] = $item; return elgg_view('river/item', $vars); }
/** * Renders a human-readable representation of a river item * * @param ElggRiverItem $item A river item object * @param array $vars An array of variables for the view * * @return string|false Depending on success */ function elgg_view_river_item($item, array $vars = array()) { // checking default viewtype since some viewtypes do not have unique views per item (rss) if (!$item || !$item->getView() || !elgg_view_exists($item->getView(), 'default')) { return ''; } $subject = $item->getSubjectEntity(); $object = $item->getObjectEntity(); if (!$subject || !$object) { // subject is disabled or subject/object deleted return ''; } $vars['item'] = $item; return elgg_view('river/item', $vars); }