Index: trunk/tools/ToolserverI18N/TsIntuition.php |
— | — | @@ -103,7 +103,7 @@ |
104 | 104 | */ |
105 | 105 | function __construct( $options = array() ) { |
106 | 106 | |
107 | | - if ( is_string( $options) ) { |
| 107 | + if ( is_string( $options ) ) { |
108 | 108 | $options = array( 'domain' => $options ); |
109 | 109 | } |
110 | 110 | |
— | — | @@ -194,7 +194,7 @@ |
195 | 195 | /* Get/Set variables |
196 | 196 | * ------------------------------------------------- */ |
197 | 197 | |
198 | | - public function getLang(){ |
| 198 | + public function getLang() { |
199 | 199 | return $this->currentLanguage; |
200 | 200 | } |
201 | 201 | |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | * Return the currently selected text domain. |
252 | 252 | * @return string |
253 | 253 | */ |
254 | | - public function getDomain(){ |
| 254 | + public function getDomain() { |
255 | 255 | return $this->currentTextdomain; |
256 | 256 | } |
257 | 257 | |
— | — | @@ -258,7 +258,7 @@ |
259 | 259 | * Get an array of all registered text domains. |
260 | 260 | * @return array |
261 | 261 | */ |
262 | | - public function getAllRegisteredDomains(){ |
| 262 | + public function getAllRegisteredDomains() { |
263 | 263 | return $this->registeredTextdomains; |
264 | 264 | } |
265 | 265 | |
— | — | @@ -278,7 +278,7 @@ |
279 | 279 | * |
280 | 280 | * @return array An array of aliases as keys and actual cookienames as values |
281 | 281 | */ |
282 | | - public function getCookieNames(){ |
| 282 | + public function getCookieNames() { |
283 | 283 | return $this->cookieNames; |
284 | 284 | } |
285 | 285 | |
— | — | @@ -293,7 +293,7 @@ |
294 | 294 | * |
295 | 295 | * @return array An array of aliases as keys and actual parameter names as values. |
296 | 296 | */ |
297 | | - public function getParamNames(){ |
| 297 | + public function getParamNames() { |
298 | 298 | return $this->paramNames; |
299 | 299 | } |
300 | 300 | |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | * |
309 | 309 | * @return boolean |
310 | 310 | */ |
311 | | - public function getUseRequestParam(){ |
| 311 | + public function getUseRequestParam() { |
312 | 312 | return $this->useRequestParam; |
313 | 313 | } |
314 | 314 | |
— | — | @@ -508,7 +508,7 @@ |
509 | 509 | */ |
510 | 510 | public function setMsgs( $messagesByKeys, $domain = 0, $lang = 0 ) { |
511 | 511 | foreach ( $messagesByKeys as $key => $message ) { |
512 | | - $this->setMsg( $key, $message, $domain, $lang); |
| 512 | + $this->setMsg( $key, $message, $domain, $lang ); |
513 | 513 | } |
514 | 514 | } |
515 | 515 | |
— | — | @@ -772,8 +772,8 @@ |
773 | 773 | * It's recommended to redirectTo() directly after this. |
774 | 774 | * @return boolean |
775 | 775 | */ |
776 | | - public function wipeCookies(){ |
777 | | - $week = 7*24*3600; |
| 776 | + public function wipeCookies() { |
| 777 | + $week = 7 * 24 * 3600; |
778 | 778 | foreach( $this->getCookieNames() as $name ) { |
779 | 779 | setcookie( $name, '', time()-$week, '/', '.toolserver.org' ); |
780 | 780 | unset( $_COOKIE[$name] ); |
— | — | @@ -785,7 +785,7 @@ |
786 | 786 | * Get expiration timestamp. |
787 | 787 | * @return integer Unix timestamp of expiration date or 0 if not available. |
788 | 788 | */ |
789 | | - public function getCookieExpiration(){ |
| 789 | + public function getCookieExpiration() { |
790 | 790 | $name = $this->getCookieName( 'track-expire' ); |
791 | 791 | $expire = isset( $_COOKIE[$name] ) ? intval( $_COOKIE[$name] ) : 0; |
792 | 792 | return $expire; |
— | — | @@ -795,14 +795,14 @@ |
796 | 796 | * Get expected lifetime left in seconds. |
797 | 797 | * Returns 0 if expired or unavailable. |
798 | 798 | */ |
799 | | - public function getCookieLifetime(){ |
| 799 | + public function getCookieLifetime() { |
800 | 800 | $expire = $this->getCookieExpiration(); |
801 | 801 | $lifetime = $expire - time(); |
802 | 802 | // If already expired (-xxx), return 0 |
803 | 803 | return $lifetime < 0 ? 0 : $lifetime; |
804 | 804 | } |
805 | 805 | |
806 | | - public function hasCookies(){ |
| 806 | + public function hasCookies() { |
807 | 807 | return isset( $_COOKIE[ $this->getCookieName( 'userlang' ) ] ); |
808 | 808 | } |
809 | 809 | |
— | — | @@ -836,7 +836,7 @@ |
837 | 837 | * |
838 | 838 | * @return true |
839 | 839 | */ |
840 | | - private function loadDomainRegistry(){ |
| 840 | + private function loadDomainRegistry() { |
841 | 841 | |
842 | 842 | // Don't load twice |
843 | 843 | if ( is_array( $this->registeredTextdomains ) ) { |
— | — | @@ -865,7 +865,7 @@ |
866 | 866 | * |
867 | 867 | * @return true |
868 | 868 | */ |
869 | | - private function loadFallbacks(){ |
| 869 | + private function loadFallbacks() { |
870 | 870 | |
871 | 871 | // Don't load twice |
872 | 872 | if ( is_array( $this->langFallbacks ) ) { |
— | — | @@ -893,7 +893,7 @@ |
894 | 894 | * |
895 | 895 | * @return true |
896 | 896 | */ |
897 | | - private function loadNames(){ |
| 897 | + private function loadNames() { |
898 | 898 | |
899 | 899 | // Don't load twice |
900 | 900 | if ( is_array( $this->langNames ) ) { |
— | — | @@ -1019,7 +1019,7 @@ |
1020 | 1020 | * Show a typical "powered by .." footer line. |
1021 | 1021 | * Same as getPromoBox() but without the image. |
1022 | 1022 | */ |
1023 | | - public function getFooterLine( $helpTranslateDomain = null ){ |
| 1023 | + public function getFooterLine( $helpTranslateDomain = null ) { |
1024 | 1024 | return $this->getPromoBox( 'no-image', $helpTranslateDomain ); |
1025 | 1025 | } |
1026 | 1026 | |
— | — | @@ -1066,7 +1066,7 @@ |
1067 | 1067 | $this->redirectTo = array( $url, $code ); |
1068 | 1068 | } |
1069 | 1069 | |
1070 | | - public function doRedirect(){ |
| 1070 | + public function doRedirect() { |
1071 | 1071 | if ( is_array( $this->redirectTo ) ) { |
1072 | 1072 | header( 'Content-Type: text/html; charset=utf-8' ); |
1073 | 1073 | header( 'Location: ' . $this->redirectTo[0], true, $this->redirectTo[1] ); |
— | — | @@ -1076,7 +1076,7 @@ |
1077 | 1077 | } |
1078 | 1078 | } |
1079 | 1079 | |
1080 | | - public function isRedirecting(){ |
| 1080 | + public function isRedirecting() { |
1081 | 1081 | return is_array( $this->redirectTo ); |
1082 | 1082 | } |
1083 | 1083 | |
— | — | @@ -1156,7 +1156,7 @@ |
1157 | 1157 | } |
1158 | 1158 | |
1159 | 1159 | /** |
1160 | | - * Check language choise tree in the following order: |
| 1160 | + * Check language choice tree in the following order: |
1161 | 1161 | * - First: Construct override |
1162 | 1162 | * - Second: Parameter override |
1163 | 1163 | * - Third: Saved cookie |
— | — | @@ -1189,7 +1189,7 @@ |
1190 | 1190 | * for it to be applied |
1191 | 1191 | * @return true |
1192 | 1192 | */ |
1193 | | - public function refreshLang(){ |
| 1193 | + public function refreshLang() { |
1194 | 1194 | $this->initLangSelect(); |
1195 | 1195 | return true; |
1196 | 1196 | } |