From fd8c90f6b6a124139e22232a8c433a55a0cba6ee Mon Sep 17 00:00:00 2001 From: Aimeos Date: Fri, 11 Dec 2015 09:27:09 +0100 Subject: [PATCH] Use navigation partial instead of inheritance The styling should be determined by the package view --- client/jqadm/templates/base-default.php | 72 ------------ .../common/partials/navigation-default.php | 105 +++++++----------- .../common/partials/pagination-default.php | 66 +++++++++++ .../jqadm/templates/product/item-default.php | 6 +- .../jqadm/templates/product/list-default.php | 14 +-- 5 files changed, 115 insertions(+), 148 deletions(-) delete mode 100644 client/jqadm/templates/base-default.php create mode 100644 client/jqadm/templates/common/partials/pagination-default.php diff --git a/client/jqadm/templates/base-default.php b/client/jqadm/templates/base-default.php deleted file mode 100644 index 3c7103e1a7..0000000000 --- a/client/jqadm/templates/base-default.php +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - Aimeos administration interface - - - - - - -block()->get( 'jqadm_styles' ); ?> - - - - -block()->get( 'jqadm_content' ); ?> - - - - - -block()->get( 'jqadm_scripts' ); ?> - - \ No newline at end of file diff --git a/client/jqadm/templates/common/partials/navigation-default.php b/client/jqadm/templates/common/partials/navigation-default.php index 3cadc11f6c..89c865fca3 100644 --- a/client/jqadm/templates/common/partials/navigation-default.php +++ b/client/jqadm/templates/common/partials/navigation-default.php @@ -1,66 +1,45 @@ -encoder(); - -$target = $this->config( 'client/jqadm/url/search/target' ); -$controller = $this->config( 'client/jqadm/url/search/controller', 'jqadm' ); -$action = $this->config( 'client/jqadm/url/search/action', 'search' ); -$config = $this->config( 'client/jqadm/url/search/config', array() ); - -$params = $this->param(); - -$total = $this->get( 'total', 0 ); -$offset = max( $this->param( 'page/offset', 0 ), 0 ); -$limit = max( $this->param( 'page/limit', 100 ), 1 ); - -$first = ( $offset > 0 ? 0 : null ); -$prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); -$next = ( $offset + $limit < $total ? $offset + $limit : null ); -$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); - -$pageCurrent = floor( $offset / $limit ) + 1; -$pageTotal = ( $total != 0 ? ceil( $total / $limit ) : 1 ); - -?> - + +block()->get( 'jqadm_content' ); ?> diff --git a/client/jqadm/templates/common/partials/pagination-default.php b/client/jqadm/templates/common/partials/pagination-default.php new file mode 100644 index 0000000000..3cadc11f6c --- /dev/null +++ b/client/jqadm/templates/common/partials/pagination-default.php @@ -0,0 +1,66 @@ +encoder(); + +$target = $this->config( 'client/jqadm/url/search/target' ); +$controller = $this->config( 'client/jqadm/url/search/controller', 'jqadm' ); +$action = $this->config( 'client/jqadm/url/search/action', 'search' ); +$config = $this->config( 'client/jqadm/url/search/config', array() ); + +$params = $this->param(); + +$total = $this->get( 'total', 0 ); +$offset = max( $this->param( 'page/offset', 0 ), 0 ); +$limit = max( $this->param( 'page/limit', 100 ), 1 ); + +$first = ( $offset > 0 ? 0 : null ); +$prev = ( $offset - $limit >= 0 ? $offset - $limit : null ); +$next = ( $offset + $limit < $total ? $offset + $limit : null ); +$last = ( ((int) ($total / $limit)) * $limit > $offset ? ((int) ($total / $limit)) * $limit : null ); + +$pageCurrent = floor( $offset / $limit ) + 1; +$pageTotal = ( $total != 0 ? ceil( $total / $limit ) : 1 ); + +?> + diff --git a/client/jqadm/templates/product/item-default.php b/client/jqadm/templates/product/item-default.php index d51fe04455..ce0ba753df 100644 --- a/client/jqadm/templates/product/item-default.php +++ b/client/jqadm/templates/product/item-default.php @@ -27,7 +27,7 @@ $listParam = array(); ?> -block()->start( 'jqadm_content' ); ?> +partial( $this->config( 'client/jqadm/partial/navigation', 'common/partials/navigation-default.php' ), array() ); ?>
@@ -143,7 +143,3 @@
- -block()->stop(); ?> - -render( 'base-default.php' ); ?> diff --git a/client/jqadm/templates/product/list-default.php b/client/jqadm/templates/product/list-default.php index a2f8f66a5a..1742311d85 100644 --- a/client/jqadm/templates/product/list-default.php +++ b/client/jqadm/templates/product/list-default.php @@ -39,14 +39,14 @@ 'filterOperators' => $this->get( 'filterOperators', array() ), ); -$navParams = array( 'total' => $this->get( 'total', 0 ) ); -$nav = $this->partial( $this->config( 'client/jqadm/partial/navigation', 'common/partials/navigation-default.php' ), $navParams ); +$pageParams = array( 'total' => $this->get( 'total', 0 ) ); +$pagination = $this->partial( $this->config( 'client/jqadm/partial/pagination', 'common/partials/pagination-default.php' ), $pageParams ); $default = $this->config( 'client/jqadm/product/fields', array( 'product.status', 'product.typeid', 'product.code', 'product.label' ) ); $fields = $this->param( 'fields', $default ); ?> -block()->start( 'jqadm_content' ); ?> +partial( $this->config( 'client/jqadm/partial/navigation', 'common/partials/navigation-default.php' ), array() ); ?>
partial( $this->config( 'client/jqadm/partial/filter', 'common/partials/filter-default.php' ), $filterParams ); ?> @@ -64,7 +64,8 @@
- + + @@ -201,8 +202,5 @@
- - -block()->stop(); ?> -render( 'base-default.php' ); ?> +