Skip to content
Snippets Groups Projects
Commit 954b5a90 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

dev #75882 refactoring CodificationListViewMode

parent 3f0dc8aa
Branches
Tags
3 merge requests!2711Dev#75882 minsoc faire des filtres sur des facettes et des domaines au moment de la recherche s2,!2707Tessadoc lost pass,!2699Dev#75882 minsoc faire des filtres sur des facettes et des domaines au moment de la recherche s2
Pipeline #4377 passed with stage
in 36 minutes and 36 seconds
......@@ -20,8 +20,27 @@
*/
class ZendAfi_Controller_Action_Helper_CodificationListViewMode extends ZendAfi_Controller_Action_Helper_AbstractListViewMode {
class ZendAfi_Controller_Action_Helper_CodificationListViewMode
extends ZendAfi_Controller_Action_Helper_AbstractListViewMode {
protected $_categories;
public function init() {
parent::init();
$this->_categories = [(new Class_CodifAnnexe)
->setLibelle($this->_('Annexes'))
->setController('site-browser'),
(new Class_CodifAuteur)
->setLibelle($this->_('Auteurs'))
->setController('author-browser'),
(new Class_CodifEmplacement)
->setLibelle($this->_('Emplacements'))
->setController('location-browser'),
(new Class_CodifThesaurus)
->setLibelle($this->_('Thesaurus'))
->setController('thesauri')];
}
public function codificationListViewMode($params) {
$this->_params = $params;
......@@ -64,10 +83,7 @@ class ZendAfi_Controller_Action_Helper_CodificationListViewMode extends ZendAfi_
public function getCategories() {
return [(new Class_CodifAnnexe)->setLibelle($this->_('Annexes')),
(new Class_CodifAuteur)->setLibelle($this->_('Auteurs')),
(new Class_CodifEmplacement)->setLibelle($this->_('Emplacements')),
(new Class_CodifThesaurus)->setLibelle($this->_('Thesaurus'))];
return $this->_categories;
}
......@@ -80,22 +96,7 @@ class ZendAfi_Controller_Action_Helper_CodificationListViewMode extends ZendAfi_
public function renderCategoryUrlParams($model) {
if($model instanceof Class_CodifThesaurus)
return ['module' => 'admin',
'controller' => 'thesauri'];
if($model instanceof Class_CodifAuteur)
return ['module' => 'admin',
'controller' => 'author-browser'];
if($model instanceof Class_CodifEmplacement)
return ['module' => 'admin',
'controller' => 'location-browser'];
if($model instanceof Class_CodifAnnexe)
return ['module' => 'admin',
'controller' => 'site-browser'];
return [];
return ['module' => 'admin',
'controller' => $model->getController()];
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment