From bc95c25d96c872aeb70af4d514277b1ccbe5f026 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sun, 28 Feb 2016 01:16:13 +0100 Subject: [PATCH] ActionController: provide central table helpers --- application/controllers/ListController.php | 13 ------------- .../Director/Web/Controller/ActionController.php | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index 8f2eb8fc..d29b908d 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -179,17 +179,4 @@ class ListController extends ActionController // $api->wipeInactiveStages(); } } - - protected function prepareTable($name) - { - $table = $this->loadTable($name)->setConnection($this->db()); - $this->view->filterEditor = $table->getFilterEditor($this->getRequest()); - $this->view->table = $this->applyPaginationLimits($table); - return $this; - } - - protected function prepareAndRenderTable($name) - { - $this->prepareTable($name)->render('table'); - } } diff --git a/library/Director/Web/Controller/ActionController.php b/library/Director/Web/Controller/ActionController.php index d71724c2..0ac0b008 100644 --- a/library/Director/Web/Controller/ActionController.php +++ b/library/Director/Web/Controller/ActionController.php @@ -147,6 +147,19 @@ abstract class ActionController extends Controller return $this->view->tabs; } + protected function prepareTable($name) + { + $table = $this->loadTable($name)->setConnection($this->db()); + $this->view->filterEditor = $table->getFilterEditor($this->getRequest()); + $this->view->table = $this->applyPaginationLimits($table); + return $this; + } + + protected function prepareAndRenderTable($name) + { + $this->prepareTable($name)->render('list/table', null, true); + } + protected function api($endpointName = null) { if ($this->api === null) {