From e6ebabfc093097f4d4e3f7a2fab287cfc20598ae Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 12 Sep 2022 11:44:44 +0200 Subject: [PATCH] add parameter $dataparam to method pageList() --- views/bootstrap/class.Bootstrap.php | 22 ++++++++++++++-------- views/bootstrap4/class.Bootstrap4.php | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 7b73fd57e..7ff884de6 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -988,7 +988,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo "\n"; } /* }}} */ - function pageList($pageNumber, $totalPages, $baseURI, $params) { /* {{{ */ + function pageList($pageNumber, $totalPages, $baseURI, $params, $dataparams=[]) { /* {{{ */ $maxpages = 25; // skip pages when more than this is shown $range = 5; // pages left and right of current page @@ -1007,11 +1007,17 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $first=false; } + $datastr = ''; + if($dataparams) { + $datastr .= ' '; + foreach($dataparams as $k=>$v) + $datastr .= 'data-'.$k.'="'.$v.'"'; + } echo "
"; echo ""; echo "
"; diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index da10dcf6d..5434b8037 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -970,7 +970,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; } /* }}} */ - function pageList($pageNumber, $totalPages, $baseURI, $params) { /* {{{ */ + function pageList($pageNumber, $totalPages, $baseURI, $params, $dataparams=[]) { /* {{{ */ $maxpages = 25; // skip pages when more than this is shown $range = 2; // pages left and right of current page @@ -989,11 +989,17 @@ background-image: linear-gradient(to bottom, #882222, #111111);; $first=false; } + $datastr = ''; + if($dataparams) { + $datastr .= ' '; + foreach($dataparams as $k=>$v) + $datastr .= 'data-'.$k.'="'.$v.'"'; + } echo "";