@@ -113,8 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $userFile = include $this->_userFile; |
115 | 115 | $this->loadUserDataFromPhp($userFile); |
116 | - } |
|
117 | - else |
|
116 | + } else |
|
118 | 117 | { |
119 | 118 | $dom=new TXmlDocument; |
120 | 119 | $dom->loadFromFile($this->_userFile); |
@@ -310,8 +309,7 @@ discard block |
||
310 | 309 | $user=new TUser($this); |
311 | 310 | $user->setIsGuest(true); |
312 | 311 | return $user; |
313 | - } |
|
314 | - else |
|
312 | + } else |
|
315 | 313 | { |
316 | 314 | $username=strtolower($username); |
317 | 315 | if(isset($this->_users[$username])) |
@@ -322,8 +320,7 @@ discard block |
||
322 | 320 | if(isset($this->_roles[$username])) |
323 | 321 | $user->setRoles($this->_roles[$username]); |
324 | 322 | return $user; |
325 | - } |
|
326 | - else |
|
323 | + } else |
|
327 | 324 | return null; |
328 | 325 | } |
329 | 326 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | { |
112 | 112 | if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP) |
113 | 113 | { |
114 | - $userFile = include $this->_userFile; |
|
114 | + $userFile=include $this->_userFile; |
|
115 | 115 | $this->loadUserDataFromPhp($userFile); |
116 | 116 | } |
117 | 117 | else |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | { |
147 | 147 | foreach($config['users'] as $user) |
148 | 148 | { |
149 | - $name = trim(strtolower(isset($user['name'])?$user['name']:'')); |
|
150 | - $password = isset($user['password'])?$user['password']:''; |
|
151 | - $this->_users[$name] = $password; |
|
152 | - $roles = isset($user['roles'])?$user['roles']:''; |
|
149 | + $name=trim(strtolower(isset($user['name']) ? $user['name'] : '')); |
|
150 | + $password=isset($user['password']) ? $user['password'] : ''; |
|
151 | + $this->_users[$name]=$password; |
|
152 | + $roles=isset($user['roles']) ? $user['roles'] : ''; |
|
153 | 153 | if($roles!=='') |
154 | 154 | { |
155 | - foreach(explode(',',$roles) as $role) |
|
155 | + foreach(explode(',', $roles) as $role) |
|
156 | 156 | { |
157 | 157 | if(($role=trim($role))!=='') |
158 | 158 | $this->_roles[$name][]=$role; |
@@ -164,9 +164,9 @@ discard block |
||
164 | 164 | { |
165 | 165 | foreach($config['roles'] as $role) |
166 | 166 | { |
167 | - $name = isset($role['name'])?$role['name']:''; |
|
168 | - $users = isset($role['users'])?$role['users']:''; |
|
169 | - foreach(explode(',',$users) as $user) |
|
167 | + $name=isset($role['name']) ? $role['name'] : ''; |
|
168 | + $users=isset($role['users']) ? $role['users'] : ''; |
|
169 | + foreach(explode(',', $users) as $user) |
|
170 | 170 | { |
171 | 171 | if(($user=trim($user))!=='') |
172 | 172 | $this->_roles[strtolower($user)][]=$name; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->_users[$name]=$node->getAttribute('password'); |
188 | 188 | if(($roles=trim($node->getAttribute('roles')))!=='') |
189 | 189 | { |
190 | - foreach(explode(',',$roles) as $role) |
|
190 | + foreach(explode(',', $roles) as $role) |
|
191 | 191 | { |
192 | 192 | if(($role=trim($role))!=='') |
193 | 193 | $this->_roles[$name][]=$role; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | } |
197 | 197 | foreach($xmlNode->getElementsByTagName('role') as $node) |
198 | 198 | { |
199 | - foreach(explode(',',$node->getAttribute('users')) as $user) |
|
199 | + foreach(explode(',', $node->getAttribute('users')) as $user) |
|
200 | 200 | { |
201 | 201 | if(($user=trim($user))!=='') |
202 | 202 | $this->_roles[strtolower($user)][]=$node->getAttribute('name'); |
@@ -246,8 +246,8 @@ discard block |
||
246 | 246 | { |
247 | 247 | if($this->_initialized) |
248 | 248 | throw new TInvalidOperationException('usermanager_userfile_unchangeable'); |
249 | - else if(($this->_userFile=Prado::getPathOfNamespace($value,self::USER_FILE_EXT))===null || !is_file($this->_userFile)) |
|
250 | - throw new TConfigurationException('usermanager_userfile_invalid',$value); |
|
249 | + else if(($this->_userFile=Prado::getPathOfNamespace($value, self::USER_FILE_EXT))===null || !is_file($this->_userFile)) |
|
250 | + throw new TConfigurationException('usermanager_userfile_invalid', $value); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function setPasswordMode($value) |
281 | 281 | { |
282 | - $this->_passwordMode=TPropertyValue::ensureEnum($value,'TUserManagerPasswordMode'); |
|
282 | + $this->_passwordMode=TPropertyValue::ensureEnum($value, 'TUserManagerPasswordMode'); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | * @param string password |
289 | 289 | * @return boolean true if validation is successful, false otherwise. |
290 | 290 | */ |
291 | - public function validateUser($username,$password) |
|
291 | + public function validateUser($username, $password) |
|
292 | 292 | { |
293 | 293 | if($this->_passwordMode===TUserManagerPasswordMode::MD5) |
294 | 294 | $password=md5($password); |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $data=unserialize($data); |
342 | 342 | if(is_array($data) && count($data)===2) |
343 | 343 | { |
344 | - list($username,$token)=$data; |
|
344 | + list($username, $token)=$data; |
|
345 | 345 | if(isset($this->_users[$username]) && $token===md5($username.$this->_users[$username])) |
346 | 346 | return $this->getUser($username); |
347 | 347 | } |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | $username=strtolower($user->getName()); |
361 | 361 | if(isset($this->_users[$username])) |
362 | 362 | { |
363 | - $data=array($username,md5($username.$this->_users[$username])); |
|
363 | + $data=array($username, md5($username.$this->_users[$username])); |
|
364 | 364 | $cookie->setValue(serialize($data)); |
365 | 365 | } |
366 | 366 | } |
@@ -112,8 +112,7 @@ |
||
112 | 112 | && strlen($datetime[1]) == 1) |
113 | 113 | { |
114 | 114 | $pattern = $datetime; |
115 | - } |
|
116 | - else //no subpattern, try the presets |
|
115 | + } else //no subpattern, try the presets |
|
117 | 116 | $pattern = $this->getPreset($string); |
118 | 117 | |
119 | 118 | //no presets found, use the string as the pattern |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | * A set of pattern presets and their respective formatting shorthand. |
71 | 71 | * @var array |
72 | 72 | */ |
73 | - static private $_patternPresets = array( |
|
74 | - 'fulldate'=>'P','full'=>'P', |
|
75 | - 'longdate'=>'D','long'=>'d', |
|
76 | - 'mediumdate'=>'p','medium'=>'p', |
|
77 | - 'shortdate'=>'d','short'=>'d', |
|
73 | + static private $_patternPresets=array( |
|
74 | + 'fulldate'=>'P', 'full'=>'P', |
|
75 | + 'longdate'=>'D', 'long'=>'d', |
|
76 | + 'mediumdate'=>'p', 'medium'=>'p', |
|
77 | + 'shortdate'=>'d', 'short'=>'d', |
|
78 | 78 | 'fulltime'=>'Q', 'longtime'=>'T', |
79 | 79 | 'mediumtime'=>'q', 'shorttime'=>'t'); |
80 | 80 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function setPattern($value) |
86 | 86 | { |
87 | - $this->setViewState('Pattern',$value,''); |
|
87 | + $this->setViewState('Pattern', $value, ''); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -93,35 +93,35 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function getPattern() |
95 | 95 | { |
96 | - $string = $this->getViewState('Pattern',''); |
|
96 | + $string=$this->getViewState('Pattern', ''); |
|
97 | 97 | |
98 | - $pattern = null; |
|
98 | + $pattern=null; |
|
99 | 99 | |
100 | 100 | //try the subpattern of "date time" presets |
101 | - $subpatterns = explode(' ',$string,2); |
|
102 | - $datetime = array(); |
|
101 | + $subpatterns=explode(' ', $string, 2); |
|
102 | + $datetime=array(); |
|
103 | 103 | if(count($subpatterns)==2) |
104 | 104 | { |
105 | - $datetime[] = $this->getPreset($subpatterns[0]); |
|
106 | - $datetime[] = $this->getPreset($subpatterns[1]); |
|
105 | + $datetime[]=$this->getPreset($subpatterns[0]); |
|
106 | + $datetime[]=$this->getPreset($subpatterns[1]); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | //we have a good subpattern |
110 | - if(count($datetime) == 2 |
|
111 | - && strlen($datetime[0]) == 1 |
|
112 | - && strlen($datetime[1]) == 1) |
|
110 | + if(count($datetime)==2 |
|
111 | + && strlen($datetime[0])==1 |
|
112 | + && strlen($datetime[1])==1) |
|
113 | 113 | { |
114 | - $pattern = $datetime; |
|
114 | + $pattern=$datetime; |
|
115 | 115 | } |
116 | 116 | else //no subpattern, try the presets |
117 | - $pattern = $this->getPreset($string); |
|
117 | + $pattern=$this->getPreset($string); |
|
118 | 118 | |
119 | 119 | //no presets found, use the string as the pattern |
120 | 120 | //and let the DateFormat handle it. |
121 | 121 | if($pattern===null) |
122 | - $pattern = $string; |
|
123 | - if (!is_array($pattern) && strlen($pattern) == 0) |
|
124 | - $pattern = null; |
|
122 | + $pattern=$string; |
|
123 | + if(!is_array($pattern) && strlen($pattern)==0) |
|
124 | + $pattern=null; |
|
125 | 125 | return $pattern; |
126 | 126 | } |
127 | 127 | |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | */ |
133 | 133 | protected function getPreset($string) |
134 | 134 | { |
135 | - $string = strtolower($string); |
|
135 | + $string=strtolower($string); |
|
136 | 136 | foreach(self::$_patternPresets as $pattern => $preset) |
137 | 137 | { |
138 | - if($string == $pattern) |
|
138 | + if($string==$pattern) |
|
139 | 139 | return $preset; |
140 | 140 | } |
141 | 141 | } |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function getValue() |
148 | 148 | { |
149 | - $value = $this->getViewState('Value',''); |
|
149 | + $value=$this->getViewState('Value', ''); |
|
150 | 150 | if(empty($value)) |
151 | 151 | { |
152 | - $defaultText = $this->getDefaultText(); |
|
152 | + $defaultText=$this->getDefaultText(); |
|
153 | 153 | if(empty($defaultText)) |
154 | 154 | return time(); |
155 | 155 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function setValue($value) |
164 | 164 | { |
165 | - $this->setViewState('Value',$value,''); |
|
165 | + $this->setViewState('Value', $value, ''); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | public function getDefaultText() |
173 | 173 | { |
174 | - return $this->getViewState('DefaultText',''); |
|
174 | + return $this->getViewState('DefaultText', ''); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function setDefaultText($value) |
182 | 182 | { |
183 | - $this->setViewState('DefaultText',$value,''); |
|
183 | + $this->setViewState('DefaultText', $value, ''); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -217,29 +217,29 @@ discard block |
||
217 | 217 | */ |
218 | 218 | protected function getFormattedDate() |
219 | 219 | { |
220 | - $value = $this->getValue(); |
|
221 | - $defaultText = $this->getDefaultText(); |
|
220 | + $value=$this->getValue(); |
|
221 | + $defaultText=$this->getDefaultText(); |
|
222 | 222 | if(empty($value) && !empty($defaultText)) |
223 | 223 | return $this->getDefaultText(); |
224 | 224 | |
225 | - $app = $this->getApplication()->getGlobalization(); |
|
225 | + $app=$this->getApplication()->getGlobalization(); |
|
226 | 226 | |
227 | 227 | //initialized the default class wide formatter |
228 | 228 | if(self::$formatter===null) |
229 | - self::$formatter = new DateFormat($app->getCulture()); |
|
229 | + self::$formatter=new DateFormat($app->getCulture()); |
|
230 | 230 | |
231 | - $culture = $this->getCulture(); |
|
231 | + $culture=$this->getCulture(); |
|
232 | 232 | |
233 | 233 | //return the specific cultural formatted date time |
234 | - if(strlen($culture) && $app->getCulture() !== $culture) |
|
234 | + if(strlen($culture) && $app->getCulture()!==$culture) |
|
235 | 235 | { |
236 | - $formatter = new DateFormat($culture); |
|
236 | + $formatter=new DateFormat($culture); |
|
237 | 237 | return $formatter->format($value, |
238 | 238 | $this->getPattern(), |
239 | 239 | $this->getCharset()); |
240 | 240 | } |
241 | 241 | //return the application wide culture formatted date time. |
242 | - $result = self::$formatter->format($value, |
|
242 | + $result=self::$formatter->format($value, |
|
243 | 243 | $this->getPattern(), |
244 | 244 | $this->getCharset()); |
245 | 245 | return $result; |
@@ -283,8 +283,7 @@ discard block |
||
283 | 283 | closedir($dir); |
284 | 284 | if($cacheValid) |
285 | 285 | $this->_skins=$skins; |
286 | - } |
|
287 | - else |
|
286 | + } else |
|
288 | 287 | { |
289 | 288 | $cacheValid=true; |
290 | 289 | $this->_cssFiles=$cssFiles; |
@@ -461,20 +460,16 @@ discard block |
||
461 | 460 | { |
462 | 461 | $setter='set'.$name; |
463 | 462 | $control->$setter($value); |
464 | - } |
|
465 | - else |
|
463 | + } else |
|
466 | 464 | throw new TConfigurationException('theme_property_readonly',$type,$name); |
467 | - } |
|
468 | - else |
|
465 | + } else |
|
469 | 466 | throw new TConfigurationException('theme_property_undefined',$type,$name); |
470 | - } |
|
471 | - else // complex property |
|
467 | + } else // complex property |
|
472 | 468 | $control->setSubProperty($name,$value); |
473 | 469 | } |
474 | 470 | } |
475 | 471 | return true; |
476 | - } |
|
477 | - else |
|
472 | + } else |
|
478 | 473 | return false; |
479 | 474 | } |
480 | 475 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * default theme class |
48 | 48 | */ |
49 | - const DEFAULT_THEMECLASS = 'TTheme'; |
|
49 | + const DEFAULT_THEMECLASS='TTheme'; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @var string |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function getTheme($name) |
89 | 89 | { |
90 | 90 | $themePath=$this->getBasePath().DIRECTORY_SEPARATOR.$name; |
91 | - $themeUrl=rtrim($this->getBaseUrl(),'/').'/'.$name; |
|
91 | + $themeUrl=rtrim($this->getBaseUrl(), '/').'/'.$name; |
|
92 | 92 | return Prado::createComponent($this->getThemeClass(), $themePath, $themeUrl); |
93 | 93 | } |
94 | 94 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @param string|null $class Theme class name in namespace format |
97 | 97 | */ |
98 | 98 | public function setThemeClass($class) { |
99 | - $this->_themeClass = $class===null ? self::DEFAULT_THEMECLASS : (string)$class; |
|
99 | + $this->_themeClass=$class===null ? self::DEFAULT_THEMECLASS : (string) $class; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $this->_basePath=dirname($this->getRequest()->getApplicationFilePath()).DIRECTORY_SEPARATOR.self::DEFAULT_BASEPATH; |
135 | 135 | if(($basePath=realpath($this->_basePath))===false || !is_dir($basePath)) |
136 | - throw new TConfigurationException('thememanager_basepath_invalid2',$this->_basePath); |
|
136 | + throw new TConfigurationException('thememanager_basepath_invalid2', $this->_basePath); |
|
137 | 137 | $this->_basePath=$basePath; |
138 | 138 | } |
139 | 139 | return $this->_basePath; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | { |
152 | 152 | $this->_basePath=Prado::getPathOfNamespace($value); |
153 | 153 | if($this->_basePath===null || !is_dir($this->_basePath)) |
154 | - throw new TInvalidDataValueException('thememanager_basepath_invalid',$value); |
|
154 | + throw new TInvalidDataValueException('thememanager_basepath_invalid', $value); |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | { |
166 | 166 | $appPath=dirname($this->getRequest()->getApplicationFilePath()); |
167 | 167 | $basePath=$this->getBasePath(); |
168 | - if(strpos($basePath,$appPath)===false) |
|
168 | + if(strpos($basePath, $appPath)===false) |
|
169 | 169 | throw new TConfigurationException('thememanager_baseurl_required'); |
170 | - $appUrl=rtrim(dirname($this->getRequest()->getApplicationUrl()),'/\\'); |
|
171 | - $this->_baseUrl=$appUrl.strtr(substr($basePath,strlen($appPath)),'\\','/'); |
|
170 | + $appUrl=rtrim(dirname($this->getRequest()->getApplicationUrl()), '/\\'); |
|
171 | + $this->_baseUrl=$appUrl.strtr(substr($basePath, strlen($appPath)), '\\', '/'); |
|
172 | 172 | } |
173 | 173 | return $this->_baseUrl; |
174 | 174 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function setBaseUrl($value) |
180 | 180 | { |
181 | - $this->_baseUrl=rtrim($value,'/'); |
|
181 | + $this->_baseUrl=rtrim($value, '/'); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * @param string theme URL |
249 | 249 | * @throws TConfigurationException if theme path does not exist or any parsing error of the skin files |
250 | 250 | */ |
251 | - public function __construct($themePath,$themeUrl) |
|
251 | + public function __construct($themePath, $themeUrl) |
|
252 | 252 | { |
253 | 253 | $this->_themeUrl=$themeUrl; |
254 | 254 | $this->_themePath=realpath($themePath); |
@@ -260,21 +260,21 @@ discard block |
||
260 | 260 | $array=$cache->get(self::THEME_CACHE_PREFIX.$themePath); |
261 | 261 | if(is_array($array)) |
262 | 262 | { |
263 | - list($skins,$cssFiles,$jsFiles,$timestamp)=$array; |
|
263 | + list($skins, $cssFiles, $jsFiles, $timestamp)=$array; |
|
264 | 264 | if($this->getApplication()->getMode()!==TApplicationMode::Performance) |
265 | 265 | { |
266 | 266 | if(($dir=opendir($themePath))===false) |
267 | - throw new TIOException('theme_path_inexistent',$themePath); |
|
267 | + throw new TIOException('theme_path_inexistent', $themePath); |
|
268 | 268 | $cacheValid=true; |
269 | 269 | while(($file=readdir($dir))!==false) |
270 | 270 | { |
271 | 271 | if($file==='.' || $file==='..') |
272 | 272 | continue; |
273 | - else if(basename($file,'.css')!==$file) |
|
273 | + else if(basename($file, '.css')!==$file) |
|
274 | 274 | $this->_cssFiles[]=$themeUrl.'/'.$file; |
275 | - else if(basename($file,'.js')!==$file) |
|
275 | + else if(basename($file, '.js')!==$file) |
|
276 | 276 | $this->_jsFiles[]=$themeUrl.'/'.$file; |
277 | - else if(basename($file,self::SKIN_FILE_EXT)!==$file && filemtime($themePath.DIRECTORY_SEPARATOR.$file)>$timestamp) |
|
277 | + else if(basename($file, self::SKIN_FILE_EXT)!==$file && filemtime($themePath.DIRECTORY_SEPARATOR.$file) > $timestamp) |
|
278 | 278 | { |
279 | 279 | $cacheValid=false; |
280 | 280 | break; |
@@ -299,29 +299,29 @@ discard block |
||
299 | 299 | $this->_jsFiles=array(); |
300 | 300 | $this->_skins=array(); |
301 | 301 | if(($dir=opendir($themePath))===false) |
302 | - throw new TIOException('theme_path_inexistent',$themePath); |
|
302 | + throw new TIOException('theme_path_inexistent', $themePath); |
|
303 | 303 | while(($file=readdir($dir))!==false) |
304 | 304 | { |
305 | 305 | if($file==='.' || $file==='..') |
306 | 306 | continue; |
307 | - else if(basename($file,'.css')!==$file) |
|
307 | + else if(basename($file, '.css')!==$file) |
|
308 | 308 | $this->_cssFiles[]=$themeUrl.'/'.$file; |
309 | - else if(basename($file,'.js')!==$file) |
|
309 | + else if(basename($file, '.js')!==$file) |
|
310 | 310 | $this->_jsFiles[]=$themeUrl.'/'.$file; |
311 | - else if(basename($file,self::SKIN_FILE_EXT)!==$file) |
|
311 | + else if(basename($file, self::SKIN_FILE_EXT)!==$file) |
|
312 | 312 | { |
313 | - $template=new TTemplate(file_get_contents($themePath.'/'.$file),$themePath,$themePath.'/'.$file); |
|
313 | + $template=new TTemplate(file_get_contents($themePath.'/'.$file), $themePath, $themePath.'/'.$file); |
|
314 | 314 | foreach($template->getItems() as $skin) |
315 | 315 | { |
316 | 316 | if(!isset($skin[2])) // a text string, ignored |
317 | 317 | continue; |
318 | 318 | else if($skin[0]!==-1) |
319 | - throw new TConfigurationException('theme_control_nested',$skin[1],dirname($themePath)); |
|
319 | + throw new TConfigurationException('theme_control_nested', $skin[1], dirname($themePath)); |
|
320 | 320 | $type=$skin[1]; |
321 | - $id=isset($skin[2]['skinid'])?$skin[2]['skinid']:0; |
|
321 | + $id=isset($skin[2]['skinid']) ? $skin[2]['skinid'] : 0; |
|
322 | 322 | unset($skin[2]['skinid']); |
323 | 323 | if(isset($this->_skins[$type][$id])) |
324 | - throw new TConfigurationException('theme_skinid_duplicated',$type,$id,dirname($themePath)); |
|
324 | + throw new TConfigurationException('theme_skinid_duplicated', $type, $id, dirname($themePath)); |
|
325 | 325 | /* |
326 | 326 | foreach($skin[2] as $name=>$value) |
327 | 327 | { |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | sort($this->_cssFiles); |
338 | 338 | sort($this->_jsFiles); |
339 | 339 | if($cache!==null) |
340 | - $cache->set(self::THEME_CACHE_PREFIX.$themePath,array($this->_skins,$this->_cssFiles,$this->_jsFiles,time())); |
|
340 | + $cache->set(self::THEME_CACHE_PREFIX.$themePath, array($this->_skins, $this->_cssFiles, $this->_jsFiles, time())); |
|
341 | 341 | } |
342 | 342 | } |
343 | 343 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | */ |
355 | 355 | protected function setName($value) |
356 | 356 | { |
357 | - $this->_name = $value; |
|
357 | + $this->_name=$value; |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | */ |
371 | 371 | protected function setBaseUrl($value) |
372 | 372 | { |
373 | - $this->_themeUrl=rtrim($value,'/'); |
|
373 | + $this->_themeUrl=rtrim($value, '/'); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | /** |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | */ |
403 | 403 | protected function setSkins($value) |
404 | 404 | { |
405 | - $this->_skins = $value; |
|
405 | + $this->_skins=$value; |
|
406 | 406 | } |
407 | 407 | |
408 | 408 | /** |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | { |
424 | 424 | foreach($this->_skins[$type][$id] as $name=>$value) |
425 | 425 | { |
426 | - Prado::trace("Applying skin $name to $type",'System.Web.UI.TThemeManager'); |
|
426 | + Prado::trace("Applying skin $name to $type", 'System.Web.UI.TThemeManager'); |
|
427 | 427 | if(is_array($value)) |
428 | 428 | { |
429 | 429 | switch($value[0]) |
@@ -432,28 +432,28 @@ discard block |
||
432 | 432 | $value=$this->evaluateExpression($value[1]); |
433 | 433 | break; |
434 | 434 | case TTemplate::CONFIG_ASSET: |
435 | - $value=$this->_themeUrl.'/'.ltrim($value[1],'/'); |
|
435 | + $value=$this->_themeUrl.'/'.ltrim($value[1], '/'); |
|
436 | 436 | break; |
437 | 437 | case TTemplate::CONFIG_DATABIND: |
438 | - $control->bindProperty($name,$value[1]); |
|
438 | + $control->bindProperty($name, $value[1]); |
|
439 | 439 | break; |
440 | 440 | case TTemplate::CONFIG_PARAMETER: |
441 | - $control->setSubProperty($name,$this->getApplication()->getParameters()->itemAt($value[1])); |
|
441 | + $control->setSubProperty($name, $this->getApplication()->getParameters()->itemAt($value[1])); |
|
442 | 442 | break; |
443 | 443 | case TTemplate::CONFIG_TEMPLATE: |
444 | - $control->setSubProperty($name,$value[1]); |
|
444 | + $control->setSubProperty($name, $value[1]); |
|
445 | 445 | break; |
446 | 446 | case TTemplate::CONFIG_LOCALIZATION: |
447 | - $control->setSubProperty($name,Prado::localize($value[1])); |
|
447 | + $control->setSubProperty($name, Prado::localize($value[1])); |
|
448 | 448 | break; |
449 | 449 | default: |
450 | - throw new TConfigurationException('theme_tag_unexpected',$name,$value[0]); |
|
450 | + throw new TConfigurationException('theme_tag_unexpected', $name, $value[0]); |
|
451 | 451 | break; |
452 | 452 | } |
453 | 453 | } |
454 | 454 | if(!is_array($value)) |
455 | 455 | { |
456 | - if(strpos($name,'.')===false) // is simple property or custom attribute |
|
456 | + if(strpos($name, '.')===false) // is simple property or custom attribute |
|
457 | 457 | { |
458 | 458 | if($control->hasProperty($name)) |
459 | 459 | { |
@@ -463,13 +463,13 @@ discard block |
||
463 | 463 | $control->$setter($value); |
464 | 464 | } |
465 | 465 | else |
466 | - throw new TConfigurationException('theme_property_readonly',$type,$name); |
|
466 | + throw new TConfigurationException('theme_property_readonly', $type, $name); |
|
467 | 467 | } |
468 | 468 | else |
469 | - throw new TConfigurationException('theme_property_undefined',$type,$name); |
|
469 | + throw new TConfigurationException('theme_property_undefined', $type, $name); |
|
470 | 470 | } |
471 | 471 | else // complex property |
472 | - $control->setSubProperty($name,$value); |
|
472 | + $control->setSubProperty($name, $value); |
|
473 | 473 | } |
474 | 474 | } |
475 | 475 | return true; |
@@ -120,11 +120,9 @@ |
||
120 | 120 | { |
121 | 121 | $this->setChecked(true); |
122 | 122 | return true; |
123 | - } |
|
124 | - else |
|
123 | + } else |
|
125 | 124 | return false; |
126 | - } |
|
127 | - else if($this->getChecked()) |
|
125 | + } else if($this->getChecked()) |
|
128 | 126 | $this->setChecked(false); |
129 | 127 | return false; |
130 | 128 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function __construct() |
79 | 79 | { |
80 | 80 | parent::__construct(); |
81 | - $this->_globalID = self::$_buttonCount++; |
|
81 | + $this->_globalID=self::$_buttonCount++; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | * @param array the input data collection |
111 | 111 | * @return boolean whether the data of the control has been changed |
112 | 112 | */ |
113 | - public function loadPostData($key,$values) |
|
113 | + public function loadPostData($key, $values) |
|
114 | 114 | { |
115 | 115 | $uniqueGroupName=$this->getUniqueGroupName(); |
116 | - $value=isset($values[$uniqueGroupName])?$values[$uniqueGroupName]:null; |
|
116 | + $value=isset($values[$uniqueGroupName]) ? $values[$uniqueGroupName] : null; |
|
117 | 117 | if($value!==null && $value===$this->getValueAttribute()) |
118 | 118 | { |
119 | 119 | if(!$this->getChecked()) |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function getGroupName() |
136 | 136 | { |
137 | - return $this->getViewState('GroupName',''); |
|
137 | + return $this->getViewState('GroupName', ''); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function setGroupName($value) |
147 | 147 | { |
148 | - $this->setViewState('GroupName',$value,''); |
|
148 | + $this->setViewState('GroupName', $value, ''); |
|
149 | 149 | $this->_uniqueGroupName=null; |
150 | 150 | } |
151 | 151 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function getUniqueGroupName() |
156 | 156 | { |
157 | - if(($groupName=$this->getViewState('UniqueGroupName',''))!=='') |
|
157 | + if(($groupName=$this->getViewState('UniqueGroupName', ''))!=='') |
|
158 | 158 | return $groupName; |
159 | 159 | else if(($uniqueID=$this->getUniqueID())!==$this->_previousUniqueID || $this->_uniqueGroupName===null) |
160 | 160 | { |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | $this->_previousUniqueID=$uniqueID; |
163 | 163 | if($uniqueID!=='') |
164 | 164 | { |
165 | - if(($pos=strrpos($uniqueID,TControl::ID_SEPARATOR))!==false) |
|
165 | + if(($pos=strrpos($uniqueID, TControl::ID_SEPARATOR))!==false) |
|
166 | 166 | { |
167 | 167 | if($groupName!=='') |
168 | - $groupName=substr($uniqueID,0,$pos+1).$groupName; |
|
168 | + $groupName=substr($uniqueID, 0, $pos + 1).$groupName; |
|
169 | 169 | else if(is_a($this->getNamingContainer(), 'TRadioButtonList')) |
170 | - $groupName=substr($uniqueID,0,$pos); |
|
170 | + $groupName=substr($uniqueID, 0, $pos); |
|
171 | 171 | } |
172 | 172 | if($groupName==='') |
173 | 173 | $groupName=$uniqueID; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setUniqueGroupName($value) |
197 | 197 | { |
198 | - $this->setViewState('UniqueGroupName',$value,''); |
|
198 | + $this->setViewState('UniqueGroupName', $value, ''); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function getRadioButtonsInGroup() |
208 | 208 | { |
209 | - $group = $this->getUniqueGroupName(); |
|
210 | - $buttons = array(); |
|
209 | + $group=$this->getUniqueGroupName(); |
|
210 | + $buttons=array(); |
|
211 | 211 | foreach(self::$_activeButtons as $control) |
212 | 212 | { |
213 | - if($control->getUniqueGroupName() === $group) |
|
214 | - $buttons[] = $control; |
|
213 | + if($control->getUniqueGroupName()===$group) |
|
214 | + $buttons[]=$control; |
|
215 | 215 | } |
216 | 216 | return $buttons; |
217 | 217 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public function getEnableClientScript() |
234 | 234 | { |
235 | - return $this->getViewState('EnableClientScript',true); |
|
235 | + return $this->getViewState('EnableClientScript', true); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function setEnableClientScript($value) |
242 | 242 | { |
243 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
243 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -249,19 +249,19 @@ discard block |
||
249 | 249 | * @param string checkbox id |
250 | 250 | * @param string onclick js |
251 | 251 | */ |
252 | - protected function renderInputTag($writer,$clientID,$onclick) |
|
252 | + protected function renderInputTag($writer, $clientID, $onclick) |
|
253 | 253 | { |
254 | 254 | if($clientID!=='') |
255 | - $writer->addAttribute('id',$clientID); |
|
256 | - $writer->addAttribute('type','radio'); |
|
257 | - $writer->addAttribute('name',$this->getUniqueGroupName()); |
|
258 | - $writer->addAttribute('value',$this->getValueAttribute()); |
|
255 | + $writer->addAttribute('id', $clientID); |
|
256 | + $writer->addAttribute('type', 'radio'); |
|
257 | + $writer->addAttribute('name', $this->getUniqueGroupName()); |
|
258 | + $writer->addAttribute('value', $this->getValueAttribute()); |
|
259 | 259 | if(!empty($onclick)) |
260 | - $writer->addAttribute('onclick',$onclick); |
|
260 | + $writer->addAttribute('onclick', $onclick); |
|
261 | 261 | if($this->getChecked()) |
262 | - $writer->addAttribute('checked','checked'); |
|
262 | + $writer->addAttribute('checked', 'checked'); |
|
263 | 263 | if(!$this->getEnabled(true)) |
264 | - $writer->addAttribute('disabled','disabled'); |
|
264 | + $writer->addAttribute('disabled', 'disabled'); |
|
265 | 265 | |
266 | 266 | $page=$this->getPage(); |
267 | 267 | if($this->getEnabled(true) |
@@ -273,10 +273,10 @@ discard block |
||
273 | 273 | } |
274 | 274 | |
275 | 275 | if(($accesskey=$this->getAccessKey())!=='') |
276 | - $writer->addAttribute('accesskey',$accesskey); |
|
277 | - if(($tabindex=$this->getTabIndex())>0) |
|
278 | - $writer->addAttribute('tabindex',"$tabindex"); |
|
279 | - if($attributes=$this->getViewState('InputAttributes',null)) |
|
276 | + $writer->addAttribute('accesskey', $accesskey); |
|
277 | + if(($tabindex=$this->getTabIndex()) > 0) |
|
278 | + $writer->addAttribute('tabindex', "$tabindex"); |
|
279 | + if($attributes=$this->getViewState('InputAttributes', null)) |
|
280 | 280 | $writer->addAttributes($attributes); |
281 | 281 | $writer->renderBeginTag('input'); |
282 | 282 | $writer->renderEndTag(); |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | */ |
288 | 288 | protected function renderClientControlScript($writer) |
289 | 289 | { |
290 | - $cs = $this->getPage()->getClientScript(); |
|
291 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
290 | + $cs=$this->getPage()->getClientScript(); |
|
291 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -178,8 +178,7 @@ discard block |
||
178 | 178 | $control->setItemType($item->getItemType()); |
179 | 179 | } |
180 | 180 | $cell->getControls()->add($control); |
181 | - } |
|
182 | - else |
|
181 | + } else |
|
183 | 182 | $control=$cell; |
184 | 183 | $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
185 | 184 | break; |
@@ -196,15 +195,13 @@ discard block |
||
196 | 195 | } |
197 | 196 | $cell->getControls()->add($control); |
198 | 197 | $cell->registerObject('EditControl',$control); |
199 | - } |
|
200 | - else |
|
198 | + } else |
|
201 | 199 | { |
202 | 200 | $control=Prado::createComponent('System.Web.UI.WebControls.TTextBox'); |
203 | 201 | $cell->getControls()->add($control); |
204 | 202 | $cell->registerObject('TextBox',$control); |
205 | 203 | } |
206 | - } |
|
207 | - else |
|
204 | + } else |
|
208 | 205 | { |
209 | 206 | if(($classPath=$this->getItemRenderer())!=='') |
210 | 207 | { |
@@ -215,8 +212,7 @@ discard block |
||
215 | 212 | $control->setItemType($item->getItemType()); |
216 | 213 | } |
217 | 214 | $cell->getControls()->add($control); |
218 | - } |
|
219 | - else |
|
215 | + } else |
|
220 | 216 | $control=$cell; |
221 | 217 | } |
222 | 218 | $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getItemRenderer() |
54 | 54 | { |
55 | - return $this->getViewState('ItemRenderer',''); |
|
55 | + return $this->getViewState('ItemRenderer', ''); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function setItemRenderer($value) |
73 | 73 | { |
74 | - $this->setViewState('ItemRenderer',$value,''); |
|
74 | + $this->setViewState('ItemRenderer', $value, ''); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function getEditItemRenderer() |
82 | 82 | { |
83 | - return $this->getViewState('EditItemRenderer',''); |
|
83 | + return $this->getViewState('EditItemRenderer', ''); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function setEditItemRenderer($value) |
101 | 101 | { |
102 | - $this->setViewState('EditItemRenderer',$value,''); |
|
102 | + $this->setViewState('EditItemRenderer', $value, ''); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function getDataField() |
109 | 109 | { |
110 | - return $this->getViewState('DataField',''); |
|
110 | + return $this->getViewState('DataField', ''); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function setDataField($value) |
117 | 117 | { |
118 | - $this->setViewState('DataField',$value,''); |
|
118 | + $this->setViewState('DataField', $value, ''); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function getDataFormatString() |
125 | 125 | { |
126 | - return $this->getViewState('DataFormatString',''); |
|
126 | + return $this->getViewState('DataFormatString', ''); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setDataFormatString($value) |
133 | 133 | { |
134 | - $this->setViewState('DataFormatString',$value,''); |
|
134 | + $this->setViewState('DataFormatString', $value, ''); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getReadOnly() |
141 | 141 | { |
142 | - return $this->getViewState('ReadOnly',false); |
|
142 | + return $this->getViewState('ReadOnly', false); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function setReadOnly($value) |
149 | 149 | { |
150 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
150 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * @param integer the index to the Columns property that the cell resides in. |
162 | 162 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
163 | 163 | */ |
164 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
164 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
165 | 165 | { |
166 | 166 | $item=$cell->getParent(); |
167 | 167 | switch($itemType) |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | else |
183 | 183 | $control=$cell; |
184 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
184 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
185 | 185 | break; |
186 | 186 | case TListItemType::EditItem: |
187 | 187 | if(!$this->getReadOnly()) |
@@ -195,13 +195,13 @@ discard block |
||
195 | 195 | $control->setItemType($item->getItemType()); |
196 | 196 | } |
197 | 197 | $cell->getControls()->add($control); |
198 | - $cell->registerObject('EditControl',$control); |
|
198 | + $cell->registerObject('EditControl', $control); |
|
199 | 199 | } |
200 | 200 | else |
201 | 201 | { |
202 | 202 | $control=Prado::createComponent('System.Web.UI.WebControls.TTextBox'); |
203 | 203 | $cell->getControls()->add($control); |
204 | - $cell->registerObject('TextBox',$control); |
|
204 | + $cell->registerObject('TextBox', $control); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | else |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | else |
220 | 220 | $control=$cell; |
221 | 221 | } |
222 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
222 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
223 | 223 | break; |
224 | 224 | default: |
225 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
225 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
226 | 226 | break; |
227 | 227 | } |
228 | 228 | } |
@@ -232,15 +232,15 @@ discard block |
||
232 | 232 | * This method is invoked when datagrid performs databinding. |
233 | 233 | * It populates the content of the cell with the relevant data from data source. |
234 | 234 | */ |
235 | - public function dataBindColumn($sender,$param) |
|
235 | + public function dataBindColumn($sender, $param) |
|
236 | 236 | { |
237 | 237 | $item=$sender->getNamingContainer(); |
238 | 238 | $data=$item->getData(); |
239 | 239 | $formatString=$this->getDataFormatString(); |
240 | 240 | if(($field=$this->getDataField())!=='') |
241 | - $value=$this->formatDataValue($formatString,$this->getDataFieldValue($data,$field)); |
|
241 | + $value=$this->formatDataValue($formatString, $this->getDataFieldValue($data, $field)); |
|
242 | 242 | else |
243 | - $value=$this->formatDataValue($formatString,$data); |
|
243 | + $value=$this->formatDataValue($formatString, $data); |
|
244 | 244 | $sender->setData($value); |
245 | 245 | } |
246 | 246 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function getDataField() |
49 | 49 | { |
50 | - return $this->getViewState('DataField',''); |
|
50 | + return $this->getViewState('DataField', ''); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setDataField($value) |
57 | 57 | { |
58 | - $this->setViewState('DataField',$value,''); |
|
58 | + $this->setViewState('DataField', $value, ''); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function getReadOnly() |
65 | 65 | { |
66 | - return $this->getViewState('ReadOnly',false); |
|
66 | + return $this->getViewState('ReadOnly', false); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function setReadOnly($value) |
73 | 73 | { |
74 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
74 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param integer the index to the Columns property that the cell resides in. |
85 | 85 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
86 | 86 | */ |
87 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
87 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
88 | 88 | { |
89 | 89 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) |
90 | 90 | { |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | $checkBox->setEnabled(false); |
94 | 94 | $cell->setHorizontalAlign('Center'); |
95 | 95 | $cell->getControls()->add($checkBox); |
96 | - $cell->registerObject('CheckBox',$checkBox); |
|
96 | + $cell->registerObject('CheckBox', $checkBox); |
|
97 | 97 | if($this->getDataField()!=='') |
98 | - $checkBox->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
98 | + $checkBox->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
99 | 99 | } |
100 | 100 | else |
101 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
101 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | * This method is invoked when datagrid performs databinding. |
107 | 107 | * It populates the content of the cell with the relevant data from data source. |
108 | 108 | */ |
109 | - public function dataBindColumn($sender,$param) |
|
109 | + public function dataBindColumn($sender, $param) |
|
110 | 110 | { |
111 | 111 | $item=$sender->getNamingContainer(); |
112 | 112 | $data=$item->getData(); |
113 | 113 | if(($field=$this->getDataField())!=='') |
114 | - $value=TPropertyValue::ensureBoolean($this->getDataFieldValue($data,$field)); |
|
114 | + $value=TPropertyValue::ensureBoolean($this->getDataFieldValue($data, $field)); |
|
115 | 115 | else |
116 | 116 | $value=TPropertyValue::ensureBoolean($data); |
117 | 117 | if($sender instanceof TCheckBox) |
@@ -270,8 +270,7 @@ discard block |
||
270 | 270 | $cell->getControls()->add($listControl); |
271 | 271 | $cell->registerObject('DropDownList',$listControl); |
272 | 272 | $control=$listControl; |
273 | - } |
|
274 | - else |
|
273 | + } else |
|
275 | 274 | $control=$cell; |
276 | 275 | $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
277 | 276 | break; |
@@ -307,8 +306,7 @@ discard block |
||
307 | 306 | $value=$text; |
308 | 307 | $formatString=$this->getDataTextFormatString(); |
309 | 308 | $text=$this->formatDataValue($formatString,$text); |
310 | - } |
|
311 | - else |
|
309 | + } else |
|
312 | 310 | $text=$value; |
313 | 311 | if($sender instanceof TTableCell) |
314 | 312 | $sender->setText($text); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | parent::loadState($state); |
78 | 78 | $this->_stateLoaded=true; |
79 | 79 | if(!$this->_dataBound) |
80 | - $this->_listControl->getItems()->loadState($this->getViewState('Items',null)); |
|
80 | + $this->_listControl->getItems()->loadState($this->getViewState('Items', null)); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function saveState() |
88 | 88 | { |
89 | - $this->setViewState('Items',$this->_listControl->getItems()->saveState(),null); |
|
89 | + $this->setViewState('Items', $this->_listControl->getItems()->saveState(), null); |
|
90 | 90 | return parent::saveState(); |
91 | 91 | } |
92 | 92 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getDataTextField() |
113 | 113 | { |
114 | - return $this->getViewState('DataTextField',''); |
|
114 | + return $this->getViewState('DataTextField', ''); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function setDataTextField($value) |
124 | 124 | { |
125 | - $this->setViewState('DataTextField',$value,''); |
|
125 | + $this->setViewState('DataTextField', $value, ''); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function getDataTextFormatString() |
132 | 132 | { |
133 | - return $this->getViewState('DataTextFormatString',''); |
|
133 | + return $this->getViewState('DataTextFormatString', ''); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function setDataTextFormatString($value) |
140 | 140 | { |
141 | - $this->setViewState('DataTextFormatString',$value,''); |
|
141 | + $this->setViewState('DataTextFormatString', $value, ''); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function getDataValueField() |
148 | 148 | { |
149 | - return $this->getViewState('DataValueField',''); |
|
149 | + return $this->getViewState('DataValueField', ''); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function setDataValueField($value) |
159 | 159 | { |
160 | - $this->setViewState('DataValueField',$value,''); |
|
160 | + $this->setViewState('DataValueField', $value, ''); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function getReadOnly() |
167 | 167 | { |
168 | - return $this->getViewState('ReadOnly',false); |
|
168 | + return $this->getViewState('ReadOnly', false); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function setReadOnly($value) |
175 | 175 | { |
176 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
176 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | */ |
198 | 198 | public function getListValueField() |
199 | 199 | { |
200 | - return $this->getViewState('ListValueField',''); |
|
200 | + return $this->getViewState('ListValueField', ''); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function setListValueField($value) |
207 | 207 | { |
208 | - $this->setViewState('ListValueField',$value,''); |
|
208 | + $this->setViewState('ListValueField', $value, ''); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function getListTextField() |
215 | 215 | { |
216 | - return $this->getViewState('ListTextField',''); |
|
216 | + return $this->getViewState('ListTextField', ''); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function setListTextField($value) |
223 | 223 | { |
224 | - $this->setViewState('ListTextField',$value,''); |
|
224 | + $this->setViewState('ListTextField', $value, ''); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function getListTextFormatString() |
231 | 231 | { |
232 | - return $this->getViewState('ListTextFormatString',''); |
|
232 | + return $this->getViewState('ListTextFormatString', ''); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function setListTextFormatString($value) |
239 | 239 | { |
240 | - $this->setViewState('ListTextFormatString',$value,''); |
|
240 | + $this->setViewState('ListTextFormatString', $value, ''); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * @param integer the index to the Columns property that the cell resides in. |
252 | 252 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
253 | 253 | */ |
254 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
254 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
255 | 255 | { |
256 | 256 | if(!$this->_dataBound && $this->_listControl->getDataSource()!==null) |
257 | 257 | { |
@@ -268,21 +268,21 @@ discard block |
||
268 | 268 | { |
269 | 269 | $listControl=clone $this->_listControl; |
270 | 270 | $cell->getControls()->add($listControl); |
271 | - $cell->registerObject('DropDownList',$listControl); |
|
271 | + $cell->registerObject('DropDownList', $listControl); |
|
272 | 272 | $control=$listControl; |
273 | 273 | } |
274 | 274 | else |
275 | 275 | $control=$cell; |
276 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
276 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
277 | 277 | break; |
278 | 278 | case TListItemType::Item: |
279 | 279 | case TListItemType::AlternatingItem: |
280 | 280 | case TListItemType::SelectedItem: |
281 | 281 | if($this->getDataTextField()!=='' || $this->getDataValueField()!=='') |
282 | - $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
282 | + $cell->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
283 | 283 | break; |
284 | 284 | default: |
285 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
285 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
286 | 286 | break; |
287 | 287 | } |
288 | 288 | } |
@@ -292,21 +292,21 @@ discard block |
||
292 | 292 | * This method is invoked when datagrid performs databinding. |
293 | 293 | * It populates the content of the cell with the relevant data from data source. |
294 | 294 | */ |
295 | - public function dataBindColumn($sender,$param) |
|
295 | + public function dataBindColumn($sender, $param) |
|
296 | 296 | { |
297 | 297 | $item=$sender->getNamingContainer(); |
298 | 298 | $data=$item->getData(); |
299 | 299 | if(($valueField=$this->getDataValueField())!=='') |
300 | - $value=$this->getDataFieldValue($data,$valueField); |
|
300 | + $value=$this->getDataFieldValue($data, $valueField); |
|
301 | 301 | else |
302 | 302 | $value=''; |
303 | 303 | if(($textField=$this->getDataTextField())!=='') |
304 | 304 | { |
305 | - $text=$this->getDataFieldValue($data,$textField); |
|
305 | + $text=$this->getDataFieldValue($data, $textField); |
|
306 | 306 | if($valueField==='') |
307 | 307 | $value=$text; |
308 | 308 | $formatString=$this->getDataTextFormatString(); |
309 | - $text=$this->formatDataValue($formatString,$text); |
|
309 | + $text=$this->formatDataValue($formatString, $text); |
|
310 | 310 | } |
311 | 311 | else |
312 | 312 | $text=$value; |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getRegularExpression() |
64 | 64 | { |
65 | - return $this->getViewState('RegularExpression',''); |
|
65 | + return $this->getViewState('RegularExpression', ''); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function setRegularExpression($value) |
72 | 72 | { |
73 | - $this->setViewState('RegularExpression',$value,''); |
|
73 | + $this->setViewState('RegularExpression', $value, ''); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | { |
85 | 85 | if(($value=$this->getValidationValue($this->getValidationTarget()))==='') |
86 | 86 | return true; |
87 | - if(($expression=addcslashes($this->getRegularExpression(),"/"))!=='') |
|
87 | + if(($expression=addcslashes($this->getRegularExpression(), "/"))!=='') |
|
88 | 88 | { |
89 | - $mods = $this->getPatternModifiers(); |
|
90 | - return preg_match("/^$expression\$/{$mods}",$value); |
|
89 | + $mods=$this->getPatternModifiers(); |
|
90 | + return preg_match("/^$expression\$/{$mods}", $value); |
|
91 | 91 | } |
92 | 92 | else |
93 | 93 | return true; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function getClientScriptOptions() |
135 | 135 | { |
136 | - $options = parent::getClientScriptOptions(); |
|
136 | + $options=parent::getClientScriptOptions(); |
|
137 | 137 | $options['ValidationExpression']=$this->getRegularExpression(); |
138 | 138 | $options['PatternModifiers']=$this->getClientSidePatternModifiers(); |
139 | 139 | return $options; |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getDataField() |
40 | 40 | { |
41 | - return $this->getViewState('DataField',''); |
|
41 | + return $this->getViewState('DataField', ''); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function setDataField($value) |
48 | 48 | { |
49 | - $this->setViewState('DataField',$value,''); |
|
49 | + $this->setViewState('DataField', $value, ''); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getDataFormatString() |
56 | 56 | { |
57 | - return $this->getViewState('DataFormatString',''); |
|
57 | + return $this->getViewState('DataFormatString', ''); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function setDataFormatString($value) |
64 | 64 | { |
65 | - $this->setViewState('DataFormatString',$value,''); |
|
65 | + $this->setViewState('DataFormatString', $value, ''); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getText() |
72 | 72 | { |
73 | - return $this->getViewState('Text',''); |
|
73 | + return $this->getViewState('Text', ''); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function setText($value) |
80 | 80 | { |
81 | - $this->setViewState('Text',$value,''); |
|
81 | + $this->setViewState('Text', $value, ''); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function getEncode() |
88 | 88 | { |
89 | - return $this->getViewState('Encode',false); |
|
89 | + return $this->getViewState('Encode', false); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function setEncode($value) |
96 | 96 | { |
97 | - $this->setViewState('Encode',TPropertyValue::ensureBoolean($value),false); |
|
97 | + $this->setViewState('Encode', TPropertyValue::ensureBoolean($value), false); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | * @param integer the index to the Columns property that the cell resides in. |
105 | 105 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
106 | 106 | */ |
107 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
107 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
108 | 108 | { |
109 | 109 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::EditItem || $itemType===TListItemType::SelectedItem) |
110 | 110 | { |
111 | 111 | if($this->getDataField()!=='') |
112 | 112 | { |
113 | - $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
113 | + $cell->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
114 | 114 | } else { |
115 | 115 | $text=$this->getText(); |
116 | 116 | if($this->getEncode()) |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | else |
122 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
122 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,15 +127,15 @@ discard block |
||
127 | 127 | * This method is invoked when datagrid performs databinding. |
128 | 128 | * It populates the content of the cell with the relevant data from data source. |
129 | 129 | */ |
130 | - public function dataBindColumn($sender,$param) |
|
130 | + public function dataBindColumn($sender, $param) |
|
131 | 131 | { |
132 | 132 | $item=$sender->getNamingContainer(); |
133 | 133 | $data=$item->getData(); |
134 | 134 | $formatString=$this->getDataFormatString(); |
135 | 135 | if(($field=$this->getDataField())!=='') |
136 | - $value=$this->formatDataValue($formatString,$this->getDataFieldValue($data,$field)); |
|
136 | + $value=$this->formatDataValue($formatString, $this->getDataFieldValue($data, $field)); |
|
137 | 137 | else |
138 | - $value=$this->formatDataValue($formatString,$data); |
|
138 | + $value=$this->formatDataValue($formatString, $data); |
|
139 | 139 | if($sender instanceof TTableCell) |
140 | 140 | { |
141 | 141 | if($this->getEncode()) |