@@ -102,7 +102,6 @@ discard block |
||
102 | 102 | |
103 | 103 | /** Checks if the given file is really writable. The standard PHP function |
104 | 104 | * is_writable() does not work properly on Windows servers. |
105 | - * @param string $dir |
|
106 | 105 | * @return bool */ |
107 | 106 | |
108 | 107 | static function isWritable($filename) { |
@@ -114,7 +113,6 @@ discard block |
||
114 | 113 | } |
115 | 114 | |
116 | 115 | /** Get the extension from filename |
117 | - * @param string $file |
|
118 | 116 | * @param bool $toLower |
119 | 117 | * @return string */ |
120 | 118 |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc File helper class |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.54 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010-2014 KCFinder Project |
|
10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | - * @link http://kcfinder.sunhater.com |
|
13 | - */ |
|
4 | + * |
|
5 | + * @desc File helper class |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.54 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010-2014 KCFinder Project |
|
10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | + * @link http://kcfinder.sunhater.com |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class file { |
16 | 16 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | 'zip' => 'application/x-zip' |
101 | 101 | ); |
102 | 102 | |
103 | - /** Checks if the given file is really writable. The standard PHP function |
|
104 | - * is_writable() does not work properly on Windows servers. |
|
105 | - * @param string $dir |
|
106 | - * @return bool */ |
|
103 | + /** Checks if the given file is really writable. The standard PHP function |
|
104 | + * is_writable() does not work properly on Windows servers. |
|
105 | + * @param string $dir |
|
106 | + * @return bool */ |
|
107 | 107 | |
108 | 108 | static function isWritable($filename) { |
109 | 109 | $filename = path::normalize($filename); |
@@ -113,26 +113,26 @@ discard block |
||
113 | 113 | return true; |
114 | 114 | } |
115 | 115 | |
116 | - /** Get the extension from filename |
|
117 | - * @param string $file |
|
118 | - * @param bool $toLower |
|
119 | - * @return string */ |
|
116 | + /** Get the extension from filename |
|
117 | + * @param string $file |
|
118 | + * @param bool $toLower |
|
119 | + * @return string */ |
|
120 | 120 | |
121 | 121 | static function getExtension($filename, $toLower=true) { |
122 | 122 | return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) |
123 | 123 | ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; |
124 | 124 | } |
125 | 125 | |
126 | - /** Get MIME type of the given filename. If Fileinfo PHP extension is |
|
127 | - * available the MIME type will be fetched by the file's content. The |
|
128 | - * second parameter is optional and defines the magic file path. If you |
|
129 | - * skip it, the default one will be loaded. |
|
130 | - * If Fileinfo PHP extension is not available the MIME type will be fetched |
|
131 | - * by filename extension regarding $MIME property. If the file extension |
|
132 | - * does not exist there, returned type will be application/octet-stream |
|
133 | - * @param string $filename |
|
134 | - * @param string $magic |
|
135 | - * @return string */ |
|
126 | + /** Get MIME type of the given filename. If Fileinfo PHP extension is |
|
127 | + * available the MIME type will be fetched by the file's content. The |
|
128 | + * second parameter is optional and defines the magic file path. If you |
|
129 | + * skip it, the default one will be loaded. |
|
130 | + * If Fileinfo PHP extension is not available the MIME type will be fetched |
|
131 | + * by filename extension regarding $MIME property. If the file extension |
|
132 | + * does not exist there, returned type will be application/octet-stream |
|
133 | + * @param string $filename |
|
134 | + * @param string $magic |
|
135 | + * @return string */ |
|
136 | 136 | |
137 | 137 | static function getMimeType($filename, $magic=null) { |
138 | 138 | if (class_exists("finfo")) { |
@@ -149,26 +149,26 @@ discard block |
||
149 | 149 | return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream"; |
150 | 150 | } |
151 | 151 | |
152 | - /** Get inexistant filename based on the given filename. If you skip $dir |
|
153 | - * parameter the directory will be fetched from $filename and returned |
|
154 | - * value will be full filename path. The third parameter is optional and |
|
155 | - * defines the template, the filename will be renamed to. Default template |
|
156 | - * is {name}({sufix}){ext}. Examples: |
|
157 | - * |
|
158 | - * file::getInexistantFilename("/my/directory/myfile.txt"); |
|
159 | - * If myfile.txt does not exist - returns the same path to the file |
|
160 | - * otherwise returns "/my/directory/myfile(1).txt" |
|
161 | - * |
|
162 | - * file::getInexistantFilename("myfile.txt", "/my/directory"); |
|
163 | - * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... |
|
164 | - * |
|
165 | - * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); |
|
166 | - * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... |
|
167 | - * |
|
168 | - * @param string $filename |
|
169 | - * @param string $dir |
|
170 | - * @param string $tpl |
|
171 | - * @return string */ |
|
152 | + /** Get inexistant filename based on the given filename. If you skip $dir |
|
153 | + * parameter the directory will be fetched from $filename and returned |
|
154 | + * value will be full filename path. The third parameter is optional and |
|
155 | + * defines the template, the filename will be renamed to. Default template |
|
156 | + * is {name}({sufix}){ext}. Examples: |
|
157 | + * |
|
158 | + * file::getInexistantFilename("/my/directory/myfile.txt"); |
|
159 | + * If myfile.txt does not exist - returns the same path to the file |
|
160 | + * otherwise returns "/my/directory/myfile(1).txt" |
|
161 | + * |
|
162 | + * file::getInexistantFilename("myfile.txt", "/my/directory"); |
|
163 | + * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... |
|
164 | + * |
|
165 | + * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); |
|
166 | + * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... |
|
167 | + * |
|
168 | + * @param string $filename |
|
169 | + * @param string $dir |
|
170 | + * @param string $tpl |
|
171 | + * @return string */ |
|
172 | 172 | |
173 | 173 | static function getInexistantFilename($filename, $dir=null, $tpl=null) { |
174 | 174 | if ($tpl === null) $tpl = "{name}({sufix}){ext}"; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class file { |
|
15 | +class file{ |
|
16 | 16 | |
17 | 17 | static $MIME = array( |
18 | 18 | 'ai' => 'application/postscript', |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param string $dir |
106 | 106 | * @return bool */ |
107 | 107 | |
108 | - static function isWritable($filename) { |
|
108 | + static function isWritable($filename){ |
|
109 | 109 | $filename = path::normalize($filename); |
110 | 110 | if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) |
111 | 111 | return false; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param bool $toLower |
119 | 119 | * @return string */ |
120 | 120 | |
121 | - static function getExtension($filename, $toLower=true) { |
|
121 | + static function getExtension($filename, $toLower = true){ |
|
122 | 122 | return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) |
123 | 123 | ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; |
124 | 124 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @param string $magic |
135 | 135 | * @return string */ |
136 | 136 | |
137 | - static function getMimeType($filename, $magic=null) { |
|
137 | + static function getMimeType($filename, $magic = null){ |
|
138 | 138 | if (class_exists("finfo")) { |
139 | 139 | $finfo = ($magic === null) |
140 | 140 | ? new finfo(FILEINFO_MIME) |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @param string $tpl |
171 | 171 | * @return string */ |
172 | 172 | |
173 | - static function getInexistantFilename($filename, $dir=null, $tpl=null) { |
|
173 | + static function getInexistantFilename($filename, $dir = null, $tpl = null){ |
|
174 | 174 | if ($tpl === null) $tpl = "{name}({sufix}){ext}"; |
175 | 175 | $fullPath = ($dir === null); |
176 | 176 | if ($fullPath) |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); |
189 | 189 | $i = 1; $file = "$dir/$filename"; |
190 | 190 | while (file_exists($file)) |
191 | - $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); |
|
191 | + $file = "$dir/".str_replace('{sufix}', $i++, $tpl); |
|
192 | 192 | |
193 | 193 | return $fullPath |
194 | 194 | ? $file |
195 | 195 | : (strlen($fdir) |
196 | - ? "$fdir/" . basename($file) |
|
196 | + ? "$fdir/".basename($file) |
|
197 | 197 | : basename($file)); |
198 | 198 | } |
199 | 199 |
@@ -12,7 +12,8 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class file { |
|
15 | +class file |
|
16 | +{ |
|
16 | 17 | |
17 | 18 | static $MIME = array( |
18 | 19 | 'ai' => 'application/postscript', |
@@ -105,10 +106,12 @@ discard block |
||
105 | 106 | * @param string $dir |
106 | 107 | * @return bool */ |
107 | 108 | |
108 | - static function isWritable($filename) { |
|
109 | + static function isWritable($filename) |
|
110 | + { |
|
109 | 111 | $filename = path::normalize($filename); |
110 | - if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) |
|
111 | - return false; |
|
112 | + if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) { |
|
113 | + return false; |
|
114 | + } |
|
112 | 115 | fclose($fp); |
113 | 116 | return true; |
114 | 117 | } |
@@ -118,7 +121,8 @@ discard block |
||
118 | 121 | * @param bool $toLower |
119 | 122 | * @return string */ |
120 | 123 | |
121 | - static function getExtension($filename, $toLower=true) { |
|
124 | + static function getExtension($filename, $toLower=true) |
|
125 | + { |
|
122 | 126 | return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) |
123 | 127 | ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; |
124 | 128 | } |
@@ -134,7 +138,8 @@ discard block |
||
134 | 138 | * @param string $magic |
135 | 139 | * @return string */ |
136 | 140 | |
137 | - static function getMimeType($filename, $magic=null) { |
|
141 | + static function getMimeType($filename, $magic=null) |
|
142 | + { |
|
138 | 143 | if (class_exists("finfo")) { |
139 | 144 | $finfo = ($magic === null) |
140 | 145 | ? new finfo(FILEINFO_MIME) |
@@ -170,12 +175,15 @@ discard block |
||
170 | 175 | * @param string $tpl |
171 | 176 | * @return string */ |
172 | 177 | |
173 | - static function getInexistantFilename($filename, $dir=null, $tpl=null) { |
|
174 | - if ($tpl === null) $tpl = "{name}({sufix}){ext}"; |
|
178 | + static function getInexistantFilename($filename, $dir=null, $tpl=null) |
|
179 | + { |
|
180 | + if ($tpl === null) { |
|
181 | + $tpl = "{name}({sufix}){ext}"; |
|
182 | + } |
|
175 | 183 | $fullPath = ($dir === null); |
176 | - if ($fullPath) |
|
177 | - $dir = path::normalize(dirname($filename)); |
|
178 | - else { |
|
184 | + if ($fullPath) { |
|
185 | + $dir = path::normalize(dirname($filename)); |
|
186 | + } else { |
|
179 | 187 | $fdir = dirname($filename); |
180 | 188 | $dir = strlen($fdir) |
181 | 189 | ? path::normalize("$dir/$fdir") |
@@ -187,8 +195,9 @@ discard block |
||
187 | 195 | $tpl = str_replace('{name}', $name, $tpl); |
188 | 196 | $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); |
189 | 197 | $i = 1; $file = "$dir/$filename"; |
190 | - while (file_exists($file)) |
|
191 | - $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); |
|
198 | + while (file_exists($file)) { |
|
199 | + $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); |
|
200 | + } |
|
192 | 201 | |
193 | 202 | return $fullPath |
194 | 203 | ? $file |
@@ -616,6 +616,9 @@ discard block |
||
616 | 616 | Output: |
617 | 617 | \*======================================================================*/ |
618 | 618 | |
619 | + /** |
|
620 | + * @param string $http_method |
|
621 | + */ |
|
619 | 622 | function _httprequest($url, $fp, $URI, $http_method, $content_type = "", $body = "") |
620 | 623 | { |
621 | 624 | $cookie_headers = ''; |
@@ -923,6 +926,10 @@ discard block |
||
923 | 926 | Output: post body |
924 | 927 | \*======================================================================*/ |
925 | 928 | |
929 | + /** |
|
930 | + * @param string $formvars |
|
931 | + * @param string $formfiles |
|
932 | + */ |
|
926 | 933 | function _prepare_post_body($formvars, $formfiles) |
927 | 934 | { |
928 | 935 | settype($formvars, "array"); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | // using proxy, send entire URI |
150 | 150 | $this->_httprequest($URI, $fp, $URI, $this->_httpmethod); |
151 | 151 | } else { |
152 | - $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : ""); |
|
152 | + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); |
|
153 | 153 | // no proxy, send only the path |
154 | 154 | $this->_httprequest($path, $fp, $URI, $this->_httpmethod); |
155 | 155 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | /* url was redirected, check if we've hit the max depth */ |
161 | 161 | if ($this->maxredirs > $this->_redirectdepth) { |
162 | 162 | // only follow redirect if it's on this site, or offsiteok is true |
163 | - if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) { |
|
163 | + if (preg_match("|^https?://".preg_quote($this->host)."|i", $this->_redirectaddr) || $this->offsiteok) { |
|
164 | 164 | /* follow the redirect */ |
165 | 165 | $this->_redirectdepth++; |
166 | 166 | $this->lastredirectaddr = $this->_redirectaddr; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | break; |
189 | 189 | default: |
190 | 190 | // not a valid protocol |
191 | - $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n'; |
|
191 | + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; |
|
192 | 192 | return false; |
193 | 193 | break; |
194 | 194 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | // using proxy, send entire URI |
240 | 240 | $this->_httprequest($URI, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); |
241 | 241 | } else { |
242 | - $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : ""); |
|
242 | + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); |
|
243 | 243 | // no proxy, send only the path |
244 | 244 | $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); |
245 | 245 | } |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | if ($this->_redirectaddr) { |
250 | 250 | /* url was redirected, check if we've hit the max depth */ |
251 | 251 | if ($this->maxredirs > $this->_redirectdepth) { |
252 | - if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr)) |
|
253 | - $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]); |
|
252 | + if (!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) |
|
253 | + $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"]."://".$URI_PARTS["host"]); |
|
254 | 254 | |
255 | 255 | // only follow redirect if it's on this site, or offsiteok is true |
256 | - if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) { |
|
256 | + if (preg_match("|^https?://".preg_quote($this->host)."|i", $this->_redirectaddr) || $this->offsiteok) { |
|
257 | 257 | /* follow the redirect */ |
258 | 258 | $this->_redirectdepth++; |
259 | 259 | $this->lastredirectaddr = $this->_redirectaddr; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | break; |
286 | 286 | default: |
287 | 287 | // not a valid protocol |
288 | - $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n'; |
|
288 | + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; |
|
289 | 289 | return false; |
290 | 290 | break; |
291 | 291 | } |
@@ -585,9 +585,9 @@ discard block |
||
585 | 585 | $match = preg_replace("|/$|", "", $match); |
586 | 586 | $match_part = parse_url($match); |
587 | 587 | $match_root = |
588 | - $match_part["scheme"] . "://" . $match_part["host"]; |
|
588 | + $match_part["scheme"]."://".$match_part["host"]; |
|
589 | 589 | |
590 | - $search = array("|^http://" . preg_quote($this->host) . "|i", |
|
590 | + $search = array("|^http://".preg_quote($this->host)."|i", |
|
591 | 591 | "|^(\/)|i", |
592 | 592 | "|^(?!http://)(?!mailto:)|i", |
593 | 593 | "|/\./|", |
@@ -595,8 +595,8 @@ discard block |
||
595 | 595 | ); |
596 | 596 | |
597 | 597 | $replace = array("", |
598 | - $match_root . "/", |
|
599 | - $match . "/", |
|
598 | + $match_root."/", |
|
599 | + $match."/", |
|
600 | 600 | "/", |
601 | 601 | "/" |
602 | 602 | ); |
@@ -625,17 +625,17 @@ discard block |
||
625 | 625 | $URI_PARTS = parse_url($URI); |
626 | 626 | if (empty($url)) |
627 | 627 | $url = "/"; |
628 | - $headers = $http_method . " " . $url . " " . $this->_httpversion . "\r\n"; |
|
628 | + $headers = $http_method." ".$url." ".$this->_httpversion."\r\n"; |
|
629 | 629 | if (!empty($this->host) && !isset($this->rawheaders['Host'])) { |
630 | - $headers .= "Host: " . $this->host; |
|
630 | + $headers .= "Host: ".$this->host; |
|
631 | 631 | if (!empty($this->port) && $this->port != '80') |
632 | - $headers .= ":" . $this->port; |
|
632 | + $headers .= ":".$this->port; |
|
633 | 633 | $headers .= "\r\n"; |
634 | 634 | } |
635 | 635 | if (!empty($this->agent)) |
636 | - $headers .= "User-Agent: " . $this->agent . "\r\n"; |
|
636 | + $headers .= "User-Agent: ".$this->agent."\r\n"; |
|
637 | 637 | if (!empty($this->accept)) |
638 | - $headers .= "Accept: " . $this->accept . "\r\n"; |
|
638 | + $headers .= "Accept: ".$this->accept."\r\n"; |
|
639 | 639 | if ($this->use_gzip) { |
640 | 640 | // make sure PHP was built with --with-zlib |
641 | 641 | // and we can handle gzipp'ed data |
@@ -643,46 +643,46 @@ discard block |
||
643 | 643 | $headers .= "Accept-encoding: gzip\r\n"; |
644 | 644 | } else { |
645 | 645 | trigger_error( |
646 | - "use_gzip is on, but PHP was built without zlib support." . |
|
646 | + "use_gzip is on, but PHP was built without zlib support.". |
|
647 | 647 | " Requesting file(s) without gzip encoding.", |
648 | 648 | E_USER_NOTICE); |
649 | 649 | } |
650 | 650 | } |
651 | 651 | if (!empty($this->referer)) |
652 | - $headers .= "Referer: " . $this->referer . "\r\n"; |
|
652 | + $headers .= "Referer: ".$this->referer."\r\n"; |
|
653 | 653 | if (!empty($this->cookies)) { |
654 | 654 | if (!is_array($this->cookies)) |
655 | - $this->cookies = (array)$this->cookies; |
|
655 | + $this->cookies = (array) $this->cookies; |
|
656 | 656 | |
657 | 657 | reset($this->cookies); |
658 | 658 | if (count($this->cookies) > 0) { |
659 | 659 | $cookie_headers .= 'Cookie: '; |
660 | 660 | foreach ($this->cookies as $cookieKey => $cookieVal) { |
661 | - $cookie_headers .= $cookieKey . "=" . urlencode($cookieVal) . "; "; |
|
661 | + $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; "; |
|
662 | 662 | } |
663 | - $headers .= substr($cookie_headers, 0, -2) . "\r\n"; |
|
663 | + $headers .= substr($cookie_headers, 0, -2)."\r\n"; |
|
664 | 664 | } |
665 | 665 | } |
666 | 666 | if (!empty($this->rawheaders)) { |
667 | 667 | if (!is_array($this->rawheaders)) |
668 | - $this->rawheaders = (array)$this->rawheaders; |
|
668 | + $this->rawheaders = (array) $this->rawheaders; |
|
669 | 669 | while (list($headerKey, $headerVal) = each($this->rawheaders)) |
670 | - $headers .= $headerKey . ": " . $headerVal . "\r\n"; |
|
670 | + $headers .= $headerKey.": ".$headerVal."\r\n"; |
|
671 | 671 | } |
672 | 672 | if (!empty($content_type)) { |
673 | 673 | $headers .= "Content-type: $content_type"; |
674 | 674 | if ($content_type == "multipart/form-data") |
675 | - $headers .= "; boundary=" . $this->_mime_boundary; |
|
675 | + $headers .= "; boundary=".$this->_mime_boundary; |
|
676 | 676 | $headers .= "\r\n"; |
677 | 677 | } |
678 | 678 | if (!empty($body)) |
679 | - $headers .= "Content-length: " . strlen($body) . "\r\n"; |
|
679 | + $headers .= "Content-length: ".strlen($body)."\r\n"; |
|
680 | 680 | if (!empty($this->user) || !empty($this->pass)) |
681 | - $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n"; |
|
681 | + $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n"; |
|
682 | 682 | |
683 | 683 | //add proxy auth headers |
684 | 684 | if (!empty($this->proxy_user)) |
685 | - $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n"; |
|
685 | + $headers .= 'Proxy-Authorization: '.'Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass)."\r\n"; |
|
686 | 686 | |
687 | 687 | |
688 | 688 | $headers .= "\r\n"; |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | socket_set_timeout($fp, $this->read_timeout); |
693 | 693 | $this->timed_out = false; |
694 | 694 | |
695 | - fwrite($fp, $headers . $body, strlen($headers . $body)); |
|
695 | + fwrite($fp, $headers.$body, strlen($headers.$body)); |
|
696 | 696 | |
697 | 697 | $this->_redirectaddr = false; |
698 | 698 | unset($this->headers); |
@@ -716,10 +716,10 @@ discard block |
||
716 | 716 | // look for :// in the Location header to see if hostname is included |
717 | 717 | if (!preg_match("|\:\/\/|", $matches[2])) { |
718 | 718 | // no host in the path, so prepend |
719 | - $this->_redirectaddr = $URI_PARTS["scheme"] . "://" . $this->host . ":" . $this->port; |
|
719 | + $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; |
|
720 | 720 | // eliminate double slash |
721 | 721 | if (!preg_match("|^/|", $matches[2])) |
722 | - $this->_redirectaddr .= "/" . $matches[2]; |
|
722 | + $this->_redirectaddr .= "/".$matches[2]; |
|
723 | 723 | else |
724 | 724 | $this->_redirectaddr .= $matches[2]; |
725 | 725 | } else |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | if (($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i", $results, $match)) { |
772 | 772 | $this->results[] = $results; |
773 | 773 | for ($x = 0; $x < count($match[1]); $x++) |
774 | - $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"] . "://" . $this->host); |
|
774 | + $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"]."://".$this->host); |
|
775 | 775 | } // have we already fetched framed content? |
776 | 776 | elseif (is_array($this->results)) |
777 | 777 | $this->results[] = $results; |
@@ -858,14 +858,14 @@ discard block |
||
858 | 858 | $context_opts['ssl']['capath'] = $this->capath; |
859 | 859 | } |
860 | 860 | |
861 | - $host = 'ssl://' . $host; |
|
861 | + $host = 'ssl://'.$host; |
|
862 | 862 | } |
863 | 863 | |
864 | 864 | $context = stream_context_create($context_opts); |
865 | 865 | |
866 | 866 | if (version_compare(PHP_VERSION, '5.0.0', '>')) { |
867 | - if($this->scheme == 'http') |
|
868 | - $host = "tcp://" . $host; |
|
867 | + if ($this->scheme == 'http') |
|
868 | + $host = "tcp://".$host; |
|
869 | 869 | $fp = stream_socket_client( |
870 | 870 | "$host:$port", |
871 | 871 | $errno, |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | case -5: |
898 | 898 | $this->error = "connection refused or timed out (-5)"; |
899 | 899 | default: |
900 | - $this->error = "connection failed (" . $errno . ")"; |
|
900 | + $this->error = "connection failed (".$errno.")"; |
|
901 | 901 | } |
902 | 902 | return false; |
903 | 903 | } |
@@ -938,26 +938,26 @@ discard block |
||
938 | 938 | while (list($key, $val) = each($formvars)) { |
939 | 939 | if (is_array($val) || is_object($val)) { |
940 | 940 | while (list($cur_key, $cur_val) = each($val)) { |
941 | - $postdata .= urlencode($key) . "[]=" . urlencode($cur_val) . "&"; |
|
941 | + $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&"; |
|
942 | 942 | } |
943 | 943 | } else |
944 | - $postdata .= urlencode($key) . "=" . urlencode($val) . "&"; |
|
944 | + $postdata .= urlencode($key)."=".urlencode($val)."&"; |
|
945 | 945 | } |
946 | 946 | break; |
947 | 947 | |
948 | 948 | case "multipart/form-data": |
949 | - $this->_mime_boundary = "Snoopy" . md5(uniqid(microtime())); |
|
949 | + $this->_mime_boundary = "Snoopy".md5(uniqid(microtime())); |
|
950 | 950 | |
951 | 951 | reset($formvars); |
952 | 952 | while (list($key, $val) = each($formvars)) { |
953 | 953 | if (is_array($val) || is_object($val)) { |
954 | 954 | while (list($cur_key, $cur_val) = each($val)) { |
955 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
955 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
956 | 956 | $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n"; |
957 | 957 | $postdata .= "$cur_val\r\n"; |
958 | 958 | } |
959 | 959 | } else { |
960 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
960 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
961 | 961 | $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n"; |
962 | 962 | $postdata .= "$val\r\n"; |
963 | 963 | } |
@@ -974,12 +974,12 @@ discard block |
||
974 | 974 | fclose($fp); |
975 | 975 | $base_name = basename($file_name); |
976 | 976 | |
977 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
977 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
978 | 978 | $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n"; |
979 | 979 | $postdata .= "$file_content\r\n"; |
980 | 980 | } |
981 | 981 | } |
982 | - $postdata .= "--" . $this->_mime_boundary . "--\r\n"; |
|
982 | + $postdata .= "--".$this->_mime_boundary."--\r\n"; |
|
983 | 983 | break; |
984 | 984 | } |
985 | 985 |
@@ -121,14 +121,18 @@ discard block |
||
121 | 121 | { |
122 | 122 | |
123 | 123 | $URI_PARTS = parse_url($URI); |
124 | - if (!empty($URI_PARTS["user"])) |
|
125 | - $this->user = $URI_PARTS["user"]; |
|
126 | - if (!empty($URI_PARTS["pass"])) |
|
127 | - $this->pass = $URI_PARTS["pass"]; |
|
128 | - if (empty($URI_PARTS["query"])) |
|
129 | - $URI_PARTS["query"] = ''; |
|
130 | - if (empty($URI_PARTS["path"])) |
|
131 | - $URI_PARTS["path"] = ''; |
|
124 | + if (!empty($URI_PARTS["user"])) { |
|
125 | + $this->user = $URI_PARTS["user"]; |
|
126 | + } |
|
127 | + if (!empty($URI_PARTS["pass"])) { |
|
128 | + $this->pass = $URI_PARTS["pass"]; |
|
129 | + } |
|
130 | + if (empty($URI_PARTS["query"])) { |
|
131 | + $URI_PARTS["query"] = ''; |
|
132 | + } |
|
133 | + if (empty($URI_PARTS["path"])) { |
|
134 | + $URI_PARTS["path"] = ''; |
|
135 | + } |
|
132 | 136 | |
133 | 137 | $fp = null; |
134 | 138 | |
@@ -142,8 +146,9 @@ discard block |
||
142 | 146 | case "http": |
143 | 147 | $this->scheme = strtolower($URI_PARTS["scheme"]); |
144 | 148 | $this->host = $URI_PARTS["host"]; |
145 | - if (!empty($URI_PARTS["port"])) |
|
146 | - $this->port = $URI_PARTS["port"]; |
|
149 | + if (!empty($URI_PARTS["port"])) { |
|
150 | + $this->port = $URI_PARTS["port"]; |
|
151 | + } |
|
147 | 152 | if ($this->_connect($fp)) { |
148 | 153 | if ($this->_isproxy) { |
149 | 154 | // using proxy, send entire URI |
@@ -177,8 +182,9 @@ discard block |
||
177 | 182 | if ($this->_framedepth < $this->maxframes) { |
178 | 183 | $this->fetch($frameurl); |
179 | 184 | $this->_framedepth++; |
180 | - } else |
|
181 | - break; |
|
185 | + } else { |
|
186 | + break; |
|
187 | + } |
|
182 | 188 | } |
183 | 189 | } |
184 | 190 | } else { |
@@ -213,14 +219,18 @@ discard block |
||
213 | 219 | $postdata = $this->_prepare_post_body($formvars, $formfiles); |
214 | 220 | |
215 | 221 | $URI_PARTS = parse_url($URI); |
216 | - if (!empty($URI_PARTS["user"])) |
|
217 | - $this->user = $URI_PARTS["user"]; |
|
218 | - if (!empty($URI_PARTS["pass"])) |
|
219 | - $this->pass = $URI_PARTS["pass"]; |
|
220 | - if (empty($URI_PARTS["query"])) |
|
221 | - $URI_PARTS["query"] = ''; |
|
222 | - if (empty($URI_PARTS["path"])) |
|
223 | - $URI_PARTS["path"] = ''; |
|
222 | + if (!empty($URI_PARTS["user"])) { |
|
223 | + $this->user = $URI_PARTS["user"]; |
|
224 | + } |
|
225 | + if (!empty($URI_PARTS["pass"])) { |
|
226 | + $this->pass = $URI_PARTS["pass"]; |
|
227 | + } |
|
228 | + if (empty($URI_PARTS["query"])) { |
|
229 | + $URI_PARTS["query"] = ''; |
|
230 | + } |
|
231 | + if (empty($URI_PARTS["path"])) { |
|
232 | + $URI_PARTS["path"] = ''; |
|
233 | + } |
|
224 | 234 | |
225 | 235 | switch (strtolower($URI_PARTS["scheme"])) { |
226 | 236 | case "https": |
@@ -232,8 +242,9 @@ discard block |
||
232 | 242 | case "http": |
233 | 243 | $this->scheme = strtolower($URI_PARTS["scheme"]); |
234 | 244 | $this->host = $URI_PARTS["host"]; |
235 | - if (!empty($URI_PARTS["port"])) |
|
236 | - $this->port = $URI_PARTS["port"]; |
|
245 | + if (!empty($URI_PARTS["port"])) { |
|
246 | + $this->port = $URI_PARTS["port"]; |
|
247 | + } |
|
237 | 248 | if ($this->_connect($fp)) { |
238 | 249 | if ($this->_isproxy) { |
239 | 250 | // using proxy, send entire URI |
@@ -249,18 +260,22 @@ discard block |
||
249 | 260 | if ($this->_redirectaddr) { |
250 | 261 | /* url was redirected, check if we've hit the max depth */ |
251 | 262 | if ($this->maxredirs > $this->_redirectdepth) { |
252 | - if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr)) |
|
253 | - $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]); |
|
263 | + if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr)) { |
|
264 | + $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]); |
|
265 | + } |
|
254 | 266 | |
255 | 267 | // only follow redirect if it's on this site, or offsiteok is true |
256 | 268 | if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) { |
257 | 269 | /* follow the redirect */ |
258 | 270 | $this->_redirectdepth++; |
259 | 271 | $this->lastredirectaddr = $this->_redirectaddr; |
260 | - if (strpos($this->_redirectaddr, "?") > 0) |
|
261 | - $this->fetch($this->_redirectaddr); // the redirect has changed the request method from post to get |
|
262 | - else |
|
263 | - $this->submit($this->_redirectaddr, $formvars, $formfiles); |
|
272 | + if (strpos($this->_redirectaddr, "?") > 0) { |
|
273 | + $this->fetch($this->_redirectaddr); |
|
274 | + } |
|
275 | + // the redirect has changed the request method from post to get |
|
276 | + else { |
|
277 | + $this->submit($this->_redirectaddr, $formvars, $formfiles); |
|
278 | + } |
|
264 | 279 | } |
265 | 280 | } |
266 | 281 | } |
@@ -273,8 +288,9 @@ discard block |
||
273 | 288 | if ($this->_framedepth < $this->maxframes) { |
274 | 289 | $this->fetch($frameurl); |
275 | 290 | $this->_framedepth++; |
276 | - } else |
|
277 | - break; |
|
291 | + } else { |
|
292 | + break; |
|
293 | + } |
|
278 | 294 | } |
279 | 295 | } |
280 | 296 | |
@@ -302,19 +318,24 @@ discard block |
||
302 | 318 | function fetchlinks($URI) |
303 | 319 | { |
304 | 320 | if ($this->fetch($URI) !== false) { |
305 | - if ($this->lastredirectaddr) |
|
306 | - $URI = $this->lastredirectaddr; |
|
321 | + if ($this->lastredirectaddr) { |
|
322 | + $URI = $this->lastredirectaddr; |
|
323 | + } |
|
307 | 324 | if (is_array($this->results)) { |
308 | - for ($x = 0; $x < count($this->results); $x++) |
|
309 | - $this->results[$x] = $this->_striplinks($this->results[$x]); |
|
310 | - } else |
|
311 | - $this->results = $this->_striplinks($this->results); |
|
325 | + for ($x = 0; $x < count($this->results); $x++) { |
|
326 | + $this->results[$x] = $this->_striplinks($this->results[$x]); |
|
327 | + } |
|
328 | + } else { |
|
329 | + $this->results = $this->_striplinks($this->results); |
|
330 | + } |
|
312 | 331 | |
313 | - if ($this->expandlinks) |
|
314 | - $this->results = $this->_expandlinks($this->results, $URI); |
|
332 | + if ($this->expandlinks) { |
|
333 | + $this->results = $this->_expandlinks($this->results, $URI); |
|
334 | + } |
|
315 | 335 | return $this; |
316 | - } else |
|
317 | - return false; |
|
336 | + } else { |
|
337 | + return false; |
|
338 | + } |
|
318 | 339 | } |
319 | 340 | |
320 | 341 | /*======================================================================*\ |
@@ -330,14 +351,17 @@ discard block |
||
330 | 351 | if ($this->fetch($URI) !== false) { |
331 | 352 | |
332 | 353 | if (is_array($this->results)) { |
333 | - for ($x = 0; $x < count($this->results); $x++) |
|
334 | - $this->results[$x] = $this->_stripform($this->results[$x]); |
|
335 | - } else |
|
336 | - $this->results = $this->_stripform($this->results); |
|
354 | + for ($x = 0; $x < count($this->results); $x++) { |
|
355 | + $this->results[$x] = $this->_stripform($this->results[$x]); |
|
356 | + } |
|
357 | + } else { |
|
358 | + $this->results = $this->_stripform($this->results); |
|
359 | + } |
|
337 | 360 | |
338 | 361 | return $this; |
339 | - } else |
|
340 | - return false; |
|
362 | + } else { |
|
363 | + return false; |
|
364 | + } |
|
341 | 365 | } |
342 | 366 | |
343 | 367 | |
@@ -352,13 +376,16 @@ discard block |
||
352 | 376 | { |
353 | 377 | if ($this->fetch($URI) !== false) { |
354 | 378 | if (is_array($this->results)) { |
355 | - for ($x = 0; $x < count($this->results); $x++) |
|
356 | - $this->results[$x] = $this->_striptext($this->results[$x]); |
|
357 | - } else |
|
358 | - $this->results = $this->_striptext($this->results); |
|
379 | + for ($x = 0; $x < count($this->results); $x++) { |
|
380 | + $this->results[$x] = $this->_striptext($this->results[$x]); |
|
381 | + } |
|
382 | + } else { |
|
383 | + $this->results = $this->_striptext($this->results); |
|
384 | + } |
|
359 | 385 | return $this; |
360 | - } else |
|
361 | - return false; |
|
386 | + } else { |
|
387 | + return false; |
|
388 | + } |
|
362 | 389 | } |
363 | 390 | |
364 | 391 | /*======================================================================*\ |
@@ -371,22 +398,26 @@ discard block |
||
371 | 398 | function submitlinks($URI, $formvars = "", $formfiles = "") |
372 | 399 | { |
373 | 400 | if ($this->submit($URI, $formvars, $formfiles) !== false) { |
374 | - if ($this->lastredirectaddr) |
|
375 | - $URI = $this->lastredirectaddr; |
|
401 | + if ($this->lastredirectaddr) { |
|
402 | + $URI = $this->lastredirectaddr; |
|
403 | + } |
|
376 | 404 | if (is_array($this->results)) { |
377 | 405 | for ($x = 0; $x < count($this->results); $x++) { |
378 | 406 | $this->results[$x] = $this->_striplinks($this->results[$x]); |
379 | - if ($this->expandlinks) |
|
380 | - $this->results[$x] = $this->_expandlinks($this->results[$x], $URI); |
|
407 | + if ($this->expandlinks) { |
|
408 | + $this->results[$x] = $this->_expandlinks($this->results[$x], $URI); |
|
409 | + } |
|
381 | 410 | } |
382 | 411 | } else { |
383 | 412 | $this->results = $this->_striplinks($this->results); |
384 | - if ($this->expandlinks) |
|
385 | - $this->results = $this->_expandlinks($this->results, $URI); |
|
413 | + if ($this->expandlinks) { |
|
414 | + $this->results = $this->_expandlinks($this->results, $URI); |
|
415 | + } |
|
386 | 416 | } |
387 | 417 | return $this; |
388 | - } else |
|
389 | - return false; |
|
418 | + } else { |
|
419 | + return false; |
|
420 | + } |
|
390 | 421 | } |
391 | 422 | |
392 | 423 | /*======================================================================*\ |
@@ -399,22 +430,26 @@ discard block |
||
399 | 430 | function submittext($URI, $formvars = "", $formfiles = "") |
400 | 431 | { |
401 | 432 | if ($this->submit($URI, $formvars, $formfiles) !== false) { |
402 | - if ($this->lastredirectaddr) |
|
403 | - $URI = $this->lastredirectaddr; |
|
433 | + if ($this->lastredirectaddr) { |
|
434 | + $URI = $this->lastredirectaddr; |
|
435 | + } |
|
404 | 436 | if (is_array($this->results)) { |
405 | 437 | for ($x = 0; $x < count($this->results); $x++) { |
406 | 438 | $this->results[$x] = $this->_striptext($this->results[$x]); |
407 | - if ($this->expandlinks) |
|
408 | - $this->results[$x] = $this->_expandlinks($this->results[$x], $URI); |
|
439 | + if ($this->expandlinks) { |
|
440 | + $this->results[$x] = $this->_expandlinks($this->results[$x], $URI); |
|
441 | + } |
|
409 | 442 | } |
410 | 443 | } else { |
411 | 444 | $this->results = $this->_striptext($this->results); |
412 | - if ($this->expandlinks) |
|
413 | - $this->results = $this->_expandlinks($this->results, $URI); |
|
445 | + if ($this->expandlinks) { |
|
446 | + $this->results = $this->_expandlinks($this->results, $URI); |
|
447 | + } |
|
414 | 448 | } |
415 | 449 | return $this; |
416 | - } else |
|
417 | - return false; |
|
450 | + } else { |
|
451 | + return false; |
|
452 | + } |
|
418 | 453 | } |
419 | 454 | |
420 | 455 | |
@@ -468,13 +503,15 @@ discard block |
||
468 | 503 | // catenate the non-empty matches from the conditional subpattern |
469 | 504 | |
470 | 505 | while (list($key, $val) = each($links[2])) { |
471 | - if (!empty($val)) |
|
472 | - $match[] = $val; |
|
506 | + if (!empty($val)) { |
|
507 | + $match[] = $val; |
|
508 | + } |
|
473 | 509 | } |
474 | 510 | |
475 | 511 | while (list($key, $val) = each($links[3])) { |
476 | - if (!empty($val)) |
|
477 | - $match[] = $val; |
|
512 | + if (!empty($val)) { |
|
513 | + $match[] = $val; |
|
514 | + } |
|
478 | 515 | } |
479 | 516 | |
480 | 517 | // return the links |
@@ -619,23 +656,28 @@ discard block |
||
619 | 656 | function _httprequest($url, $fp, $URI, $http_method, $content_type = "", $body = "") |
620 | 657 | { |
621 | 658 | $cookie_headers = ''; |
622 | - if ($this->passcookies && $this->_redirectaddr) |
|
623 | - $this->setcookies(); |
|
659 | + if ($this->passcookies && $this->_redirectaddr) { |
|
660 | + $this->setcookies(); |
|
661 | + } |
|
624 | 662 | |
625 | 663 | $URI_PARTS = parse_url($URI); |
626 | - if (empty($url)) |
|
627 | - $url = "/"; |
|
664 | + if (empty($url)) { |
|
665 | + $url = "/"; |
|
666 | + } |
|
628 | 667 | $headers = $http_method . " " . $url . " " . $this->_httpversion . "\r\n"; |
629 | 668 | if (!empty($this->host) && !isset($this->rawheaders['Host'])) { |
630 | 669 | $headers .= "Host: " . $this->host; |
631 | - if (!empty($this->port) && $this->port != '80') |
|
632 | - $headers .= ":" . $this->port; |
|
670 | + if (!empty($this->port) && $this->port != '80') { |
|
671 | + $headers .= ":" . $this->port; |
|
672 | + } |
|
633 | 673 | $headers .= "\r\n"; |
634 | 674 | } |
635 | - if (!empty($this->agent)) |
|
636 | - $headers .= "User-Agent: " . $this->agent . "\r\n"; |
|
637 | - if (!empty($this->accept)) |
|
638 | - $headers .= "Accept: " . $this->accept . "\r\n"; |
|
675 | + if (!empty($this->agent)) { |
|
676 | + $headers .= "User-Agent: " . $this->agent . "\r\n"; |
|
677 | + } |
|
678 | + if (!empty($this->accept)) { |
|
679 | + $headers .= "Accept: " . $this->accept . "\r\n"; |
|
680 | + } |
|
639 | 681 | if ($this->use_gzip) { |
640 | 682 | // make sure PHP was built with --with-zlib |
641 | 683 | // and we can handle gzipp'ed data |
@@ -648,11 +690,13 @@ discard block |
||
648 | 690 | E_USER_NOTICE); |
649 | 691 | } |
650 | 692 | } |
651 | - if (!empty($this->referer)) |
|
652 | - $headers .= "Referer: " . $this->referer . "\r\n"; |
|
693 | + if (!empty($this->referer)) { |
|
694 | + $headers .= "Referer: " . $this->referer . "\r\n"; |
|
695 | + } |
|
653 | 696 | if (!empty($this->cookies)) { |
654 | - if (!is_array($this->cookies)) |
|
655 | - $this->cookies = (array)$this->cookies; |
|
697 | + if (!is_array($this->cookies)) { |
|
698 | + $this->cookies = (array)$this->cookies; |
|
699 | + } |
|
656 | 700 | |
657 | 701 | reset($this->cookies); |
658 | 702 | if (count($this->cookies) > 0) { |
@@ -664,32 +708,39 @@ discard block |
||
664 | 708 | } |
665 | 709 | } |
666 | 710 | if (!empty($this->rawheaders)) { |
667 | - if (!is_array($this->rawheaders)) |
|
668 | - $this->rawheaders = (array)$this->rawheaders; |
|
669 | - while (list($headerKey, $headerVal) = each($this->rawheaders)) |
|
670 | - $headers .= $headerKey . ": " . $headerVal . "\r\n"; |
|
711 | + if (!is_array($this->rawheaders)) { |
|
712 | + $this->rawheaders = (array)$this->rawheaders; |
|
713 | + } |
|
714 | + while (list($headerKey, $headerVal) = each($this->rawheaders)) { |
|
715 | + $headers .= $headerKey . ": " . $headerVal . "\r\n"; |
|
716 | + } |
|
671 | 717 | } |
672 | 718 | if (!empty($content_type)) { |
673 | 719 | $headers .= "Content-type: $content_type"; |
674 | - if ($content_type == "multipart/form-data") |
|
675 | - $headers .= "; boundary=" . $this->_mime_boundary; |
|
720 | + if ($content_type == "multipart/form-data") { |
|
721 | + $headers .= "; boundary=" . $this->_mime_boundary; |
|
722 | + } |
|
676 | 723 | $headers .= "\r\n"; |
677 | 724 | } |
678 | - if (!empty($body)) |
|
679 | - $headers .= "Content-length: " . strlen($body) . "\r\n"; |
|
680 | - if (!empty($this->user) || !empty($this->pass)) |
|
681 | - $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n"; |
|
725 | + if (!empty($body)) { |
|
726 | + $headers .= "Content-length: " . strlen($body) . "\r\n"; |
|
727 | + } |
|
728 | + if (!empty($this->user) || !empty($this->pass)) { |
|
729 | + $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n"; |
|
730 | + } |
|
682 | 731 | |
683 | 732 | //add proxy auth headers |
684 | - if (!empty($this->proxy_user)) |
|
685 | - $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n"; |
|
733 | + if (!empty($this->proxy_user)) { |
|
734 | + $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n"; |
|
735 | + } |
|
686 | 736 | |
687 | 737 | |
688 | 738 | $headers .= "\r\n"; |
689 | 739 | |
690 | 740 | // set the read timeout if needed |
691 | - if ($this->read_timeout > 0) |
|
692 | - socket_set_timeout($fp, $this->read_timeout); |
|
741 | + if ($this->read_timeout > 0) { |
|
742 | + socket_set_timeout($fp, $this->read_timeout); |
|
743 | + } |
|
693 | 744 | $this->timed_out = false; |
694 | 745 | |
695 | 746 | fwrite($fp, $headers . $body, strlen($headers . $body)); |
@@ -706,8 +757,9 @@ discard block |
||
706 | 757 | return false; |
707 | 758 | } |
708 | 759 | |
709 | - if ($currentHeader == "\r\n") |
|
710 | - break; |
|
760 | + if ($currentHeader == "\r\n") { |
|
761 | + break; |
|
762 | + } |
|
711 | 763 | |
712 | 764 | // if a header begins with Location: or URI:, set the redirect |
713 | 765 | if (preg_match("/^(Location:|URI:)/i", $currentHeader)) { |
@@ -718,12 +770,14 @@ discard block |
||
718 | 770 | // no host in the path, so prepend |
719 | 771 | $this->_redirectaddr = $URI_PARTS["scheme"] . "://" . $this->host . ":" . $this->port; |
720 | 772 | // eliminate double slash |
721 | - if (!preg_match("|^/|", $matches[2])) |
|
722 | - $this->_redirectaddr .= "/" . $matches[2]; |
|
723 | - else |
|
724 | - $this->_redirectaddr .= $matches[2]; |
|
725 | - } else |
|
726 | - $this->_redirectaddr = $matches[2]; |
|
773 | + if (!preg_match("|^/|", $matches[2])) { |
|
774 | + $this->_redirectaddr .= "/" . $matches[2]; |
|
775 | + } else { |
|
776 | + $this->_redirectaddr .= $matches[2]; |
|
777 | + } |
|
778 | + } else { |
|
779 | + $this->_redirectaddr = $matches[2]; |
|
780 | + } |
|
727 | 781 | } |
728 | 782 | |
729 | 783 | if (preg_match("|^HTTP/|", $currentHeader)) { |
@@ -770,14 +824,17 @@ discard block |
||
770 | 824 | // have we hit our frame depth and is there frame src to fetch? |
771 | 825 | if (($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i", $results, $match)) { |
772 | 826 | $this->results[] = $results; |
773 | - for ($x = 0; $x < count($match[1]); $x++) |
|
774 | - $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"] . "://" . $this->host); |
|
827 | + for ($x = 0; $x < count($match[1]); $x++) { |
|
828 | + $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"] . "://" . $this->host); |
|
829 | + } |
|
775 | 830 | } // have we already fetched framed content? |
776 | - elseif (is_array($this->results)) |
|
777 | - $this->results[] = $results; |
|
831 | + elseif (is_array($this->results)) { |
|
832 | + $this->results[] = $results; |
|
833 | + } |
|
778 | 834 | // no framed content |
779 | - else |
|
780 | - $this->results = $results; |
|
835 | + else { |
|
836 | + $this->results = $results; |
|
837 | + } |
|
781 | 838 | |
782 | 839 | return $this; |
783 | 840 | } |
@@ -790,8 +847,9 @@ discard block |
||
790 | 847 | function setcookies() |
791 | 848 | { |
792 | 849 | for ($x = 0; $x < count($this->headers); $x++) { |
793 | - if (preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x], $match)) |
|
794 | - $this->cookies[$match[1]] = urldecode($match[2]); |
|
850 | + if (preg_match('/^set-cookie:[\s]+([^=]+)=([^;]+)/i', $this->headers[$x], $match)) { |
|
851 | + $this->cookies[$match[1]] = urldecode($match[2]); |
|
852 | + } |
|
795 | 853 | } |
796 | 854 | return $this; |
797 | 855 | } |
@@ -852,10 +910,12 @@ discard block |
||
852 | 910 | 'disable_compression' => true, |
853 | 911 | ); |
854 | 912 | |
855 | - if (isset($this->cafile)) |
|
856 | - $context_opts['ssl']['cafile'] = $this->cafile; |
|
857 | - if (isset($this->capath)) |
|
858 | - $context_opts['ssl']['capath'] = $this->capath; |
|
913 | + if (isset($this->cafile)) { |
|
914 | + $context_opts['ssl']['cafile'] = $this->cafile; |
|
915 | + } |
|
916 | + if (isset($this->capath)) { |
|
917 | + $context_opts['ssl']['capath'] = $this->capath; |
|
918 | + } |
|
859 | 919 | } |
860 | 920 | |
861 | 921 | $host = 'ssl://' . $host; |
@@ -864,8 +924,9 @@ discard block |
||
864 | 924 | $context = stream_context_create($context_opts); |
865 | 925 | |
866 | 926 | if (version_compare(PHP_VERSION, '5.0.0', '>')) { |
867 | - if($this->scheme == 'http') |
|
868 | - $host = "tcp://" . $host; |
|
927 | + if($this->scheme == 'http') { |
|
928 | + $host = "tcp://" . $host; |
|
929 | + } |
|
869 | 930 | $fp = stream_socket_client( |
870 | 931 | "$host:$port", |
871 | 932 | $errno, |
@@ -929,8 +990,9 @@ discard block |
||
929 | 990 | settype($formfiles, "array"); |
930 | 991 | $postdata = ''; |
931 | 992 | |
932 | - if (count($formvars) == 0 && count($formfiles) == 0) |
|
933 | - return; |
|
993 | + if (count($formvars) == 0 && count($formfiles) == 0) { |
|
994 | + return; |
|
995 | + } |
|
934 | 996 | |
935 | 997 | switch ($this->_submit_type) { |
936 | 998 | case "application/x-www-form-urlencoded": |
@@ -940,8 +1002,9 @@ discard block |
||
940 | 1002 | while (list($cur_key, $cur_val) = each($val)) { |
941 | 1003 | $postdata .= urlencode($key) . "[]=" . urlencode($cur_val) . "&"; |
942 | 1004 | } |
943 | - } else |
|
944 | - $postdata .= urlencode($key) . "=" . urlencode($val) . "&"; |
|
1005 | + } else { |
|
1006 | + $postdata .= urlencode($key) . "=" . urlencode($val) . "&"; |
|
1007 | + } |
|
945 | 1008 | } |
946 | 1009 | break; |
947 | 1010 | |
@@ -967,7 +1030,9 @@ discard block |
||
967 | 1030 | while (list($field_name, $file_names) = each($formfiles)) { |
968 | 1031 | settype($file_names, "array"); |
969 | 1032 | while (list(, $file_name) = each($file_names)) { |
970 | - if (!is_readable($file_name)) continue; |
|
1033 | + if (!is_readable($file_name)) { |
|
1034 | + continue; |
|
1035 | + } |
|
971 | 1036 | |
972 | 1037 | $fp = fopen($file_name, "r"); |
973 | 1038 | $file_content = fread($fp, filesize($file_name)); |
@@ -243,6 +243,9 @@ discard block |
||
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
246 | +/** |
|
247 | + * @param integer $lvl |
|
248 | + */ |
|
246 | 249 | function debug ($debugmsg, $lvl=E_USER_NOTICE) { |
247 | 250 | trigger_error("MagpieRSS [debug] $debugmsg", $lvl); |
248 | 251 | } |
@@ -289,6 +292,9 @@ discard block |
||
289 | 292 | Input: an HTTP response object (see Snoopy) |
290 | 293 | Output: parsed RSS object (see rss_parse) |
291 | 294 | \*=======================================================================*/ |
295 | +/** |
|
296 | + * @param Snoopy $resp |
|
297 | + */ |
|
292 | 298 | function _response_to_rss ($resp) { |
293 | 299 | $rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING ); |
294 | 300 |
@@ -166,7 +166,7 @@ |
||
166 | 166 | $resp = _fetch_remote_file( $url, $request_headers ); |
167 | 167 | |
168 | 168 | if (isset($resp) and $resp) { |
169 | - if ($resp->status == '304' ) { |
|
169 | + if ($resp->status == '304' ) { |
|
170 | 170 | // we have the most current copy |
171 | 171 | if ( MAGPIE_DEBUG > 1) { |
172 | 172 | debug("Got 304 for $url"); |
@@ -24,19 +24,19 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | if (!defined('MAGPIE_DIR')) { |
27 | - define('MAGPIE_DIR', dirname(__FILE__) . DIR_SEP); |
|
27 | + define('MAGPIE_DIR', dirname(__FILE__).DIR_SEP); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | if (!defined('MAGPIE_CACHE_DIR')) { |
31 | - define('MAGPIE_CACHE_DIR', MODX_BASE_PATH . 'assets/cache/rss'); |
|
31 | + define('MAGPIE_CACHE_DIR', MODX_BASE_PATH.'assets/cache/rss'); |
|
32 | 32 | } |
33 | 33 | |
34 | -require_once( MAGPIE_DIR . 'rss_parse.inc' ); |
|
35 | -require_once( MAGPIE_DIR . 'rss_cache.inc' ); |
|
34 | +require_once(MAGPIE_DIR.'rss_parse.inc'); |
|
35 | +require_once(MAGPIE_DIR.'rss_cache.inc'); |
|
36 | 36 | |
37 | 37 | // for including 3rd party libraries |
38 | -define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP); |
|
39 | -require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc'); |
|
38 | +define('MAGPIE_EXTLIB', MAGPIE_DIR.'extlib'.DIR_SEP); |
|
39 | +require_once(MAGPIE_EXTLIB.'Snoopy.class.inc'); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | /* |
@@ -89,21 +89,21 @@ discard block |
||
89 | 89 | |
90 | 90 | $MAGPIE_ERROR = ""; |
91 | 91 | |
92 | -function fetch_rss ($url) { |
|
92 | +function fetch_rss($url){ |
|
93 | 93 | // initialize constants |
94 | 94 | init(); |
95 | 95 | |
96 | - if ( !isset($url) ) { |
|
96 | + if (!isset($url)) { |
|
97 | 97 | error("fetch_rss called without a url"); |
98 | 98 | return false; |
99 | 99 | } |
100 | 100 | |
101 | 101 | // if cache is disabled |
102 | - if ( !MAGPIE_CACHE_ON ) { |
|
102 | + if (!MAGPIE_CACHE_ON) { |
|
103 | 103 | // fetch file, and parse it |
104 | - $resp = _fetch_remote_file( $url ); |
|
105 | - if ( is_success( $resp->status ) ) { |
|
106 | - return _response_to_rss( $resp ); |
|
104 | + $resp = _fetch_remote_file($url); |
|
105 | + if (is_success($resp->status)) { |
|
106 | + return _response_to_rss($resp); |
|
107 | 107 | } |
108 | 108 | else { |
109 | 109 | error("Failed to fetch $url and cache is off"); |
@@ -118,34 +118,34 @@ discard block |
||
118 | 118 | // 3. if cached obj fails freshness check, fetch remote |
119 | 119 | // 4. if remote fails, return stale object, or error |
120 | 120 | |
121 | - $cache = new RSSCache( MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE ); |
|
121 | + $cache = new RSSCache(MAGPIE_CACHE_DIR, MAGPIE_CACHE_AGE); |
|
122 | 122 | |
123 | 123 | if (MAGPIE_DEBUG and $cache->ERROR) { |
124 | 124 | debug($cache->ERROR, E_USER_WARNING); |
125 | 125 | } |
126 | 126 | |
127 | 127 | |
128 | - $cache_status = 0; // response of check_cache |
|
128 | + $cache_status = 0; // response of check_cache |
|
129 | 129 | $request_headers = array(); // HTTP headers to send with fetch |
130 | - $rss = 0; // parsed RSS object |
|
131 | - $errormsg = 0; // errors, if any |
|
130 | + $rss = 0; // parsed RSS object |
|
131 | + $errormsg = 0; // errors, if any |
|
132 | 132 | |
133 | 133 | // store parsed XML by desired output encoding |
134 | 134 | // as character munging happens at parse time |
135 | - $cache_key = $url . MAGPIE_OUTPUT_ENCODING; |
|
135 | + $cache_key = $url.MAGPIE_OUTPUT_ENCODING; |
|
136 | 136 | |
137 | 137 | if (!$cache->ERROR) { |
138 | 138 | // return cache HIT, MISS, or STALE |
139 | - $cache_status = $cache->check_cache( $cache_key); |
|
139 | + $cache_status = $cache->check_cache($cache_key); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | // if object cached, and cache is fresh, return cached obj |
143 | - if ( $cache_status == 'HIT' ) { |
|
144 | - $rss = $cache->get( $cache_key ); |
|
145 | - if ( isset($rss) and $rss ) { |
|
143 | + if ($cache_status == 'HIT') { |
|
144 | + $rss = $cache->get($cache_key); |
|
145 | + if (isset($rss) and $rss) { |
|
146 | 146 | // should be cache age |
147 | 147 | $rss->from_cache = 1; |
148 | - if ( MAGPIE_DEBUG > 1) { |
|
148 | + if (MAGPIE_DEBUG > 1) { |
|
149 | 149 | debug("MagpieRSS: Cache HIT", E_USER_NOTICE); |
150 | 150 | } |
151 | 151 | return $rss; |
@@ -155,50 +155,50 @@ discard block |
||
155 | 155 | // else attempt a conditional get |
156 | 156 | |
157 | 157 | // setup headers |
158 | - if ( $cache_status == 'STALE' ) { |
|
159 | - $rss = $cache->get( $cache_key ); |
|
160 | - if ( $rss and $rss->etag and $rss->last_modified ) { |
|
158 | + if ($cache_status == 'STALE') { |
|
159 | + $rss = $cache->get($cache_key); |
|
160 | + if ($rss and $rss->etag and $rss->last_modified) { |
|
161 | 161 | $request_headers['If-None-Match'] = $rss->etag; |
162 | 162 | $request_headers['If-Last-Modified'] = $rss->last_modified; |
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
166 | - $resp = _fetch_remote_file( $url, $request_headers ); |
|
166 | + $resp = _fetch_remote_file($url, $request_headers); |
|
167 | 167 | |
168 | 168 | if (isset($resp) and $resp) { |
169 | - if ($resp->status == '304' ) { |
|
169 | + if ($resp->status == '304') { |
|
170 | 170 | // we have the most current copy |
171 | - if ( MAGPIE_DEBUG > 1) { |
|
171 | + if (MAGPIE_DEBUG > 1) { |
|
172 | 172 | debug("Got 304 for $url"); |
173 | 173 | } |
174 | 174 | // reset cache on 304 (at minutillo insistent prodding) |
175 | 175 | $cache->set($cache_key, $rss); |
176 | 176 | return $rss; |
177 | 177 | } |
178 | - elseif ( is_success( $resp->status ) ) { |
|
179 | - $rss = _response_to_rss( $resp ); |
|
180 | - if ( $rss ) { |
|
178 | + elseif (is_success($resp->status)) { |
|
179 | + $rss = _response_to_rss($resp); |
|
180 | + if ($rss) { |
|
181 | 181 | if (MAGPIE_DEBUG > 1) { |
182 | 182 | debug("Fetch successful"); |
183 | 183 | } |
184 | 184 | // add object to cache |
185 | - $cache->set( $cache_key, $rss ); |
|
185 | + $cache->set($cache_key, $rss); |
|
186 | 186 | return $rss; |
187 | 187 | } |
188 | 188 | } |
189 | 189 | else { |
190 | 190 | $errormsg = "Failed to fetch $url "; |
191 | - if ( $resp->status == '-100' ) { |
|
192 | - $errormsg .= "(Request timed out after " . MAGPIE_FETCH_TIME_OUT . " seconds)"; |
|
191 | + if ($resp->status == '-100') { |
|
192 | + $errormsg .= "(Request timed out after ".MAGPIE_FETCH_TIME_OUT." seconds)"; |
|
193 | 193 | } |
194 | - elseif ( $resp->error ) { |
|
194 | + elseif ($resp->error) { |
|
195 | 195 | # compensate for Snoopy's annoying habbit to tacking |
196 | 196 | # on '\n' |
197 | 197 | $http_error = substr($resp->error, 0, -2); |
198 | 198 | $errormsg .= "(HTTP Error: $http_error)"; |
199 | 199 | } |
200 | 200 | else { |
201 | - $errormsg .= "(HTTP Response: " . $resp->response_code .')'; |
|
201 | + $errormsg .= "(HTTP Response: ".$resp->response_code.')'; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | } |
@@ -210,14 +210,14 @@ discard block |
||
210 | 210 | |
211 | 211 | // attempt to return cached object |
212 | 212 | if ($rss) { |
213 | - if ( MAGPIE_DEBUG ) { |
|
213 | + if (MAGPIE_DEBUG) { |
|
214 | 214 | debug("Returning STALE object for $url"); |
215 | 215 | } |
216 | 216 | return $rss; |
217 | 217 | } |
218 | 218 | |
219 | 219 | // else we totally failed |
220 | - error( $errormsg ); |
|
220 | + error($errormsg); |
|
221 | 221 | |
222 | 222 | return false; |
223 | 223 | |
@@ -229,21 +229,21 @@ discard block |
||
229 | 229 | Purpose: set MAGPIE_ERROR, and trigger error |
230 | 230 | \*=======================================================================*/ |
231 | 231 | |
232 | -function error ($errormsg, $lvl=E_USER_WARNING) { |
|
232 | +function error($errormsg, $lvl = E_USER_WARNING){ |
|
233 | 233 | global $MAGPIE_ERROR; |
234 | 234 | |
235 | 235 | // append PHP's error message if track_errors enabled |
236 | - if ( isset($php_errormsg) ) { |
|
236 | + if (isset($php_errormsg)) { |
|
237 | 237 | $errormsg .= " ($php_errormsg)"; |
238 | 238 | } |
239 | - if ( $errormsg ) { |
|
239 | + if ($errormsg) { |
|
240 | 240 | $errormsg = "MagpieRSS: $errormsg"; |
241 | 241 | $MAGPIE_ERROR = $errormsg; |
242 | - trigger_error( $errormsg, $lvl); |
|
242 | + trigger_error($errormsg, $lvl); |
|
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
246 | -function debug ($debugmsg, $lvl=E_USER_NOTICE) { |
|
246 | +function debug($debugmsg, $lvl = E_USER_NOTICE){ |
|
247 | 247 | trigger_error("MagpieRSS [debug] $debugmsg", $lvl); |
248 | 248 | } |
249 | 249 | |
@@ -251,10 +251,10 @@ discard block |
||
251 | 251 | Function: magpie_error |
252 | 252 | Purpose: accessor for the magpie error variable |
253 | 253 | \*=======================================================================*/ |
254 | -function magpie_error ($errormsg="") { |
|
254 | +function magpie_error($errormsg = ""){ |
|
255 | 255 | global $MAGPIE_ERROR; |
256 | 256 | |
257 | - if ( isset($errormsg) and $errormsg ) { |
|
257 | + if (isset($errormsg) and $errormsg) { |
|
258 | 258 | $MAGPIE_ERROR = $errormsg; |
259 | 259 | } |
260 | 260 | |
@@ -268,13 +268,13 @@ discard block |
||
268 | 268 | headers to send along with the request (optional) |
269 | 269 | Output: an HTTP response object (see Snoopy.class.inc) |
270 | 270 | \*=======================================================================*/ |
271 | -function _fetch_remote_file ($url, $headers = "" ) { |
|
271 | +function _fetch_remote_file($url, $headers = ""){ |
|
272 | 272 | // Snoopy is an HTTP client in PHP |
273 | 273 | $client = new Snoopy(); |
274 | 274 | $client->agent = MAGPIE_USER_AGENT; |
275 | 275 | $client->read_timeout = MAGPIE_FETCH_TIME_OUT; |
276 | 276 | $client->use_gzip = MAGPIE_USE_GZIP; |
277 | - if (is_array($headers) ) { |
|
277 | + if (is_array($headers)) { |
|
278 | 278 | $client->rawheaders = $headers; |
279 | 279 | } |
280 | 280 | |
@@ -289,14 +289,14 @@ discard block |
||
289 | 289 | Input: an HTTP response object (see Snoopy) |
290 | 290 | Output: parsed RSS object (see rss_parse) |
291 | 291 | \*=======================================================================*/ |
292 | -function _response_to_rss ($resp) { |
|
293 | - $rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING ); |
|
292 | +function _response_to_rss($resp){ |
|
293 | + $rss = new MagpieRSS($resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING); |
|
294 | 294 | |
295 | 295 | // if RSS parsed successfully |
296 | - if ( $rss and !$rss->ERROR) { |
|
296 | + if ($rss and !$rss->ERROR) { |
|
297 | 297 | |
298 | 298 | // find Etag, and Last-Modified |
299 | - foreach($resp->headers as $h) { |
|
299 | + foreach ($resp->headers as $h) { |
|
300 | 300 | // 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1" |
301 | 301 | if (strpos($h, ": ")) { |
302 | 302 | list($field, $val) = explode(": ", $h, 2); |
@@ -306,11 +306,11 @@ discard block |
||
306 | 306 | $val = ""; |
307 | 307 | } |
308 | 308 | |
309 | - if ( $field == 'ETag' ) { |
|
309 | + if ($field == 'ETag') { |
|
310 | 310 | $rss->etag = $val; |
311 | 311 | } |
312 | 312 | |
313 | - if ( $field == 'Last-Modified' ) { |
|
313 | + if ($field == 'Last-Modified') { |
|
314 | 314 | $rss->last_modified = $val; |
315 | 315 | } |
316 | 316 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $errormsg = "Failed to parse RSS file."; |
322 | 322 | |
323 | 323 | if ($rss) { |
324 | - $errormsg .= " (" . $rss->ERROR . ")"; |
|
324 | + $errormsg .= " (".$rss->ERROR.")"; |
|
325 | 325 | } |
326 | 326 | error($errormsg); |
327 | 327 | |
@@ -334,67 +334,67 @@ discard block |
||
334 | 334 | Purpose: setup constants with default values |
335 | 335 | check for user overrides |
336 | 336 | \*=======================================================================*/ |
337 | -function init () { |
|
338 | - if ( defined('MAGPIE_INITALIZED') ) { |
|
337 | +function init(){ |
|
338 | + if (defined('MAGPIE_INITALIZED')) { |
|
339 | 339 | return; |
340 | 340 | } |
341 | 341 | else { |
342 | 342 | define('MAGPIE_INITALIZED', true); |
343 | 343 | } |
344 | 344 | |
345 | - if ( !defined('MAGPIE_CACHE_ON') ) { |
|
345 | + if (!defined('MAGPIE_CACHE_ON')) { |
|
346 | 346 | define('MAGPIE_CACHE_ON', true); |
347 | 347 | } |
348 | 348 | |
349 | - if ( !defined('MAGPIE_CACHE_DIR') ) { |
|
349 | + if (!defined('MAGPIE_CACHE_DIR')) { |
|
350 | 350 | define('MAGPIE_CACHE_DIR', './cache'); |
351 | 351 | } |
352 | 352 | |
353 | - if ( !defined('MAGPIE_CACHE_AGE') ) { |
|
354 | - define('MAGPIE_CACHE_AGE', 60*60); // one hour |
|
353 | + if (!defined('MAGPIE_CACHE_AGE')) { |
|
354 | + define('MAGPIE_CACHE_AGE', 60 * 60); // one hour |
|
355 | 355 | } |
356 | 356 | |
357 | - if ( !defined('MAGPIE_CACHE_FRESH_ONLY') ) { |
|
357 | + if (!defined('MAGPIE_CACHE_FRESH_ONLY')) { |
|
358 | 358 | define('MAGPIE_CACHE_FRESH_ONLY', false); |
359 | 359 | } |
360 | 360 | |
361 | - if ( !defined('MAGPIE_OUTPUT_ENCODING') ) { |
|
361 | + if (!defined('MAGPIE_OUTPUT_ENCODING')) { |
|
362 | 362 | global $modx_manager_charset; |
363 | - if(empty($modx_manager_charset)) $modx_manager_charset = 'ISO-8859-1'; |
|
363 | + if (empty($modx_manager_charset)) $modx_manager_charset = 'ISO-8859-1'; |
|
364 | 364 | define('MAGPIE_OUTPUT_ENCODING', $modx_manager_charset); |
365 | 365 | } |
366 | 366 | |
367 | - if ( !defined('MAGPIE_INPUT_ENCODING') ) { |
|
367 | + if (!defined('MAGPIE_INPUT_ENCODING')) { |
|
368 | 368 | define('MAGPIE_INPUT_ENCODING', null); |
369 | 369 | } |
370 | 370 | |
371 | - if ( !defined('MAGPIE_DETECT_ENCODING') ) { |
|
371 | + if (!defined('MAGPIE_DETECT_ENCODING')) { |
|
372 | 372 | define('MAGPIE_DETECT_ENCODING', true); |
373 | 373 | } |
374 | 374 | |
375 | - if ( !defined('MAGPIE_DEBUG') ) { |
|
375 | + if (!defined('MAGPIE_DEBUG')) { |
|
376 | 376 | define('MAGPIE_DEBUG', 0); |
377 | 377 | } |
378 | 378 | |
379 | - if ( !defined('MAGPIE_USER_AGENT') ) { |
|
380 | - $ua = 'MagpieRSS/'. MAGPIE_VERSION . ' (+http://magpierss.sf.net'; |
|
379 | + if (!defined('MAGPIE_USER_AGENT')) { |
|
380 | + $ua = 'MagpieRSS/'.MAGPIE_VERSION.' (+http://magpierss.sf.net'; |
|
381 | 381 | |
382 | - if ( MAGPIE_CACHE_ON ) { |
|
383 | - $ua = $ua . ')'; |
|
382 | + if (MAGPIE_CACHE_ON) { |
|
383 | + $ua = $ua.')'; |
|
384 | 384 | } |
385 | 385 | else { |
386 | - $ua = $ua . '; No cache)'; |
|
386 | + $ua = $ua.'; No cache)'; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | define('MAGPIE_USER_AGENT', $ua); |
390 | 390 | } |
391 | 391 | |
392 | - if ( !defined('MAGPIE_FETCH_TIME_OUT') ) { |
|
392 | + if (!defined('MAGPIE_FETCH_TIME_OUT')) { |
|
393 | 393 | define('MAGPIE_FETCH_TIME_OUT', 5); // 5 second timeout |
394 | 394 | } |
395 | 395 | |
396 | 396 | // use gzip encoding to fetch rss files if supported? |
397 | - if ( !defined('MAGPIE_USE_GZIP') ) { |
|
397 | + if (!defined('MAGPIE_USE_GZIP')) { |
|
398 | 398 | define('MAGPIE_USE_GZIP', true); |
399 | 399 | } |
400 | 400 | } |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | Function: is_info |
418 | 418 | Purpose: return true if Informational status code |
419 | 419 | \*=======================================================================*/ |
420 | -function is_info ($sc) { |
|
420 | +function is_info($sc){ |
|
421 | 421 | return $sc >= 100 && $sc < 200; |
422 | 422 | } |
423 | 423 | |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | Function: is_success |
426 | 426 | Purpose: return true if Successful status code |
427 | 427 | \*=======================================================================*/ |
428 | -function is_success ($sc) { |
|
428 | +function is_success($sc){ |
|
429 | 429 | return $sc >= 200 && $sc < 300; |
430 | 430 | } |
431 | 431 | |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | Function: is_redirect |
434 | 434 | Purpose: return true if Redirection status code |
435 | 435 | \*=======================================================================*/ |
436 | -function is_redirect ($sc) { |
|
436 | +function is_redirect($sc){ |
|
437 | 437 | return $sc >= 300 && $sc < 400; |
438 | 438 | } |
439 | 439 | |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | Function: is_error |
442 | 442 | Purpose: return true if Error status code |
443 | 443 | \*=======================================================================*/ |
444 | -function is_error ($sc) { |
|
444 | +function is_error($sc){ |
|
445 | 445 | return $sc >= 400 && $sc < 600; |
446 | 446 | } |
447 | 447 | |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | Function: is_client_error |
450 | 450 | Purpose: return true if Error status code, and its a client error |
451 | 451 | \*=======================================================================*/ |
452 | -function is_client_error ($sc) { |
|
452 | +function is_client_error($sc){ |
|
453 | 453 | return $sc >= 400 && $sc < 500; |
454 | 454 | } |
455 | 455 | |
@@ -457,6 +457,6 @@ discard block |
||
457 | 457 | Function: is_client_error |
458 | 458 | Purpose: return true if Error status code, and its a server error |
459 | 459 | \*=======================================================================*/ |
460 | -function is_server_error ($sc) { |
|
460 | +function is_server_error($sc){ |
|
461 | 461 | return $sc >= 500 && $sc < 600; |
462 | 462 | } |
@@ -89,7 +89,8 @@ discard block |
||
89 | 89 | |
90 | 90 | $MAGPIE_ERROR = ""; |
91 | 91 | |
92 | -function fetch_rss ($url) { |
|
92 | +function fetch_rss ($url) |
|
93 | +{ |
|
93 | 94 | // initialize constants |
94 | 95 | init(); |
95 | 96 | |
@@ -104,8 +105,7 @@ discard block |
||
104 | 105 | $resp = _fetch_remote_file( $url ); |
105 | 106 | if ( is_success( $resp->status ) ) { |
106 | 107 | return _response_to_rss( $resp ); |
107 | - } |
|
108 | - else { |
|
108 | + } else { |
|
109 | 109 | error("Failed to fetch $url and cache is off"); |
110 | 110 | return false; |
111 | 111 | } |
@@ -174,8 +174,7 @@ discard block |
||
174 | 174 | // reset cache on 304 (at minutillo insistent prodding) |
175 | 175 | $cache->set($cache_key, $rss); |
176 | 176 | return $rss; |
177 | - } |
|
178 | - elseif ( is_success( $resp->status ) ) { |
|
177 | + } elseif ( is_success( $resp->status ) ) { |
|
179 | 178 | $rss = _response_to_rss( $resp ); |
180 | 179 | if ( $rss ) { |
181 | 180 | if (MAGPIE_DEBUG > 1) { |
@@ -185,24 +184,20 @@ discard block |
||
185 | 184 | $cache->set( $cache_key, $rss ); |
186 | 185 | return $rss; |
187 | 186 | } |
188 | - } |
|
189 | - else { |
|
187 | + } else { |
|
190 | 188 | $errormsg = "Failed to fetch $url "; |
191 | 189 | if ( $resp->status == '-100' ) { |
192 | 190 | $errormsg .= "(Request timed out after " . MAGPIE_FETCH_TIME_OUT . " seconds)"; |
193 | - } |
|
194 | - elseif ( $resp->error ) { |
|
191 | + } elseif ( $resp->error ) { |
|
195 | 192 | # compensate for Snoopy's annoying habbit to tacking |
196 | 193 | # on '\n' |
197 | 194 | $http_error = substr($resp->error, 0, -2); |
198 | 195 | $errormsg .= "(HTTP Error: $http_error)"; |
199 | - } |
|
200 | - else { |
|
196 | + } else { |
|
201 | 197 | $errormsg .= "(HTTP Response: " . $resp->response_code .')'; |
202 | 198 | } |
203 | 199 | } |
204 | - } |
|
205 | - else { |
|
200 | + } else { |
|
206 | 201 | $errormsg = "Unable to retrieve RSS file for unknown reasons."; |
207 | 202 | } |
208 | 203 | |
@@ -229,7 +224,8 @@ discard block |
||
229 | 224 | Purpose: set MAGPIE_ERROR, and trigger error |
230 | 225 | \*=======================================================================*/ |
231 | 226 | |
232 | -function error ($errormsg, $lvl=E_USER_WARNING) { |
|
227 | +function error ($errormsg, $lvl=E_USER_WARNING) |
|
228 | +{ |
|
233 | 229 | global $MAGPIE_ERROR; |
234 | 230 | |
235 | 231 | // append PHP's error message if track_errors enabled |
@@ -243,7 +239,8 @@ discard block |
||
243 | 239 | } |
244 | 240 | } |
245 | 241 | |
246 | -function debug ($debugmsg, $lvl=E_USER_NOTICE) { |
|
242 | +function debug ($debugmsg, $lvl=E_USER_NOTICE) |
|
243 | +{ |
|
247 | 244 | trigger_error("MagpieRSS [debug] $debugmsg", $lvl); |
248 | 245 | } |
249 | 246 | |
@@ -251,7 +248,8 @@ discard block |
||
251 | 248 | Function: magpie_error |
252 | 249 | Purpose: accessor for the magpie error variable |
253 | 250 | \*=======================================================================*/ |
254 | -function magpie_error ($errormsg="") { |
|
251 | +function magpie_error ($errormsg="") |
|
252 | +{ |
|
255 | 253 | global $MAGPIE_ERROR; |
256 | 254 | |
257 | 255 | if ( isset($errormsg) and $errormsg ) { |
@@ -268,7 +266,8 @@ discard block |
||
268 | 266 | headers to send along with the request (optional) |
269 | 267 | Output: an HTTP response object (see Snoopy.class.inc) |
270 | 268 | \*=======================================================================*/ |
271 | -function _fetch_remote_file ($url, $headers = "" ) { |
|
269 | +function _fetch_remote_file ($url, $headers = "" ) |
|
270 | +{ |
|
272 | 271 | // Snoopy is an HTTP client in PHP |
273 | 272 | $client = new Snoopy(); |
274 | 273 | $client->agent = MAGPIE_USER_AGENT; |
@@ -289,7 +288,8 @@ discard block |
||
289 | 288 | Input: an HTTP response object (see Snoopy) |
290 | 289 | Output: parsed RSS object (see rss_parse) |
291 | 290 | \*=======================================================================*/ |
292 | -function _response_to_rss ($resp) { |
|
291 | +function _response_to_rss ($resp) |
|
292 | +{ |
|
293 | 293 | $rss = new MagpieRSS( $resp->results, MAGPIE_OUTPUT_ENCODING, MAGPIE_INPUT_ENCODING, MAGPIE_DETECT_ENCODING ); |
294 | 294 | |
295 | 295 | // if RSS parsed successfully |
@@ -300,8 +300,7 @@ discard block |
||
300 | 300 | // 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1" |
301 | 301 | if (strpos($h, ": ")) { |
302 | 302 | list($field, $val) = explode(": ", $h, 2); |
303 | - } |
|
304 | - else { |
|
303 | + } else { |
|
305 | 304 | $field = $h; |
306 | 305 | $val = ""; |
307 | 306 | } |
@@ -334,11 +333,11 @@ discard block |
||
334 | 333 | Purpose: setup constants with default values |
335 | 334 | check for user overrides |
336 | 335 | \*=======================================================================*/ |
337 | -function init () { |
|
336 | +function init () |
|
337 | +{ |
|
338 | 338 | if ( defined('MAGPIE_INITALIZED') ) { |
339 | 339 | return; |
340 | - } |
|
341 | - else { |
|
340 | + } else { |
|
342 | 341 | define('MAGPIE_INITALIZED', true); |
343 | 342 | } |
344 | 343 | |
@@ -360,7 +359,9 @@ discard block |
||
360 | 359 | |
361 | 360 | if ( !defined('MAGPIE_OUTPUT_ENCODING') ) { |
362 | 361 | global $modx_manager_charset; |
363 | - if(empty($modx_manager_charset)) $modx_manager_charset = 'ISO-8859-1'; |
|
362 | + if(empty($modx_manager_charset)) { |
|
363 | + $modx_manager_charset = 'ISO-8859-1'; |
|
364 | + } |
|
364 | 365 | define('MAGPIE_OUTPUT_ENCODING', $modx_manager_charset); |
365 | 366 | } |
366 | 367 | |
@@ -381,8 +382,7 @@ discard block |
||
381 | 382 | |
382 | 383 | if ( MAGPIE_CACHE_ON ) { |
383 | 384 | $ua = $ua . ')'; |
384 | - } |
|
385 | - else { |
|
385 | + } else { |
|
386 | 386 | $ua = $ua . '; No cache)'; |
387 | 387 | } |
388 | 388 | |
@@ -417,7 +417,8 @@ discard block |
||
417 | 417 | Function: is_info |
418 | 418 | Purpose: return true if Informational status code |
419 | 419 | \*=======================================================================*/ |
420 | -function is_info ($sc) { |
|
420 | +function is_info ($sc) |
|
421 | +{ |
|
421 | 422 | return $sc >= 100 && $sc < 200; |
422 | 423 | } |
423 | 424 | |
@@ -425,7 +426,8 @@ discard block |
||
425 | 426 | Function: is_success |
426 | 427 | Purpose: return true if Successful status code |
427 | 428 | \*=======================================================================*/ |
428 | -function is_success ($sc) { |
|
429 | +function is_success ($sc) |
|
430 | +{ |
|
429 | 431 | return $sc >= 200 && $sc < 300; |
430 | 432 | } |
431 | 433 | |
@@ -433,7 +435,8 @@ discard block |
||
433 | 435 | Function: is_redirect |
434 | 436 | Purpose: return true if Redirection status code |
435 | 437 | \*=======================================================================*/ |
436 | -function is_redirect ($sc) { |
|
438 | +function is_redirect ($sc) |
|
439 | +{ |
|
437 | 440 | return $sc >= 300 && $sc < 400; |
438 | 441 | } |
439 | 442 | |
@@ -441,7 +444,8 @@ discard block |
||
441 | 444 | Function: is_error |
442 | 445 | Purpose: return true if Error status code |
443 | 446 | \*=======================================================================*/ |
444 | -function is_error ($sc) { |
|
447 | +function is_error ($sc) |
|
448 | +{ |
|
445 | 449 | return $sc >= 400 && $sc < 600; |
446 | 450 | } |
447 | 451 | |
@@ -449,7 +453,8 @@ discard block |
||
449 | 453 | Function: is_client_error |
450 | 454 | Purpose: return true if Error status code, and its a client error |
451 | 455 | \*=======================================================================*/ |
452 | -function is_client_error ($sc) { |
|
456 | +function is_client_error ($sc) |
|
457 | +{ |
|
453 | 458 | return $sc >= 400 && $sc < 500; |
454 | 459 | } |
455 | 460 | |
@@ -457,6 +462,7 @@ discard block |
||
457 | 462 | Function: is_client_error |
458 | 463 | Purpose: return true if Error status code, and its a server error |
459 | 464 | \*=======================================================================*/ |
460 | -function is_server_error ($sc) { |
|
465 | +function is_server_error ($sc) |
|
466 | +{ |
|
461 | 467 | return $sc >= 500 && $sc < 600; |
462 | 468 | } |
@@ -28,7 +28,9 @@ discard block |
||
28 | 28 | 'type7' => $_lang["lock_element_type_7"], |
29 | 29 | 'type8' => $_lang["lock_element_type_8"] |
30 | 30 | ); |
31 | -foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
31 | +foreach($unlockTranslations as $key => $value) { |
|
32 | + $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
33 | +} |
|
32 | 34 | |
33 | 35 | // Prepare lang-strings for mgrResAction() |
34 | 36 | $mraTranslations = array( |
@@ -44,7 +46,9 @@ discard block |
||
44 | 46 | 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], |
45 | 47 | 'confirm_delete_module' => $_lang["confirm_delete_module"], |
46 | 48 | ); |
47 | -foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
49 | +foreach($mraTranslations as $key => $value) { |
|
50 | + $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
51 | +} |
|
48 | 52 | ?> |
49 | 53 | <script>var trans = <?php echo json_encode($unlockTranslations); ?>;</script> |
50 | 54 | <script>var mraTrans = <?php echo json_encode($mraTranslations); ?>;</script> |
@@ -1,48 +1,48 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { |
7 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); |
|
7 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); |
|
8 | 8 | } else { |
9 | - include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); |
|
9 | + include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); |
|
10 | 10 | } |
11 | 11 | if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { |
12 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); |
|
12 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); |
|
13 | 13 | } else { |
14 | - include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); |
|
14 | + include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | $resources = new mgrResources(); |
18 | 18 | |
19 | 19 | // Prepare lang-strings for "Lock Elements" |
20 | 20 | $unlockTranslations = array( |
21 | - 'msg' => $_lang["unlock_element_id_warning"], |
|
22 | - 'type1' => $_lang["lock_element_type_1"], |
|
23 | - 'type2' => $_lang["lock_element_type_2"], |
|
24 | - 'type3' => $_lang["lock_element_type_3"], |
|
25 | - 'type4' => $_lang["lock_element_type_4"], |
|
26 | - 'type5' => $_lang["lock_element_type_5"], |
|
27 | - 'type6' => $_lang["lock_element_type_6"], |
|
28 | - 'type7' => $_lang["lock_element_type_7"], |
|
29 | - 'type8' => $_lang["lock_element_type_8"] |
|
21 | + 'msg' => $_lang["unlock_element_id_warning"], |
|
22 | + 'type1' => $_lang["lock_element_type_1"], |
|
23 | + 'type2' => $_lang["lock_element_type_2"], |
|
24 | + 'type3' => $_lang["lock_element_type_3"], |
|
25 | + 'type4' => $_lang["lock_element_type_4"], |
|
26 | + 'type5' => $_lang["lock_element_type_5"], |
|
27 | + 'type6' => $_lang["lock_element_type_6"], |
|
28 | + 'type7' => $_lang["lock_element_type_7"], |
|
29 | + 'type8' => $_lang["lock_element_type_8"] |
|
30 | 30 | ); |
31 | 31 | foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
32 | 32 | |
33 | 33 | // Prepare lang-strings for mgrResAction() |
34 | 34 | $mraTranslations = array( |
35 | - 'create_new' => $_lang["create_new"], |
|
36 | - 'edit' => $_lang["edit"], |
|
37 | - 'duplicate' => $_lang["duplicate"], |
|
38 | - 'remove' => $_lang["remove"], |
|
39 | - 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], |
|
40 | - 'confirm_delete_template' => $_lang["confirm_delete_template"], |
|
41 | - 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], |
|
42 | - 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], |
|
43 | - 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], |
|
44 | - 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], |
|
45 | - 'confirm_delete_module' => $_lang["confirm_delete_module"], |
|
35 | + 'create_new' => $_lang["create_new"], |
|
36 | + 'edit' => $_lang["edit"], |
|
37 | + 'duplicate' => $_lang["duplicate"], |
|
38 | + 'remove' => $_lang["remove"], |
|
39 | + 'confirm_duplicate_record' => $_lang["confirm_duplicate_record"], |
|
40 | + 'confirm_delete_template' => $_lang["confirm_delete_template"], |
|
41 | + 'confirm_delete_tmplvars' => $_lang["confirm_delete_tmplvars"], |
|
42 | + 'confirm_delete_htmlsnippet' => $_lang["confirm_delete_htmlsnippet"], |
|
43 | + 'confirm_delete_snippet' => $_lang["confirm_delete_htmlsnippet"], |
|
44 | + 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], |
|
45 | + 'confirm_delete_module' => $_lang["confirm_delete_module"], |
|
46 | 46 | ); |
47 | 47 | foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
48 | 48 | ?> |
@@ -65,46 +65,46 @@ discard block |
||
65 | 65 | </script> |
66 | 66 | |
67 | 67 | <?php |
68 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { |
|
69 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); |
|
70 | - } else { |
|
71 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); |
|
72 | - } |
|
68 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { |
|
69 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); |
|
70 | + } else { |
|
71 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); |
|
72 | + } |
|
73 | 73 | |
74 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { |
|
75 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); |
|
76 | - } else { |
|
77 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); |
|
78 | - } |
|
74 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { |
|
75 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); |
|
76 | + } else { |
|
77 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); |
|
78 | + } |
|
79 | 79 | |
80 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { |
|
81 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); |
|
82 | - } else { |
|
83 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); |
|
84 | - } |
|
80 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { |
|
81 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); |
|
82 | + } else { |
|
83 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); |
|
84 | + } |
|
85 | 85 | |
86 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { |
|
87 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); |
|
88 | - } else { |
|
89 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); |
|
90 | - } |
|
86 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { |
|
87 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); |
|
88 | + } else { |
|
89 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); |
|
90 | + } |
|
91 | 91 | |
92 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { |
|
93 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); |
|
94 | - } else { |
|
95 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); |
|
96 | - } |
|
92 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { |
|
93 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); |
|
94 | + } else { |
|
95 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); |
|
96 | + } |
|
97 | 97 | |
98 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { |
|
99 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); |
|
100 | - } else { |
|
101 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); |
|
102 | - } |
|
98 | + if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { |
|
99 | + include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); |
|
100 | + } else { |
|
101 | + include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); |
|
102 | + } |
|
103 | 103 | |
104 | 104 | |
105 | - if(is_numeric($_GET['tab'])) { |
|
106 | - echo '<script type="text/javascript"> tpResources.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
107 | - } |
|
108 | - ?> |
|
105 | + if(is_numeric($_GET['tab'])) { |
|
106 | + echo '<script type="text/javascript"> tpResources.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
107 | + } |
|
108 | + ?> |
|
109 | 109 | </div> |
110 | 110 | </div> |
@@ -1,17 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php')) { |
|
7 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/functions.inc.php'); |
|
6 | +if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/functions.inc.php')) { |
|
7 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/functions.inc.php'); |
|
8 | 8 | } else { |
9 | - include_once(MODX_MANAGER_PATH . 'actions/resources/functions.inc.php'); |
|
9 | + include_once(MODX_MANAGER_PATH.'actions/resources/functions.inc.php'); |
|
10 | 10 | } |
11 | -if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php')) { |
|
12 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/mgrResources.class.php'); |
|
11 | +if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/mgrResources.class.php')) { |
|
12 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/mgrResources.class.php'); |
|
13 | 13 | } else { |
14 | - include_once(MODX_MANAGER_PATH . 'actions/resources/mgrResources.class.php'); |
|
14 | + include_once(MODX_MANAGER_PATH.'actions/resources/mgrResources.class.php'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | $resources = new mgrResources(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'type7' => $_lang["lock_element_type_7"], |
29 | 29 | 'type8' => $_lang["lock_element_type_8"] |
30 | 30 | ); |
31 | -foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
31 | +foreach ($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
32 | 32 | |
33 | 33 | // Prepare lang-strings for mgrResAction() |
34 | 34 | $mraTranslations = array( |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], |
45 | 45 | 'confirm_delete_module' => $_lang["confirm_delete_module"], |
46 | 46 | ); |
47 | -foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
47 | +foreach ($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
48 | 48 | ?> |
49 | 49 | <script>var trans = <?php echo json_encode($unlockTranslations); ?>;</script> |
50 | 50 | <script>var mraTrans = <?php echo json_encode($mraTranslations); ?>;</script> |
@@ -65,45 +65,45 @@ discard block |
||
65 | 65 | </script> |
66 | 66 | |
67 | 67 | <?php |
68 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php')) { |
|
69 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab1_templates.inc.php'); |
|
68 | + if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab1_templates.inc.php')) { |
|
69 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab1_templates.inc.php'); |
|
70 | 70 | } else { |
71 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab1_templates.inc.php'); |
|
71 | + include_once(MODX_MANAGER_PATH.'/actions/resources/tab1_templates.inc.php'); |
|
72 | 72 | } |
73 | 73 | |
74 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php')) { |
|
75 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab2_templatevars.inc.php'); |
|
74 | + if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab2_templatevars.inc.php')) { |
|
75 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab2_templatevars.inc.php'); |
|
76 | 76 | } else { |
77 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab2_templatevars.inc.php'); |
|
77 | + include_once(MODX_MANAGER_PATH.'/actions/resources/tab2_templatevars.inc.php'); |
|
78 | 78 | } |
79 | 79 | |
80 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php')) { |
|
81 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab3_chunks.inc.php'); |
|
80 | + if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab3_chunks.inc.php')) { |
|
81 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab3_chunks.inc.php'); |
|
82 | 82 | } else { |
83 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab3_chunks.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH.'/actions/resources/tab3_chunks.inc.php'); |
|
84 | 84 | } |
85 | 85 | |
86 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php')) { |
|
87 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab4_snippets.inc.php'); |
|
86 | + if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab4_snippets.inc.php')) { |
|
87 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab4_snippets.inc.php'); |
|
88 | 88 | } else { |
89 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab4_snippets.inc.php'); |
|
89 | + include_once(MODX_MANAGER_PATH.'/actions/resources/tab4_snippets.inc.php'); |
|
90 | 90 | } |
91 | 91 | |
92 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php')) { |
|
93 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab5_plugins.inc.php'); |
|
92 | + if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab5_plugins.inc.php')) { |
|
93 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab5_plugins.inc.php'); |
|
94 | 94 | } else { |
95 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab5_plugins.inc.php'); |
|
95 | + include_once(MODX_MANAGER_PATH.'/actions/resources/tab5_plugins.inc.php'); |
|
96 | 96 | } |
97 | 97 | |
98 | - if(file_exists(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php')) { |
|
99 | - include_once(MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/actions/resources/tab6_categoryview.inc.php'); |
|
98 | + if (file_exists(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab6_categoryview.inc.php')) { |
|
99 | + include_once(MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/actions/resources/tab6_categoryview.inc.php'); |
|
100 | 100 | } else { |
101 | - include_once(MODX_MANAGER_PATH . '/actions/resources/tab6_categoryview.inc.php'); |
|
101 | + include_once(MODX_MANAGER_PATH.'/actions/resources/tab6_categoryview.inc.php'); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | |
105 | - if(is_numeric($_GET['tab'])) { |
|
106 | - echo '<script type="text/javascript"> tpResources.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
105 | + if (is_numeric($_GET['tab'])) { |
|
106 | + echo '<script type="text/javascript"> tpResources.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
107 | 107 | } |
108 | 108 | ?> |
109 | 109 | </div> |
@@ -177,9 +177,9 @@ |
||
177 | 177 | <td colspan="2"><div class="split"></div></td> |
178 | 178 | </tr> |
179 | 179 | <?php |
180 | - // Check for GD before allowing captcha to be enabled |
|
181 | - $gdAvailable = extension_loaded('gd'); |
|
182 | - ?> |
|
180 | + // Check for GD before allowing captcha to be enabled |
|
181 | + $gdAvailable = extension_loaded('gd'); |
|
182 | + ?> |
|
183 | 183 | <?php |
184 | 184 | $gdAvailable = extension_loaded('gd'); |
185 | 185 | if(!$gdAvailable) $use_captcha = 0; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4 |
3 | - if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) { |
|
3 | + if (empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) { |
|
4 | 4 | $valid_hostnames = $_SERVER['HTTP_HOST']; |
5 | 5 | } else { |
6 | 6 | $valid_hostnames = $MODX_SITE_HOSTNAMES; |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | <tr> |
16 | 16 | <th><?php echo $_lang['allow_eval_title']; ?><br><small>[(allow_eval)]</small></th> |
17 | 17 | <td> |
18 | -<?php echo wrap_label($_lang['allow_eval_with_scan'] , form_radio('allow_eval','with_scan'));?><br /> |
|
19 | -<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'] , form_radio('allow_eval','with_scan_at_post'));?><br /> |
|
20 | -<?php echo wrap_label($_lang['allow_eval_everytime_eval'] , form_radio('allow_eval','everytime_eval'));?><br /> |
|
21 | -<?php echo wrap_label($_lang['allow_eval_dont_eval'] , form_radio('allow_eval','dont_eval'));?> |
|
18 | +<?php echo wrap_label($_lang['allow_eval_with_scan'], form_radio('allow_eval', 'with_scan')); ?><br /> |
|
19 | +<?php echo wrap_label($_lang['allow_eval_with_scan_at_post'], form_radio('allow_eval', 'with_scan_at_post')); ?><br /> |
|
20 | +<?php echo wrap_label($_lang['allow_eval_everytime_eval'], form_radio('allow_eval', 'everytime_eval')); ?><br /> |
|
21 | +<?php echo wrap_label($_lang['allow_eval_dont_eval'], form_radio('allow_eval', 'dont_eval')); ?> |
|
22 | 22 | <div class="comment"> |
23 | 23 | <?php echo $_lang['allow_eval_msg'] ?> |
24 | 24 | </div> |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | <tr> |
44 | 44 | <th><?php echo $_lang['check_files_onlogin_title'] ?><br><small>[(check_files_onlogin)]</small></th> |
45 | 45 | <td> |
46 | - <textarea name="check_files_onlogin"><?php echo $check_files_onlogin;?></textarea><br /> |
|
46 | + <textarea name="check_files_onlogin"><?php echo $check_files_onlogin; ?></textarea><br /> |
|
47 | 47 | |
48 | 48 | </td> |
49 | 49 | </tr> |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | <tr> |
54 | 54 | <td nowrap class="warning"><?php echo $_lang['validate_referer_title'] ?><br><small>[(validate_referer)]</small></td> |
55 | 55 | <td> |
56 | - <?php echo wrap_label($_lang['yes'],form_radio('validate_referer', 1));?><br /> |
|
57 | - <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0));?> |
|
56 | + <?php echo wrap_label($_lang['yes'], form_radio('validate_referer', 1)); ?><br /> |
|
57 | + <?php echo wrap_label($_lang['no'], form_radio('validate_referer', 0)); ?> |
|
58 | 58 | </td> |
59 | 59 | </tr> |
60 | 60 | <tr> |
@@ -89,25 +89,25 @@ discard block |
||
89 | 89 | <tr> |
90 | 90 | <th><?php echo $_lang['a17_error_reporting_title']; ?><br><small>[(error_reporting)]</small></th> |
91 | 91 | <td> |
92 | -<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting','0'));?><br /> |
|
93 | -<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting','1'));?><br /> |
|
94 | -<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting','2'));?><br /> |
|
95 | -<?php echo wrap_label($_lang['a17_error_reporting_opt99'],form_radio('error_reporting','99'));?> |
|
92 | +<?php echo wrap_label($_lang['a17_error_reporting_opt0'], form_radio('error_reporting', '0')); ?><br /> |
|
93 | +<?php echo wrap_label($_lang['a17_error_reporting_opt1'], form_radio('error_reporting', '1')); ?><br /> |
|
94 | +<?php echo wrap_label($_lang['a17_error_reporting_opt2'], form_radio('error_reporting', '2')); ?><br /> |
|
95 | +<?php echo wrap_label($_lang['a17_error_reporting_opt99'], form_radio('error_reporting', '99')); ?> |
|
96 | 96 | </td> |
97 | 97 | </tr> |
98 | 98 | <tr> |
99 | 99 | <td width="200"> </td> |
100 | - <td class="comment"> <?php echo $_lang['a17_error_reporting_msg'];?></td> |
|
100 | + <td class="comment"> <?php echo $_lang['a17_error_reporting_msg']; ?></td> |
|
101 | 101 | </tr> |
102 | 102 | <tr><td colspan="2"><div class="split"></div></td></tr> |
103 | 103 | <tr> |
104 | 104 | <th><?php echo $_lang['mutate_settings.dynamic.php6']; ?><br><small>[(send_errormail)]</small></th> |
105 | 105 | <td> |
106 | -<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'],form_radio('send_errormail','0'));?><br /> |
|
107 | -<?php echo wrap_label('error',form_radio('send_errormail','3'));?><br /> |
|
108 | -<?php echo wrap_label('error + warning',form_radio('send_errormail','2'));?><br /> |
|
109 | -<?php echo wrap_label('error + warning + information',form_radio('send_errormail','1'));?><br /> |
|
110 | -<?php echo parseText($_lang['mutate_settings.dynamic.php8'],array('emailsender'=>$modx->config['emailsender']));?></td> |
|
106 | +<?php echo wrap_label($_lang['mutate_settings.dynamic.php7'], form_radio('send_errormail', '0')); ?><br /> |
|
107 | +<?php echo wrap_label('error', form_radio('send_errormail', '3')); ?><br /> |
|
108 | +<?php echo wrap_label('error + warning', form_radio('send_errormail', '2')); ?><br /> |
|
109 | +<?php echo wrap_label('error + warning + information', form_radio('send_errormail', '1')); ?><br /> |
|
110 | +<?php echo parseText($_lang['mutate_settings.dynamic.php8'], array('emailsender'=>$modx->config['emailsender'])); ?></td> |
|
111 | 111 | </tr> |
112 | 112 | <tr> |
113 | 113 | <td colspan="2"><div class="split"></div></td> |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | <tr> |
116 | 116 | <th><?php echo $_lang['enable_bindings_title'] ?><br><small>[(enable_bindings)]</small></th> |
117 | 117 | <td> |
118 | -<?php echo wrap_label($_lang['yes'],form_radio('enable_bindings','1'));?><br /> |
|
119 | -<?php echo wrap_label($_lang['no'], form_radio('enable_bindings','0'));?> |
|
118 | +<?php echo wrap_label($_lang['yes'], form_radio('enable_bindings', '1')); ?><br /> |
|
119 | +<?php echo wrap_label($_lang['no'], form_radio('enable_bindings', '0')); ?> |
|
120 | 120 | |
121 | 121 | </td> |
122 | 122 | </tr> |
@@ -157,20 +157,20 @@ discard block |
||
157 | 157 | <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th> |
158 | 158 | <td> |
159 | 159 | <?php |
160 | -if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
161 | -$phm['e']['BLOWFISH_Y'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_Y') ? 0:1; |
|
162 | -$phm['e']['BLOWFISH_A'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_A') ? 0:1; |
|
163 | -$phm['e']['SHA512'] = $modx->getManagerApi()->checkHashAlgorithm('SHA512') ? 0:1; |
|
164 | -$phm['e']['SHA256'] = $modx->getManagerApi()->checkHashAlgorithm('SHA256') ? 0:1; |
|
165 | -$phm['e']['MD5'] = $modx->getManagerApi()->checkHashAlgorithm('MD5') ? 0:1; |
|
166 | -$phm['e']['UNCRYPT'] = $modx->getManagerApi()->checkHashAlgorithm('UNCRYPT') ? 0:1; |
|
160 | +if (empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
161 | +$phm['e']['BLOWFISH_Y'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_Y') ? 0 : 1; |
|
162 | +$phm['e']['BLOWFISH_A'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_A') ? 0 : 1; |
|
163 | +$phm['e']['SHA512'] = $modx->getManagerApi()->checkHashAlgorithm('SHA512') ? 0 : 1; |
|
164 | +$phm['e']['SHA256'] = $modx->getManagerApi()->checkHashAlgorithm('SHA256') ? 0 : 1; |
|
165 | +$phm['e']['MD5'] = $modx->getManagerApi()->checkHashAlgorithm('MD5') ? 0 : 1; |
|
166 | +$phm['e']['UNCRYPT'] = $modx->getManagerApi()->checkHashAlgorithm('UNCRYPT') ? 0 : 1; |
|
167 | 167 | ?> |
168 | -<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y']));?><br /> |
|
169 | -<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)',form_radio('pwd_hash_algo','BLOWFISH_A', '', $phm['e']['BLOWFISH_A']));?><br /> |
|
170 | -<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)' ,form_radio('pwd_hash_algo','SHA512' , '', $phm['e']['SHA512']));?><br /> |
|
171 | -<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)' ,form_radio('pwd_hash_algo','SHA256' , '', $phm['e']['SHA256']));?><br /> |
|
172 | -<?php echo wrap_label('CRYPT_MD5 (salt & stretch)' ,form_radio('pwd_hash_algo','MD5' , '', $phm['e']['MD5']));?><br /> |
|
173 | -<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)' ,form_radio('pwd_hash_algo','UNCRYPT' , '', $phm['e']['UNCRYPT']));?> |
|
168 | +<?php echo wrap_label('CRYPT_BLOWFISH_Y (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_Y', '', $phm['e']['BLOWFISH_Y'])); ?><br /> |
|
169 | +<?php echo wrap_label('CRYPT_BLOWFISH_A (salt & stretch)', form_radio('pwd_hash_algo', 'BLOWFISH_A', '', $phm['e']['BLOWFISH_A'])); ?><br /> |
|
170 | +<?php echo wrap_label('CRYPT_SHA512 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA512', '', $phm['e']['SHA512'])); ?><br /> |
|
171 | +<?php echo wrap_label('CRYPT_SHA256 (salt & stretch)', form_radio('pwd_hash_algo', 'SHA256', '', $phm['e']['SHA256'])); ?><br /> |
|
172 | +<?php echo wrap_label('CRYPT_MD5 (salt & stretch)', form_radio('pwd_hash_algo', 'MD5', '', $phm['e']['MD5'])); ?><br /> |
|
173 | +<?php echo wrap_label('UNCRYPT(32 chars salt + SHA-1 hash)', form_radio('pwd_hash_algo', 'UNCRYPT', '', $phm['e']['UNCRYPT'])); ?> |
|
174 | 174 | </td> |
175 | 175 | </tr> |
176 | 176 | <tr> |
@@ -186,13 +186,13 @@ discard block |
||
186 | 186 | ?> |
187 | 187 | <?php |
188 | 188 | $gdAvailable = extension_loaded('gd'); |
189 | -if(!$gdAvailable) $use_captcha = 0; |
|
189 | +if (!$gdAvailable) $use_captcha = 0; |
|
190 | 190 | ?> |
191 | 191 | <tr> |
192 | 192 | <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td> |
193 | - <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha==1) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : ''; ?> /> |
|
193 | + <td> <label><input type="radio" id="captchaOn" name="use_captcha" value="1" <?php echo ($use_captcha == 1) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> |
|
194 | 194 | <?php echo $_lang['yes']?></label><br /> |
195 | - <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha==0) ? 'checked="checked"' : "" ; echo (!$gdAvailable)? ' readonly="readonly"' : '';?> /> |
|
195 | + <label><input type="radio" id="captchaOff" name="use_captcha" value="0" <?php echo ($use_captcha == 0) ? 'checked="checked"' : ""; echo (!$gdAvailable) ? ' readonly="readonly"' : ''; ?> /> |
|
196 | 196 | <?php echo $_lang['no']?></label> </td> |
197 | 197 | </tr> |
198 | 198 | <tr> |
@@ -202,23 +202,23 @@ discard block |
||
202 | 202 | <tr> |
203 | 203 | <td colspan="2"><div class="split"></div></td> |
204 | 204 | </tr> |
205 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
205 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
206 | 206 | <td nowrap class="warning"><?php echo $_lang['captcha_words_title'] ?><br><small>[(captcha_words)]</small> |
207 | 207 | <br /> |
208 | 208 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
209 | 209 | <select name="reload_captcha_words" id="reload_captcha_words_select" onchange="confirmLangChange(this, 'captcha_words_default', 'captcha_words_input');"> |
210 | -<?php echo get_lang_options('captcha_words_default');?> |
|
210 | +<?php echo get_lang_options('captcha_words_default'); ?> |
|
211 | 211 | </select> |
212 | 212 | </td> |
213 | 213 | <td><input type="text" id="captcha_words_input" name="captcha_words" style="width:250px" value="<?php echo $captcha_words; ?>" /> |
214 | - <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']);?>" /> |
|
214 | + <input type="hidden" name="captcha_words_default" id="captcha_words_default_hidden" value="<?php echo addslashes($_lang['captcha_words_default']); ?>" /> |
|
215 | 215 | </td> |
216 | 216 | </tr> |
217 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
217 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
218 | 218 | <td width="200"> </td> |
219 | 219 | <td class="comment"><?php echo $_lang['captcha_words_message'] ?></td> |
220 | 220 | </tr> |
221 | - <tr class="captchaRow" <?php echo showHide($use_captcha==1);?>> |
|
221 | + <tr class="captchaRow" <?php echo showHide($use_captcha == 1); ?>> |
|
222 | 222 | <td colspan="2"><div class="split"></div></td> |
223 | 223 | </tr> |
224 | 224 | <tr> |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | <?php |
227 | 227 | // invoke OnMiscSettingsRender event |
228 | 228 | $evtOut = $modx->invokeEvent('OnSecuritySettingsRender'); |
229 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
229 | + if (is_array($evtOut)) echo implode("", $evtOut); |
|
230 | 230 | ?> |
231 | 231 | </td> |
232 | 232 | </tr> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | $MODX_SITE_HOSTNAMES = MODX_SITE_HOSTNAMES; // Fix for PHP 5.4 |
3 | - if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) { |
|
3 | + if(empty($valid_hostnames) && empty($MODX_SITE_HOSTNAMES)) { |
|
4 | 4 | $valid_hostnames = $_SERVER['HTTP_HOST']; |
5 | - } else { |
|
5 | + } else { |
|
6 | 6 | $valid_hostnames = $MODX_SITE_HOSTNAMES; |
7 | 7 | } |
8 | 8 | ?> |
@@ -157,7 +157,9 @@ discard block |
||
157 | 157 | <th><?php echo $_lang['pwd_hash_algo_title'] ?><br><small>[(pwd_hash_algo)]</small></th> |
158 | 158 | <td> |
159 | 159 | <?php |
160 | -if(empty($pwd_hash_algo)) $phm['sel']['UNCRYPT'] = 1; |
|
160 | +if(empty($pwd_hash_algo)) { |
|
161 | + $phm['sel']['UNCRYPT'] = 1; |
|
162 | +} |
|
161 | 163 | $phm['e']['BLOWFISH_Y'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_Y') ? 0:1; |
162 | 164 | $phm['e']['BLOWFISH_A'] = $modx->getManagerApi()->checkHashAlgorithm('BLOWFISH_A') ? 0:1; |
163 | 165 | $phm['e']['SHA512'] = $modx->getManagerApi()->checkHashAlgorithm('SHA512') ? 0:1; |
@@ -186,7 +188,9 @@ discard block |
||
186 | 188 | ?> |
187 | 189 | <?php |
188 | 190 | $gdAvailable = extension_loaded('gd'); |
189 | -if(!$gdAvailable) $use_captcha = 0; |
|
191 | +if(!$gdAvailable) { |
|
192 | + $use_captcha = 0; |
|
193 | +} |
|
190 | 194 | ?> |
191 | 195 | <tr> |
192 | 196 | <td nowrap class="warning"><?php echo $_lang['captcha_title'] ?><br><small>[(use_captcha)]</small></td> |
@@ -226,7 +230,9 @@ discard block |
||
226 | 230 | <?php |
227 | 231 | // invoke OnMiscSettingsRender event |
228 | 232 | $evtOut = $modx->invokeEvent('OnSecuritySettingsRender'); |
229 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
233 | + if(is_array($evtOut)) { |
|
234 | + echo implode("",$evtOut); |
|
235 | + } |
|
230 | 236 | ?> |
231 | 237 | </td> |
232 | 238 | </tr> |
@@ -127,7 +127,9 @@ |
||
127 | 127 | <?php |
128 | 128 | // invoke OnUserSettingsRender event |
129 | 129 | $evtOut = $modx->invokeEvent('OnUserSettingsRender'); |
130 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
130 | + if(is_array($evtOut)) { |
|
131 | + echo implode("",$evtOut); |
|
132 | + } |
|
131 | 133 | ?> |
132 | 134 | </td> |
133 | 135 | </tr> |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | <tr> |
7 | 7 | <td nowrap class="warning"><?php echo $_lang['udperms_title'] ?><br><small>[(use_udperms)]</small></td> |
8 | 8 | <td> |
9 | - <?php echo wrap_label($_lang['yes'],form_radio('use_udperms', 1, 'id="udPermsOn"'));?><br /> |
|
10 | - <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"'));?> |
|
9 | + <?php echo wrap_label($_lang['yes'], form_radio('use_udperms', 1, 'id="udPermsOn"')); ?><br /> |
|
10 | + <?php echo wrap_label($_lang['no'], form_radio('use_udperms', 0, 'id="udPermsOff"')); ?> |
|
11 | 11 | </td> |
12 | 12 | </tr> |
13 | 13 | <tr> |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | <tr> |
18 | 18 | <td colspan="2"><div class="split"></div></td> |
19 | 19 | </tr> |
20 | - <tr class="udPerms" <?php echo showHide($use_udperms==1);?>> |
|
20 | + <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>> |
|
21 | 21 | <td nowrap class="warning"><?php echo $_lang['udperms_allowroot_title'] ?><br><small>[(udperms_allowroot)]</small></td> |
22 | 22 | <td> |
23 | - <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot=='1' ? 'checked="checked"' : "" ; ?> /> |
|
23 | + <label><input type="radio" name="udperms_allowroot" value="1" <?php echo $udperms_allowroot == '1' ? 'checked="checked"' : ""; ?> /> |
|
24 | 24 | <?php echo $_lang['yes']?></label><br /> |
25 | - <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot=='0' ? 'checked="checked"' : "" ; ?> /> |
|
25 | + <label><input type="radio" name="udperms_allowroot" value="0" <?php echo $udperms_allowroot == '0' ? 'checked="checked"' : ""; ?> /> |
|
26 | 26 | <?php echo $_lang['no']?></label> |
27 | 27 | </td> |
28 | 28 | </tr> |
29 | - <tr class="udPerms" <?php echo showHide($use_udperms==1);?>> |
|
29 | + <tr class="udPerms" <?php echo showHide($use_udperms == 1); ?>> |
|
30 | 30 | <td width="200"> </td> |
31 | 31 | <td class="comment"><?php echo $_lang['udperms_allowroot_message'] ?></td> |
32 | 32 | </tr> |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | <tr> |
38 | 38 | <td nowrap class="warning"><?php echo $_lang['email_sender_method'] ?><br><small>[(email_sender_method)]</small></td> |
39 | 39 | <td> |
40 | - <label><input type="radio" name="email_sender_method" value="1" <?php echo $email_sender_method=='1' ? 'checked="checked"' : "" ; ?> /> |
|
40 | + <label><input type="radio" name="email_sender_method" value="1" <?php echo $email_sender_method == '1' ? 'checked="checked"' : ""; ?> /> |
|
41 | 41 | <?php echo $_lang['auto']?></label><br /> |
42 | - <label><input type="radio" name="email_sender_method" value="0" <?php echo $email_sender_method=='0' ? 'checked="checked"' : "" ; ?> /> |
|
42 | + <label><input type="radio" name="email_sender_method" value="0" <?php echo $email_sender_method == '0' ? 'checked="checked"' : ""; ?> /> |
|
43 | 43 | <?php echo $_lang['use_emailsender']?></label> |
44 | 44 | </td> |
45 | 45 | </tr> |
@@ -55,10 +55,10 @@ discard block |
||
55 | 55 | <tr> |
56 | 56 | <td nowrap class="warning"><?php echo $_lang['email_method_title'] ?><br><small>[(email_method)]</small></td> |
57 | 57 | <td> |
58 | - <?php echo wrap_label($_lang['email_method_mail'],form_radio('email_method','mail','id="useMail"'));?><br /> |
|
59 | - <?php echo wrap_label($_lang['email_method_smtp'],form_radio('email_method','smtp','id="useSmtp"'));?> |
|
60 | - <div class="smtpRow" <?php echo showHide($email_method=='smtp');?>> |
|
61 | - <?php include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/snippet_smtp.inc.php'); ?> |
|
58 | + <?php echo wrap_label($_lang['email_method_mail'], form_radio('email_method', 'mail', 'id="useMail"')); ?><br /> |
|
59 | + <?php echo wrap_label($_lang['email_method_smtp'], form_radio('email_method', 'smtp', 'id="useSmtp"')); ?> |
|
60 | + <div class="smtpRow" <?php echo showHide($email_method == 'smtp'); ?>> |
|
61 | + <?php include_once(MODX_MANAGER_PATH.'actions/mutate_settings/snippet_smtp.inc.php'); ?> |
|
62 | 62 | </div> |
63 | 63 | </td> |
64 | 64 | </tr> |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | <br /> |
71 | 71 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
72 | 72 | <select name="reload_emailsubject" id="reload_emailsubject_select" onchange="confirmLangChange(this, 'emailsubject_default', 'emailsubject_field');"> |
73 | -<?php echo get_lang_options('emailsubject_default');?> |
|
73 | +<?php echo get_lang_options('emailsubject_default'); ?> |
|
74 | 74 | </select> |
75 | 75 | </td> |
76 | 76 | <td ><input id="emailsubject_field" name="emailsubject" onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" value="<?php echo $emailsubject; ?>" /> |
77 | - <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']);?>" /> |
|
77 | + <input type="hidden" name="emailsubject_default" id="emailsubject_default_hidden" value="<?php echo addslashes($_lang['emailsubject_default']); ?>" /> |
|
78 | 78 | </td> |
79 | 79 | </tr> |
80 | 80 | <tr> |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | <br /> |
90 | 90 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
91 | 91 | <select name="reload_signupemail_message" id="reload_signupemail_message_select" onchange="confirmLangChange(this, 'system_email_signup', 'signupemail_message_textarea');"> |
92 | -<?php echo get_lang_options('system_email_signup');?> |
|
92 | +<?php echo get_lang_options('system_email_signup'); ?> |
|
93 | 93 | </select> |
94 | 94 | </td> |
95 | 95 | <td> <textarea id="signupemail_message_textarea" name="signupemail_message" style="width:100%; height: 120px;"><?php echo $signupemail_message; ?></textarea> |
96 | - <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']);?>" /> |
|
96 | + <input type="hidden" name="system_email_signup_default" id="system_email_signup_hidden" value="<?php echo addslashes($_lang['system_email_signup']); ?>" /> |
|
97 | 97 | </td> |
98 | 98 | </tr> |
99 | 99 | <tr> |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | <br /> |
109 | 109 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
110 | 110 | <select name="reload_websignupemail_message" id="reload_websignupemail_message_select" onchange="confirmLangChange(this, 'system_email_websignup', 'websignupemail_message_textarea');"> |
111 | -<?php echo get_lang_options('system_email_websignup');?> |
|
111 | +<?php echo get_lang_options('system_email_websignup'); ?> |
|
112 | 112 | </select> |
113 | 113 | </td> |
114 | 114 | <td> <textarea id="websignupemail_message_textarea" name="websignupemail_message" style="width:100%; height: 120px;"><?php echo $websignupemail_message; ?></textarea> |
115 | - <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']);?>" /> |
|
115 | + <input type="hidden" name="system_email_websignup_default" id="system_email_websignup_hidden" value="<?php echo addslashes($_lang['system_email_websignup']); ?>" /> |
|
116 | 116 | </td> |
117 | 117 | </tr> |
118 | 118 | <tr> |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | <br /> |
128 | 128 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
129 | 129 | <select name="reload_system_email_webreminder_message" id="reload_system_email_webreminder_select" onchange="confirmLangChange(this, 'system_email_webreminder', 'system_email_webreminder_textarea');"> |
130 | -<?php echo get_lang_options('system_email_webreminder');?> |
|
130 | +<?php echo get_lang_options('system_email_webreminder'); ?> |
|
131 | 131 | </select> |
132 | 132 | </td> |
133 | 133 | <td> <textarea id="system_email_webreminder_textarea" name="webpwdreminder_message" style="width:100%; height: 120px;"><?php echo $webpwdreminder_message; ?></textarea> |
134 | - <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']);?>" /> |
|
134 | + <input type="hidden" name="system_email_webreminder_default" id="system_email_webreminder_hidden" value="<?php echo addslashes($_lang['system_email_webreminder']); ?>" /> |
|
135 | 135 | </td> |
136 | 136 | </tr> |
137 | 137 | <tr> |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | <tr> |
145 | 145 | <td nowrap class="warning" valign="top"><?php echo $_lang['allow_multiple_emails_title'] ?><br><small>[(allow_multiple_emails)]</small></td> |
146 | 146 | <td> |
147 | - <?php echo wrap_label($_lang['yes'],form_radio('allow_multiple_emails','1'));?><br /> |
|
148 | - <?php echo wrap_label($_lang['no'], form_radio('allow_multiple_emails','0'));?> |
|
147 | + <?php echo wrap_label($_lang['yes'], form_radio('allow_multiple_emails', '1')); ?><br /> |
|
148 | + <?php echo wrap_label($_lang['no'], form_radio('allow_multiple_emails', '0')); ?> |
|
149 | 149 | </td> |
150 | 150 | </tr> |
151 | 151 | <tr> |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | <?php |
158 | 158 | // invoke OnUserSettingsRender event |
159 | 159 | $evtOut = $modx->invokeEvent('OnUserSettingsRender'); |
160 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
160 | + if (is_array($evtOut)) echo implode("", $evtOut); |
|
161 | 161 | ?> |
162 | 162 | </td> |
163 | 163 | </tr> |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | <tr> |
7 | 7 | <td nowrap class="warning"><?php echo $_lang['rb_title']?><br><small>[(use_browser)]</small></td> |
8 | 8 | <td> |
9 | - <?php echo wrap_label($_lang['yes'],form_radio('use_browser', 1, 'id="rbRowOn"'));?><br /> |
|
10 | - <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"'));?> |
|
9 | + <?php echo wrap_label($_lang['yes'], form_radio('use_browser', 1, 'id="rbRowOn"')); ?><br /> |
|
10 | + <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"')); ?> |
|
11 | 11 | </td> |
12 | 12 | </tr> |
13 | 13 | <tr> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <td colspan="2"><div class="split"></div></td> |
19 | 19 | </tr> |
20 | 20 | |
21 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
21 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
22 | 22 | <td nowrap class="warning"><?php echo $_lang['which_browser_default_title']?><br><small>[(which_browser)]</small></td> |
23 | 23 | <td> |
24 | 24 | <select name="which_browser" size="1" class="inputBox" onchange="documentDirty=true;"> |
@@ -27,206 +27,206 @@ discard block |
||
27 | 27 | $dir = str_replace('\\', '/', $dir); |
28 | 28 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
29 | 29 | $selected = $browser_name == $which_browser ? ' selected="selected"' : ''; |
30 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
30 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
31 | 31 | } |
32 | 32 | ?> |
33 | 33 | </select> |
34 | 34 | </td> |
35 | 35 | </tr> |
36 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
36 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
37 | 37 | <td width="200"> </td> |
38 | 38 | <td class="comment"><?php echo $_lang['which_browser_default_msg']?></td> |
39 | 39 | </tr> |
40 | 40 | <tr> |
41 | 41 | <td colspan="2"><div class="split"></div></td> |
42 | 42 | </tr> |
43 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
43 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
44 | 44 | <td nowrap class="warning"><?php echo $_lang['rb_webuser_title']?><br><small>[(rb_webuser)]</small></td> |
45 | 45 | <td> |
46 | - <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser=='1' ? 'checked="checked"' : "" ; ?> /> |
|
46 | + <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser == '1' ? 'checked="checked"' : ""; ?> /> |
|
47 | 47 | <?php echo $_lang['yes']?></label><br /> |
48 | - <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser=='0' ? 'checked="checked"' : "" ; ?> /> |
|
48 | + <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser == '0' ? 'checked="checked"' : ""; ?> /> |
|
49 | 49 | <?php echo $_lang['no']?></label> |
50 | 50 | </td> |
51 | 51 | </tr> |
52 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
52 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
53 | 53 | <td width="200"> </td> |
54 | 54 | <td class="comment"><?php echo $_lang['rb_webuser_message']?></td> |
55 | 55 | </tr> |
56 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
56 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
57 | 57 | <td colspan="2"><div class="split"></div></td> |
58 | 58 | </tr> |
59 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
59 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
60 | 60 | <td nowrap class="warning"><?php echo $_lang['rb_base_dir_title']?><br><small>[(rb_base_dir)]</small></td> |
61 | 61 | <td> |
62 | 62 | <?php echo $_lang['default']; ?> <span id="default_rb_base_dir">[(base_path)]assets/</span><br /> |
63 | 63 | <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_dir" id="rb_base_dir" value="<?php echo $rb_base_dir; ?>" /> <input type="button" onclick="reset_path('rb_base_dir');" value="<?php echo $_lang['reset']; ?>" name="reset_rb_base_dir"> |
64 | 64 | </td> |
65 | 65 | </tr> |
66 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
66 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
67 | 67 | <td width="200"> </td> |
68 | 68 | <td class="comment"><?php echo $_lang['rb_base_dir_message']?></td> |
69 | 69 | </tr> |
70 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
70 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
71 | 71 | <td colspan="2"><div class="split"></div></td> |
72 | 72 | </tr> |
73 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
73 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
74 | 74 | <td nowrap class="warning"><?php echo $_lang['rb_base_url_title']?><br><small>[(rb_base_url)]</small></td> |
75 | 75 | <td> |
76 | 76 | <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_url" value="<?php echo $rb_base_url; ?>" /> |
77 | 77 | </td> |
78 | 78 | </tr> |
79 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
79 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
80 | 80 | <td width="200"> </td> |
81 | 81 | <td class="comment"><?php echo $_lang['rb_base_url_message']?></td> |
82 | 82 | </tr> |
83 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
83 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
84 | 84 | <td colspan="2"><div class="split"></div></td> |
85 | 85 | </tr> |
86 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
86 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
87 | 87 | <td nowrap class="warning"><?php echo $_lang['clean_uploaded_filename']?><br><small>[(clean_uploaded_filename)]</small></td> |
88 | 88 | <td> |
89 | - <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename=='1' ? 'checked="checked"' : "" ; ?> /> |
|
89 | + <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename == '1' ? 'checked="checked"' : ""; ?> /> |
|
90 | 90 | <?php echo $_lang['yes']?></label><br /> |
91 | - <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename=='0' ? 'checked="checked"' : "" ; ?> /> |
|
91 | + <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename == '0' ? 'checked="checked"' : ""; ?> /> |
|
92 | 92 | <?php echo $_lang['no']?></label> |
93 | 93 | </td> |
94 | 94 | </tr> |
95 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
95 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
96 | 96 | <td width="200"> </td> |
97 | - <td class="comment"><?php echo $_lang['clean_uploaded_filename_message'];?></td> |
|
97 | + <td class="comment"><?php echo $_lang['clean_uploaded_filename_message']; ?></td> |
|
98 | 98 | </tr> |
99 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
99 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
100 | 100 | <td colspan="2"><div class="split"></div></td> |
101 | 101 | </tr> |
102 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
102 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
103 | 103 | <td nowrap class="warning"><?php echo $_lang['settings_strip_image_paths_title']?><br><small>[(strip_image_paths)]</small></td> |
104 | 104 | <td> |
105 | - <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths=='1' ? 'checked="checked"' : "" ; ?> /> |
|
105 | + <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths == '1' ? 'checked="checked"' : ""; ?> /> |
|
106 | 106 | <?php echo $_lang['yes']?></label><br /> |
107 | - <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths=='0' ? 'checked="checked"' : "" ; ?> /> |
|
107 | + <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths == '0' ? 'checked="checked"' : ""; ?> /> |
|
108 | 108 | <?php echo $_lang['no']?></label> |
109 | 109 | </td> |
110 | 110 | </tr> |
111 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
111 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
112 | 112 | <td width="200"> </td> |
113 | 113 | <td class="comment"><?php echo $_lang['settings_strip_image_paths_message']?></td> |
114 | 114 | </tr> |
115 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
115 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
116 | 116 | <td colspan="2"><div class="split"></div></td> |
117 | 117 | </tr> |
118 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
118 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
119 | 119 | <td nowrap class="warning"><?php echo $_lang['maxImageWidth']?><br><small>[(maxImageWidth)]</small></td> |
120 | 120 | <td> |
121 | 121 | <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageWidth" value="<?php echo $maxImageWidth; ?>" /> |
122 | 122 | </td> |
123 | 123 | </tr> |
124 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
124 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
125 | 125 | <td width="200"> </td> |
126 | 126 | <td class="comment"><?php echo $_lang['maxImageWidth_message']?></td> |
127 | 127 | </tr> |
128 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
128 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
129 | 129 | <td colspan="2"><div class="split"></div></td> |
130 | 130 | </tr> |
131 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
131 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
132 | 132 | <td nowrap class="warning"><?php echo $_lang['maxImageHeight']?><br><small>[(maxImageHeight)]</small></td> |
133 | 133 | <td> |
134 | 134 | <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageHeight" value="<?php echo $maxImageHeight; ?>" /> |
135 | 135 | </td> |
136 | 136 | </tr> |
137 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
137 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
138 | 138 | <td width="200"> </td> |
139 | 139 | <td class="comment"><?php echo $_lang['maxImageHeight_message']?></td> |
140 | 140 | </tr> |
141 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
141 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
142 | 142 | <td colspan="2"><div class="split"></div></td> |
143 | 143 | </tr> |
144 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
144 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
145 | 145 | <td nowrap class="warning"><?php echo $_lang['thumbWidth']?><br><small>[(thumbWidth)]</small></td> |
146 | 146 | <td> |
147 | 147 | <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbWidth" value="<?php echo $thumbWidth; ?>" /> |
148 | 148 | </td> |
149 | 149 | </tr> |
150 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
150 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
151 | 151 | <td width="200"> </td> |
152 | 152 | <td class="comment"><?php echo $_lang['thumbWidth_message']?></td> |
153 | 153 | </tr> |
154 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
154 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
155 | 155 | <td colspan="2"><div class="split"></div></td> |
156 | 156 | </tr> |
157 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
157 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
158 | 158 | <td nowrap class="warning"><?php echo $_lang['thumbHeight']?><br><small>[(thumbHeight)]</small></td> |
159 | 159 | <td> |
160 | 160 | <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbHeight" value="<?php echo $thumbHeight; ?>" /> |
161 | 161 | </td> |
162 | 162 | </tr> |
163 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
163 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
164 | 164 | <td width="200"> </td> |
165 | 165 | <td class="comment"><?php echo $_lang['thumbHeight_message']?></td> |
166 | 166 | </tr> |
167 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
167 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
168 | 168 | <td colspan="2"><div class="split"></div></td> |
169 | 169 | </tr> |
170 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
170 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
171 | 171 | <td nowrap class="warning"><?php echo $_lang['thumbsDir']?><br><small>[(thumbsDir)]</small></td> |
172 | 172 | <td> |
173 | 173 | <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="thumbsDir" value="<?php echo $thumbsDir; ?>" /> |
174 | 174 | </td> |
175 | 175 | </tr> |
176 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
176 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
177 | 177 | <td width="200"> </td> |
178 | 178 | <td class="comment"><?php echo $_lang['thumbsDir_message']?></td> |
179 | 179 | </tr> |
180 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
180 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
181 | 181 | <td colspan="2"><div class="split"></div></td> |
182 | 182 | </tr> |
183 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
183 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
184 | 184 | <td nowrap class="warning"><?php echo $_lang['jpegQuality']?><br><small>[(jpegQuality)]</small></td> |
185 | 185 | <td> |
186 | 186 | <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="jpegQuality" value="<?php echo $jpegQuality; ?>" /> |
187 | 187 | </td> |
188 | 188 | </tr> |
189 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
189 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
190 | 190 | <td width="200"> </td> |
191 | 191 | <td class="comment"><?php echo $_lang['jpegQuality_message']?></td> |
192 | 192 | </tr> |
193 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
193 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
194 | 194 | <td colspan="2"><div class="split"></div></td> |
195 | 195 | </tr> |
196 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
196 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
197 | 197 | <td nowrap class="warning"><?php echo $_lang['denyZipDownload'] ?><br><small>[(denyZipDownload)]</small></td> |
198 | 198 | <td> |
199 | - <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload=='0' ? 'checked="checked"' : ""; ?> /> |
|
199 | + <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload == '0' ? 'checked="checked"' : ""; ?> /> |
|
200 | 200 | <?php echo $_lang['no']?></label><br /> |
201 | - <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload=='1' ? 'checked="checked"' : ""; ?> /> |
|
201 | + <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload == '1' ? 'checked="checked"' : ""; ?> /> |
|
202 | 202 | <?php echo $_lang['yes']?></label> |
203 | 203 | </td> |
204 | 204 | </tr> |
205 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
205 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
206 | 206 | <td colspan="2"><div class="split"></div></td> |
207 | 207 | </tr> |
208 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
208 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
209 | 209 | <td nowrap class="warning"><?php echo $_lang['denyExtensionRename'] ?><br><small>[(denyExtensionRename)]</small></td> |
210 | 210 | <td> |
211 | - <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename=='0' ? 'checked="checked"' : ""; ?> /> |
|
211 | + <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename == '0' ? 'checked="checked"' : ""; ?> /> |
|
212 | 212 | <?php echo $_lang['no']?></label><br /> |
213 | - <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename=='1' ? 'checked="checked"' : ""; ?> /> |
|
213 | + <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename == '1' ? 'checked="checked"' : ""; ?> /> |
|
214 | 214 | <?php echo $_lang['yes']?></label> |
215 | 215 | </td> |
216 | 216 | </tr> |
217 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
217 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
218 | 218 | <td colspan="2"><div class="split"></div></td> |
219 | 219 | </tr> |
220 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
220 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
221 | 221 | <td nowrap class="warning"><?php echo $_lang['showHiddenFiles'] ?><br><small>[(showHiddenFiles)]</small></td> |
222 | 222 | <td> |
223 | - <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles=='0' ? 'checked="checked"' : ""; ?> /> |
|
223 | + <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles == '0' ? 'checked="checked"' : ""; ?> /> |
|
224 | 224 | <?php echo $_lang['no']?></label><br /> |
225 | - <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles=='1' ? 'checked="checked"' : ""; ?> /> |
|
225 | + <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles == '1' ? 'checked="checked"' : ""; ?> /> |
|
226 | 226 | <?php echo $_lang['yes']?></label> |
227 | 227 | </td> |
228 | 228 | </tr> |
229 | - <tr class="rbRow" <?php echo showHide($use_browser==1);?>> |
|
229 | + <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>> |
|
230 | 230 | <td colspan="2"><div class="split"></div></td> |
231 | 231 | </tr> |
232 | 232 | |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | <?php |
236 | 236 | // invoke OnMiscSettingsRender event |
237 | 237 | $evtOut = $modx->invokeEvent('OnMiscSettingsRender'); |
238 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
238 | + if (is_array($evtOut)) echo implode("", $evtOut); |
|
239 | 239 | ?> |
240 | 240 | </td> |
241 | 241 | </tr> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <td> |
24 | 24 | <select name="which_browser" size="1" class="inputBox" onchange="documentDirty=true;"> |
25 | 25 | <?php |
26 | - foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
26 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
27 | 27 | $dir = str_replace('\\', '/', $dir); |
28 | 28 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
29 | 29 | $selected = $browser_name == $which_browser ? ' selected="selected"' : ''; |
@@ -235,7 +235,9 @@ discard block |
||
235 | 235 | <?php |
236 | 236 | // invoke OnMiscSettingsRender event |
237 | 237 | $evtOut = $modx->invokeEvent('OnMiscSettingsRender'); |
238 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
238 | + if(is_array($evtOut)) { |
|
239 | + echo implode("",$evtOut); |
|
240 | + } |
|
239 | 241 | ?> |
240 | 242 | </td> |
241 | 243 | </tr> |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | <select name="manager_theme" size="1" class="inputBox" onChange="documentDirty=true; document.forms['settings'].theme_refresher.value = Date.parse(new Date());"> |
50 | 50 | <?php |
51 | 51 | $dir = dir("media/style/"); |
52 | - while ($file = $dir->read()) { |
|
53 | - if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
54 | - if ($file === 'common') { |
|
52 | + while ($file = $dir->read()) { |
|
53 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
54 | + if ($file === 'common') { |
|
55 | 55 | continue; |
56 | 56 | } |
57 | 57 | $themename = $file; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $tpl = '<option value="[+value+]" [+selected+]>[+title+]</option>' . "\n"; |
210 | 210 | $option = explode(',', $_lang['settings_group_tv_options']); |
211 | 211 | $output = array(); |
212 | - foreach ($option as $k => $v) { |
|
212 | + foreach ($option as $k => $v) { |
|
213 | 213 | $selected = ($k == $group_tvs) ? 'selected' : ''; |
214 | 214 | $s = array('[+value+]', '[+selected+]', '[+title+]'); |
215 | 215 | $r = array($k, $selected, $v); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $tpl = '<option value="[+value+]" [+selected+]>[*[+value+]*]</option>' . "\n"; |
283 | 283 | $option = array('pagetitle', 'longtitle', 'menutitle', 'alias', 'createdon', 'editedon', 'publishedon'); |
284 | 284 | $output = array(); |
285 | - foreach ($option as $v) { |
|
285 | + foreach ($option as $v) { |
|
286 | 286 | $selected = ($v == $resource_tree_node_name) ? 'selected' : ''; |
287 | 287 | $s = array('[+value+]', '[+selected+]'); |
288 | 288 | $r = array($v, $selected); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | <?php |
364 | 364 | $datetime_format_list = array('dd-mm-YYYY', 'mm/dd/YYYY', 'YYYY/mm/dd'); |
365 | 365 | $str = ''; |
366 | - foreach ($datetime_format_list as $value) { |
|
366 | + foreach ($datetime_format_list as $value) { |
|
367 | 367 | $selectedtext = ($datetime_format == $value) ? ' selected' : ''; |
368 | 368 | $str .= '<option value="' . $value . '"' . $selectedtext . '>'; |
369 | 369 | $str .= $value . '</option>' . PHP_EOL; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | <?php |
446 | 446 | // invoke OnRichTextEditorRegister event |
447 | 447 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister'); |
448 | - if (!is_array($evtOut)) { |
|
448 | + if (!is_array($evtOut)) { |
|
449 | 449 | $evtOut = array(); |
450 | 450 | $use_editor = 0; |
451 | 451 | } |
@@ -477,8 +477,8 @@ discard block |
||
477 | 477 | <?php |
478 | 478 | // invoke OnRichTextEditorRegister event |
479 | 479 | echo "<option value='none'" . ($which_editor == 'none' ? " selected='selected'" : "") . ">" . $_lang['none'] . "</option>\n"; |
480 | - if (is_array($evtOut)) { |
|
481 | - foreach ($evtOut as $editor) { |
|
480 | + if (is_array($evtOut)) { |
|
481 | + foreach ($evtOut as $editor) { |
|
482 | 482 | echo "<option value='$editor'" . ($which_editor == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
483 | 483 | } |
484 | 484 | } |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | <?php |
535 | 535 | // invoke OnInterfaceSettingsRender event |
536 | 536 | $evtOut = $modx->invokeEvent('OnInterfaceSettingsRender'); |
537 | - if (is_array($evtOut)) { |
|
537 | + if (is_array($evtOut)) { |
|
538 | 538 | echo implode("", $evtOut); |
539 | 539 | } |
540 | 540 | ?> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | $themename = $file; |
58 | 58 | $selectedtext = $themename == $manager_theme ? "selected='selected'" : ""; |
59 | - echo "<option value='$themename' $selectedtext>" . ucwords(str_replace("_", " ", $themename)) . "</option>"; |
|
59 | + echo "<option value='$themename' $selectedtext>".ucwords(str_replace("_", " ", $themename))."</option>"; |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | $dir->close(); |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | <tr> |
131 | 131 | <th><?php echo $_lang['login_form_position_title'] ?><br><small>[(login_form_position)]</small></th> |
132 | 132 | <td> |
133 | - <?php echo wrap_label($_lang['login_form_position_left'],form_radio('login_form_position', 'left'));?><br /> |
|
134 | - <?php echo wrap_label($_lang['login_form_position_center'], form_radio('login_form_position', 'center'));?><br /> |
|
135 | - <?php echo wrap_label($_lang['login_form_position_right'], form_radio('login_form_position', 'right'));?> |
|
133 | + <?php echo wrap_label($_lang['login_form_position_left'], form_radio('login_form_position', 'left')); ?><br /> |
|
134 | + <?php echo wrap_label($_lang['login_form_position_center'], form_radio('login_form_position', 'center')); ?><br /> |
|
135 | + <?php echo wrap_label($_lang['login_form_position_right'], form_radio('login_form_position', 'right')); ?> |
|
136 | 136 | </td> |
137 | 137 | </tr> |
138 | 138 | <tr> |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | <tr> |
145 | 145 | <th><?php echo $_lang['manager_menu_position_title'] ?><br><small>[(manager_menu_position)]</small></th> |
146 | 146 | <td> |
147 | - <?php echo wrap_label($_lang['manager_menu_position_top'],form_radio('manager_menu_position', 'top'));?><br /> |
|
148 | - <?php echo wrap_label($_lang['manager_menu_position_left'], form_radio('manager_menu_position', 'left'));?><br /> |
|
147 | + <?php echo wrap_label($_lang['manager_menu_position_top'], form_radio('manager_menu_position', 'top')); ?><br /> |
|
148 | + <?php echo wrap_label($_lang['manager_menu_position_left'], form_radio('manager_menu_position', 'left')); ?><br /> |
|
149 | 149 | </td> |
150 | 150 | </tr> |
151 | 151 | |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | <td> |
288 | 288 | <select name="group_tvs" size="1" class="form-control"> |
289 | 289 | <?php |
290 | - $tpl = '<option value="[+value+]" [+selected+]>[+title+]</option>' . "\n"; |
|
290 | + $tpl = '<option value="[+value+]" [+selected+]>[+title+]</option>'."\n"; |
|
291 | 291 | $option = explode(',', $_lang['settings_group_tv_options']); |
292 | 292 | $output = array(); |
293 | 293 | foreach ($option as $k => $v) { |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | <td> |
361 | 361 | <select name="resource_tree_node_name" size="1" class="inputBox"> |
362 | 362 | <?php |
363 | - $tpl = '<option value="[+value+]" [+selected+]>[*[+value+]*]</option>' . "\n"; |
|
363 | + $tpl = '<option value="[+value+]" [+selected+]>[*[+value+]*]</option>'."\n"; |
|
364 | 364 | $option = array('pagetitle', 'longtitle', 'menutitle', 'alias', 'createdon', 'editedon', 'publishedon'); |
365 | 365 | $output = array(); |
366 | 366 | foreach ($option as $v) { |
@@ -446,8 +446,8 @@ discard block |
||
446 | 446 | $str = ''; |
447 | 447 | foreach ($datetime_format_list as $value) { |
448 | 448 | $selectedtext = ($datetime_format == $value) ? ' selected' : ''; |
449 | - $str .= '<option value="' . $value . '"' . $selectedtext . '>'; |
|
450 | - $str .= $value . '</option>' . PHP_EOL; |
|
449 | + $str .= '<option value="'.$value.'"'.$selectedtext.'>'; |
|
450 | + $str .= $value.'</option>'.PHP_EOL; |
|
451 | 451 | } |
452 | 452 | echo $str; |
453 | 453 | ?> |
@@ -557,10 +557,10 @@ discard block |
||
557 | 557 | <select name="which_editor" onChange="documentDirty=true;"> |
558 | 558 | <?php |
559 | 559 | // invoke OnRichTextEditorRegister event |
560 | - echo "<option value='none'" . ($which_editor == 'none' ? " selected='selected'" : "") . ">" . $_lang['none'] . "</option>\n"; |
|
560 | + echo "<option value='none'".($which_editor == 'none' ? " selected='selected'" : "").">".$_lang['none']."</option>\n"; |
|
561 | 561 | if (is_array($evtOut)) { |
562 | 562 | foreach ($evtOut as $editor) { |
563 | - echo "<option value='$editor'" . ($which_editor == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
563 | + echo "<option value='$editor'".($which_editor == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
564 | 564 | } |
565 | 565 | } |
566 | 566 | ?> |
@@ -644,14 +644,14 @@ discard block |
||
644 | 644 | lastImageCtrl = ctrl; |
645 | 645 | var w = screen.width * 0.7; |
646 | 646 | var h = screen.height * 0.7; |
647 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
647 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | function BrowseFileServer(ctrl) { |
651 | 651 | lastFileCtrl = ctrl; |
652 | 652 | var w = screen.width * 0.7; |
653 | 653 | var h = screen.height * 0.7; |
654 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=files", w, h); |
|
654 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=files", w, h); |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | function SetUrlChange(el) { |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | <tr> |
3 | 3 | <td><?php echo $_lang['smtp_auth_title'] ?></td> |
4 | 4 | <td> |
5 | - <?php echo wrap_label($_lang['yes'],form_radio('smtp_auth','1' ));?><br /> |
|
6 | - <?php echo wrap_label($_lang['no'],form_radio('smtp_auth','0' ));?> |
|
5 | + <?php echo wrap_label($_lang['yes'], form_radio('smtp_auth', '1')); ?><br /> |
|
6 | + <?php echo wrap_label($_lang['no'], form_radio('smtp_auth', '0')); ?> |
|
7 | 7 | </td> |
8 | 8 | </tr> |
9 | 9 | <tr> |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | <td > |
16 | 16 | <select name="smtp_secure" size="1" class="inputBox"> |
17 | 17 | <option value="none" ><?php echo $_lang['no'] ?></option> |
18 | - <option value="ssl" <?php if($smtp_secure == 'ssl') echo "selected='selected'"; ?> >SSL</option> |
|
19 | - <option value="tls" <?php if($smtp_secure == 'tls') echo "selected='selected'"; ?> >TLS</option> |
|
18 | + <option value="ssl" <?php if ($smtp_secure == 'ssl') echo "selected='selected'"; ?> >SSL</option> |
|
19 | + <option value="tls" <?php if ($smtp_secure == 'tls') echo "selected='selected'"; ?> >TLS</option> |
|
20 | 20 | </select> |
21 | 21 | <br /> |
22 | 22 | </td> |
@@ -15,8 +15,14 @@ |
||
15 | 15 | <td > |
16 | 16 | <select name="smtp_secure" size="1" class="inputBox"> |
17 | 17 | <option value="none" ><?php echo $_lang['no'] ?></option> |
18 | - <option value="ssl" <?php if($smtp_secure == 'ssl') echo "selected='selected'"; ?> >SSL</option> |
|
19 | - <option value="tls" <?php if($smtp_secure == 'tls') echo "selected='selected'"; ?> >TLS</option> |
|
18 | + <option value="ssl" <?php if($smtp_secure == 'ssl') { |
|
19 | + echo "selected='selected'"; |
|
20 | +} |
|
21 | +?> >SSL</option> |
|
22 | + <option value="tls" <?php if($smtp_secure == 'tls') { |
|
23 | + echo "selected='selected'"; |
|
24 | +} |
|
25 | +?> >TLS</option> |
|
20 | 26 | </select> |
21 | 27 | <br /> |
22 | 28 | </td> |