20 $paginationConfig = $action->
getParam(
"paginationConfig");
34 $searchConfig = $action->
getParam(
"searchConfig");
36 $action->parent->addJsRef(
"GENERIC:pagination.js");
43 $paginationDefButton = array(
50 "%n" =>
getButtonLayout($action,
"nextpage", $paginationConfig, $searchConfig[
"next"], _(
"Next page") , $searchConfig[
"hasnext"]) ,
51 "%p" =>
getButtonLayout($action,
"prevpage", $paginationConfig, $searchConfig[
"prev"], _(
"Previous page") , $searchConfig[
"pagenumber"] != 1) ,
52 "%l" =>
getButtonLayout($action,
"lastpage", $paginationConfig, $searchConfig[
"last"], _(
"Last page") , $searchConfig[
"hasnext"]) ,
53 "%f" =>
getButtonLayout($action,
"firstpage", $paginationConfig,
"0", _(
"First page") , $searchConfig[
"pagenumber"] != 1)
56 $paginationDefOther = array(
57 "%np" => $searchConfig[
"numberofpage"],
58 "%cp" => $searchConfig[
"pagenumber"],
59 "%nd" => $searchConfig[
"numberofdocuments"],
60 "%br" => $searchConfig[
"rangefrom"],
61 "%er" => $searchConfig[
"rangeto"]
64 $action->lay->set(
"pagination",
true);
65 if ($paginationConfig[
"type"] !==
"none") {
67 $type = $paginationConfig[
"type"];
68 switch ($paginationConfig[
"type"]) {
70 $type =
"%p%t%cp%t%n";
74 $type =
"%f%p%t%cp/%np%t%n%l";
77 case "documentNumber":
78 $type = _(
"Showing %br to %er of %nd documents%t%t%p%n");
86 $parts = explode(
"%t",
$type);
87 $action->lay->set(
"centeralign", count($parts) > 1);
88 $action->lay->set(
"rightalign", count($parts) > 2);
90 foreach ($parts as $k => $v) {
95 $v = str_replace(array_keys($paginationDefOther) , array_values($paginationDefOther) , $v);
96 $action->lay->set($layoutKeys[$k], str_replace(array_keys($paginationDefButton) , array_values($paginationDefButton) , $v));
97 }
else $action->lay->set($layoutKeys[$k],
"");
100 $action->lay->set(
"pagination",
false);
106 $lay =
new Layout(
"GENERIC/Layout/pagination_button.xml");
107 foreach ($paginationConfig as $key =>
$value) {
110 $lay->set(
"APPNAME", isset($action->parent->name) ? $action->parent->name :
'');
111 $lay->set(
"page", $page);
112 $lay->set(
"buttonclass", $buttonName);
113 $lay->set(
"buttontitle", $buttonTitle);
114 $lay->set(
"buttonvisible", $visible ==
true);
Layout is a template generator.