示例#1
0
 /**
  * Create a new ViewModel.
  *
  * @param array $params Parameters to pass to ViewModel constructor.
  *
  * @return \Zend\View\Model\ViewModel
  */
 protected function createViewModel($params = null)
 {
     $view = parent::createViewModel($params);
     $this->layout()->searchClassId = $view->searchClassId = $this->searchClassId;
     if (!is_null($this->driver)) {
         $view->driver = $this->driver;
     }
     return $view;
 }
示例#2
0
 /**
  * Create a new ViewModel.
  *
  * @param array $params Parameters to pass to ViewModel constructor.
  *
  * @return ViewModel
  */
 protected function createViewModel($params = null)
 {
     $view = parent::createViewModel($params);
     $view->searchClassId = $this->searchClassId;
     return $view;
 }
示例#3
0
 /**
  * Create a new ViewModel.
  *
  * @param array $params Parameters to pass to ViewModel constructor.
  *
  * @return \Zend\View\Model\ViewModel
  */
 protected function createViewModel($params = null)
 {
     $view = parent::createViewModel($params);
     $this->layout()->searchClassId = $view->searchClassId = $this->searchClassId;
     $view->driver = $this->loadRecord();
     return $view;
 }
示例#4
0
 /**
  * Create a new ViewModel with title.
  *
  * @param array $params Parameters to pass to ViewModel constructor.
  *
  * @return ViewModel
  */
 protected function createViewModel($params = null)
 {
     $view = parent::createViewModel($params);
     $view->title = $this->getVuDLConfig()->General->title;
     return $view;
 }
示例#5
0
 /**
  * Create a new ViewModel.
  *
  * @param array $params Parameters to pass to ViewModel constructor.
  *
  * @return \Zend\View\Model\ViewModel
  */
 protected function createViewModel($params = null)
 {
     $view = parent::createViewModel($params);
     // Set the current action.
     $currentAction = $this->getCurrentAction();
     if (!empty($currentAction)) {
         $view->currentAction = $currentAction;
     }
     // Initialize the array of top-level browse options.
     $browseOptions = [];
     // First option: tags -- is it enabled in config.ini?  If no setting is
     // found, assume it is active. Note that this setting is disabled if tags
     // are universally turned off.
     if ((!isset($this->config->Browse->tag) || $this->config->Browse->tag) && $this->tagsEnabled()) {
         $browseOptions[] = $this->buildBrowseOption('Tag', 'Tag');
         $view->tagEnabled = true;
     }
     // Read configuration settings for LC / Dewey call number display; default
     // to LC only if no settings exist in config.ini.
     if (!isset($this->config->Browse->dewey) && !isset($this->config->Browse->lcc)) {
         $lcc = true;
         $dewey = false;
     } else {
         $lcc = isset($this->config->Browse->lcc) && $this->config->Browse->lcc;
         $dewey = isset($this->config->Browse->dewey) && $this->config->Browse->dewey;
     }
     // Add the call number options as needed -- note that if both options exist,
     // we need to use special text to disambiguate them.
     if ($dewey) {
         $browseOptions[] = $this->buildBrowseOption('Dewey', $lcc ? 'browse_dewey' : 'Call Number');
         $view->deweyEnabled = true;
     }
     if ($lcc) {
         $browseOptions[] = $this->buildBrowseOption('LCC', $dewey ? 'browse_lcc' : 'Call Number');
         $view->lccEnabled = true;
     }
     // Loop through remaining browse options.  All may be individually disabled
     // in config.ini, but if no settings are found, they are assumed to be on.
     $remainingOptions = ['Author', 'Topic', 'Genre', 'Region', 'Era'];
     foreach ($remainingOptions as $current) {
         $option = strToLower($current);
         if (!isset($this->config->Browse->{$option}) || $this->config->Browse->{$option} == true) {
             $browseOptions[] = $this->buildBrowseOption($current, $current);
             $option .= 'Enabled';
             $view->{$option} = true;
         }
     }
     // CARRY
     if ($findby = $this->params()->fromQuery('findby')) {
         $view->findby = $findby;
     }
     if ($query = $this->params()->fromQuery('query')) {
         $view->query = $query;
     }
     if ($category = $this->params()->fromQuery('category')) {
         $view->category = $category;
     }
     $view->browseOptions = $browseOptions;
     return $view;
 }