/** * Return the views output * * @param KViewContext $context A view context object * @return string The output of the view */ protected function _actionRender(KViewContext $context) { $pages = $this->getObject('com://site/docman.model.pages')->fetch(); // Only render if there is a menu item to DOCman AND we have categories to display if (count($pages) && $context->parameters->total) { return parent::_actionRender($context); } return ''; }
/** * Return the views output * * @param KViewContext $context A view context object * @return string The output of the view */ protected function _actionRender(KViewContext $context) { $params = $this->getParameters(); $pages = $this->getObject('com://site/docman.model.pages')->fetch(); // Only render if there is a menu item to DOCman AND we have documents or displaying a user's own documents if (count($pages)) { if (count($context->data->documents) || ($params->own && $this->getObject('user')->getId())) { if ($params->layout) { $this->setLayout($params->layout); } return parent::_actionRender($context); } } return ''; }