/** * Add pages that show the user an overview of the tracks / surveys used * in the project. * * @param string $label * @param array $other * @return \Gems_Menu_SubMenuItem */ public function addProjectPage($label) { if ($this->escort instanceof \Gems_Project_Tracks_SingleTrackInterface) { if ($trackId = $this->escort->getTrackId()) { $infoPage = $this->addPage($label, 'pr.project', 'project-tracks', 'show')->addHiddenParameter(\MUtil_Model::REQUEST_ID, $trackId); $trackSurveys = $infoPage; } else { $infoPage = $this->addPage($label, 'pr.project', 'project-tracks'); $trackSurveys = $infoPage->addShowAction('pr.project'); } $trackSurveys->addAction($this->_('Preview'), 'pr.project.questions', 'questions')->addNamedParameters(\MUtil_Model::REQUEST_ID, 'gro_id_track', \Gems_Model::SURVEY_ID, 'gsu_id_survey'); $infoPage->addAutofilterAction(); // \MUtil_Echo::track($infoPage->_toNavigationArray(array($this->_getOriginalRequest()))); } else { $infoPage = $this->addContainer($label); $tracksPage = $infoPage->addPage($this->_('Tracks'), 'pr.project', 'project-tracks'); $tracksPage->addAutofilterAction(); $trackSurveys = $tracksPage->addShowAction('pr.project'); $trackSurveys->addAction($this->_('Preview'), 'pr.project.questions', 'questions')->addNamedParameters(\MUtil_Model::REQUEST_ID, 'gro_id_track', \Gems_Model::SURVEY_ID, 'gsu_id_survey'); $surveysPage = $infoPage->addPage($this->_('Surveys'), 'pr.project', 'project-surveys'); $surveysPage->addAutofilterAction(); $surveysPage->addShowAction('pr.project'); } return $infoPage; }