diff --git a/wire/modules/Process/ProcessPageType/ProcessPageType.module b/wire/modules/Process/ProcessPageType/ProcessPageType.module index 460fd595..8bc6fe0d 100644 --- a/wire/modules/Process/ProcessPageType/ProcessPageType.module +++ b/wire/modules/Process/ProcessPageType/ProcessPageType.module @@ -139,7 +139,10 @@ class ProcessPageType extends Process implements ConfigurableModule, WirePageEdi } public function ___executeList() { - return $this->renderList("limit=25, status<" . Page::statusMax); + $templateID = (int) $this->wire('input')->get('templates_id'); + if(!$templateID) $templateID = (int) $this->wire('session')->get($this->className() . 'TemplatesID'); + $selector = $templateID ? "templates_id=$templateID, " : ""; + return $this->renderList($selector . "limit=25, status<" . Page::statusMax); } /** @@ -398,15 +401,19 @@ class ProcessPageType extends Process implements ConfigurableModule, WirePageEdi $field->attr('id+name', 'templates_id'); $field->label = $this->_('Filter by Template'); $field->addOption('', $this->_('Show All')); + $field->icon = 'filter'; $field->collapsed = Inputfield::collapsedBlank; + + $templates = $this->pages instanceof PagesType ? $this->pages->getTemplates() : array(); + if(!count($templates)) $templates = $this->wire('templates'); - foreach($this->templates as $template) { + foreach($templates as $template) { $field->addOption($template->id, $template->name); } $filterName = $this->className . 'TemplatesID'; - if(isset($this->input->get->templates_id)) { - $this->session->set($filterName, (int) $this->input->get->templates_id); + if(isset($_GET['templates_id'])) { + $this->session->set($filterName, (int) $this->input->get('templates_id')); } $filterValue = (int) $this->session->$filterName; diff --git a/wire/modules/Process/ProcessUser/ProcessUser.module b/wire/modules/Process/ProcessUser/ProcessUser.module index 6a22e60e..420716c4 100644 --- a/wire/modules/Process/ProcessUser/ProcessUser.module +++ b/wire/modules/Process/ProcessUser/ProcessUser.module @@ -44,7 +44,7 @@ class ProcessUser extends ProcessPageType { } protected function useLister() { - return true; + return $this->wire('user')->hasPermission('page-lister'); } /**