@@ -29,33 +29,33 @@ discard block |
||
29 | 29 | // include MagPieRSS |
30 | 30 | require_once(MODX_MANAGER_PATH.'media/rss/rss_fetch.inc'); |
31 | 31 | // Convert relative path into absolute url |
32 | -function rel2abs( $rel, $base ) { |
|
32 | +function rel2abs($rel, $base){ |
|
33 | 33 | // parse base URL and convert to local variables: $scheme, $host, $path |
34 | - extract( parse_url( $base ) ); |
|
35 | - if ( strpos( $rel,"//" ) === 0 ) { |
|
36 | - return $scheme . ':' . $rel; |
|
34 | + extract(parse_url($base)); |
|
35 | + if (strpos($rel, "//") === 0) { |
|
36 | + return $scheme.':'.$rel; |
|
37 | 37 | } |
38 | 38 | // return if already absolute URL |
39 | - if ( parse_url( $rel, PHP_URL_SCHEME ) != '' ) { |
|
39 | + if (parse_url($rel, PHP_URL_SCHEME) != '') { |
|
40 | 40 | return $rel; |
41 | 41 | } |
42 | 42 | // queries and anchors |
43 | - if ( $rel[0] == '#' || $rel[0] == '?' ) { |
|
44 | - return $base . $rel; |
|
43 | + if ($rel[0] == '#' || $rel[0] == '?') { |
|
44 | + return $base.$rel; |
|
45 | 45 | } |
46 | 46 | // remove non-directory element from path |
47 | - $path = preg_replace( '#/[^/]*$#', '', $path ); |
|
47 | + $path = preg_replace('#/[^/]*$#', '', $path); |
|
48 | 48 | // destroy path if relative url points to root |
49 | - if ( $rel[0] == '/' ) { |
|
49 | + if ($rel[0] == '/') { |
|
50 | 50 | $path = ''; |
51 | 51 | } |
52 | 52 | // dirty absolute URL |
53 | - $abs = $host . $path . "/" . $rel; |
|
53 | + $abs = $host.$path."/".$rel; |
|
54 | 54 | // replace '//' or '/./' or '/foo/../' with '/' |
55 | - $abs = preg_replace( "/(\/\.?\/)/", "/", $abs ); |
|
56 | - $abs = preg_replace( "/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs ); |
|
55 | + $abs = preg_replace("/(\/\.?\/)/", "/", $abs); |
|
56 | + $abs = preg_replace("/\/(?!\.\.)[^\/]+\/\.\.\//", "/", $abs); |
|
57 | 57 | // absolute URL is ready! |
58 | - return $scheme . '://' . $abs; |
|
58 | + return $scheme.'://'.$abs; |
|
59 | 59 | } |
60 | 60 | $feedData = array(); |
61 | 61 | |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | foreach ($urls as $section=>$url) { |
64 | 64 | $output = ''; |
65 | 65 | $rss = @fetch_rss($url); |
66 | - if( !$rss ){ |
|
67 | - $feedData[$section] = 'Failed to retrieve ' . $url; |
|
66 | + if (!$rss) { |
|
67 | + $feedData[$section] = 'Failed to retrieve '.$url; |
|
68 | 68 | continue; |
69 | 69 | } |
70 | 70 | $output .= '<ul>'; |
71 | 71 | |
72 | 72 | $items = array_slice($rss->items, 0, $itemsNumber); |
73 | 73 | foreach ($items as $item) { |
74 | - $href = rel2abs($item['link'],'https://github.com'); |
|
74 | + $href = rel2abs($item['link'], 'https://github.com'); |
|
75 | 75 | $title = $item['title']; |
76 | 76 | $pubdate = $item['pubdate']; |
77 | 77 | $pubdate = $modx->toDateFormat(strtotime($pubdate)); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$c = &$settings; |
|
3 | +$c = &$settings; |
|
4 | 4 | |
5 | 5 | $c['site_name'] = 'My MODX Site'; |
6 | 6 | $c['site_start'] = 1; |
@@ -65,26 +65,26 @@ |
||
65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
67 | 67 | |
68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
68 | +if ($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
69 | +elseif ($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
70 | +elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
71 | +elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
72 | +elseif ($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
73 | +elseif ($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
74 | +elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
75 | +elseif ($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
76 | +elseif ($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
77 | +elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
78 | +elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
79 | +elseif ($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
80 | +elseif ($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
81 | +elseif ($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
82 | +elseif ($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
83 | 83 | |
84 | 84 | $tpl = '<option value="%s" %s>%s</option>'; |
85 | 85 | $options = array(); |
86 | -foreach($_ as $value=>$label) { |
|
87 | - $selected = $value===$modx_charset ? 'selected' : ''; |
|
86 | +foreach ($_ as $value=>$label) { |
|
87 | + $selected = $value === $modx_charset ? 'selected' : ''; |
|
88 | 88 | $options[] = sprintf($tpl, $value, $selected, $label); |
89 | 89 | } |
90 | 90 | echo join("\n", $options); |
@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | global $site_sessionname; |
4 | 4 | $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession |
5 | 5 | |
6 | -function genEvoSessionName() { |
|
6 | +function genEvoSessionName(){ |
|
7 | 7 | $_ = crc32(__FILE__); |
8 | 8 | $_ = sprintf('%u', $_); |
9 | - return 'evo' . base_convert($_,10,36); |
|
9 | + return 'evo'.base_convert($_, 10, 36); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | function startCMSSession(){ |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | session_name($site_sessionname); |
17 | 17 | removeInvalidCmsSessionIds($site_sessionname); |
18 | - $cookieExpiration= 0; |
|
18 | + $cookieExpiration = 0; |
|
19 | 19 | $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port); |
20 | 20 | $cookiePath = !empty($session_cookie_path) ? $session_cookie_path : MODX_BASE_URL; |
21 | 21 | $cookieDomain = !empty($session_cookie_domain) ? $session_cookie_domain : ''; |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | $key = "modx.{$context}.session.cookie.lifetime"; |
26 | 26 | if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
27 | - $cookieLifetime= intval($_SESSION[$key]); |
|
28 | - if($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime; |
|
27 | + $cookieLifetime = intval($_SESSION[$key]); |
|
28 | + if ($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; |
|
29 | 29 | setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true); |
30 | 30 | } |
31 | 31 | if (!isset($_SESSION['modx.session.created.time'])) { |
@@ -33,14 +33,14 @@ discard block |
||
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -function removeInvalidCmsSessionFromStorage(&$storage, $session_name) { |
|
36 | +function removeInvalidCmsSessionFromStorage(&$storage, $session_name){ |
|
37 | 37 | if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) |
38 | 38 | { |
39 | 39 | unset($storage[$session_name]); |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | -function removeInvalidCmsSessionIds($session_name) { |
|
43 | +function removeInvalidCmsSessionIds($session_name){ |
|
44 | 44 | // session ids is invalid iff it is empty string |
45 | 45 | // storage priorioty can see in PHP source ext/session/session.c |
46 | 46 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | //Kyle Jaebker - 08/07/06 |
4 | 4 | |
5 | 5 | //Create a new category |
6 | -function newCategory($newCat) { |
|
6 | +function newCategory($newCat){ |
|
7 | 7 | global $modx; |
8 | 8 | $useTable = $modx->getFullTableName('categories'); |
9 | 9 | $categoryId = $modx->db->insert( |
@@ -14,36 +14,36 @@ discard block |
||
14 | 14 | return $categoryId; |
15 | 15 | } |
16 | 16 | //check if new category already exists |
17 | -function checkCategory($newCat = '') { |
|
17 | +function checkCategory($newCat = ''){ |
|
18 | 18 | global $modx; |
19 | 19 | $useTable = $modx->getFullTableName('categories'); |
20 | 20 | $newCat = $modx->db->escape($newCat); |
21 | 21 | $cats = $modx->db->select('id', $modx->getFullTableName('categories'), "category='{$newCat}'"); |
22 | - if($cat = $modx->db->getValue($cats)) { |
|
22 | + if ($cat = $modx->db->getValue($cats)) { |
|
23 | 23 | return $cat; |
24 | 24 | } |
25 | 25 | return 0; |
26 | 26 | } |
27 | 27 | //Check for category, create new if not exists |
28 | -function getCategory($category='') { |
|
28 | +function getCategory($category = ''){ |
|
29 | 29 | $categoryId = checkCategory($category); |
30 | - if(!$categoryId) $categoryId = newCategory($category); |
|
30 | + if (!$categoryId) $categoryId = newCategory($category); |
|
31 | 31 | return $categoryId; |
32 | 32 | } |
33 | 33 | //Get all categories |
34 | -function getCategories() { |
|
34 | +function getCategories(){ |
|
35 | 35 | global $modx; |
36 | 36 | $useTable = $modx->getFullTableName('categories'); |
37 | 37 | $cats = $modx->db->select('id, category', $modx->getFullTableName('categories'), '', 'category'); |
38 | 38 | $resourceArray = array(); |
39 | - while($row = $modx->db->getRow($cats)) { |
|
39 | + while ($row = $modx->db->getRow($cats)) { |
|
40 | 40 | $row['category'] = stripslashes($row['category']); |
41 | 41 | $resourceArray[] = $row; |
42 | 42 | } |
43 | 43 | return $resourceArray; |
44 | 44 | } |
45 | 45 | //Delete category & associations |
46 | -function deleteCategory($catId=0) { |
|
46 | +function deleteCategory($catId = 0){ |
|
47 | 47 | global $modx; |
48 | 48 | if ($catId) { |
49 | 49 | $resetTables = array('site_plugins', 'site_snippets', 'site_htmlsnippets', 'site_templates', 'site_tmplvars', 'site_modules'); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | var $errorcode; |
6 | 6 | var $errors = array(); |
7 | 7 | |
8 | - function __construct() { |
|
8 | + function __construct(){ |
|
9 | 9 | |
10 | 10 | $_lang = $this->include_lang('errormsg'); |
11 | 11 | |
@@ -40,33 +40,33 @@ discard block |
||
40 | 40 | ); |
41 | 41 | } |
42 | 42 | |
43 | - function include_lang($context='common') { |
|
43 | + function include_lang($context = 'common'){ |
|
44 | 44 | global $modx; |
45 | 45 | $_lang = array(); |
46 | 46 | |
47 | - $context = trim($context,'/'); |
|
48 | - if(strpos($context,'..')!==false) return; |
|
47 | + $context = trim($context, '/'); |
|
48 | + if (strpos($context, '..') !== false) return; |
|
49 | 49 | |
50 | - if($context === 'common') |
|
51 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
50 | + if ($context === 'common') |
|
51 | + $lang_path = MODX_MANAGER_PATH.'includes/lang/'; |
|
52 | 52 | else |
53 | - $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
54 | - include_once($lang_path . 'english.inc.php'); |
|
53 | + $lang_path = MODX_MANAGER_PATH."includes/lang/{$context}/"; |
|
54 | + include_once($lang_path.'english.inc.php'); |
|
55 | 55 | $manager_language = $modx->config['manager_language']; |
56 | - if(is_file("{$lang_path}{$manager_language}.inc.php")) |
|
56 | + if (is_file("{$lang_path}{$manager_language}.inc.php")) |
|
57 | 57 | include_once("{$lang_path}{$manager_language}.inc.php"); |
58 | 58 | return $_lang; |
59 | 59 | } |
60 | 60 | |
61 | - function setError($errorcode, $custommessage=""){ |
|
62 | - $this->errorcode=$errorcode; |
|
63 | - $this->errormessage=$this->errors[$errorcode]; |
|
64 | - if($custommessage!="") { |
|
65 | - $this->errormessage=$custommessage; |
|
61 | + function setError($errorcode, $custommessage = ""){ |
|
62 | + $this->errorcode = $errorcode; |
|
63 | + $this->errormessage = $this->errors[$errorcode]; |
|
64 | + if ($custommessage != "") { |
|
65 | + $this->errormessage = $custommessage; |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | - function getError() { |
|
69 | + function getError(){ |
|
70 | 70 | return $this->errorcode; |
71 | 71 | } |
72 | 72 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | * Created by Raymond Irving Feb, 2005 |
5 | 5 | */ |
6 | 6 | global $BINDINGS; // Array of supported bindings. must be upper case |
7 | -$BINDINGS = array ( |
|
7 | +$BINDINGS = array( |
|
8 | 8 | 'FILE', |
9 | 9 | 'CHUNK', |
10 | 10 | 'DOCUMENT', |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | 'DIRECTORY' |
15 | 15 | ); |
16 | 16 | |
17 | -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { |
|
17 | +function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()){ |
|
18 | 18 | global $modx; |
19 | 19 | $docid = intval($docid) ? intval($docid) : $modx->documentIdentifier; |
20 | 20 | $nvalue = trim($value); |
21 | 21 | if (substr($nvalue, 0, 1) != '@') |
22 | 22 | return $value; |
23 | - elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
23 | + elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings'] != 1 && $src === 'docform') { |
|
24 | 24 | return '@Bindings is disabled.'; |
25 | 25 | } |
26 | 26 | else { |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | break; |
47 | 47 | |
48 | 48 | case "SELECT" : // selects a record from the cms database |
49 | - $rt = array (); |
|
50 | - $replacementVars = array ( |
|
49 | + $rt = array(); |
|
50 | + $replacementVars = array( |
|
51 | 51 | 'DBASE' => $modx->db->config['dbase'], |
52 | 52 | 'PREFIX' => $modx->db->config['table_prefix'] |
53 | 53 | ); |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | break; |
89 | 89 | |
90 | 90 | case 'DIRECTORY' : |
91 | - $files = array (); |
|
92 | - $path = $modx->config['base_path'] . $param; |
|
91 | + $files = array(); |
|
92 | + $path = $modx->config['base_path'].$param; |
|
93 | 93 | if (substr($path, -1, 1) != '/') { |
94 | 94 | $path .= '/'; |
95 | 95 | } |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | -function ProcessFile($file) { |
|
120 | +function ProcessFile($file){ |
|
121 | 121 | // get the file |
122 | 122 | $buffer = @file_get_contents($file); |
123 | - if ($buffer===false) $buffer = " Could not retrieve document '$file'."; |
|
123 | + if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
|
124 | 124 | return $buffer; |
125 | 125 | } |
126 | 126 | |
@@ -129,12 +129,12 @@ discard block |
||
129 | 129 | { |
130 | 130 | global $BINDINGS; |
131 | 131 | $binding_array = array(); |
132 | - foreach($BINDINGS as $cmd) |
|
132 | + foreach ($BINDINGS as $cmd) |
|
133 | 133 | { |
134 | - if(strpos($binding_string,'@'.$cmd)===0) |
|
134 | + if (strpos($binding_string, '@'.$cmd) === 0) |
|
135 | 135 | { |
136 | - $code = substr($binding_string,strlen($cmd)+1); |
|
137 | - $binding_array = array($cmd,trim($code)); |
|
136 | + $code = substr($binding_string, strlen($cmd) + 1); |
|
137 | + $binding_array = array($cmd, trim($code)); |
|
138 | 138 | break; |
139 | 139 | } |
140 | 140 | } |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | if (strpos($param, '[*') !== false) { |
150 | 150 | $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
151 | 151 | foreach ($matches[0] as $i=>$match) { |
152 | - if(isset($tvsArray[ $matches[1][$i] ])) { |
|
153 | - if(is_array($tvsArray[ $matches[1][$i] ])) { |
|
152 | + if (isset($tvsArray[$matches[1][$i]])) { |
|
153 | + if (is_array($tvsArray[$matches[1][$i]])) { |
|
154 | 154 | $value = $tvsArray[$matches[1][$i]]['value']; |
155 | 155 | $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
156 | 156 | } else { |
157 | - $value = $tvsArray[ $matches[1][$i] ]; |
|
157 | + $value = $tvsArray[$matches[1][$i]]; |
|
158 | 158 | } |
159 | 159 | $param = str_replace($match, $value, $param); |
160 | 160 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $sysMsgs = ""; |
14 | 14 | $limit = count($SystemAlertMsgQueque); |
15 | - for($i=0;$i<$limit;$i++) { |
|
15 | + for ($i = 0; $i < $limit; $i++) { |
|
16 | 16 | $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
17 | 17 | } |
18 | 18 | // reset message queque |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $_SESSION['SystemAlertMsgQueque'] = array(); |
21 | 21 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
22 | 22 | |
23 | - if($sysMsgs!="") { |
|
23 | + if ($sysMsgs != "") { |
|
24 | 24 | ?> |
25 | 25 | |
26 | 26 | <?php // fetch the styles |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | var sysAlert = new Element('div').setProperties({ |
33 | 33 | 'class': 'sysAlert' |
34 | 34 | }); |
35 | - sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs);?>'; |
|
35 | + sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs); ?>'; |
|
36 | 36 | var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, { |
37 | 37 | buttons: 1, |
38 | 38 | button1: 'Ok', |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | class Paging |
32 | 32 | { |
33 | 33 | |
34 | - var $int_num_result; // Number of result to show per page (decided by user) |
|
35 | - var $int_nbr_row; // Total number of items (SQL count from db) |
|
36 | - var $int_cur_position;// Current position in recordset |
|
37 | - var $str_ext_argv; // Extra argv of query string |
|
34 | + var $int_num_result; // Number of result to show per page (decided by user) |
|
35 | + var $int_nbr_row; // Total number of items (SQL count from db) |
|
36 | + var $int_cur_position; // Current position in recordset |
|
37 | + var $str_ext_argv; // Extra argv of query string |
|
38 | 38 | |
39 | 39 | // ------------------------------------------------------------------------ Constructor |
40 | 40 | // |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | $array_paging['total'] = $this->int_nbr_row; |
65 | 65 | |
66 | 66 | if ($this->int_cur_position != 0) { |
67 | - $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0" . $this->str_ext_argv . "\">"; |
|
68 | - $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . ($this->int_cur_position - $this->int_num_result) . $this->str_ext_argv . "\">"; |
|
67 | + $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0".$this->str_ext_argv."\">"; |
|
68 | + $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=".($this->int_cur_position - $this->int_num_result).$this->str_ext_argv."\">"; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | if (($this->int_nbr_row - $this->int_cur_position) > $this->int_num_result) { |
72 | 72 | $int_new_position = $this->int_cur_position + $this->int_num_result; |
73 | - $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . $this->int_nbr_row . $this->str_ext_argv . "\">"; |
|
74 | - $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position" . $this->str_ext_argv . "\">"; |
|
73 | + $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=".$this->int_nbr_row.$this->str_ext_argv."\">"; |
|
74 | + $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position".$this->str_ext_argv."\">"; |
|
75 | 75 | } |
76 | 76 | return $array_paging; |
77 | 77 | } // end function |
@@ -86,10 +86,10 @@ discard block |
||
86 | 86 | for ($i = 0; $i < $this->getNumberOfPage(); $i++) { |
87 | 87 | // if current page, do not make a link |
88 | 88 | if ($i == $this->getCurrentPage()) { |
89 | - $array_all_page[$i] = "<b>" . ($i + 1) . "</b> "; |
|
89 | + $array_all_page[$i] = "<b>".($i + 1)."</b> "; |
|
90 | 90 | } else { |
91 | 91 | $int_new_position = ($i * $this->int_num_result); |
92 | - $array_all_page[$i] = "<a href=\"" . $PHP_SELF . "?int_cur_position=$int_new_position$this->str_ext_argv\">" . ($i + 1) . "</a> "; |
|
92 | + $array_all_page[$i] = "<a href=\"".$PHP_SELF."?int_cur_position=$int_new_position$this->str_ext_argv\">".($i + 1)."</a> "; |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | return $array_all_page; |