@@ -156,6 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | /** |
158 | 158 | * @param boolean if databind has been invoked in this page request |
159 | + * @param boolean $value |
|
159 | 160 | */ |
160 | 161 | protected function setIsDataBound($value) |
161 | 162 | { |
@@ -216,6 +217,7 @@ discard block |
||
216 | 217 | |
217 | 218 | /** |
218 | 219 | * @param integer the zero-based index of the current page |
220 | + * @param integer $value |
|
219 | 221 | * @throws TInvalidDataValueException if the value is less than 0 |
220 | 222 | */ |
221 | 223 | public function setCurrentPageIndex($value) |
@@ -278,6 +280,7 @@ discard block |
||
278 | 280 | * If true and the control has been prerendered while it uses the data source |
279 | 281 | * specified by {@link setDataSourceID}, a databind call will be called by this method. |
280 | 282 | * @param boolean whether a databind call is required. |
283 | + * @param boolean $value |
|
281 | 284 | */ |
282 | 285 | protected function setRequiresDataBinding($value) |
283 | 286 | { |
@@ -410,6 +413,9 @@ discard block |
||
410 | 413 | return $this->_currentDataSource; |
411 | 414 | } |
412 | 415 | |
416 | + /** |
|
417 | + * @param \Traversable $data |
|
418 | + */ |
|
413 | 419 | abstract protected function performDataBinding($data); |
414 | 420 | |
415 | 421 | /** |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | */ |
50 | 50 | abstract class TDataBoundControl extends \Prado\Web\UI\WebControls\TWebControl |
51 | 51 | { |
52 | - private $_initialized = false; |
|
52 | + private $_initialized=false; |
|
53 | 53 | private $_dataSource; |
54 | - private $_requiresBindToNull = false; |
|
55 | - private $_requiresDataBinding = false; |
|
56 | - private $_prerendered = false; |
|
54 | + private $_requiresBindToNull=false; |
|
55 | + private $_requiresDataBinding=false; |
|
56 | + private $_prerendered=false; |
|
57 | 57 | private $_currentView; |
58 | 58 | private $_currentDataSource; |
59 | - private $_currentViewValid = false; |
|
60 | - private $_currentDataSourceValid = false; |
|
61 | - private $_currentViewIsFromDataSourceID = false; |
|
59 | + private $_currentViewValid=false; |
|
60 | + private $_currentDataSourceValid=false; |
|
61 | + private $_currentViewIsFromDataSourceID=false; |
|
62 | 62 | private $_parameters; |
63 | - private $_isDataBound = false; |
|
63 | + private $_isDataBound=false; |
|
64 | 64 | |
65 | 65 | /** |
66 | 66 | * @return Traversable data source object, defaults to null. |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setDataSource($value) |
81 | 81 | { |
82 | - $this->_dataSource = $this->validateDataSource($value); |
|
82 | + $this->_dataSource=$this->validateDataSource($value); |
|
83 | 83 | $this->onDataSourceChanged(); |
84 | 84 | } |
85 | 85 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function setDataSourceID($value) |
99 | 99 | { |
100 | - $dsid = $this->getViewState('DataSourceID', ''); |
|
101 | - if($dsid !== '' && $value === '') |
|
102 | - $this->_requiresBindToNull = true; |
|
100 | + $dsid=$this->getViewState('DataSourceID', ''); |
|
101 | + if($dsid!=='' && $value==='') |
|
102 | + $this->_requiresBindToNull=true; |
|
103 | 103 | $this->setViewState('DataSourceID', $value, ''); |
104 | 104 | $this->onDataSourceChanged(); |
105 | 105 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | protected function getUsingDataSourceID() |
113 | 113 | { |
114 | - return $this->getDataSourceID() !== ''; |
|
114 | + return $this->getDataSourceID()!==''; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function onDataSourceChanged() |
122 | 122 | { |
123 | - $this->_currentViewValid = false; |
|
124 | - $this->_currentDataSourceValid = false; |
|
123 | + $this->_currentViewValid=false; |
|
124 | + $this->_currentDataSourceValid=false; |
|
125 | 125 | if($this->getInitialized()) |
126 | 126 | $this->setRequiresDataBinding(true); |
127 | 127 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | protected function setInitialized($value) |
146 | 146 | { |
147 | - $this->_initialized = TPropertyValue::ensureBoolean($value); |
|
147 | + $this->_initialized=TPropertyValue::ensureBoolean($value); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | protected function setIsDataBound($value) |
162 | 162 | { |
163 | - $this->_isDataBound = $value; |
|
163 | + $this->_isDataBound=$value; |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function setCurrentPageIndex($value) |
223 | 223 | { |
224 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
225 | - $value = 0; |
|
224 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
225 | + $value=0; |
|
226 | 226 | $this->setViewState('CurrentPageIndex', $value, 0); |
227 | 227 | } |
228 | 228 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function setPageSize($value) |
242 | 242 | { |
243 | - if(($value = TPropertyValue::ensureInteger($value)) < 1) |
|
243 | + if(($value=TPropertyValue::ensureInteger($value)) < 1) |
|
244 | 244 | throw new TInvalidDataValueException('databoundcontrol_pagesize_invalid', get_class($this)); |
245 | 245 | $this->setViewState('PageSize', TPropertyValue::ensureInteger($value), 10); |
246 | 246 | } |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | */ |
270 | 270 | public function setVirtualItemCount($value) |
271 | 271 | { |
272 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
272 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
273 | 273 | throw new TInvalidDataValueException('databoundcontrol_virtualitemcount_invalid', get_class($this)); |
274 | 274 | $this->setViewState('VirtualItemCount', $value, 0); |
275 | 275 | } |
@@ -282,14 +282,14 @@ discard block |
||
282 | 282 | */ |
283 | 283 | protected function setRequiresDataBinding($value) |
284 | 284 | { |
285 | - $value = TPropertyValue::ensureBoolean($value); |
|
285 | + $value=TPropertyValue::ensureBoolean($value); |
|
286 | 286 | if($value && $this->_prerendered) |
287 | 287 | { |
288 | - $this->_requiresDataBinding = true; |
|
288 | + $this->_requiresDataBinding=true; |
|
289 | 289 | $this->ensureDataBound(); |
290 | 290 | } |
291 | 291 | else |
292 | - $this->_requiresDataBinding = $value; |
|
292 | + $this->_requiresDataBinding=$value; |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | /** |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | if($this->_requiresDataBinding && ($this->getUsingDataSourceID() || $this->_requiresBindToNull)) |
304 | 304 | { |
305 | 305 | $this->dataBind(); |
306 | - $this->_requiresBindToNull = false; |
|
306 | + $this->_requiresBindToNull=false; |
|
307 | 307 | } |
308 | 308 | } |
309 | 309 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | protected function createPagedDataSource() |
314 | 314 | { |
315 | - $ds = new TPagedDataSource; |
|
315 | + $ds=new TPagedDataSource; |
|
316 | 316 | $ds->setCurrentPageIndex($this->getCurrentPageIndex()); |
317 | 317 | $ds->setPageSize($this->getPageSize()); |
318 | 318 | $ds->setAllowPaging($this->getAllowPaging()); |
@@ -333,16 +333,16 @@ discard block |
||
333 | 333 | $this->dataBindProperties(); |
334 | 334 | $this->onDataBinding(null); |
335 | 335 | |
336 | - if(($view = $this->getDataSourceView()) !== null) |
|
337 | - $data = $view->select($this->getSelectParameters()); |
|
336 | + if(($view=$this->getDataSourceView())!==null) |
|
337 | + $data=$view->select($this->getSelectParameters()); |
|
338 | 338 | else |
339 | - $data = null; |
|
339 | + $data=null; |
|
340 | 340 | |
341 | 341 | if($data instanceof \Traversable) |
342 | 342 | { |
343 | 343 | if($this->getAllowPaging()) |
344 | 344 | { |
345 | - $ds = $this->createPagedDataSource(); |
|
345 | + $ds=$this->createPagedDataSource(); |
|
346 | 346 | $ds->setDataSource($data); |
347 | 347 | $this->setViewState('PageCount', $ds->getPageCount()); |
348 | 348 | if($ds->getCurrentPageIndex() >= $ds->getPageCount()) |
@@ -373,18 +373,18 @@ discard block |
||
373 | 373 | if(!$this->_currentViewValid) |
374 | 374 | { |
375 | 375 | if($this->_currentView && $this->_currentViewIsFromDataSourceID) |
376 | - $this->_currentView->detachEventHandler('DataSourceViewChanged', [$this,'dataSourceViewChanged']); |
|
377 | - if(($dataSource = $this->determineDataSource()) !== null) |
|
376 | + $this->_currentView->detachEventHandler('DataSourceViewChanged', [$this, 'dataSourceViewChanged']); |
|
377 | + if(($dataSource=$this->determineDataSource())!==null) |
|
378 | 378 | { |
379 | - if(($view = $dataSource->getView($this->getDataMember())) === null) |
|
379 | + if(($view=$dataSource->getView($this->getDataMember()))===null) |
|
380 | 380 | throw new TInvalidDataValueException('databoundcontrol_datamember_invalid', $this->getDataMember()); |
381 | - if($this->_currentViewIsFromDataSourceID = $this->getUsingDataSourceID()) |
|
382 | - $view->attachEventHandler('OnDataSourceViewChanged', [$this,'dataSourceViewChanged']); |
|
383 | - $this->_currentView = $view; |
|
381 | + if($this->_currentViewIsFromDataSourceID=$this->getUsingDataSourceID()) |
|
382 | + $view->attachEventHandler('OnDataSourceViewChanged', [$this, 'dataSourceViewChanged']); |
|
383 | + $this->_currentView=$view; |
|
384 | 384 | } |
385 | 385 | else |
386 | - $this->_currentView = null; |
|
387 | - $this->_currentViewValid = true; |
|
386 | + $this->_currentView=null; |
|
387 | + $this->_currentViewValid=true; |
|
388 | 388 | } |
389 | 389 | return $this->_currentView; |
390 | 390 | } |
@@ -393,20 +393,20 @@ discard block |
||
393 | 393 | { |
394 | 394 | if(!$this->_currentDataSourceValid) |
395 | 395 | { |
396 | - if(($dsid = $this->getDataSourceID()) !== '') |
|
396 | + if(($dsid=$this->getDataSourceID())!=='') |
|
397 | 397 | { |
398 | - if(($dataSource = $this->getNamingContainer()->findControl($dsid)) === null) |
|
398 | + if(($dataSource=$this->getNamingContainer()->findControl($dsid))===null) |
|
399 | 399 | throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent', $dsid); |
400 | 400 | elseif(!($dataSource instanceof IDataSource)) |
401 | 401 | throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid', $dsid); |
402 | 402 | else |
403 | - $this->_currentDataSource = $dataSource; |
|
403 | + $this->_currentDataSource=$dataSource; |
|
404 | 404 | } |
405 | - elseif(($dataSource = $this->getDataSource()) !== null) |
|
406 | - $this->_currentDataSource = new TReadOnlyDataSource($dataSource, $this->getDataMember()); |
|
405 | + elseif(($dataSource=$this->getDataSource())!==null) |
|
406 | + $this->_currentDataSource=new TReadOnlyDataSource($dataSource, $this->getDataMember()); |
|
407 | 407 | else |
408 | - $this->_currentDataSource = null; |
|
409 | - $this->_currentDataSourceValid = true; |
|
408 | + $this->_currentDataSource=null; |
|
409 | + $this->_currentDataSourceValid=true; |
|
410 | 410 | } |
411 | 411 | return $this->_currentDataSource; |
412 | 412 | } |
@@ -433,8 +433,8 @@ discard block |
||
433 | 433 | public function onInit($param) |
434 | 434 | { |
435 | 435 | parent::onInit($param); |
436 | - $page = $this->getPage(); |
|
437 | - $page->attachEventHandler('OnPreLoad', [$this,'pagePreLoad']); |
|
436 | + $page=$this->getPage(); |
|
437 | + $page->attachEventHandler('OnPreLoad', [$this, 'pagePreLoad']); |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | /** |
@@ -445,8 +445,8 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function pagePreLoad($sender, $param) |
447 | 447 | { |
448 | - $this->_initialized = true; |
|
449 | - $isPostBack = $this->getPage()->getIsPostBack(); |
|
448 | + $this->_initialized=true; |
|
449 | + $isPostBack=$this->getPage()->getIsPostBack(); |
|
450 | 450 | if(!$isPostBack || ($isPostBack && (!$this->getEnableViewState(true) || !$this->getIsDataBound()))) |
451 | 451 | $this->setRequiresDataBinding(true); |
452 | 452 | } |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | */ |
459 | 459 | public function onPreRender($param) |
460 | 460 | { |
461 | - $this->_prerendered = true; |
|
461 | + $this->_prerendered=true; |
|
462 | 462 | $this->ensureDataBound(); |
463 | 463 | parent::onPreRender($param); |
464 | 464 | } |
@@ -474,13 +474,13 @@ discard block |
||
474 | 474 | { |
475 | 475 | if(is_string($value)) |
476 | 476 | { |
477 | - $list = new TList; |
|
477 | + $list=new TList; |
|
478 | 478 | foreach(TPropertyValue::ensureArray($value) as $key => $value) |
479 | 479 | { |
480 | 480 | if(is_array($value)) |
481 | 481 | $list->add($value); |
482 | 482 | else |
483 | - $list->add([$value,is_string($key)?$key:$value]); |
|
483 | + $list->add([$value, is_string($key) ? $key : $value]); |
|
484 | 484 | } |
485 | 485 | return $list; |
486 | 486 | } |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | // read array from TDbDataReader since it's forward-only stream and can only be traversed once |
491 | 491 | return $value->readAll(); |
492 | 492 | } |
493 | - elseif(($value instanceof \Traversable) || $value === null) |
|
493 | + elseif(($value instanceof \Traversable) || $value===null) |
|
494 | 494 | return $value; |
495 | 495 | else |
496 | 496 | throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid', get_class($this)); |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | public function getSelectParameters() |
510 | 510 | { |
511 | 511 | if(!$this->_parameters) |
512 | - $this->_parameters = new TDataSourceSelectParameters; |
|
512 | + $this->_parameters=new TDataSourceSelectParameters; |
|
513 | 513 | return $this->_parameters; |
514 | 514 | } |
515 | 515 | } |
516 | 516 | \ No newline at end of file |
@@ -287,8 +287,7 @@ discard block |
||
287 | 287 | { |
288 | 288 | $this->_requiresDataBinding = true; |
289 | 289 | $this->ensureDataBound(); |
290 | - } |
|
291 | - else |
|
290 | + } else |
|
292 | 291 | $this->_requiresDataBinding = $value; |
293 | 292 | } |
294 | 293 | |
@@ -351,8 +350,7 @@ discard block |
||
351 | 350 | $this->setCurrentPageIndex($ds->getCurrentPageIndex()); |
352 | 351 | } |
353 | 352 | $this->performDataBinding($ds); |
354 | - } |
|
355 | - else |
|
353 | + } else |
|
356 | 354 | { |
357 | 355 | $this->clearViewState('PageCount'); |
358 | 356 | $this->performDataBinding($data); |
@@ -381,8 +379,7 @@ discard block |
||
381 | 379 | if($this->_currentViewIsFromDataSourceID = $this->getUsingDataSourceID()) |
382 | 380 | $view->attachEventHandler('OnDataSourceViewChanged', [$this,'dataSourceViewChanged']); |
383 | 381 | $this->_currentView = $view; |
384 | - } |
|
385 | - else |
|
382 | + } else |
|
386 | 383 | $this->_currentView = null; |
387 | 384 | $this->_currentViewValid = true; |
388 | 385 | } |
@@ -401,8 +398,7 @@ discard block |
||
401 | 398 | throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid', $dsid); |
402 | 399 | else |
403 | 400 | $this->_currentDataSource = $dataSource; |
404 | - } |
|
405 | - elseif(($dataSource = $this->getDataSource()) !== null) |
|
401 | + } elseif(($dataSource = $this->getDataSource()) !== null) |
|
406 | 402 | $this->_currentDataSource = new TReadOnlyDataSource($dataSource, $this->getDataMember()); |
407 | 403 | else |
408 | 404 | $this->_currentDataSource = null; |
@@ -483,14 +479,12 @@ discard block |
||
483 | 479 | $list->add([$value,is_string($key)?$key:$value]); |
484 | 480 | } |
485 | 481 | return $list; |
486 | - } |
|
487 | - elseif(is_array($value)) |
|
482 | + } elseif(is_array($value)) |
|
488 | 483 | return new TMap($value); |
489 | 484 | elseif($value instanceof TDbDataReader) { |
490 | 485 | // read array from TDbDataReader since it's forward-only stream and can only be traversed once |
491 | 486 | return $value->readAll(); |
492 | - } |
|
493 | - elseif(($value instanceof \Traversable) || $value === null) |
|
487 | + } elseif(($value instanceof \Traversable) || $value === null) |
|
494 | 488 | return $value; |
495 | 489 | else |
496 | 490 | throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid', get_class($this)); |
@@ -69,7 +69,7 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * @return TListItemType item type. |
|
72 | + * @return string item type. |
|
73 | 73 | */ |
74 | 74 | public function getItemType() |
75 | 75 | { |
@@ -132,8 +132,7 @@ |
||
132 | 132 | { |
133 | 133 | $this->raiseBubbleEvent($this, new TDataGridCommandEventParameter($this, $sender, $param)); |
134 | 134 | return true; |
135 | - } |
|
136 | - else |
|
135 | + } else |
|
137 | 136 | return false; |
138 | 137 | } |
139 | 138 | } |
140 | 139 | \ No newline at end of file |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @var integer index of the data item in the Items collection of datagrid |
39 | 39 | */ |
40 | - private $_itemIndex = ''; |
|
40 | + private $_itemIndex=''; |
|
41 | 41 | /** |
42 | 42 | * @var integer index of the item from the bound data source |
43 | 43 | */ |
44 | - private $_dataSourceIndex = 0; |
|
44 | + private $_dataSourceIndex=0; |
|
45 | 45 | /** |
46 | 46 | * type of the TDataGridItem |
47 | 47 | * @var string |
48 | 48 | */ |
49 | - private $_itemType = ''; |
|
49 | + private $_itemType=''; |
|
50 | 50 | /** |
51 | 51 | * value of the data item |
52 | 52 | * @var mixed |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function __construct($itemIndex, $dataSourceIndex, $itemType) |
62 | 62 | { |
63 | - $this->_itemIndex = $itemIndex; |
|
64 | - $this->_dataSourceIndex = $dataSourceIndex; |
|
63 | + $this->_itemIndex=$itemIndex; |
|
64 | + $this->_dataSourceIndex=$dataSourceIndex; |
|
65 | 65 | $this->setItemType($itemType); |
66 | - if($itemType === TListItemType::Header) |
|
66 | + if($itemType===TListItemType::Header) |
|
67 | 67 | $this->setTableSection(TTableRowSection::Header); |
68 | - elseif($itemType === TListItemType::Footer) |
|
68 | + elseif($itemType===TListItemType::Footer) |
|
69 | 69 | $this->setTableSection(TTableRowSection::Footer); |
70 | 70 | } |
71 | 71 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function setItemType($value) |
84 | 84 | { |
85 | - $this->_itemType = TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TListItemType'); |
|
85 | + $this->_itemType=TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TListItemType'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function setData($value) |
118 | 118 | { |
119 | - $this->_data = $value; |
|
119 | + $this->_data=$value; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -32,6 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * Constructor. |
34 | 34 | * @param TDataGrid datagrid object |
35 | + * @param TDataGrid $dataGrid |
|
35 | 36 | */ |
36 | 37 | public function __construct($dataGrid) |
37 | 38 | { |
@@ -51,8 +51,7 @@ |
||
51 | 51 | { |
52 | 52 | $this->raiseBubbleEvent($this, new TDataGridCommandEventParameter($this, $sender, $param)); |
53 | 53 | return true; |
54 | - } |
|
55 | - else |
|
54 | + } else |
|
56 | 55 | return false; |
57 | 56 | } |
58 | 57 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function __construct($dataGrid) |
37 | 37 | { |
38 | - $this->_dataGrid = $dataGrid; |
|
38 | + $this->_dataGrid=$dataGrid; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -34,6 +34,7 @@ |
||
34 | 34 | /** |
35 | 35 | * Constructor. |
36 | 36 | * @param TControl DataList item related with the corresponding event |
37 | + * @param \Prado\TComponent $item |
|
37 | 38 | */ |
38 | 39 | public function __construct($item) |
39 | 40 | { |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function __construct($item) |
40 | 40 | { |
41 | - $this->_item = $item; |
|
41 | + $this->_item=$item; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -230,6 +230,7 @@ discard block |
||
230 | 230 | * If a font field is not set in the font, it will be overwritten with |
231 | 231 | * the new one. |
232 | 232 | * @param TFont the new font |
233 | + * @param TFont $font |
|
233 | 234 | */ |
234 | 235 | public function mergeWith($font) |
235 | 236 | { |
@@ -256,6 +257,7 @@ discard block |
||
256 | 257 | * If a font field is set in the new font, the corresponding field |
257 | 258 | * in this font will be overwritten. |
258 | 259 | * @param TFont the new font |
260 | + * @param TFont $font |
|
259 | 261 | */ |
260 | 262 | public function copyFrom($font) |
261 | 263 | { |
@@ -27,35 +27,35 @@ discard block |
||
27 | 27 | /** |
28 | 28 | * Bits indicating the font states. |
29 | 29 | */ |
30 | - const IS_BOLD = 0x01; |
|
31 | - const IS_ITALIC = 0x02; |
|
32 | - const IS_OVERLINE = 0x04; |
|
33 | - const IS_STRIKEOUT = 0x08; |
|
34 | - const IS_UNDERLINE = 0x10; |
|
30 | + const IS_BOLD=0x01; |
|
31 | + const IS_ITALIC=0x02; |
|
32 | + const IS_OVERLINE=0x04; |
|
33 | + const IS_STRIKEOUT=0x08; |
|
34 | + const IS_UNDERLINE=0x10; |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * Bits indicating whether particular font states are changed. |
38 | 38 | */ |
39 | - const IS_SET_BOLD = 0x01000; |
|
40 | - const IS_SET_ITALIC = 0x02000; |
|
41 | - const IS_SET_OVERLINE = 0x04000; |
|
42 | - const IS_SET_STRIKEOUT = 0x08000; |
|
43 | - const IS_SET_UNDERLINE = 0x10000; |
|
44 | - const IS_SET_SIZE = 0x20000; |
|
45 | - const IS_SET_NAME = 0x40000; |
|
39 | + const IS_SET_BOLD=0x01000; |
|
40 | + const IS_SET_ITALIC=0x02000; |
|
41 | + const IS_SET_OVERLINE=0x04000; |
|
42 | + const IS_SET_STRIKEOUT=0x08000; |
|
43 | + const IS_SET_UNDERLINE=0x10000; |
|
44 | + const IS_SET_SIZE=0x20000; |
|
45 | + const IS_SET_NAME=0x40000; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @var integer bits representing various states |
49 | 49 | */ |
50 | - private $_flags = 0; |
|
50 | + private $_flags=0; |
|
51 | 51 | /** |
52 | 52 | * @var string font name |
53 | 53 | */ |
54 | - private $_name = ''; |
|
54 | + private $_name=''; |
|
55 | 55 | /** |
56 | 56 | * @var string font size |
57 | 57 | */ |
58 | - private $_size = ''; |
|
58 | + private $_size=''; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Returns an array with the names of all variables of this object that should NOT be serialized |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | protected function _getZappableSleepProps(&$exprops) |
67 | 67 | { |
68 | 68 | parent::_getZappableSleepProps($exprops); |
69 | - if ($this->_flags === 0) |
|
70 | - $exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_flags"; |
|
71 | - if ($this->_name === '') |
|
72 | - $exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_name"; |
|
73 | - if ($this->_size === '') |
|
74 | - $exprops[] = "\0Prado\Web\UI\WebControls\TFont\0_size"; |
|
69 | + if($this->_flags===0) |
|
70 | + $exprops[]="\0Prado\Web\UI\WebControls\TFont\0_flags"; |
|
71 | + if($this->_name==='') |
|
72 | + $exprops[]="\0Prado\Web\UI\WebControls\TFont\0_name"; |
|
73 | + if($this->_size==='') |
|
74 | + $exprops[]="\0Prado\Web\UI\WebControls\TFont\0_size"; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getBold() |
81 | 81 | { |
82 | - return ($this->_flags & self::IS_BOLD) !== 0; |
|
82 | + return ($this->_flags & self::IS_BOLD)!==0; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function setBold($value) |
89 | 89 | { |
90 | - $this->_flags |= self::IS_SET_BOLD; |
|
90 | + $this->_flags|=self::IS_SET_BOLD; |
|
91 | 91 | if(TPropertyValue::ensureBoolean($value)) |
92 | - $this->_flags |= self::IS_BOLD; |
|
92 | + $this->_flags|=self::IS_BOLD; |
|
93 | 93 | else |
94 | - $this->_flags &= ~self::IS_BOLD; |
|
94 | + $this->_flags&=~self::IS_BOLD; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function getItalic() |
101 | 101 | { |
102 | - return ($this->_flags & self::IS_ITALIC) !== 0; |
|
102 | + return ($this->_flags & self::IS_ITALIC)!==0; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function setItalic($value) |
109 | 109 | { |
110 | - $this->_flags |= self::IS_SET_ITALIC; |
|
110 | + $this->_flags|=self::IS_SET_ITALIC; |
|
111 | 111 | if(TPropertyValue::ensureBoolean($value)) |
112 | - $this->_flags |= self::IS_ITALIC; |
|
112 | + $this->_flags|=self::IS_ITALIC; |
|
113 | 113 | else |
114 | - $this->_flags &= ~self::IS_ITALIC; |
|
114 | + $this->_flags&=~self::IS_ITALIC; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getOverline() |
121 | 121 | { |
122 | - return ($this->_flags & self::IS_OVERLINE) !== 0; |
|
122 | + return ($this->_flags & self::IS_OVERLINE)!==0; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function setOverline($value) |
129 | 129 | { |
130 | - $this->_flags |= self::IS_SET_OVERLINE; |
|
130 | + $this->_flags|=self::IS_SET_OVERLINE; |
|
131 | 131 | if(TPropertyValue::ensureBoolean($value)) |
132 | - $this->_flags |= self::IS_OVERLINE; |
|
132 | + $this->_flags|=self::IS_OVERLINE; |
|
133 | 133 | else |
134 | - $this->_flags &= ~self::IS_OVERLINE; |
|
134 | + $this->_flags&=~self::IS_OVERLINE; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function setSize($value) |
149 | 149 | { |
150 | - $this->_flags |= self::IS_SET_SIZE; |
|
151 | - $this->_size = $value; |
|
150 | + $this->_flags|=self::IS_SET_SIZE; |
|
151 | + $this->_size=$value; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function getStrikeout() |
158 | 158 | { |
159 | - return ($this->_flags & self::IS_STRIKEOUT) !== 0; |
|
159 | + return ($this->_flags & self::IS_STRIKEOUT)!==0; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function setStrikeout($value) |
166 | 166 | { |
167 | - $this->_flags |= self::IS_SET_STRIKEOUT; |
|
167 | + $this->_flags|=self::IS_SET_STRIKEOUT; |
|
168 | 168 | if(TPropertyValue::ensureBoolean($value)) |
169 | - $this->_flags |= self::IS_STRIKEOUT; |
|
169 | + $this->_flags|=self::IS_STRIKEOUT; |
|
170 | 170 | else |
171 | - $this->_flags &= ~self::IS_STRIKEOUT; |
|
171 | + $this->_flags&=~self::IS_STRIKEOUT; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function getUnderline() |
178 | 178 | { |
179 | - return ($this->_flags & self::IS_UNDERLINE) !== 0; |
|
179 | + return ($this->_flags & self::IS_UNDERLINE)!==0; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function setUnderline($value) |
186 | 186 | { |
187 | - $this->_flags |= self::IS_SET_UNDERLINE; |
|
187 | + $this->_flags|=self::IS_SET_UNDERLINE; |
|
188 | 188 | if(TPropertyValue::ensureBoolean($value)) |
189 | - $this->_flags |= self::IS_UNDERLINE; |
|
189 | + $this->_flags|=self::IS_UNDERLINE; |
|
190 | 190 | else |
191 | - $this->_flags &= ~self::IS_UNDERLINE; |
|
191 | + $this->_flags&=~self::IS_UNDERLINE; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
@@ -204,8 +204,8 @@ discard block |
||
204 | 204 | */ |
205 | 205 | public function setName($value) |
206 | 206 | { |
207 | - $this->_flags |= self::IS_SET_NAME; |
|
208 | - $this->_name = $value; |
|
207 | + $this->_flags|=self::IS_SET_NAME; |
|
208 | + $this->_name=$value; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function reset() |
223 | 223 | { |
224 | - $this->_flags = 0; |
|
225 | - $this->_name = ''; |
|
226 | - $this->_size = ''; |
|
224 | + $this->_flags=0; |
|
225 | + $this->_name=''; |
|
226 | + $this->_size=''; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function mergeWith($font) |
236 | 236 | { |
237 | - if($font === null || $font->_flags === 0) |
|
237 | + if($font===null || $font->_flags===0) |
|
238 | 238 | return; |
239 | 239 | if(!($this->_flags & self::IS_SET_BOLD) && ($font->_flags & self::IS_SET_BOLD)) |
240 | 240 | $this->setBold($font->getBold()); |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | */ |
261 | 261 | public function copyFrom($font) |
262 | 262 | { |
263 | - if($font === null || $font->_flags === 0) |
|
263 | + if($font===null || $font->_flags===0) |
|
264 | 264 | return; |
265 | 265 | if($font->_flags & self::IS_SET_BOLD) |
266 | 266 | $this->setBold($font->getBold()); |
@@ -283,27 +283,27 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function toString() |
285 | 285 | { |
286 | - if($this->_flags === 0) |
|
286 | + if($this->_flags===0) |
|
287 | 287 | return ''; |
288 | - $str = ''; |
|
288 | + $str=''; |
|
289 | 289 | if($this->_flags & self::IS_SET_BOLD) |
290 | - $str .= 'font-weight:' . (($this->_flags & self::IS_BOLD)?'bold;':'normal;'); |
|
290 | + $str.='font-weight:'.(($this->_flags & self::IS_BOLD) ? 'bold;' : 'normal;'); |
|
291 | 291 | if($this->_flags & self::IS_SET_ITALIC) |
292 | - $str .= 'font-style:' . (($this->_flags & self::IS_ITALIC)?'italic;':'normal;'); |
|
293 | - $textDec = ''; |
|
292 | + $str.='font-style:'.(($this->_flags & self::IS_ITALIC) ? 'italic;' : 'normal;'); |
|
293 | + $textDec=''; |
|
294 | 294 | if($this->_flags & self::IS_UNDERLINE) |
295 | - $textDec .= 'underline'; |
|
295 | + $textDec.='underline'; |
|
296 | 296 | if($this->_flags & self::IS_OVERLINE) |
297 | - $textDec .= ' overline'; |
|
297 | + $textDec.=' overline'; |
|
298 | 298 | if($this->_flags & self::IS_STRIKEOUT) |
299 | - $textDec .= ' line-through'; |
|
300 | - $textDec = ltrim($textDec); |
|
301 | - if($textDec !== '') |
|
302 | - $str .= 'text-decoration:' . $textDec . ';'; |
|
303 | - if($this->_size !== '') |
|
304 | - $str .= 'font-size:' . $this->_size . ';'; |
|
305 | - if($this->_name !== '') |
|
306 | - $str .= 'font-family:' . $this->_name . ';'; |
|
299 | + $textDec.=' line-through'; |
|
300 | + $textDec=ltrim($textDec); |
|
301 | + if($textDec!=='') |
|
302 | + $str.='text-decoration:'.$textDec.';'; |
|
303 | + if($this->_size!=='') |
|
304 | + $str.='font-size:'.$this->_size.';'; |
|
305 | + if($this->_name!=='') |
|
306 | + $str.='font-family:'.$this->_name.';'; |
|
307 | 307 | return $str; |
308 | 308 | } |
309 | 309 | |
@@ -313,25 +313,25 @@ discard block |
||
313 | 313 | */ |
314 | 314 | public function addAttributesToRender($writer) |
315 | 315 | { |
316 | - if($this->_flags === 0) |
|
316 | + if($this->_flags===0) |
|
317 | 317 | return; |
318 | 318 | if($this->_flags & self::IS_SET_BOLD) |
319 | - $writer->addStyleAttribute('font-weight', (($this->_flags & self::IS_BOLD)?'bold':'normal')); |
|
319 | + $writer->addStyleAttribute('font-weight', (($this->_flags & self::IS_BOLD) ? 'bold' : 'normal')); |
|
320 | 320 | if($this->_flags & self::IS_SET_ITALIC) |
321 | - $writer->addStyleAttribute('font-style', (($this->_flags & self::IS_ITALIC)?'italic':'normal')); |
|
322 | - $textDec = ''; |
|
321 | + $writer->addStyleAttribute('font-style', (($this->_flags & self::IS_ITALIC) ? 'italic' : 'normal')); |
|
322 | + $textDec=''; |
|
323 | 323 | if($this->_flags & self::IS_UNDERLINE) |
324 | - $textDec .= 'underline'; |
|
324 | + $textDec.='underline'; |
|
325 | 325 | if($this->_flags & self::IS_OVERLINE) |
326 | - $textDec .= ' overline'; |
|
326 | + $textDec.=' overline'; |
|
327 | 327 | if($this->_flags & self::IS_STRIKEOUT) |
328 | - $textDec .= ' line-through'; |
|
329 | - $textDec = ltrim($textDec); |
|
330 | - if($textDec !== '') |
|
328 | + $textDec.=' line-through'; |
|
329 | + $textDec=ltrim($textDec); |
|
330 | + if($textDec!=='') |
|
331 | 331 | $writer->addStyleAttribute('text-decoration', $textDec); |
332 | - if($this->_size !== '') |
|
332 | + if($this->_size!=='') |
|
333 | 333 | $writer->addStyleAttribute('font-size', $this->_size); |
334 | - if($this->_name !== '') |
|
334 | + if($this->_name!=='') |
|
335 | 335 | $writer->addStyleAttribute('font-family', $this->_name); |
336 | 336 | } |
337 | 337 | } |
@@ -438,6 +438,9 @@ discard block |
||
438 | 438 | return $url; |
439 | 439 | } |
440 | 440 | |
441 | + /** |
|
442 | + * @param string $url |
|
443 | + */ |
|
441 | 444 | protected function copyCustomPlugins($url) |
442 | 445 | { |
443 | 446 | if($plugins = $this->getCustomPluginPath()) |
@@ -481,6 +484,7 @@ discard block |
||
481 | 484 | |
482 | 485 | /** |
483 | 486 | * Parse additional options set in the Options property. |
487 | + * @param string $string |
|
484 | 488 | * @return array additional custom options |
485 | 489 | */ |
486 | 490 | protected function parseEditorOptions($string) |
@@ -505,6 +509,7 @@ discard block |
||
505 | 509 | } |
506 | 510 | |
507 | 511 | /** |
512 | + * @param string $culture |
|
508 | 513 | * @return string localized editor interface language extension. |
509 | 514 | */ |
510 | 515 | protected function getLanguageSuffix($culture) |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * @var array list of locale => language file pairs. |
62 | 62 | */ |
63 | - private static $_langs = [ |
|
63 | + private static $_langs=[ |
|
64 | 64 | 'ar' => 'ar', |
65 | 65 | 'az' => 'az', |
66 | 66 | 'be' => 'be', |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | /** |
146 | 146 | * @var array list of default plugins to load, override using getAvailablePlugins(); |
147 | 147 | */ |
148 | - private static $_plugins = [ |
|
148 | + private static $_plugins=[ |
|
149 | 149 | 'advhr', |
150 | 150 | 'advimage', |
151 | 151 | 'advlink', |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | /** |
190 | 190 | * @var array default themes to load |
191 | 191 | */ |
192 | - private static $_themes = [ |
|
192 | + private static $_themes=[ |
|
193 | 193 | 'simple', |
194 | 194 | 'advanced' |
195 | 195 | ]; |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | |
341 | 341 | protected function loadJavascriptLibrary() |
342 | 342 | { |
343 | - $scripts = $this->getPage()->getClientScript(); |
|
343 | + $scripts=$this->getPage()->getClientScript(); |
|
344 | 344 | $scripts->registerPradoScript('htmlarea'); |
345 | 345 | $scripts->registerScriptFile('prado:THtmlArea', $this->getScriptUrl()); |
346 | 346 | } |
@@ -351,14 +351,14 @@ discard block |
||
351 | 351 | protected function registerEditorClientScript($writer) |
352 | 352 | { |
353 | 353 | $this->loadJavascriptLibrary(); |
354 | - $scripts = $this->getPage()->getClientScript(); |
|
355 | - $options = [ |
|
354 | + $scripts=$this->getPage()->getClientScript(); |
|
355 | + $options=[ |
|
356 | 356 | 'EditorOptions' => $this->getEditorOptions() |
357 | 357 | ]; |
358 | 358 | |
359 | - $options = TJavaScript::encode($options, true, true); |
|
360 | - $script = "new {$this->getClientClassName()}($options)"; |
|
361 | - $scripts->registerEndScript('prado:THtmlArea' . $this->ClientID, $script); |
|
359 | + $options=TJavaScript::encode($options, true, true); |
|
360 | + $script="new {$this->getClientClassName()}($options)"; |
|
361 | + $scripts->registerEndScript('prado:THtmlArea'.$this->ClientID, $script); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | */ |
367 | 367 | protected function getScriptUrl() |
368 | 368 | { |
369 | - return $this->getScriptDeploymentPath() . '/tiny_mce/tiny_mce.js'; |
|
369 | + return $this->getScriptDeploymentPath().'/tiny_mce/tiny_mce.js'; |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | /** |
@@ -375,23 +375,23 @@ discard block |
||
375 | 375 | */ |
376 | 376 | protected function getScriptDeploymentPath() |
377 | 377 | { |
378 | - $tarfile = Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.tar'); |
|
379 | - $md5sum = Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.md5'); |
|
380 | - if($tarfile === null || $md5sum === null) |
|
378 | + $tarfile=Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.tar'); |
|
379 | + $md5sum=Prado::getPathOfNamespace('Vendor.pradosoft.prado-tinymce3.tiny_mce', '.md5'); |
|
380 | + if($tarfile===null || $md5sum===null) |
|
381 | 381 | throw new TConfigurationException('htmlarea_tarfile_invalid'); |
382 | - $url = $this->getApplication()->getAssetManager()->publishTarFile($tarfile, $md5sum); |
|
382 | + $url=$this->getApplication()->getAssetManager()->publishTarFile($tarfile, $md5sum); |
|
383 | 383 | $this->copyCustomPlugins($url); |
384 | 384 | return $url; |
385 | 385 | } |
386 | 386 | |
387 | 387 | protected function copyCustomPlugins($url) |
388 | 388 | { |
389 | - if($plugins = $this->getCustomPluginPath()) |
|
389 | + if($plugins=$this->getCustomPluginPath()) |
|
390 | 390 | { |
391 | - $assets = $this->getApplication()->getAssetManager(); |
|
392 | - $path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
393 | - $dest = $assets->getBasePath() . '/' . basename($url) . '/tiny_mce/plugins/' . basename($path); |
|
394 | - if(!is_dir($dest) || $this->getApplication()->getMode() !== TApplicationMode::Performance) |
|
391 | + $assets=$this->getApplication()->getAssetManager(); |
|
392 | + $path=is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
393 | + $dest=$assets->getBasePath().'/'.basename($url).'/tiny_mce/plugins/'.basename($path); |
|
394 | + if(!is_dir($dest) || $this->getApplication()->getMode()!==TApplicationMode::Performance) |
|
395 | 395 | $assets->copyDirectory($path, $dest); |
396 | 396 | } |
397 | 397 | } |
@@ -402,26 +402,26 @@ discard block |
||
402 | 402 | */ |
403 | 403 | protected function getEditorOptions() |
404 | 404 | { |
405 | - $options['mode'] = 'exact'; |
|
406 | - $options['elements'] = $this->getClientID(); |
|
407 | - $options['language'] = $this->getLanguageSuffix($this->getCulture()); |
|
408 | - $options['theme'] = 'advanced'; |
|
405 | + $options['mode']='exact'; |
|
406 | + $options['elements']=$this->getClientID(); |
|
407 | + $options['language']=$this->getLanguageSuffix($this->getCulture()); |
|
408 | + $options['theme']='advanced'; |
|
409 | 409 | |
410 | 410 | //make it basic advanced to fit into 1 line of buttons. |
411 | 411 | //$options['theme_advanced_buttons1'] = 'bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright, justifyfull,separator,bullist,numlist,separator,undo,redo,separator,link,unlink,separator,charmap,separator,code,help'; |
412 | 412 | //$options['theme_advanced_buttons2'] = ' '; |
413 | - $options['theme_advanced_buttons1'] = 'formatselect,fontselect,fontsizeselect,separator,bold,italic,underline,strikethrough,sub,sup'; |
|
414 | - $options['theme_advanced_buttons2'] = 'justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,outdent,indent,separator,forecolor,backcolor,separator,hr,link,unlink,image,charmap,separator,removeformat,code,help'; |
|
415 | - $options['theme_advanced_buttons3'] = ''; |
|
416 | - |
|
417 | - $options['theme_advanced_toolbar_location'] = 'top'; |
|
418 | - $options['theme_advanced_toolbar_align'] = 'left'; |
|
419 | - $options['theme_advanced_path_location'] = 'bottom'; |
|
420 | - $options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
413 | + $options['theme_advanced_buttons1']='formatselect,fontselect,fontsizeselect,separator,bold,italic,underline,strikethrough,sub,sup'; |
|
414 | + $options['theme_advanced_buttons2']='justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,outdent,indent,separator,forecolor,backcolor,separator,hr,link,unlink,image,charmap,separator,removeformat,code,help'; |
|
415 | + $options['theme_advanced_buttons3']=''; |
|
416 | + |
|
417 | + $options['theme_advanced_toolbar_location']='top'; |
|
418 | + $options['theme_advanced_toolbar_align']='left'; |
|
419 | + $options['theme_advanced_path_location']='bottom'; |
|
420 | + $options['extended_valid_elements']='a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
421 | 421 | if($this->getReadOnly()) |
422 | - $options['readonly'] = true; |
|
422 | + $options['readonly']=true; |
|
423 | 423 | |
424 | - $options = array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
424 | + $options=array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
425 | 425 | return $options; |
426 | 426 | } |
427 | 427 | |
@@ -431,20 +431,20 @@ discard block |
||
431 | 431 | */ |
432 | 432 | protected function parseEditorOptions($string) |
433 | 433 | { |
434 | - $options = []; |
|
435 | - $substrings = preg_split('/,\s*\n|\n/', trim($string)); |
|
434 | + $options=[]; |
|
435 | + $substrings=preg_split('/,\s*\n|\n/', trim($string)); |
|
436 | 436 | foreach($substrings as $bits) |
437 | 437 | { |
438 | - $option = explode(":", $bits, 2); |
|
438 | + $option=explode(":", $bits, 2); |
|
439 | 439 | |
440 | - if(count($option) == 2) |
|
440 | + if(count($option)==2) |
|
441 | 441 | { |
442 | - $value = trim(trim($option[1]), "'\""); |
|
443 | - if (($s = strtolower($value)) === 'false') |
|
444 | - $value = false; |
|
445 | - elseif ($s === 'true') |
|
446 | - $value = true; |
|
447 | - $options[trim($option[0])] = $value; |
|
442 | + $value=trim(trim($option[1]), "'\""); |
|
443 | + if(($s=strtolower($value))==='false') |
|
444 | + $value=false; |
|
445 | + elseif($s==='true') |
|
446 | + $value=true; |
|
447 | + $options[trim($option[0])]=$value; |
|
448 | 448 | } |
449 | 449 | } |
450 | 450 | return $options; |
@@ -455,12 +455,12 @@ discard block |
||
455 | 455 | */ |
456 | 456 | protected function getLanguageSuffix($culture) |
457 | 457 | { |
458 | - $app = $this->getApplication()->getGlobalization(); |
|
459 | - if(empty($culture) && ($app !== null)) |
|
460 | - $culture = $app->getCulture(); |
|
461 | - $variants = []; |
|
462 | - if($app !== null) |
|
463 | - $variants = $app->getCultureVariants($culture); |
|
458 | + $app=$this->getApplication()->getGlobalization(); |
|
459 | + if(empty($culture) && ($app!==null)) |
|
460 | + $culture=$app->getCulture(); |
|
461 | + $variants=[]; |
|
462 | + if($app!==null) |
|
463 | + $variants=$app->getCultureVariants($culture); |
|
464 | 464 | |
465 | 465 | foreach($variants as $variant) |
466 | 466 | { |
@@ -210,6 +210,7 @@ |
||
210 | 210 | * If you override this method, be sure to call the parent implementation |
211 | 211 | * so that the event handler can be invoked. |
212 | 212 | * @param TImageMapEventParameter event parameter to be passed to the event handlers |
213 | + * @param TImageMapEventParameter $param |
|
213 | 214 | */ |
214 | 215 | public function onClick($param) |
215 | 216 | { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | class TImageMap extends TImage implements \Prado\Web\UI\IPostBackEventHandler |
38 | 38 | { |
39 | - const MAP_NAME_PREFIX = 'ImageMap'; |
|
39 | + const MAP_NAME_PREFIX='ImageMap'; |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Processes an object that is created during parsing template. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | parent::addAttributesToRender($writer); |
61 | 61 | if($this->getHotSpots()->getCount() > 0) |
62 | 62 | { |
63 | - $writer->addAttribute('usemap', '#' . self::MAP_NAME_PREFIX . $this->getClientID()); |
|
63 | + $writer->addAttribute('usemap', '#'.self::MAP_NAME_PREFIX.$this->getClientID()); |
|
64 | 64 | $writer->addAttribute('id', $this->getUniqueID()); |
65 | 65 | } |
66 | 66 | if($this->getEnabled() && !$this->getEnabled(true)) |
@@ -75,38 +75,38 @@ discard block |
||
75 | 75 | { |
76 | 76 | parent::render($writer); |
77 | 77 | |
78 | - $hotspots = $this->getHotSpots(); |
|
78 | + $hotspots=$this->getHotSpots(); |
|
79 | 79 | |
80 | 80 | if($hotspots->getCount() > 0) |
81 | 81 | { |
82 | - $clientID = $this->getClientID(); |
|
83 | - $cs = $this->getPage()->getClientScript(); |
|
82 | + $clientID=$this->getClientID(); |
|
83 | + $cs=$this->getPage()->getClientScript(); |
|
84 | 84 | $writer->writeLine(); |
85 | - $writer->addAttribute('name', self::MAP_NAME_PREFIX . $clientID); |
|
85 | + $writer->addAttribute('name', self::MAP_NAME_PREFIX.$clientID); |
|
86 | 86 | $writer->renderBeginTag('map'); |
87 | 87 | $writer->writeLine(); |
88 | - if(($mode = $this->getHotSpotMode()) === THotSpotMode::NotSet) |
|
89 | - $mode = THotSpotMode::Navigate; |
|
90 | - $target = $this->getTarget(); |
|
91 | - $i = 0; |
|
92 | - $options['EventTarget'] = $this->getUniqueID(); |
|
93 | - $options['StopEvent'] = true; |
|
94 | - $cs = $this->getPage()->getClientScript(); |
|
88 | + if(($mode=$this->getHotSpotMode())===THotSpotMode::NotSet) |
|
89 | + $mode=THotSpotMode::Navigate; |
|
90 | + $target=$this->getTarget(); |
|
91 | + $i=0; |
|
92 | + $options['EventTarget']=$this->getUniqueID(); |
|
93 | + $options['StopEvent']=true; |
|
94 | + $cs=$this->getPage()->getClientScript(); |
|
95 | 95 | foreach($hotspots as $hotspot) |
96 | 96 | { |
97 | - if($hotspot->getHotSpotMode() === THotSpotMode::NotSet) |
|
97 | + if($hotspot->getHotSpotMode()===THotSpotMode::NotSet) |
|
98 | 98 | $hotspot->setHotSpotMode($mode); |
99 | - if($target !== '' && $hotspot->getTarget() === '') |
|
99 | + if($target!=='' && $hotspot->getTarget()==='') |
|
100 | 100 | $hotspot->setTarget($target); |
101 | - if($hotspot->getHotSpotMode() === THotSpotMode::PostBack) |
|
101 | + if($hotspot->getHotSpotMode()===THotSpotMode::PostBack) |
|
102 | 102 | { |
103 | - $id = $clientID . '_' . $i; |
|
103 | + $id=$clientID.'_'.$i; |
|
104 | 104 | $writer->addAttribute('id', $id); |
105 | - $writer->addAttribute('href', '#' . $id); //create unique no-op url references |
|
106 | - $options['ID'] = $id; |
|
107 | - $options['EventParameter'] = "$i"; |
|
108 | - $options['CausesValidation'] = $hotspot->getCausesValidation(); |
|
109 | - $options['ValidationGroup'] = $hotspot->getValidationGroup(); |
|
105 | + $writer->addAttribute('href', '#'.$id); //create unique no-op url references |
|
106 | + $options['ID']=$id; |
|
107 | + $options['EventParameter']="$i"; |
|
108 | + $options['CausesValidation']=$hotspot->getCausesValidation(); |
|
109 | + $options['ValidationGroup']=$hotspot->getValidationGroup(); |
|
110 | 110 | $cs->registerPostBackControl($this->getClientClassName(), $options); |
111 | 111 | } |
112 | 112 | $hotspot->render($writer); |
@@ -135,25 +135,25 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function raisePostBackEvent($param) |
137 | 137 | { |
138 | - $postBackValue = null; |
|
139 | - if($param !== '') |
|
138 | + $postBackValue=null; |
|
139 | + if($param!=='') |
|
140 | 140 | { |
141 | - $index = TPropertyValue::ensureInteger($param); |
|
142 | - $hotspots = $this->getHotSpots(); |
|
141 | + $index=TPropertyValue::ensureInteger($param); |
|
142 | + $hotspots=$this->getHotSpots(); |
|
143 | 143 | if($index >= 0 && $index < $hotspots->getCount()) |
144 | 144 | { |
145 | - $hotspot = $hotspots->itemAt($index); |
|
146 | - if(($mode = $hotspot->getHotSpotMode()) === THotSpotMode::NotSet) |
|
147 | - $mode = $this->getHotSpotMode(); |
|
148 | - if($mode === THotSpotMode::PostBack) |
|
145 | + $hotspot=$hotspots->itemAt($index); |
|
146 | + if(($mode=$hotspot->getHotSpotMode())===THotSpotMode::NotSet) |
|
147 | + $mode=$this->getHotSpotMode(); |
|
148 | + if($mode===THotSpotMode::PostBack) |
|
149 | 149 | { |
150 | - $postBackValue = $hotspot->getPostBackValue(); |
|
150 | + $postBackValue=$hotspot->getPostBackValue(); |
|
151 | 151 | if($hotspot->getCausesValidation()) |
152 | 152 | $this->getPage()->validate($hotspot->getValidationGroup()); |
153 | 153 | } |
154 | 154 | } |
155 | 155 | } |
156 | - if($postBackValue !== null) |
|
156 | + if($postBackValue!==null) |
|
157 | 157 | $this->onClick(new TImageMapEventParameter($postBackValue)); |
158 | 158 | } |
159 | 159 | |
@@ -181,9 +181,9 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function getHotSpots() |
183 | 183 | { |
184 | - if(($hotspots = $this->getViewState('HotSpots', null)) === null) |
|
184 | + if(($hotspots=$this->getViewState('HotSpots', null))===null) |
|
185 | 185 | { |
186 | - $hotspots = new THotSpotCollection; |
|
186 | + $hotspots=new THotSpotCollection; |
|
187 | 187 | $this->setViewState('HotSpots', $hotspots); |
188 | 188 | } |
189 | 189 | return $hotspots; |
@@ -163,6 +163,7 @@ |
||
163 | 163 | |
164 | 164 | /** |
165 | 165 | * @param TListControl control to validate |
166 | + * @param \Prado\Web\UI\TControl $control |
|
166 | 167 | * @return array number of selected values and its values. |
167 | 168 | */ |
168 | 169 | protected function getSelection($control) |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function setMinSelection($value) |
86 | 86 | { |
87 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
88 | - $value = -1; |
|
87 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
88 | + $value=-1; |
|
89 | 89 | $this->setViewState('MinSelection', $value, -1); |
90 | 90 | } |
91 | 91 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function setMaxSelection($value) |
104 | 104 | { |
105 | - if(($value = TPropertyValue::ensureInteger($value)) < 0) |
|
106 | - $value = -1; |
|
105 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
106 | + $value=-1; |
|
107 | 107 | $this->setViewState('MaxSelection', $value, -1); |
108 | 108 | } |
109 | 109 | |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function evaluateIsValid() |
135 | 135 | { |
136 | - $control = $this->getValidationTarget(); |
|
136 | + $control=$this->getValidationTarget(); |
|
137 | 137 | |
138 | - $exists = true; |
|
139 | - $values = $this->getSelection($control); |
|
140 | - $count = count($values); |
|
141 | - $required = $this->getRequiredValues(); |
|
138 | + $exists=true; |
|
139 | + $values=$this->getSelection($control); |
|
140 | + $count=count($values); |
|
141 | + $required=$this->getRequiredValues(); |
|
142 | 142 | |
143 | 143 | //if required, check the values |
144 | 144 | if(!empty($required)) |
@@ -146,17 +146,17 @@ discard block |
||
146 | 146 | if($count < count($required)) |
147 | 147 | return false; |
148 | 148 | foreach($required as $require) |
149 | - $exists = $exists && in_array($require, $values); |
|
149 | + $exists=$exists && in_array($require, $values); |
|
150 | 150 | } |
151 | 151 | |
152 | - $min = $this->getMinSelection(); |
|
153 | - $max = $this->getMaxSelection(); |
|
152 | + $min=$this->getMinSelection(); |
|
153 | + $max=$this->getMaxSelection(); |
|
154 | 154 | |
155 | - if($min !== -1 && $max !== -1) |
|
155 | + if($min!==-1 && $max!==-1) |
|
156 | 156 | return $exists && $count >= $min && $count <= $max; |
157 | - elseif($min === -1 && $max !== -1) |
|
157 | + elseif($min===-1 && $max!==-1) |
|
158 | 158 | return $exists && $count <= $max; |
159 | - elseif($min !== -1 && $max === -1) |
|
159 | + elseif($min!==-1 && $max===-1) |
|
160 | 160 | return $exists && $count >= $min; |
161 | 161 | else |
162 | 162 | return $exists; |
@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | */ |
169 | 169 | protected function getSelection($control) |
170 | 170 | { |
171 | - $values = []; |
|
171 | + $values=[]; |
|
172 | 172 | |
173 | 173 | //get the data |
174 | 174 | foreach($control->getItems() as $item) |
175 | 175 | { |
176 | 176 | if($item->getSelected()) |
177 | - $values[] = $item->getValue(); |
|
177 | + $values[]=$item->getValue(); |
|
178 | 178 | } |
179 | 179 | return $values; |
180 | 180 | } |
@@ -184,10 +184,10 @@ discard block |
||
184 | 184 | */ |
185 | 185 | protected function getRequiredValues() |
186 | 186 | { |
187 | - $required = []; |
|
188 | - $string = $this->getRequiredSelections(); |
|
187 | + $required=[]; |
|
188 | + $string=$this->getRequiredSelections(); |
|
189 | 189 | if(!empty($string)) |
190 | - $required = preg_split('/,\s*/', $string); |
|
190 | + $required=preg_split('/,\s*/', $string); |
|
191 | 191 | return $required; |
192 | 192 | } |
193 | 193 | |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | */ |
198 | 198 | protected function getClientScriptOptions() |
199 | 199 | { |
200 | - $options = parent::getClientScriptOptions(); |
|
201 | - $control = $this->getValidationTarget(); |
|
200 | + $options=parent::getClientScriptOptions(); |
|
201 | + $control=$this->getValidationTarget(); |
|
202 | 202 | |
203 | 203 | if(!$control instanceof TListControl) |
204 | 204 | { |
@@ -207,16 +207,16 @@ discard block |
||
207 | 207 | $this->getID(), $this->getControlToValidate(), get_class($control)); |
208 | 208 | } |
209 | 209 | |
210 | - $min = $this->getMinSelection(); |
|
211 | - $max = $this->getMaxSelection(); |
|
212 | - if($min !== -1) |
|
213 | - $options['Min'] = $min; |
|
214 | - if($max !== -1) |
|
215 | - $options['Max'] = $max; |
|
216 | - $required = $this->getRequiredSelections(); |
|
210 | + $min=$this->getMinSelection(); |
|
211 | + $max=$this->getMaxSelection(); |
|
212 | + if($min!==-1) |
|
213 | + $options['Min']=$min; |
|
214 | + if($max!==-1) |
|
215 | + $options['Max']=$max; |
|
216 | + $required=$this->getRequiredSelections(); |
|
217 | 217 | if(strlen($required) > 0) |
218 | - $options['Required'] = $required; |
|
219 | - $options['TotalItems'] = $control->getItemCount(); |
|
218 | + $options['Required']=$required; |
|
219 | + $options['TotalItems']=$control->getItemCount(); |
|
220 | 220 | |
221 | 221 | return $options; |
222 | 222 | } |
@@ -97,6 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | /** |
99 | 99 | * @param boolean whether the item is enabled |
100 | + * @param boolean $value |
|
100 | 101 | */ |
101 | 102 | public function setEnabled($value) |
102 | 103 | { |
@@ -113,6 +114,7 @@ discard block |
||
113 | 114 | |
114 | 115 | /** |
115 | 116 | * @param boolean whether the item is selected |
117 | + * @param boolean $value |
|
116 | 118 | */ |
117 | 119 | public function setSelected($value) |
118 | 120 | { |
@@ -145,6 +147,7 @@ discard block |
||
145 | 147 | |
146 | 148 | /** |
147 | 149 | * @param string value of the item |
150 | + * @param string $value |
|
148 | 151 | */ |
149 | 152 | public function setValue($value) |
150 | 153 | { |
@@ -38,19 +38,19 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * @var string text of the item |
40 | 40 | */ |
41 | - private $_text = ''; |
|
41 | + private $_text=''; |
|
42 | 42 | /** |
43 | 43 | * @var string value of the item |
44 | 44 | */ |
45 | - private $_value = ''; |
|
45 | + private $_value=''; |
|
46 | 46 | /** |
47 | 47 | * @var boolean whether the item is enabled |
48 | 48 | */ |
49 | - private $_enabled = true; |
|
49 | + private $_enabled=true; |
|
50 | 50 | /** |
51 | 51 | * @var boolean whether the item is selected |
52 | 52 | */ |
53 | - private $_selected = false; |
|
53 | + private $_selected=false; |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Constructor. |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @param boolean whether the item is enabled |
60 | 60 | * @param boolean whether the item is selected |
61 | 61 | */ |
62 | - public function __construct($text = '', $value = '', $enabled = true, $selected = false) |
|
62 | + public function __construct($text='', $value='', $enabled=true, $selected=false) |
|
63 | 63 | { |
64 | 64 | $this->setText($text); |
65 | 65 | $this->setValue($value); |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | protected function _getZappableSleepProps(&$exprops) |
77 | 77 | { |
78 | 78 | parent::_getZappableSleepProps($exprops); |
79 | - if ($this->_attributes === null) |
|
80 | - $exprops[] = "\0Prado\Web\UI\WebControls\TListItem\0_attributes"; |
|
81 | - if($this->_text === '') |
|
82 | - $exprops[] = "\0Prado\Web\UI\WebControls\TListItem\0_text"; |
|
83 | - if($this->_value === '') |
|
84 | - $exprops[] = "\0Prado\Web\UI\WebControls\TListItem\0_value"; |
|
85 | - if ($this->_enabled === true) |
|
86 | - $exprops[] = "\0Prado\Web\UI\WebControls\TListItem\0_enabled"; |
|
87 | - if ($this->_selected === false) |
|
88 | - $exprops[] = "\0Prado\Web\UI\WebControls\TListItem\0_selected"; |
|
79 | + if($this->_attributes===null) |
|
80 | + $exprops[]="\0Prado\Web\UI\WebControls\TListItem\0_attributes"; |
|
81 | + if($this->_text==='') |
|
82 | + $exprops[]="\0Prado\Web\UI\WebControls\TListItem\0_text"; |
|
83 | + if($this->_value==='') |
|
84 | + $exprops[]="\0Prado\Web\UI\WebControls\TListItem\0_value"; |
|
85 | + if($this->_enabled===true) |
|
86 | + $exprops[]="\0Prado\Web\UI\WebControls\TListItem\0_enabled"; |
|
87 | + if($this->_selected===false) |
|
88 | + $exprops[]="\0Prado\Web\UI\WebControls\TListItem\0_selected"; |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function setEnabled($value) |
103 | 103 | { |
104 | - $this->_enabled = TPropertyValue::ensureBoolean($value); |
|
104 | + $this->_enabled=TPropertyValue::ensureBoolean($value); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function setSelected($value) |
119 | 119 | { |
120 | - $this->_selected = TPropertyValue::ensureBoolean($value); |
|
120 | + $this->_selected=TPropertyValue::ensureBoolean($value); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function getText() |
127 | 127 | { |
128 | - return $this->_text === ''?$this->_value:$this->_text; |
|
128 | + return $this->_text==='' ? $this->_value : $this->_text; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function setText($value) |
135 | 135 | { |
136 | - $this->_text = TPropertyValue::ensureString($value); |
|
136 | + $this->_text=TPropertyValue::ensureString($value); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function getValue() |
143 | 143 | { |
144 | - return $this->_value === ''?$this->_text:$this->_value; |
|
144 | + return $this->_value==='' ? $this->_text : $this->_value; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function setValue($value) |
151 | 151 | { |
152 | - $this->_value = TPropertyValue::ensureString($value); |
|
152 | + $this->_value=TPropertyValue::ensureString($value); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | public function getAttributes() |
159 | 159 | { |
160 | 160 | if(!$this->_attributes) |
161 | - $this->_attributes = new TAttributeCollection; |
|
161 | + $this->_attributes=new TAttributeCollection; |
|
162 | 162 | return $this->_attributes; |
163 | 163 | } |
164 | 164 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function hasAttribute($name) |
178 | 178 | { |
179 | - return $this->_attributes?$this->_attributes->contains($name):false; |
|
179 | + return $this->_attributes ? $this->_attributes->contains($name) : false; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getAttribute($name) |
186 | 186 | { |
187 | - return $this->_attributes?$this->_attributes->itemAt($name):null; |
|
187 | + return $this->_attributes ? $this->_attributes->itemAt($name) : null; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function removeAttribute($name) |
205 | 205 | { |
206 | - return $this->_attributes?$this->_attributes->remove($name):null; |
|
206 | + return $this->_attributes ? $this->_attributes->remove($name) : null; |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 |