/** * Display block content * * @return string HTML */ public function display($pub = NULL, $manifest = NULL, $viewname = 'edit', $blockId = 0) { // Set block manifest if ($this->_manifest === NULL) { $this->_manifest = $manifest ? $manifest : self::getManifest(); } // Register blockId $this->_blockId = $blockId; if ($viewname == 'curator') { // Output HTML $view = new \Hubzero\Component\View(array('name' => 'curation', 'layout' => 'block')); } else { $name = $viewname == 'freeze' ? 'freeze' : 'draft'; // Output HTML $view = new \Hubzero\Plugin\View(array('folder' => 'projects', 'element' => 'publications', 'name' => $name, 'layout' => 'wrapper')); } // Get block status $status = $pub->curation('blocks', $blockId, 'status'); $status->review = $pub->curation('blocks', $blockId, 'review'); // Get block element model $elModel = new \Components\Publications\Models\BlockElements($this->_parent->_db); // Properties object $master = new stdClass(); $master->block = $this->_name; $master->blockId = $this->_blockId; $master->params = $this->_manifest->params; $master->props = $elModel->getActiveElement($status->elements, $status->review); $view->manifest = $this->_manifest; $view->content = self::buildContent($pub, $viewname, $status, $master); $view->pub = $pub; $view->active = $this->_name; $view->step = $blockId; $view->showControls = isset($master->params->collapse_elements) && $master->params->collapse_elements == 1 ? 3 : 1; $view->status = $status; $view->master = $master; if ($this->getError()) { $view->setError($this->getError()); } return $view->loadTemplate(); }