/** * 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->menu) { $default = $this->project->getDefaultTrackId(); if ($default) { if ($this->respondent->getReceptionCode()->isSuccess()) { $track = $this->loader->getTracker()->getTrackEngine($default); if ($track->isUserCreatable()) { $list = $this->menu->getMenuList()->addByController('track', 'create', sprintf($this->_('Add %s track to this respondent'), $track->getTrackName()))->addParameterSources(array(\Gems_Model::TRACK_ID => $default, 'gtr_id_track' => $default, 'track_can_be_created' => 1), $this->request); $this->onEmpty = $list->getActionLink('track', 'create'); } } } if (!$this->onEmpty) { if ($this->respondent->getReceptionCode()->isSuccess()) { $list = $this->menu->getMenuList()->addByController('track', 'show-track', $this->_('Add a track to this respondent'))->addParameterSources($this->request); $this->onEmpty = $list->getActionLink('track', 'show-track'); } else { $this->onEmpty = \MUtil_Html::create('em', $this->_('No valid tokens found')); } } } return parent::hasHtmlOutput(); }