} $title = ''; break; case 'vocabularyimportlist': $showBc = true; $showVocabularyBc = true; $tab = true; break; case 'vocabuser': $showBc = true; $showVocabularyBc = true; $showVocabUserBc = true; if (!isset($vocabulary_has_user)) { $id = 'show' == $action ? $sf_params->get('id') : $paramId; if ($id) { $vocabulary_has_user = VocabularyHasUserPeer::retrieveByPK($id); } } $objectId = $vocabulary_has_user->getID(); if (!isset($vocabulary)) { $vocabulary = $vocabulary_has_user->getVocabulary(); } $tab = false; break; case 'concept': $showBc = true; $showVocabularyBc = true; $showConceptBc = true; if (!isset($concept)) { $id = 'show' == $action ? $sf_params->get('id') : $paramId; if ($id) {
public function getVocabularyCredentials($vocabularyId = false) { //$vocabularyId = sfContext::getInstance()->getRequest()->getParameter('id'); if ($this->isAuthenticated()) { if (!$this->hasCredential(array(0 => 'hasAgents'))) { $this->setHasAgents(); } if ($vocabularyId) { //make sure we've revoked the credentials -- we revoke, then set them every time the vocabulary is accessed $this->removeCredential('vocabularycontact'); $this->removeCredential('vocabularyregistrar'); $this->removeCredential('vocabularymaintainer'); $this->removeCredential('vocabularyadmin'); /* @var VocabularyHasUserPeer */ $vocabularyContact = VocabularyHasUserPeer::retrieveByPK($vocabularyId, $this->getSubscriberId()); if (isset($vocabularyContact)) { $this->addCredential('vocabularycontact'); if ($vocabularyContact->getIsRegistrarFor()) { $this->addCredential('vocabularyregistrar'); } if ($vocabularyContact->getIsMaintainerFor()) { $this->addCredential('vocabularymaintainer'); } if ($vocabularyContact->getIsAdminFor()) { $this->addCredential('vocabularyadmin'); } } } elseif ('create' == sfContext::getInstance()->getRequest()->getParameter('action')) { $this->addCredential('vocabularycontact'); $this->addCredential('vocabularyregistrar'); $this->addCredential('vocabularyadmin'); } } return; }