From: Roland Häder Date: Tue, 12 Jul 2011 14:34:20 +0000 (+0000) Subject: Rewrites for a little easier adding of additional parameters X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=36ac901c2e3ea78a0e58d1eea4b3d9d55dfaccd2;p=mailer.git Rewrites for a little easier adding of additional parameters --- diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 827ee9c2c6..73bb07cf49 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -42,9 +42,15 @@ if (!defined('__SECURITY')) { // Add links for selecting some users function alpha ($sortby, $colspan, $return=false) { - if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', 0); + if (!isGetRequestParameterSet('offset')) { + setGetRequestParameter('offset', 0); + } // END - if $add = '&page=' . getRequestParameter('page').'&offset=' . getRequestParameter('offset'); - if (isGetRequestParameterSet('mode')) $add .= '&mode=' . getRequestParameter('mode'); + foreach (array('mode','status') as $param) { + if (isGetRequestParameterSet($param)) { + $add .= '&' . $param . '=' . getRequestParameter($param); + } // END - if + } // END - foreach /* Creates the list of letters and makes them a link. */ $alphabet = explode(',', 'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,'); @@ -57,7 +63,11 @@ function alpha ($sortby, $colspan, $return=false) { } else { // Output link to letter $OUT .= '' . $ltr . ''; } @@ -94,9 +104,12 @@ function addSortLinks ($letter, $sortby, $colspan, $return=false) { // Add page and offset $add = '&page=' . getRequestParameter('page') . '&offset=' . getRequestParameter('offset'); - // Add status or mode - if (isGetRequestParameterSet('status')) $add .= '&mode=' . getRequestParameter('status'); - elseif (isGetRequestParameterSet('mode')) $add .= '&mode=' . getRequestParameter('mode'); + // Add status/ mode + foreach (array('mode','status') as $param) { + if (isGetRequestParameterSet($param)) { + $add .= '&' . $param . '=' . getRequestParameter($param); + } // END - if + } // END - foreach // Makes order by links.. if ($letter == 'front') { @@ -165,9 +178,12 @@ function addPageNavigation ($numPages, $offset, $showForm, $colspan, $return=fal // Base link $OUT .= '';