mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 16:24:43 +03:00
Do not use style path for pagination generation
This commit is contained in:
parent
84094ad38b
commit
7c1e123ad6
@ -29,10 +29,9 @@ use Handlebars\Template;
|
||||
*
|
||||
* Example of usage:
|
||||
* <code>
|
||||
* {{generatePagination stylePath paginationInfo bottom}}
|
||||
* {{generatePagination paginationInfo bottom}}
|
||||
* </code>
|
||||
* where:
|
||||
* - "stylePath" is expression for path to current style.
|
||||
* - "paginationInfo" is 'info' key from the result of setup_pagination
|
||||
* function.
|
||||
* - "bottom": optional argument that indicate if pagination block shoud
|
||||
@ -48,16 +47,14 @@ class GeneratePaginationHelper implements HelperInterface
|
||||
public function execute(Template $template, Context $context, $args, $source)
|
||||
{
|
||||
$parsed_args = $template->parseArguments($args);
|
||||
if (empty($parsed_args) || count($parsed_args) < 2) {
|
||||
if (empty($parsed_args) || count($parsed_args) < 1) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$stylePath = $context->get($parsed_args[0]);
|
||||
$pagination_info = $context->get($parsed_args[1]);
|
||||
$bottom = empty($parsed_args[2]) ? true : $context->get($parsed_args[2]);
|
||||
$pagination_info = $context->get($parsed_args[0]);
|
||||
$bottom = empty($parsed_args[1]) ? true : $context->get($parsed_args[1]);
|
||||
|
||||
$pagination = generate_pagination(
|
||||
$stylePath,
|
||||
$pagination_info,
|
||||
($bottom === "false") ? false : true
|
||||
);
|
||||
|
@ -142,14 +142,13 @@ function setup_pagination($items, $default_items_per_page = 15)
|
||||
/**
|
||||
* Builds HTML markup for pagination pager.
|
||||
*
|
||||
* @param string $style_path Root path of the style.
|
||||
* @param array $pagination Pagination info. See description of the result of
|
||||
* pagination_info function for details.
|
||||
* @param bool $bottom Indicates if pager will be displayed at the bottom of a
|
||||
* page.
|
||||
* @return string HTML markup
|
||||
*/
|
||||
function generate_pagination($style_path, $pagination, $bottom = true)
|
||||
function generate_pagination($pagination, $bottom = true)
|
||||
{
|
||||
$result = getlocal(
|
||||
'Page {0} of {1}, {2}-{3} from {4}',
|
||||
|
@ -27,6 +27,6 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="clear"> </div>
|
||||
<div class="center">{{generatePagination stylePath pagination}}</div>
|
||||
<div class="center">{{generatePagination pagination}}</div>
|
||||
{{/override}}
|
||||
{{/extends}}
|
@ -75,7 +75,7 @@
|
||||
|
||||
{{#if pagination}}
|
||||
<br />
|
||||
{{generatePagination stylePath pagination}}
|
||||
{{generatePagination pagination}}
|
||||
{{/if}}
|
||||
{{/override}}
|
||||
{{/extends}}
|
@ -87,7 +87,7 @@
|
||||
|
||||
{{#if pagination}}
|
||||
<br />
|
||||
{{generatePagination stylePath pagination}}
|
||||
{{generatePagination pagination}}
|
||||
{{/if}}
|
||||
{{/override}}
|
||||
{{/extends}}
|
@ -98,7 +98,7 @@
|
||||
|
||||
{{#if pagination}}
|
||||
<br/>
|
||||
{{generatePagination stylePath pagination}}
|
||||
{{generatePagination pagination}}
|
||||
{{/if}}
|
||||
{{/override}}
|
||||
{{/extends}}
|
@ -37,7 +37,7 @@
|
||||
|
||||
{{#if pagination}}
|
||||
<br />
|
||||
{{generatePagination stylePath pagination}}
|
||||
{{generatePagination pagination}}
|
||||
{{/if}}
|
||||
{{/override}}
|
||||
{{/extends}}
|
@ -47,7 +47,7 @@
|
||||
|
||||
|
||||
{{#if pagination}}
|
||||
{{generatePagination stylePath pagination "false"}}
|
||||
{{generatePagination pagination "false"}}
|
||||
{{/if}}
|
||||
|
||||
<table class="translate">
|
||||
@ -80,7 +80,7 @@
|
||||
|
||||
{{#if pagination}}
|
||||
<br />
|
||||
{{generatePagination stylePath pagination}}
|
||||
{{generatePagination pagination}}
|
||||
{{/if}}
|
||||
{{/override}}
|
||||
{{/extends}}
|
Loading…
Reference in New Issue
Block a user