コード例 #1
0
 /**
  *
  * @return string collection id
  * @throws Application_Util_BrowsingParamsException if requested collection is not accessible in search context
  */
 public function getCollectionId()
 {
     try {
         $collectionList = new Solrsearch_Model_CollectionList($this->_request->getParam('id'));
         return $collectionList->getCollectionId();
     } catch (Solrsearch_Model_Exception $e) {
         $this->log->debug($e->getMessage());
         throw new Application_Util_BrowsingParamsException($e->getMessage(), $e->getCode(), $e);
     }
 }
コード例 #2
0
ファイル: IndexController.php プロジェクト: alexukua/opus4
 private function prepareChildren()
 {
     $collectionList = null;
     try {
         $collectionList = new Solrsearch_Model_CollectionList($this->getRequest()->getParam('id'));
     } catch (Solrsearch_Model_Exception $e) {
         $this->_logger->debug($e->getMessage());
         return $this->_redirectToAndExit('index', '', 'browse', null, array(), true);
     }
     $this->view->collectionId = $collectionList->getCollectionId();
     $this->view->collectionRole = $collectionList->getCollectionRole();
     $this->view->children = $collectionList->getChildren();
     $this->view->parents = $collectionList->getParents();
     $translation = $this->view->translate($collectionList->getCollectionRoleTitle());
     if ($translation === $collectionList->getCollectionRoleTitle()) {
         $translation = $collectionList->getCollectionRoleTitlePlain();
     }
     $this->view->collectionRoleTitle = $translation;
     if ($collectionList->isRootCollection()) {
         $this->view->title = $translation;
     } else {
         $this->view->title = $collectionList->getTitle();
     }
     // Get the theme assigned to this collection iff usertheme is
     // set in the request.  To enable the collection theme, add
     // /usetheme/1/ to the URL.
     $usetheme = $this->getRequest()->getParam("usetheme");
     if (!is_null($usetheme) && 1 === (int) $usetheme) {
         $layoutPath = APPLICATION_PATH . '/public/layouts/' . $collectionList->getTheme();
         if (is_readable($layoutPath . '/common.phtml')) {
             $this->_helper->layout->setLayoutPath($layoutPath);
         } else {
             $this->_logger->debug("The requested theme '" . $collectionList->getTheme() . "' does not exist - use default theme instead.");
         }
     }
 }
コード例 #3
0
 public function testCollectionRoleTitle()
 {
     $rootCollection = $this->getRootCollection(1);
     $collectionList = new Solrsearch_Model_CollectionList($rootCollection->getId());
     $collectionList->getCollectionRoleTitle();
 }