コード例 #1
0
 public function indexAction()
 {
     $user = OpenSKOS_Db_Table_Users::requireFromIdentity();
     $apiClient = new Editor_Models_ApiClient();
     $this->view->assign('conceptSchemes', $apiClient->getAllConceptSchemeUriTitlesMap());
     $this->view->assign('conceptSchemesId', $apiClient->getConceptSchemeMap('uri', 'uuid'));
     $this->view->assign('disableSearchProfileChanging', $user->disableSearchProfileChanging);
     $this->view->assign('exportForm', Editor_Forms_Export::getInstance());
     $this->view->assign('deleteForm', Editor_Forms_Delete::getInstance());
     $this->view->assign('changeStatusForm', Editor_Forms_ChangeStatus::getInstance());
     $this->view->assign('historyData', $user->getUserHistory());
     $this->view->assign('searchForm', Editor_Forms_Search::getInstance());
 }
コード例 #2
0
 /**
  * @return Editor_Forms_SearchOptions
  */
 protected function buildConceptSchemes()
 {
     $apiClient = new Editor_Models_ApiClient();
     $conceptSchemes = $apiClient->getAllConceptSchemeUriTitlesMap();
     $this->addElement('multiCheckbox', 'conceptScheme', array('label' => _('Concept schemes'), 'multiOptions' => $conceptSchemes));
     return $this;
 }
コード例 #3
0
ファイル: Search.php プロジェクト: rubensworks/OpenSKOS
 protected function buildAllowedConceptScheme()
 {
     $loggedUser = OpenSKOS_Db_Table_Users::requireFromIdentity();
     $userForSearch = $this->getUserForSearch();
     $userOptions = $userForSearch->getSearchOptions($loggedUser['id'] != $userForSearch['id']);
     $allowedConceptSchemes = array();
     if (isset($userOptions['searchProfileId'])) {
         $profilesModel = new OpenSKOS_Db_Table_SearchProfiles();
         $profile = $profilesModel->find($userOptions['searchProfileId'])->current();
         if (null !== $profile) {
             $profileOptions = $profile->getSearchOptions();
             $apiClient = new Editor_Models_ApiClient();
             $inCollections = array();
             if (isset($profileOptions['collections'])) {
                 $inCollections = $profileOptions['collections'];
             }
             $conceptSchemesInCollections = $apiClient->getAllConceptSchemeUriTitlesMap(null, $inCollections);
             if (!empty($profileOptions['conceptScheme'])) {
                 foreach ($profileOptions['conceptScheme'] as $allowedConceptSchemeUri) {
                     $allowedConceptSchemes[$allowedConceptSchemeUri] = $conceptSchemesInCollections[$allowedConceptSchemeUri];
                 }
             } else {
                 // If we don't have concept schemes checked - then all concept schemes in the collections are allowed.
                 $allowedConceptSchemes = $conceptSchemesInCollections;
             }
         }
     }
     $this->addElement('multiCheckbox', 'allowedConceptScheme', array('label' => _('Concept scheme'), 'multiOptions' => $allowedConceptSchemes));
     return $this;
 }