/** * The place to check if the data set in the snippet is valid * to generate the snippet. * * When invalid data should result in an error, you can throw it * here but you can also perform the check in the * checkRegistryRequestsAnswers() function from the * {@see \MUtil_Registry_TargetInterface}. * * @return boolean */ public function hasHtmlOutput() { if ($this->trackEngine && !$this->trackId) { $this->trackId = $this->trackEngine->getTrackId(); } if ($this->trackId) { // Try to get $this->trackEngine filled if (!$this->trackEngine) { // Set the engine used $this->trackEngine = $this->loader->getTracker()->getTrackEngine($this->trackId); } } else { return false; } if (!$this->roundId) { $this->roundId = $this->request->getParam(\Gems_Model::ROUND_ID); } return $this->roundId && parent::hasHtmlOutput(); }
/** * The place to check if the data set in the snippet is valid * to generate the snippet. * * When invalid data should result in an error, you can throw it * here but you can also perform the check in the * checkRegistryRequestsAnswers() function from the * {@see \MUtil_Registry_TargetInterface}. * * @return boolean */ public function hasHtmlOutput() { if ($this->request->getParam($this->confirmParameter)) { $this->performAction(); $redirectRoute = $this->getRedirectRoute(); return empty($redirectRoute); } else { return parent::hasHtmlOutput(); } }
/** * Create the snippets content * * This is a stub function either override getHtmlOutput() or override render() * * @param \Zend_View_Abstract $view Just in case it is needed here * @return \MUtil_Html_HtmlInterface Something that can be rendered */ public function getHtmlOutput(\Zend_View_Abstract $view) { if ($table = parent::getHtmlOutput($view)) { if ($title = $this->getTitle()) { $htmlDiv = \MUtil_Html::div(array('renderWithoutContent' => false)); $htmlDiv->h3($title); $this->applyHtmlAttributes($table); $htmlDiv[] = $table; return $htmlDiv; } else { return $table; } } }
/** * Create the snippets content * * This is a stub function either override getHtmlOutput() or override render() * * @param \Zend_View_Abstract $view Just in case it is needed here * @return \MUtil_Html_HtmlInterface Something that can be rendered */ public function getHtmlOutput(\Zend_View_Abstract $view) { if ($this->tokenId) { if ($this->token->exists) { $htmlDiv = \MUtil_Html::div(); $htmlDiv->h3($this->getTitle()); $table = parent::getHtmlOutput($view); $this->applyHtmlAttributes($table); $htmlDiv[] = $table; return $htmlDiv; } else { $this->addMessage(sprintf($this->_('Token %s not found.'), $this->tokenId)); } } else { $this->addMessage($this->_('No token specified.')); } }