@@ -404,6 +404,7 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | /** |
| 406 | 406 | * @param ITemplate the template for item |
| 407 | + * @param TWizardSideBarListItemTemplate $value |
|
| 407 | 408 | * @throws TInvalidDataTypeException if the input is not an {@link ITemplate} or not null. |
| 408 | 409 | */ |
| 409 | 410 | public function setItemTemplate($value) |
@@ -959,6 +960,7 @@ discard block |
||
| 959 | 960 | * If you override this method, be sure to call parent's implementation |
| 960 | 961 | * so that event handlers have chance to respond to the event. |
| 961 | 962 | * @param TDataListItemEventParameter event parameter |
| 963 | + * @param TDataListItemEventParameter $param |
|
| 962 | 964 | */ |
| 963 | 965 | public function onItemCreated($param) |
| 964 | 966 | { |
@@ -973,6 +975,7 @@ discard block |
||
| 973 | 975 | * If you override this method, be sure to call parent's implementation |
| 974 | 976 | * so that event handlers have chance to respond to the event. |
| 975 | 977 | * @param TDataListItemEventParameter event parameter |
| 978 | + * @param TDataListItemEventParameter $param |
|
| 976 | 979 | */ |
| 977 | 980 | public function onItemDataBound($param) |
| 978 | 981 | { |
@@ -984,6 +987,7 @@ discard block |
||
| 984 | 987 | * This method is invoked when a child control of the data list |
| 985 | 988 | * raises an <b>OnCommand</b> event. |
| 986 | 989 | * @param TDataListCommandEventParameter event parameter |
| 990 | + * @param TDataListCommandEventParameter $param |
|
| 987 | 991 | */ |
| 988 | 992 | public function onItemCommand($param) |
| 989 | 993 | { |
@@ -995,6 +999,7 @@ discard block |
||
| 995 | 999 | * This method is invoked when a child control of the data list |
| 996 | 1000 | * raises an <b>OnCommand</b> event and the command name is 'edit' (case-insensitive). |
| 997 | 1001 | * @param TDataListCommandEventParameter event parameter |
| 1002 | + * @param TDataListCommandEventParameter $param |
|
| 998 | 1003 | */ |
| 999 | 1004 | public function onEditCommand($param) |
| 1000 | 1005 | { |
@@ -1006,6 +1011,7 @@ discard block |
||
| 1006 | 1011 | * This method is invoked when a child control of the data list |
| 1007 | 1012 | * raises an <b>OnCommand</b> event and the command name is 'delete' (case-insensitive). |
| 1008 | 1013 | * @param TDataListCommandEventParameter event parameter |
| 1014 | + * @param TDataListCommandEventParameter $param |
|
| 1009 | 1015 | */ |
| 1010 | 1016 | public function onDeleteCommand($param) |
| 1011 | 1017 | { |
@@ -1017,6 +1023,7 @@ discard block |
||
| 1017 | 1023 | * This method is invoked when a child control of the data list |
| 1018 | 1024 | * raises an <b>OnCommand</b> event and the command name is 'update' (case-insensitive). |
| 1019 | 1025 | * @param TDataListCommandEventParameter event parameter |
| 1026 | + * @param TDataListCommandEventParameter $param |
|
| 1020 | 1027 | */ |
| 1021 | 1028 | public function onUpdateCommand($param) |
| 1022 | 1029 | { |
@@ -1028,6 +1035,7 @@ discard block |
||
| 1028 | 1035 | * This method is invoked when a child control of the data list |
| 1029 | 1036 | * raises an <b>OnCommand</b> event and the command name is 'cancel' (case-insensitive). |
| 1030 | 1037 | * @param TDataListCommandEventParameter event parameter |
| 1038 | + * @param TDataListCommandEventParameter $param |
|
| 1031 | 1039 | */ |
| 1032 | 1040 | public function onCancelCommand($param) |
| 1033 | 1041 | { |
@@ -1131,6 +1139,7 @@ discard block |
||
| 1131 | 1139 | * This method invokes {@link createItem} to create a new datalist item. |
| 1132 | 1140 | * @param integer zero-based item index. |
| 1133 | 1141 | * @param TListItemType item type |
| 1142 | + * @param integer $itemIndex |
|
| 1134 | 1143 | * @return TControl the created item, null if item is not created |
| 1135 | 1144 | */ |
| 1136 | 1145 | private function createItemInternal($itemIndex,$itemType) |
@@ -1152,6 +1161,7 @@ discard block |
||
| 1152 | 1161 | * @param integer zero-based item index. |
| 1153 | 1162 | * @param TListItemType item type |
| 1154 | 1163 | * @param mixed data to be associated with the item |
| 1164 | + * @param integer $itemIndex |
|
| 1155 | 1165 | * @return TControl the created item, null if item is not created |
| 1156 | 1166 | */ |
| 1157 | 1167 | private function createItemWithDataInternal($itemIndex,$itemType,$dataItem) |
@@ -1511,6 +1521,7 @@ discard block |
||
| 1511 | 1521 | /** |
| 1512 | 1522 | * Constructor. |
| 1513 | 1523 | * @param TControl DataList item related with the corresponding event |
| 1524 | + * @param TControl $item |
|
| 1514 | 1525 | */ |
| 1515 | 1526 | public function __construct($item) |
| 1516 | 1527 | { |
@@ -924,23 +924,19 @@ discard block |
||
| 924 | 924 | $this->setSelectedItemIndex($item->getItemIndex()); |
| 925 | 925 | $this->onSelectedIndexChanged($param); |
| 926 | 926 | return true; |
| 927 | - } |
|
| 928 | - else if(strcasecmp($command,self::CMD_EDIT)===0) |
|
| 927 | + } else if(strcasecmp($command,self::CMD_EDIT)===0) |
|
| 929 | 928 | { |
| 930 | 929 | $this->onEditCommand($param); |
| 931 | 930 | return true; |
| 932 | - } |
|
| 933 | - else if(strcasecmp($command,self::CMD_DELETE)===0) |
|
| 931 | + } else if(strcasecmp($command,self::CMD_DELETE)===0) |
|
| 934 | 932 | { |
| 935 | 933 | $this->onDeleteCommand($param); |
| 936 | 934 | return true; |
| 937 | - } |
|
| 938 | - else if(strcasecmp($command,self::CMD_UPDATE)===0) |
|
| 935 | + } else if(strcasecmp($command,self::CMD_UPDATE)===0) |
|
| 939 | 936 | { |
| 940 | 937 | $this->onUpdateCommand($param); |
| 941 | 938 | return true; |
| 942 | - } |
|
| 943 | - else if(strcasecmp($command,self::CMD_CANCEL)===0) |
|
| 939 | + } else if(strcasecmp($command,self::CMD_CANCEL)===0) |
|
| 944 | 940 | { |
| 945 | 941 | $this->onCancelCommand($param); |
| 946 | 942 | return true; |
@@ -1078,8 +1074,7 @@ discard block |
||
| 1078 | 1074 | $style=$item->getStyle(); |
| 1079 | 1075 | $item->clearStyle(); |
| 1080 | 1076 | return $style; |
| 1081 | - } |
|
| 1082 | - else |
|
| 1077 | + } else |
|
| 1083 | 1078 | return null; |
| 1084 | 1079 | } |
| 1085 | 1080 | |
@@ -1141,8 +1136,7 @@ discard block |
||
| 1141 | 1136 | $this->onItemCreated($param); |
| 1142 | 1137 | $this->getControls()->add($item); |
| 1143 | 1138 | return $item; |
| 1144 | - } |
|
| 1145 | - else |
|
| 1139 | + } else |
|
| 1146 | 1140 | return null; |
| 1147 | 1141 | } |
| 1148 | 1142 | |
@@ -1166,8 +1160,7 @@ discard block |
||
| 1166 | 1160 | $item->dataBind(); |
| 1167 | 1161 | $this->onItemDataBound($param); |
| 1168 | 1162 | return $item; |
| 1169 | - } |
|
| 1170 | - else |
|
| 1163 | + } else |
|
| 1171 | 1164 | return null; |
| 1172 | 1165 | } |
| 1173 | 1166 | |
@@ -1187,8 +1180,7 @@ discard block |
||
| 1187 | 1180 | return array($this->getItemRenderer(),$this->_itemTemplate); |
| 1188 | 1181 | else |
| 1189 | 1182 | return $this->getAlternatingItemDisplay(); |
| 1190 | - } |
|
| 1191 | - else |
|
| 1183 | + } else |
|
| 1192 | 1184 | return array($classPath,$this->_selectedItemTemplate); |
| 1193 | 1185 | } |
| 1194 | 1186 | |
@@ -1248,15 +1240,13 @@ discard block |
||
| 1248 | 1240 | $item->setItemIndex($itemIndex); |
| 1249 | 1241 | $item->setItemType($itemType); |
| 1250 | 1242 | } |
| 1251 | - } |
|
| 1252 | - else if($template!==null) |
|
| 1243 | + } else if($template!==null) |
|
| 1253 | 1244 | { |
| 1254 | 1245 | $item=new TDataListItem; |
| 1255 | 1246 | $item->setItemIndex($itemIndex); |
| 1256 | 1247 | $item->setItemType($itemType); |
| 1257 | 1248 | $template->instantiateIn($item); |
| 1258 | - } |
|
| 1259 | - else |
|
| 1249 | + } else |
|
| 1260 | 1250 | $item=null; |
| 1261 | 1251 | |
| 1262 | 1252 | return $item; |
@@ -1415,8 +1405,7 @@ discard block |
||
| 1415 | 1405 | $items->add($this->createItemInternal($i,$itemType)); |
| 1416 | 1406 | } |
| 1417 | 1407 | $this->_footer=$this->createItemInternal(-1,TListItemType::Footer); |
| 1418 | - } |
|
| 1419 | - else |
|
| 1408 | + } else |
|
| 1420 | 1409 | $this->createEmptyContent(); |
| 1421 | 1410 | $this->clearChildState(); |
| 1422 | 1411 | } |
@@ -1481,8 +1470,7 @@ discard block |
||
| 1481 | 1470 | $this->applyItemStyles(); |
| 1482 | 1471 | $repeatInfo=$this->getRepeatInfo(); |
| 1483 | 1472 | $repeatInfo->renderRepeater($writer,$this); |
| 1484 | - } |
|
| 1485 | - else if($this->_emptyTemplate!==null || $this->getEmptyRenderer()!=='') |
|
| 1473 | + } else if($this->_emptyTemplate!==null || $this->getEmptyRenderer()!=='') |
|
| 1486 | 1474 | parent::render($writer); |
| 1487 | 1475 | } |
| 1488 | 1476 | } |
@@ -1725,8 +1713,7 @@ discard block |
||
| 1725 | 1713 | { |
| 1726 | 1714 | $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param)); |
| 1727 | 1715 | return true; |
| 1728 | - } |
|
| 1729 | - else |
|
| 1716 | + } else |
|
| 1730 | 1717 | return false; |
| 1731 | 1718 | } |
| 1732 | 1719 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | public function getItemCount() |
| 200 | 200 | { |
| 201 | - return $this->_items?$this->_items->getCount():0; |
|
| 201 | + return $this->_items ? $this->_items->getCount() : 0; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public function getItemRenderer() |
| 209 | 209 | { |
| 210 | - return $this->getViewState('ItemRenderer',''); |
|
| 210 | + return $this->getViewState('ItemRenderer', ''); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | public function setItemRenderer($value) |
| 224 | 224 | { |
| 225 | - $this->setViewState('ItemRenderer',$value,''); |
|
| 225 | + $this->setViewState('ItemRenderer', $value, ''); |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | /** |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function getAlternatingItemRenderer() |
| 233 | 233 | { |
| 234 | - return $this->getViewState('AlternatingItemRenderer',''); |
|
| 234 | + return $this->getViewState('AlternatingItemRenderer', ''); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public function setAlternatingItemRenderer($value) |
| 248 | 248 | { |
| 249 | - $this->setViewState('AlternatingItemRenderer',$value,''); |
|
| 249 | + $this->setViewState('AlternatingItemRenderer', $value, ''); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public function getEditItemRenderer() |
| 257 | 257 | { |
| 258 | - return $this->getViewState('EditItemRenderer',''); |
|
| 258 | + return $this->getViewState('EditItemRenderer', ''); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | */ |
| 271 | 271 | public function setEditItemRenderer($value) |
| 272 | 272 | { |
| 273 | - $this->setViewState('EditItemRenderer',$value,''); |
|
| 273 | + $this->setViewState('EditItemRenderer', $value, ''); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /** |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function getSelectedItemRenderer() |
| 281 | 281 | { |
| 282 | - return $this->getViewState('SelectedItemRenderer',''); |
|
| 282 | + return $this->getViewState('SelectedItemRenderer', ''); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /** |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | public function setSelectedItemRenderer($value) |
| 296 | 296 | { |
| 297 | - $this->setViewState('SelectedItemRenderer',$value,''); |
|
| 297 | + $this->setViewState('SelectedItemRenderer', $value, ''); |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | /** |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | public function getSeparatorRenderer() |
| 305 | 305 | { |
| 306 | - return $this->getViewState('SeparatorRenderer',''); |
|
| 306 | + return $this->getViewState('SeparatorRenderer', ''); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | /** |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | */ |
| 319 | 319 | public function setSeparatorRenderer($value) |
| 320 | 320 | { |
| 321 | - $this->setViewState('SeparatorRenderer',$value,''); |
|
| 321 | + $this->setViewState('SeparatorRenderer', $value, ''); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | */ |
| 328 | 328 | public function getHeaderRenderer() |
| 329 | 329 | { |
| 330 | - return $this->getViewState('HeaderRenderer',''); |
|
| 330 | + return $this->getViewState('HeaderRenderer', ''); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /** |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function setHeaderRenderer($value) |
| 344 | 344 | { |
| 345 | - $this->setViewState('HeaderRenderer',$value,''); |
|
| 345 | + $this->setViewState('HeaderRenderer', $value, ''); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | /** |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | */ |
| 352 | 352 | public function getFooterRenderer() |
| 353 | 353 | { |
| 354 | - return $this->getViewState('FooterRenderer',''); |
|
| 354 | + return $this->getViewState('FooterRenderer', ''); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | public function setFooterRenderer($value) |
| 368 | 368 | { |
| 369 | - $this->setViewState('FooterRenderer',$value,''); |
|
| 369 | + $this->setViewState('FooterRenderer', $value, ''); |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | */ |
| 376 | 376 | public function getEmptyRenderer() |
| 377 | 377 | { |
| 378 | - return $this->getViewState('EmptyRenderer',''); |
|
| 378 | + return $this->getViewState('EmptyRenderer', ''); |
|
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /** |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | */ |
| 392 | 392 | public function setEmptyRenderer($value) |
| 393 | 393 | { |
| 394 | - $this->setViewState('EmptyRenderer',$value,''); |
|
| 394 | + $this->setViewState('EmptyRenderer', $value, ''); |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | /** |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | if($value instanceof ITemplate || $value===null) |
| 412 | 412 | $this->_itemTemplate=$value; |
| 413 | 413 | else |
| 414 | - throw new TInvalidDataTypeException('datalist_template_required','ItemTemplate'); |
|
| 414 | + throw new TInvalidDataTypeException('datalist_template_required', 'ItemTemplate'); |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | /** |
@@ -419,10 +419,10 @@ discard block |
||
| 419 | 419 | */ |
| 420 | 420 | public function getItemStyle() |
| 421 | 421 | { |
| 422 | - if(($style=$this->getViewState('ItemStyle',null))===null) |
|
| 422 | + if(($style=$this->getViewState('ItemStyle', null))===null) |
|
| 423 | 423 | { |
| 424 | 424 | $style=new TTableItemStyle; |
| 425 | - $this->setViewState('ItemStyle',$style,null); |
|
| 425 | + $this->setViewState('ItemStyle', $style, null); |
|
| 426 | 426 | } |
| 427 | 427 | return $style; |
| 428 | 428 | } |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | if($value instanceof ITemplate || $value===null) |
| 445 | 445 | $this->_alternatingItemTemplate=$value; |
| 446 | 446 | else |
| 447 | - throw new TInvalidDataTypeException('datalist_template_required','AlternatingItemType'); |
|
| 447 | + throw new TInvalidDataTypeException('datalist_template_required', 'AlternatingItemType'); |
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | /** |
@@ -452,10 +452,10 @@ discard block |
||
| 452 | 452 | */ |
| 453 | 453 | public function getAlternatingItemStyle() |
| 454 | 454 | { |
| 455 | - if(($style=$this->getViewState('AlternatingItemStyle',null))===null) |
|
| 455 | + if(($style=$this->getViewState('AlternatingItemStyle', null))===null) |
|
| 456 | 456 | { |
| 457 | 457 | $style=new TTableItemStyle; |
| 458 | - $this->setViewState('AlternatingItemStyle',$style,null); |
|
| 458 | + $this->setViewState('AlternatingItemStyle', $style, null); |
|
| 459 | 459 | } |
| 460 | 460 | return $style; |
| 461 | 461 | } |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | if($value instanceof ITemplate || $value===null) |
| 478 | 478 | $this->_selectedItemTemplate=$value; |
| 479 | 479 | else |
| 480 | - throw new TInvalidDataTypeException('datalist_template_required','SelectedItemTemplate'); |
|
| 480 | + throw new TInvalidDataTypeException('datalist_template_required', 'SelectedItemTemplate'); |
|
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | /** |
@@ -485,10 +485,10 @@ discard block |
||
| 485 | 485 | */ |
| 486 | 486 | public function getSelectedItemStyle() |
| 487 | 487 | { |
| 488 | - if(($style=$this->getViewState('SelectedItemStyle',null))===null) |
|
| 488 | + if(($style=$this->getViewState('SelectedItemStyle', null))===null) |
|
| 489 | 489 | { |
| 490 | 490 | $style=new TTableItemStyle; |
| 491 | - $this->setViewState('SelectedItemStyle',$style,null); |
|
| 491 | + $this->setViewState('SelectedItemStyle', $style, null); |
|
| 492 | 492 | } |
| 493 | 493 | return $style; |
| 494 | 494 | } |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | if($value instanceof ITemplate || $value===null) |
| 511 | 511 | $this->_editItemTemplate=$value; |
| 512 | 512 | else |
| 513 | - throw new TInvalidDataTypeException('datalist_template_required','EditItemTemplate'); |
|
| 513 | + throw new TInvalidDataTypeException('datalist_template_required', 'EditItemTemplate'); |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | /** |
@@ -518,10 +518,10 @@ discard block |
||
| 518 | 518 | */ |
| 519 | 519 | public function getEditItemStyle() |
| 520 | 520 | { |
| 521 | - if(($style=$this->getViewState('EditItemStyle',null))===null) |
|
| 521 | + if(($style=$this->getViewState('EditItemStyle', null))===null) |
|
| 522 | 522 | { |
| 523 | 523 | $style=new TTableItemStyle; |
| 524 | - $this->setViewState('EditItemStyle',$style,null); |
|
| 524 | + $this->setViewState('EditItemStyle', $style, null); |
|
| 525 | 525 | } |
| 526 | 526 | return $style; |
| 527 | 527 | } |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | if($value instanceof ITemplate || $value===null) |
| 544 | 544 | $this->_headerTemplate=$value; |
| 545 | 545 | else |
| 546 | - throw new TInvalidDataTypeException('datalist_template_required','HeaderTemplate'); |
|
| 546 | + throw new TInvalidDataTypeException('datalist_template_required', 'HeaderTemplate'); |
|
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | /** |
@@ -551,10 +551,10 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | public function getHeaderStyle() |
| 553 | 553 | { |
| 554 | - if(($style=$this->getViewState('HeaderStyle',null))===null) |
|
| 554 | + if(($style=$this->getViewState('HeaderStyle', null))===null) |
|
| 555 | 555 | { |
| 556 | 556 | $style=new TTableItemStyle; |
| 557 | - $this->setViewState('HeaderStyle',$style,null); |
|
| 557 | + $this->setViewState('HeaderStyle', $style, null); |
|
| 558 | 558 | } |
| 559 | 559 | return $style; |
| 560 | 560 | } |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | if($value instanceof ITemplate || $value===null) |
| 585 | 585 | $this->_footerTemplate=$value; |
| 586 | 586 | else |
| 587 | - throw new TInvalidDataTypeException('datalist_template_required','FooterTemplate'); |
|
| 587 | + throw new TInvalidDataTypeException('datalist_template_required', 'FooterTemplate'); |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /** |
@@ -592,10 +592,10 @@ discard block |
||
| 592 | 592 | */ |
| 593 | 593 | public function getFooterStyle() |
| 594 | 594 | { |
| 595 | - if(($style=$this->getViewState('FooterStyle',null))===null) |
|
| 595 | + if(($style=$this->getViewState('FooterStyle', null))===null) |
|
| 596 | 596 | { |
| 597 | 597 | $style=new TTableItemStyle; |
| 598 | - $this->setViewState('FooterStyle',$style,null); |
|
| 598 | + $this->setViewState('FooterStyle', $style, null); |
|
| 599 | 599 | } |
| 600 | 600 | return $style; |
| 601 | 601 | } |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | if($value instanceof ITemplate || $value===null) |
| 626 | 626 | $this->_emptyTemplate=$value; |
| 627 | 627 | else |
| 628 | - throw new TInvalidDataTypeException('datalist_template_required','EmptyTemplate'); |
|
| 628 | + throw new TInvalidDataTypeException('datalist_template_required', 'EmptyTemplate'); |
|
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | /** |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | if($value instanceof ITemplate || $value===null) |
| 646 | 646 | $this->_separatorTemplate=$value; |
| 647 | 647 | else |
| 648 | - throw new TInvalidDataTypeException('datalist_template_required','SeparatorTemplate'); |
|
| 648 | + throw new TInvalidDataTypeException('datalist_template_required', 'SeparatorTemplate'); |
|
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | /** |
@@ -653,10 +653,10 @@ discard block |
||
| 653 | 653 | */ |
| 654 | 654 | public function getSeparatorStyle() |
| 655 | 655 | { |
| 656 | - if(($style=$this->getViewState('SeparatorStyle',null))===null) |
|
| 656 | + if(($style=$this->getViewState('SeparatorStyle', null))===null) |
|
| 657 | 657 | { |
| 658 | 658 | $style=new TTableItemStyle; |
| 659 | - $this->setViewState('SeparatorStyle',$style,null); |
|
| 659 | + $this->setViewState('SeparatorStyle', $style, null); |
|
| 660 | 660 | } |
| 661 | 661 | return $style; |
| 662 | 662 | } |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | */ |
| 668 | 668 | public function getSelectedItemIndex() |
| 669 | 669 | { |
| 670 | - return $this->getViewState('SelectedItemIndex',-1); |
|
| 670 | + return $this->getViewState('SelectedItemIndex', -1); |
|
| 671 | 671 | } |
| 672 | 672 | |
| 673 | 673 | /** |
@@ -679,20 +679,20 @@ discard block |
||
| 679 | 679 | */ |
| 680 | 680 | public function setSelectedItemIndex($value) |
| 681 | 681 | { |
| 682 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
| 682 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
| 683 | 683 | $value=-1; |
| 684 | 684 | if(($current=$this->getSelectedItemIndex())!==$value) |
| 685 | 685 | { |
| 686 | - $this->setViewState('SelectedItemIndex',$value,-1); |
|
| 686 | + $this->setViewState('SelectedItemIndex', $value, -1); |
|
| 687 | 687 | $items=$this->getItems(); |
| 688 | 688 | $itemCount=$items->getCount(); |
| 689 | - if($current>=0 && $current<$itemCount) |
|
| 689 | + if($current >= 0 && $current < $itemCount) |
|
| 690 | 690 | { |
| 691 | 691 | $item=$items->itemAt($current); |
| 692 | 692 | if(($item instanceof IItemDataRenderer) && $item->getItemType()!==TListItemType::EditItem) |
| 693 | - $item->setItemType($current%2?TListItemType::AlternatingItem : TListItemType::Item); |
|
| 693 | + $item->setItemType($current % 2 ? TListItemType::AlternatingItem : TListItemType::Item); |
|
| 694 | 694 | } |
| 695 | - if($value>=0 && $value<$itemCount) |
|
| 695 | + if($value >= 0 && $value < $itemCount) |
|
| 696 | 696 | { |
| 697 | 697 | $item=$items->itemAt($value); |
| 698 | 698 | if(($item instanceof IItemDataRenderer) && $item->getItemType()!==TListItemType::EditItem) |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | { |
| 709 | 709 | $index=$this->getSelectedItemIndex(); |
| 710 | 710 | $items=$this->getItems(); |
| 711 | - if($index>=0 && $index<$items->getCount()) |
|
| 711 | + if($index >= 0 && $index < $items->getCount()) |
|
| 712 | 712 | return $items->itemAt($index); |
| 713 | 713 | else |
| 714 | 714 | return null; |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | throw new TInvalidOperationException('datalist_datakeyfield_required'); |
| 725 | 725 | $index=$this->getSelectedItemIndex(); |
| 726 | 726 | $dataKeys=$this->getDataKeys(); |
| 727 | - if($index>=0 && $index<$dataKeys->getCount()) |
|
| 727 | + if($index >= 0 && $index < $dataKeys->getCount()) |
|
| 728 | 728 | return $dataKeys->itemAt($index); |
| 729 | 729 | else |
| 730 | 730 | return null; |
@@ -736,7 +736,7 @@ discard block |
||
| 736 | 736 | */ |
| 737 | 737 | public function getEditItemIndex() |
| 738 | 738 | { |
| 739 | - return $this->getViewState('EditItemIndex',-1); |
|
| 739 | + return $this->getViewState('EditItemIndex', -1); |
|
| 740 | 740 | } |
| 741 | 741 | |
| 742 | 742 | /** |
@@ -747,16 +747,16 @@ discard block |
||
| 747 | 747 | */ |
| 748 | 748 | public function setEditItemIndex($value) |
| 749 | 749 | { |
| 750 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
| 750 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
| 751 | 751 | $value=-1; |
| 752 | 752 | if(($current=$this->getEditItemIndex())!==$value) |
| 753 | 753 | { |
| 754 | - $this->setViewState('EditItemIndex',$value,-1); |
|
| 754 | + $this->setViewState('EditItemIndex', $value, -1); |
|
| 755 | 755 | $items=$this->getItems(); |
| 756 | 756 | $itemCount=$items->getCount(); |
| 757 | - if($current>=0 && $current<$itemCount) |
|
| 758 | - $items->itemAt($current)->setItemType($current%2?TListItemType::AlternatingItem : TListItemType::Item); |
|
| 759 | - if($value>=0 && $value<$itemCount) |
|
| 757 | + if($current >= 0 && $current < $itemCount) |
|
| 758 | + $items->itemAt($current)->setItemType($current % 2 ? TListItemType::AlternatingItem : TListItemType::Item); |
|
| 759 | + if($value >= 0 && $value < $itemCount) |
|
| 760 | 760 | $items->itemAt($value)->setItemType(TListItemType::EditItem); |
| 761 | 761 | } |
| 762 | 762 | } |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | { |
| 769 | 769 | $index=$this->getEditItemIndex(); |
| 770 | 770 | $items=$this->getItems(); |
| 771 | - if($index>=0 && $index<$items->getCount()) |
|
| 771 | + if($index >= 0 && $index < $items->getCount()) |
|
| 772 | 772 | return $items->itemAt($index); |
| 773 | 773 | else |
| 774 | 774 | return null; |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | */ |
| 780 | 780 | public function getShowHeader() |
| 781 | 781 | { |
| 782 | - return $this->getViewState('ShowHeader',true); |
|
| 782 | + return $this->getViewState('ShowHeader', true); |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | /** |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | */ |
| 788 | 788 | public function setShowHeader($value) |
| 789 | 789 | { |
| 790 | - $this->setViewState('ShowHeader',TPropertyValue::ensureBoolean($value),true); |
|
| 790 | + $this->setViewState('ShowHeader', TPropertyValue::ensureBoolean($value), true); |
|
| 791 | 791 | } |
| 792 | 792 | |
| 793 | 793 | /** |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | */ |
| 796 | 796 | public function getShowFooter() |
| 797 | 797 | { |
| 798 | - return $this->getViewState('ShowFooter',true); |
|
| 798 | + return $this->getViewState('ShowFooter', true); |
|
| 799 | 799 | } |
| 800 | 800 | |
| 801 | 801 | /** |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | */ |
| 804 | 804 | public function setShowFooter($value) |
| 805 | 805 | { |
| 806 | - $this->setViewState('ShowFooter',TPropertyValue::ensureBoolean($value),true); |
|
| 806 | + $this->setViewState('ShowFooter', TPropertyValue::ensureBoolean($value), true); |
|
| 807 | 807 | } |
| 808 | 808 | |
| 809 | 809 | /** |
@@ -811,10 +811,10 @@ discard block |
||
| 811 | 811 | */ |
| 812 | 812 | protected function getRepeatInfo() |
| 813 | 813 | { |
| 814 | - if(($repeatInfo=$this->getViewState('RepeatInfo',null))===null) |
|
| 814 | + if(($repeatInfo=$this->getViewState('RepeatInfo', null))===null) |
|
| 815 | 815 | { |
| 816 | 816 | $repeatInfo=new TRepeatInfo; |
| 817 | - $this->setViewState('RepeatInfo',$repeatInfo,null); |
|
| 817 | + $this->setViewState('RepeatInfo', $repeatInfo, null); |
|
| 818 | 818 | } |
| 819 | 819 | return $repeatInfo; |
| 820 | 820 | } |
@@ -912,35 +912,35 @@ discard block |
||
| 912 | 912 | * @param TEventParameter event parameter |
| 913 | 913 | * @return boolean whether the event bubbling should stop here. |
| 914 | 914 | */ |
| 915 | - public function bubbleEvent($sender,$param) |
|
| 915 | + public function bubbleEvent($sender, $param) |
|
| 916 | 916 | { |
| 917 | 917 | if($param instanceof TDataListCommandEventParameter) |
| 918 | 918 | { |
| 919 | 919 | $this->onItemCommand($param); |
| 920 | 920 | $command=$param->getCommandName(); |
| 921 | - if(strcasecmp($command,self::CMD_SELECT)===0) |
|
| 921 | + if(strcasecmp($command, self::CMD_SELECT)===0) |
|
| 922 | 922 | { |
| 923 | 923 | if(($item=$param->getItem()) instanceof IItemDataRenderer) |
| 924 | 924 | $this->setSelectedItemIndex($item->getItemIndex()); |
| 925 | 925 | $this->onSelectedIndexChanged($param); |
| 926 | 926 | return true; |
| 927 | 927 | } |
| 928 | - else if(strcasecmp($command,self::CMD_EDIT)===0) |
|
| 928 | + else if(strcasecmp($command, self::CMD_EDIT)===0) |
|
| 929 | 929 | { |
| 930 | 930 | $this->onEditCommand($param); |
| 931 | 931 | return true; |
| 932 | 932 | } |
| 933 | - else if(strcasecmp($command,self::CMD_DELETE)===0) |
|
| 933 | + else if(strcasecmp($command, self::CMD_DELETE)===0) |
|
| 934 | 934 | { |
| 935 | 935 | $this->onDeleteCommand($param); |
| 936 | 936 | return true; |
| 937 | 937 | } |
| 938 | - else if(strcasecmp($command,self::CMD_UPDATE)===0) |
|
| 938 | + else if(strcasecmp($command, self::CMD_UPDATE)===0) |
|
| 939 | 939 | { |
| 940 | 940 | $this->onUpdateCommand($param); |
| 941 | 941 | return true; |
| 942 | 942 | } |
| 943 | - else if(strcasecmp($command,self::CMD_CANCEL)===0) |
|
| 943 | + else if(strcasecmp($command, self::CMD_CANCEL)===0) |
|
| 944 | 944 | { |
| 945 | 945 | $this->onCancelCommand($param); |
| 946 | 946 | return true; |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | */ |
| 963 | 963 | public function onItemCreated($param) |
| 964 | 964 | { |
| 965 | - $this->raiseEvent('OnItemCreated',$this,$param); |
|
| 965 | + $this->raiseEvent('OnItemCreated', $this, $param); |
|
| 966 | 966 | } |
| 967 | 967 | |
| 968 | 968 | /** |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | */ |
| 977 | 977 | public function onItemDataBound($param) |
| 978 | 978 | { |
| 979 | - $this->raiseEvent('OnItemDataBound',$this,$param); |
|
| 979 | + $this->raiseEvent('OnItemDataBound', $this, $param); |
|
| 980 | 980 | } |
| 981 | 981 | |
| 982 | 982 | /** |
@@ -987,7 +987,7 @@ discard block |
||
| 987 | 987 | */ |
| 988 | 988 | public function onItemCommand($param) |
| 989 | 989 | { |
| 990 | - $this->raiseEvent('OnItemCommand',$this,$param); |
|
| 990 | + $this->raiseEvent('OnItemCommand', $this, $param); |
|
| 991 | 991 | } |
| 992 | 992 | |
| 993 | 993 | /** |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | */ |
| 999 | 999 | public function onEditCommand($param) |
| 1000 | 1000 | { |
| 1001 | - $this->raiseEvent('OnEditCommand',$this,$param); |
|
| 1001 | + $this->raiseEvent('OnEditCommand', $this, $param); |
|
| 1002 | 1002 | } |
| 1003 | 1003 | |
| 1004 | 1004 | /** |
@@ -1009,7 +1009,7 @@ discard block |
||
| 1009 | 1009 | */ |
| 1010 | 1010 | public function onDeleteCommand($param) |
| 1011 | 1011 | { |
| 1012 | - $this->raiseEvent('OnDeleteCommand',$this,$param); |
|
| 1012 | + $this->raiseEvent('OnDeleteCommand', $this, $param); |
|
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | 1015 | /** |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | */ |
| 1021 | 1021 | public function onUpdateCommand($param) |
| 1022 | 1022 | { |
| 1023 | - $this->raiseEvent('OnUpdateCommand',$this,$param); |
|
| 1023 | + $this->raiseEvent('OnUpdateCommand', $this, $param); |
|
| 1024 | 1024 | } |
| 1025 | 1025 | |
| 1026 | 1026 | /** |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | */ |
| 1032 | 1032 | public function onCancelCommand($param) |
| 1033 | 1033 | { |
| 1034 | - $this->raiseEvent('OnCancelCommand',$this,$param); |
|
| 1034 | + $this->raiseEvent('OnCancelCommand', $this, $param); |
|
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | /** |
@@ -1071,9 +1071,9 @@ discard block |
||
| 1071 | 1071 | * @param integer index of the item being rendered |
| 1072 | 1072 | * @return TStyle item style |
| 1073 | 1073 | */ |
| 1074 | - public function generateItemStyle($itemType,$index) |
|
| 1074 | + public function generateItemStyle($itemType, $index) |
|
| 1075 | 1075 | { |
| 1076 | - if(($item=$this->getItem($itemType,$index))!==null && ($item instanceof IStyleable) && $item->getHasStyle()) |
|
| 1076 | + if(($item=$this->getItem($itemType, $index))!==null && ($item instanceof IStyleable) && $item->getHasStyle()) |
|
| 1077 | 1077 | { |
| 1078 | 1078 | $style=$item->getStyle(); |
| 1079 | 1079 | $item->clearStyle(); |
@@ -1091,9 +1091,9 @@ discard block |
||
| 1091 | 1091 | * @param string item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager) |
| 1092 | 1092 | * @param integer zero-based index of the item in the item list |
| 1093 | 1093 | */ |
| 1094 | - public function renderItem($writer,$repeatInfo,$itemType,$index) |
|
| 1094 | + public function renderItem($writer, $repeatInfo, $itemType, $index) |
|
| 1095 | 1095 | { |
| 1096 | - $item=$this->getItem($itemType,$index); |
|
| 1096 | + $item=$this->getItem($itemType, $index); |
|
| 1097 | 1097 | if($repeatInfo->getRepeatLayout()===TRepeatLayout::Raw && get_class($item)==='TDataListItem') |
| 1098 | 1098 | $item->setTagName('div'); |
| 1099 | 1099 | $item->renderControl($writer); |
@@ -1104,7 +1104,7 @@ discard block |
||
| 1104 | 1104 | * @param integer item index |
| 1105 | 1105 | * @return TControl data list item with the specified item type and index |
| 1106 | 1106 | */ |
| 1107 | - private function getItem($itemType,$index) |
|
| 1107 | + private function getItem($itemType, $index) |
|
| 1108 | 1108 | { |
| 1109 | 1109 | switch($itemType) |
| 1110 | 1110 | { |
@@ -1116,9 +1116,9 @@ discard block |
||
| 1116 | 1116 | case TListItemType::Header: |
| 1117 | 1117 | return $this->getControls()->itemAt(0); |
| 1118 | 1118 | case TListItemType::Footer: |
| 1119 | - return $this->getControls()->itemAt($this->getControls()->getCount()-1); |
|
| 1119 | + return $this->getControls()->itemAt($this->getControls()->getCount() - 1); |
|
| 1120 | 1120 | case TListItemType::Separator: |
| 1121 | - $i=$index+$index+1; |
|
| 1121 | + $i=$index + $index + 1; |
|
| 1122 | 1122 | if($this->_headerTemplate!==null || $this->getHeaderRenderer()!=='') |
| 1123 | 1123 | $i++; |
| 1124 | 1124 | return $this->getControls()->itemAt($i); |
@@ -1133,9 +1133,9 @@ discard block |
||
| 1133 | 1133 | * @param TListItemType item type |
| 1134 | 1134 | * @return TControl the created item, null if item is not created |
| 1135 | 1135 | */ |
| 1136 | - private function createItemInternal($itemIndex,$itemType) |
|
| 1136 | + private function createItemInternal($itemIndex, $itemType) |
|
| 1137 | 1137 | { |
| 1138 | - if(($item=$this->createItem($itemIndex,$itemType))!==null) |
|
| 1138 | + if(($item=$this->createItem($itemIndex, $itemType))!==null) |
|
| 1139 | 1139 | { |
| 1140 | 1140 | $param=new TDataListItemEventParameter($item); |
| 1141 | 1141 | $this->onItemCreated($param); |
@@ -1154,9 +1154,9 @@ discard block |
||
| 1154 | 1154 | * @param mixed data to be associated with the item |
| 1155 | 1155 | * @return TControl the created item, null if item is not created |
| 1156 | 1156 | */ |
| 1157 | - private function createItemWithDataInternal($itemIndex,$itemType,$dataItem) |
|
| 1157 | + private function createItemWithDataInternal($itemIndex, $itemType, $dataItem) |
|
| 1158 | 1158 | { |
| 1159 | - if(($item=$this->createItem($itemIndex,$itemType))!==null) |
|
| 1159 | + if(($item=$this->createItem($itemIndex, $itemType))!==null) |
|
| 1160 | 1160 | { |
| 1161 | 1161 | $param=new TDataListItemEventParameter($item); |
| 1162 | 1162 | if($item instanceof IDataRenderer) |
@@ -1174,22 +1174,22 @@ discard block |
||
| 1174 | 1174 | private function getAlternatingItemDisplay() |
| 1175 | 1175 | { |
| 1176 | 1176 | if(($classPath=$this->getAlternatingItemRenderer())==='' && $this->_alternatingItemTemplate===null) |
| 1177 | - return array($this->getItemRenderer(),$this->_itemTemplate); |
|
| 1177 | + return array($this->getItemRenderer(), $this->_itemTemplate); |
|
| 1178 | 1178 | else |
| 1179 | - return array($classPath,$this->_alternatingItemTemplate); |
|
| 1179 | + return array($classPath, $this->_alternatingItemTemplate); |
|
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | private function getSelectedItemDisplay($itemIndex) |
| 1183 | 1183 | { |
| 1184 | 1184 | if(($classPath=$this->getSelectedItemRenderer())==='' && $this->_selectedItemTemplate===null) |
| 1185 | 1185 | { |
| 1186 | - if($itemIndex%2===0) |
|
| 1187 | - return array($this->getItemRenderer(),$this->_itemTemplate); |
|
| 1186 | + if($itemIndex % 2===0) |
|
| 1187 | + return array($this->getItemRenderer(), $this->_itemTemplate); |
|
| 1188 | 1188 | else |
| 1189 | 1189 | return $this->getAlternatingItemDisplay(); |
| 1190 | 1190 | } |
| 1191 | 1191 | else |
| 1192 | - return array($classPath,$this->_selectedItemTemplate); |
|
| 1192 | + return array($classPath, $this->_selectedItemTemplate); |
|
| 1193 | 1193 | } |
| 1194 | 1194 | |
| 1195 | 1195 | private function getEditItemDisplay($itemIndex) |
@@ -1197,7 +1197,7 @@ discard block |
||
| 1197 | 1197 | if(($classPath=$this->getEditItemRenderer())==='' && $this->_editItemTemplate===null) |
| 1198 | 1198 | return $this->getSelectedItemDisplay($itemIndex); |
| 1199 | 1199 | else |
| 1200 | - return array($classPath,$this->_editItemTemplate); |
|
| 1200 | + return array($classPath, $this->_editItemTemplate); |
|
| 1201 | 1201 | } |
| 1202 | 1202 | |
| 1203 | 1203 | /** |
@@ -1206,7 +1206,7 @@ discard block |
||
| 1206 | 1206 | * @param TListItemType item type |
| 1207 | 1207 | * @return TControl created datalist item |
| 1208 | 1208 | */ |
| 1209 | - protected function createItem($itemIndex,$itemType) |
|
| 1209 | + protected function createItem($itemIndex, $itemType) |
|
| 1210 | 1210 | { |
| 1211 | 1211 | $template=null; |
| 1212 | 1212 | $classPath=null; |
@@ -1217,13 +1217,13 @@ discard block |
||
| 1217 | 1217 | $template=$this->_itemTemplate; |
| 1218 | 1218 | break; |
| 1219 | 1219 | case TListItemType::AlternatingItem : |
| 1220 | - list($classPath,$template)=$this->getAlternatingItemDisplay(); |
|
| 1220 | + list($classPath, $template)=$this->getAlternatingItemDisplay(); |
|
| 1221 | 1221 | break; |
| 1222 | 1222 | case TListItemType::SelectedItem: |
| 1223 | - list($classPath,$template)=$this->getSelectedItemDisplay($itemIndex); |
|
| 1223 | + list($classPath, $template)=$this->getSelectedItemDisplay($itemIndex); |
|
| 1224 | 1224 | break; |
| 1225 | 1225 | case TListItemType::EditItem: |
| 1226 | - list($classPath,$template)=$this->getEditItemDisplay($itemIndex); |
|
| 1226 | + list($classPath, $template)=$this->getEditItemDisplay($itemIndex); |
|
| 1227 | 1227 | break; |
| 1228 | 1228 | case TListItemType::Header : |
| 1229 | 1229 | $classPath=$this->getHeaderRenderer(); |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | $template=$this->_separatorTemplate; |
| 1239 | 1239 | break; |
| 1240 | 1240 | default: |
| 1241 | - throw new TInvalidDataValueException('datalist_itemtype_unknown',$itemType); |
|
| 1241 | + throw new TInvalidDataValueException('datalist_itemtype_unknown', $itemType); |
|
| 1242 | 1242 | } |
| 1243 | 1243 | if($classPath!=='') |
| 1244 | 1244 | { |
@@ -1286,9 +1286,9 @@ discard block |
||
| 1286 | 1286 | */ |
| 1287 | 1287 | protected function applyItemStyles() |
| 1288 | 1288 | { |
| 1289 | - $itemStyle=$this->getViewState('ItemStyle',null); |
|
| 1289 | + $itemStyle=$this->getViewState('ItemStyle', null); |
|
| 1290 | 1290 | |
| 1291 | - $alternatingItemStyle=$this->getViewState('AlternatingItemStyle',null); |
|
| 1291 | + $alternatingItemStyle=$this->getViewState('AlternatingItemStyle', null); |
|
| 1292 | 1292 | if($itemStyle!==null) |
| 1293 | 1293 | { |
| 1294 | 1294 | if($alternatingItemStyle===null) |
@@ -1297,9 +1297,9 @@ discard block |
||
| 1297 | 1297 | $alternatingItemStyle->mergeWith($itemStyle); |
| 1298 | 1298 | } |
| 1299 | 1299 | |
| 1300 | - $selectedItemStyle=$this->getViewState('SelectedItemStyle',null); |
|
| 1300 | + $selectedItemStyle=$this->getViewState('SelectedItemStyle', null); |
|
| 1301 | 1301 | |
| 1302 | - $editItemStyle=$this->getViewState('EditItemStyle',null); |
|
| 1302 | + $editItemStyle=$this->getViewState('EditItemStyle', null); |
|
| 1303 | 1303 | if($selectedItemStyle!==null) |
| 1304 | 1304 | { |
| 1305 | 1305 | if($editItemStyle===null) |
@@ -1311,14 +1311,14 @@ discard block |
||
| 1311 | 1311 | // apply header style if any |
| 1312 | 1312 | if($this->_header!==null && $this->_header instanceof IStyleable) |
| 1313 | 1313 | { |
| 1314 | - if($headerStyle=$this->getViewState('HeaderStyle',null)) |
|
| 1314 | + if($headerStyle=$this->getViewState('HeaderStyle', null)) |
|
| 1315 | 1315 | $this->_header->getStyle()->mergeWith($headerStyle); |
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | 1318 | // apply footer style if any |
| 1319 | 1319 | if($this->_footer!==null && $this->_footer instanceof IStyleable) |
| 1320 | 1320 | { |
| 1321 | - if($footerStyle=$this->getViewState('FooterStyle',null)) |
|
| 1321 | + if($footerStyle=$this->getViewState('FooterStyle', null)) |
|
| 1322 | 1322 | $this->_footer->getStyle()->mergeWith($footerStyle); |
| 1323 | 1323 | } |
| 1324 | 1324 | |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | $style=$editItemStyle; |
| 1333 | 1333 | else if($index===$selectedIndex) |
| 1334 | 1334 | $style=$selectedItemStyle; |
| 1335 | - else if($index%2===0) |
|
| 1335 | + else if($index % 2===0) |
|
| 1336 | 1336 | $style=$itemStyle; |
| 1337 | 1337 | else |
| 1338 | 1338 | $style=$alternatingItemStyle; |
@@ -1341,11 +1341,11 @@ discard block |
||
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | // apply separator style if any |
| 1344 | - if(($separatorStyle=$this->getViewState('SeparatorStyle',null))!==null && $this->getHasSeparators()) |
|
| 1344 | + if(($separatorStyle=$this->getViewState('SeparatorStyle', null))!==null && $this->getHasSeparators()) |
|
| 1345 | 1345 | { |
| 1346 | 1346 | $controls=$this->getControls(); |
| 1347 | 1347 | $count=$controls->getCount(); |
| 1348 | - for($i=$this->_header?2:1;$i<$count;$i+=2) |
|
| 1348 | + for($i=$this->_header ? 2 : 1; $i < $count; $i+=2) |
|
| 1349 | 1349 | { |
| 1350 | 1350 | if(($separator=$controls->itemAt($i)) instanceof IStyleable) |
| 1351 | 1351 | $separator->getStyle()->mergeWith($separatorStyle); |
@@ -1361,7 +1361,7 @@ discard block |
||
| 1361 | 1361 | { |
| 1362 | 1362 | parent::saveState(); |
| 1363 | 1363 | if($this->_items) |
| 1364 | - $this->setViewState('ItemCount',$this->_items->getCount(),0); |
|
| 1364 | + $this->setViewState('ItemCount', $this->_items->getCount(), 0); |
|
| 1365 | 1365 | else |
| 1366 | 1366 | $this->clearViewState('ItemCount'); |
| 1367 | 1367 | } |
@@ -1395,26 +1395,26 @@ discard block |
||
| 1395 | 1395 | protected function restoreItemsFromViewState() |
| 1396 | 1396 | { |
| 1397 | 1397 | $this->reset(); |
| 1398 | - if(($itemCount=$this->getViewState('ItemCount',0))>0) |
|
| 1398 | + if(($itemCount=$this->getViewState('ItemCount', 0)) > 0) |
|
| 1399 | 1399 | { |
| 1400 | 1400 | $items=$this->getItems(); |
| 1401 | 1401 | $selectedIndex=$this->getSelectedItemIndex(); |
| 1402 | 1402 | $editIndex=$this->getEditItemIndex(); |
| 1403 | 1403 | $hasSeparator=$this->_separatorTemplate!==null || $this->getSeparatorRenderer()!==''; |
| 1404 | - $this->_header=$this->createItemInternal(-1,TListItemType::Header); |
|
| 1405 | - for($i=0;$i<$itemCount;++$i) |
|
| 1404 | + $this->_header=$this->createItemInternal(-1, TListItemType::Header); |
|
| 1405 | + for($i=0; $i < $itemCount; ++$i) |
|
| 1406 | 1406 | { |
| 1407 | - if($hasSeparator && $i>0) |
|
| 1408 | - $this->createItemInternal($i-1,TListItemType::Separator); |
|
| 1407 | + if($hasSeparator && $i > 0) |
|
| 1408 | + $this->createItemInternal($i - 1, TListItemType::Separator); |
|
| 1409 | 1409 | if($i===$editIndex) |
| 1410 | 1410 | $itemType=TListItemType::EditItem; |
| 1411 | 1411 | else if($i===$selectedIndex) |
| 1412 | 1412 | $itemType=TListItemType::SelectedItem; |
| 1413 | 1413 | else |
| 1414 | - $itemType=$i%2?TListItemType::AlternatingItem : TListItemType::Item; |
|
| 1415 | - $items->add($this->createItemInternal($i,$itemType)); |
|
| 1414 | + $itemType=$i % 2 ? TListItemType::AlternatingItem : TListItemType::Item; |
|
| 1415 | + $items->add($this->createItemInternal($i, $itemType)); |
|
| 1416 | 1416 | } |
| 1417 | - $this->_footer=$this->createItemInternal(-1,TListItemType::Footer); |
|
| 1417 | + $this->_footer=$this->createItemInternal(-1, TListItemType::Footer); |
|
| 1418 | 1418 | } |
| 1419 | 1419 | else |
| 1420 | 1420 | $this->createEmptyContent(); |
@@ -1441,30 +1441,30 @@ discard block |
||
| 1441 | 1441 | foreach($data as $key=>$dataItem) |
| 1442 | 1442 | { |
| 1443 | 1443 | if($keyField!=='') |
| 1444 | - $keys->add($this->getDataFieldValue($dataItem,$keyField)); |
|
| 1444 | + $keys->add($this->getDataFieldValue($dataItem, $keyField)); |
|
| 1445 | 1445 | else |
| 1446 | 1446 | $keys->add($key); |
| 1447 | 1447 | if($itemIndex===0) |
| 1448 | - $this->_header=$this->createItemWithDataInternal(-1,TListItemType::Header,null); |
|
| 1449 | - if($hasSeparator && $itemIndex>0) |
|
| 1450 | - $this->createItemWithDataInternal($itemIndex-1,TListItemType::Separator,null); |
|
| 1448 | + $this->_header=$this->createItemWithDataInternal(-1, TListItemType::Header, null); |
|
| 1449 | + if($hasSeparator && $itemIndex > 0) |
|
| 1450 | + $this->createItemWithDataInternal($itemIndex - 1, TListItemType::Separator, null); |
|
| 1451 | 1451 | if($itemIndex===$editIndex) |
| 1452 | 1452 | $itemType=TListItemType::EditItem; |
| 1453 | 1453 | else if($itemIndex===$selectedIndex) |
| 1454 | 1454 | $itemType=TListItemType::SelectedItem; |
| 1455 | 1455 | else |
| 1456 | - $itemType=$itemIndex%2?TListItemType::AlternatingItem : TListItemType::Item; |
|
| 1457 | - $items->add($this->createItemWithDataInternal($itemIndex,$itemType,$dataItem)); |
|
| 1456 | + $itemType=$itemIndex % 2 ? TListItemType::AlternatingItem : TListItemType::Item; |
|
| 1457 | + $items->add($this->createItemWithDataInternal($itemIndex, $itemType, $dataItem)); |
|
| 1458 | 1458 | $itemIndex++; |
| 1459 | 1459 | } |
| 1460 | - if($itemIndex>0) |
|
| 1461 | - $this->_footer=$this->createItemWithDataInternal(-1,TListItemType::Footer,null); |
|
| 1460 | + if($itemIndex > 0) |
|
| 1461 | + $this->_footer=$this->createItemWithDataInternal(-1, TListItemType::Footer, null); |
|
| 1462 | 1462 | else |
| 1463 | 1463 | { |
| 1464 | 1464 | $this->createEmptyContent(); |
| 1465 | 1465 | $this->dataBindChildren(); |
| 1466 | 1466 | } |
| 1467 | - $this->setViewState('ItemCount',$itemIndex,0); |
|
| 1467 | + $this->setViewState('ItemCount', $itemIndex, 0); |
|
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | 1470 | /** |
@@ -1476,11 +1476,11 @@ discard block |
||
| 1476 | 1476 | { |
| 1477 | 1477 | if($this->getHasControls()) |
| 1478 | 1478 | { |
| 1479 | - if($this->getItemCount()>0) |
|
| 1479 | + if($this->getItemCount() > 0) |
|
| 1480 | 1480 | { |
| 1481 | 1481 | $this->applyItemStyles(); |
| 1482 | 1482 | $repeatInfo=$this->getRepeatInfo(); |
| 1483 | - $repeatInfo->renderRepeater($writer,$this); |
|
| 1483 | + $repeatInfo->renderRepeater($writer, $this); |
|
| 1484 | 1484 | } |
| 1485 | 1485 | else if($this->_emptyTemplate!==null || $this->getEmptyRenderer()!=='') |
| 1486 | 1486 | parent::render($writer); |
@@ -1557,11 +1557,11 @@ discard block |
||
| 1557 | 1557 | * @param TControl original event sender |
| 1558 | 1558 | * @param TCommandEventParameter original event parameter |
| 1559 | 1559 | */ |
| 1560 | - public function __construct($item,$source,TCommandEventParameter $param) |
|
| 1560 | + public function __construct($item, $source, TCommandEventParameter $param) |
|
| 1561 | 1561 | { |
| 1562 | 1562 | $this->_item=$item; |
| 1563 | 1563 | $this->_source=$source; |
| 1564 | - parent::__construct($param->getCommandName(),$param->getCommandParameter()); |
|
| 1564 | + parent::__construct($param->getCommandName(), $param->getCommandParameter()); |
|
| 1565 | 1565 | } |
| 1566 | 1566 | |
| 1567 | 1567 | /** |
@@ -1653,7 +1653,7 @@ discard block |
||
| 1653 | 1653 | */ |
| 1654 | 1654 | public function setItemType($value) |
| 1655 | 1655 | { |
| 1656 | - $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType'); |
|
| 1656 | + $this->_itemType=TPropertyValue::ensureEnum($value, 'TListItemType'); |
|
| 1657 | 1657 | } |
| 1658 | 1658 | |
| 1659 | 1659 | /** |
@@ -1719,11 +1719,11 @@ discard block |
||
| 1719 | 1719 | * @param TEventParameter event parameter |
| 1720 | 1720 | * @return boolean whether the event bubbling should stop here. |
| 1721 | 1721 | */ |
| 1722 | - public function bubbleEvent($sender,$param) |
|
| 1722 | + public function bubbleEvent($sender, $param) |
|
| 1723 | 1723 | { |
| 1724 | 1724 | if($param instanceof TCommandEventParameter) |
| 1725 | 1725 | { |
| 1726 | - $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param)); |
|
| 1726 | + $this->raiseBubbleEvent($this, new TDataListCommandEventParameter($this, $sender, $param)); |
|
| 1727 | 1727 | return true; |
| 1728 | 1728 | } |
| 1729 | 1729 | else |
@@ -1749,10 +1749,10 @@ discard block |
||
| 1749 | 1749 | * @param mixed new item |
| 1750 | 1750 | * @throws TInvalidDataTypeException if the item to be inserted is not a TControl descendant. |
| 1751 | 1751 | */ |
| 1752 | - public function insertAt($index,$item) |
|
| 1752 | + public function insertAt($index, $item) |
|
| 1753 | 1753 | { |
| 1754 | 1754 | if($item instanceof TControl) |
| 1755 | - parent::insertAt($index,$item); |
|
| 1755 | + parent::insertAt($index, $item); |
|
| 1756 | 1756 | else |
| 1757 | 1757 | throw new TInvalidDataTypeException('datalistitemcollection_datalistitem_required'); |
| 1758 | 1758 | } |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TDataList class file |
|
| 4 | - * |
|
| 5 | - * @author Qiang Xue <[email protected]> |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2005-2016 The PRADO Group |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System.Web.UI.WebControls |
|
| 10 | - */ |
|
| 3 | + * TDataList class file |
|
| 4 | + * |
|
| 5 | + * @author Qiang Xue <[email protected]> |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2005-2016 The PRADO Group |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System.Web.UI.WebControls |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Includes TBaseDataList class |
@@ -20,6 +20,10 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | public function getView($viewName); |
| 22 | 22 | public function getViewNames(); |
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @return void |
|
| 26 | + */ |
|
| 23 | 27 | public function onDataSourceChanged($param); |
| 24 | 28 | } |
| 25 | 29 | |
@@ -95,6 +99,9 @@ discard block |
||
| 95 | 99 | private $_dataSource; |
| 96 | 100 | private $_dataMember; |
| 97 | 101 | |
| 102 | + /** |
|
| 103 | + * @param Traversable $dataSource |
|
| 104 | + */ |
|
| 98 | 105 | public function __construct($dataSource,$dataMember) |
| 99 | 106 | { |
| 100 | 107 | if(!is_array($dataSource) && !($dataSource instanceof IDataSource) && !($dataSource instanceof Traversable)) |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | public function onDataSourceChanged($param) |
| 46 | 46 | { |
| 47 | - $this->raiseEvent('OnDataSourceChanged',$this,$param); |
|
| 47 | + $this->raiseEvent('OnDataSourceChanged', $this, $param); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function focus() |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | private $_dataSource; |
| 96 | 96 | private $_dataMember; |
| 97 | 97 | |
| 98 | - public function __construct($dataSource,$dataMember) |
|
| 98 | + public function __construct($dataSource, $dataMember) |
|
| 99 | 99 | { |
| 100 | 100 | if(!is_array($dataSource) && !($dataSource instanceof IDataSource) && !($dataSource instanceof Traversable)) |
| 101 | 101 | throw new TInvalidDataTypeException('readonlydatasource_datasource_invalid'); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if($this->_dataSource instanceof IDataSource) |
| 109 | 109 | return $this->_dataSource->getView($viewName); |
| 110 | 110 | else |
| 111 | - return new TReadOnlyDataSourceView($this,$this->_dataMember,$this->_dataSource); |
|
| 111 | + return new TReadOnlyDataSourceView($this, $this->_dataMember, $this->_dataSource); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * IDataSource, TDataSourceControl, TReadOnlyDataSource class file |
|
| 4 | - * |
|
| 5 | - * @author Qiang Xue <[email protected]> |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2005-2016 The PRADO Group |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System.Web.UI.WebControls |
|
| 10 | - */ |
|
| 3 | + * IDataSource, TDataSourceControl, TReadOnlyDataSource class file |
|
| 4 | + * |
|
| 5 | + * @author Qiang Xue <[email protected]> |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2005-2016 The PRADO Group |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System.Web.UI.WebControls |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * IDataSource class |
@@ -106,6 +106,7 @@ discard block |
||
| 106 | 106 | /** |
| 107 | 107 | * Sets the format of the date string. |
| 108 | 108 | * @param string the format of the date string |
| 109 | + * @param string $value |
|
| 109 | 110 | */ |
| 110 | 111 | public function setDateFormat($value) |
| 111 | 112 | { |
@@ -245,6 +246,7 @@ discard block |
||
| 245 | 246 | |
| 246 | 247 | /** |
| 247 | 248 | * @param integer date picker starting year, default is 2000. |
| 249 | + * @param integer $value |
|
| 248 | 250 | */ |
| 249 | 251 | public function setFromYear($value) |
| 250 | 252 | { |
@@ -354,6 +356,7 @@ discard block |
||
| 354 | 356 | |
| 355 | 357 | /** |
| 356 | 358 | * @param string date string |
| 359 | + * @param string $value |
|
| 357 | 360 | */ |
| 358 | 361 | public function setDate($value) |
| 359 | 362 | { |
@@ -731,6 +734,7 @@ discard block |
||
| 731 | 734 | * "MMMM" will return the month names, "MM" or "MMM" return abbr. month names |
| 732 | 735 | * and "M" return month digits. |
| 733 | 736 | * @param DateTimeFormatInfo localized date format information. |
| 737 | + * @param DateTimeFormatInfo $info |
|
| 734 | 738 | * @return array localized month names. |
| 735 | 739 | */ |
| 736 | 740 | protected function getLocalizedMonthNames($info) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Script path relative to the TClientScriptManager::SCRIPT_PATH |
| 82 | 82 | */ |
| 83 | - const SCRIPT_PATH = 'prado/datepicker'; |
|
| 83 | + const SCRIPT_PATH='prado/datepicker'; |
|
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | 86 | * @var TDatePickerClientScript validator client-script options. |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function getDateFormat() |
| 102 | 102 | { |
| 103 | - return $this->getViewState('DateFormat','dd-MM-yyyy'); |
|
| 103 | + return $this->getViewState('DateFormat', 'dd-MM-yyyy'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function setDateFormat($value) |
| 111 | 111 | { |
| 112 | - $this->setViewState('DateFormat',$value,'dd-MM-yyyy'); |
|
| 112 | + $this->setViewState('DateFormat', $value, 'dd-MM-yyyy'); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function getShowCalendar() |
| 119 | 119 | { |
| 120 | - return $this->getViewState('ShowCalendar',true); |
|
| 120 | + return $this->getViewState('ShowCalendar', true); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function setShowCalendar($value) |
| 128 | 128 | { |
| 129 | - $this->setViewState('ShowCalendar',TPropertyValue::ensureBoolean($value),true); |
|
| 129 | + $this->setViewState('ShowCalendar', TPropertyValue::ensureBoolean($value), true); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | public function setFromYear($value) |
| 250 | 250 | { |
| 251 | - $this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))-5); |
|
| 251 | + $this->setViewState('FromYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) - 5); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function getFromYear() |
| 258 | 258 | { |
| 259 | - return $this->getViewState('FromYear', intval(@date('Y'))-5); |
|
| 259 | + return $this->getViewState('FromYear', intval(@date('Y')) - 5); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /** |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | */ |
| 265 | 265 | public function setUpToYear($value) |
| 266 | 266 | { |
| 267 | - $this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y'))+10); |
|
| 267 | + $this->setViewState('UpToYear', TPropertyValue::ensureInteger($value), intval(@date('Y')) + 10); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function getUpToYear() |
| 274 | 274 | { |
| 275 | - return $this->getViewState('UpToYear', intval(@date('Y'))+10); |
|
| 275 | + return $this->getViewState('UpToYear', intval(@date('Y')) + 10); |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
@@ -312,8 +312,8 @@ discard block |
||
| 312 | 312 | $this->setText(''); |
| 313 | 313 | else |
| 314 | 314 | { |
| 315 | - $date = TPropertyValue::ensureFloat($value); |
|
| 316 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat()); |
|
| 315 | + $date=TPropertyValue::ensureFloat($value); |
|
| 316 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat()); |
|
| 317 | 317 | $this->setText($formatter->format($date)); |
| 318 | 318 | } |
| 319 | 319 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | public function getClientSide() |
| 374 | 374 | { |
| 375 | 375 | if($this->_clientScript===null) |
| 376 | - $this->_clientScript = $this->createClientScript(); |
|
| 376 | + $this->_clientScript=$this->createClientScript(); |
|
| 377 | 377 | return $this->_clientScript; |
| 378 | 378 | } |
| 379 | 379 | |
@@ -392,10 +392,10 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | public function getValidationPropertyValue() |
| 394 | 394 | { |
| 395 | - if(($text = $this->getText()) === '') |
|
| 395 | + if(($text=$this->getText())==='') |
|
| 396 | 396 | return ''; |
| 397 | - $date = $this->getTimeStamp(); |
|
| 398 | - return $date == null ? $text : $date; |
|
| 397 | + $date=$this->getTimeStamp(); |
|
| 398 | + return $date==null ? $text : $date; |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | /** |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | */ |
| 417 | 417 | public function render($writer) |
| 418 | 418 | { |
| 419 | - if($this->getInputMode() == TDatePickerInputMode::TextBox) |
|
| 419 | + if($this->getInputMode()==TDatePickerInputMode::TextBox) |
|
| 420 | 420 | { |
| 421 | 421 | parent::render($writer); |
| 422 | 422 | $this->renderDatePickerButtons($writer); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | { |
| 440 | 440 | if($this->getShowCalendar()) |
| 441 | 441 | { |
| 442 | - switch ($this->getMode()) |
|
| 442 | + switch($this->getMode()) |
|
| 443 | 443 | { |
| 444 | 444 | case TDatePickerMode::Button: |
| 445 | 445 | $this->renderButtonDatePicker($writer); |
@@ -459,11 +459,11 @@ discard block |
||
| 459 | 459 | * @param array the input data collection |
| 460 | 460 | * @return boolean whether the data of the component has been changed |
| 461 | 461 | */ |
| 462 | - public function loadPostData($key,$values) |
|
| 462 | + public function loadPostData($key, $values) |
|
| 463 | 463 | { |
| 464 | - if($this->getInputMode() == TDatePickerInputMode::TextBox) |
|
| 464 | + if($this->getInputMode()==TDatePickerInputMode::TextBox) |
|
| 465 | 465 | return parent::loadPostData($key, $values); |
| 466 | - $value = $this->getDateFromPostData($key, $values); |
|
| 466 | + $value=$this->getDateFromPostData($key, $values); |
|
| 467 | 467 | if(!$this->getReadOnly() && $this->getText()!==$value) |
| 468 | 468 | { |
| 469 | 469 | $this->setText($value); |
@@ -481,30 +481,30 @@ discard block |
||
| 481 | 481 | */ |
| 482 | 482 | protected function getDateFromPostData($key, $values) |
| 483 | 483 | { |
| 484 | - $date = @getdate(); |
|
| 484 | + $date=@getdate(); |
|
| 485 | 485 | |
| 486 | 486 | if(isset($values[$key.'$day'])) |
| 487 | - $day = intval($values[$key.'$day']); |
|
| 487 | + $day=intval($values[$key.'$day']); |
|
| 488 | 488 | else |
| 489 | - $day = $date['mday']; |
|
| 489 | + $day=$date['mday']; |
|
| 490 | 490 | |
| 491 | 491 | if(isset($values[$key.'$month'])) |
| 492 | - $month = intval($values[$key.'$month']) + 1; |
|
| 492 | + $month=intval($values[$key.'$month']) + 1; |
|
| 493 | 493 | else |
| 494 | - $month = $date['mon']; |
|
| 494 | + $month=$date['mon']; |
|
| 495 | 495 | |
| 496 | 496 | if(isset($values[$key.'$year'])) |
| 497 | - $year = intval($values[$key.'$year']); |
|
| 497 | + $year=intval($values[$key.'$year']); |
|
| 498 | 498 | else |
| 499 | - $year = $date['year']; |
|
| 499 | + $year=$date['year']; |
|
| 500 | 500 | |
| 501 | - $s = Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 502 | - $date = $s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
| 501 | + $s=Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 502 | + $date=$s->getTimeStamp(0, 0, 0, $month, $day, $year); |
|
| 503 | 503 | //$date = @mktime(0, 0, 0, $month, $day, $year); |
| 504 | 504 | |
| 505 | - $pattern = $this->getDateFormat(); |
|
| 506 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
| 507 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 505 | + $pattern=$this->getDateFormat(); |
|
| 506 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
| 507 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 508 | 508 | return $formatter->format($date); |
| 509 | 509 | } |
| 510 | 510 | |
@@ -514,31 +514,31 @@ discard block |
||
| 514 | 514 | */ |
| 515 | 515 | protected function getDatePickerOptions() |
| 516 | 516 | { |
| 517 | - $options['ID'] = $this->getClientID(); |
|
| 518 | - $options['InputMode'] = $this->getInputMode(); |
|
| 519 | - $options['Format'] = $this->getDateFormat(); |
|
| 520 | - $options['FirstDayOfWeek'] = $this->getFirstDayOfWeek(); |
|
| 517 | + $options['ID']=$this->getClientID(); |
|
| 518 | + $options['InputMode']=$this->getInputMode(); |
|
| 519 | + $options['Format']=$this->getDateFormat(); |
|
| 520 | + $options['FirstDayOfWeek']=$this->getFirstDayOfWeek(); |
|
| 521 | 521 | if(($cssClass=$this->getCssClass())!=='') |
| 522 | - $options['ClassName'] = $cssClass; |
|
| 523 | - $options['CalendarStyle'] = $this->getCalendarStyle(); |
|
| 524 | - $options['FromYear'] = $this->getFromYear(); |
|
| 525 | - $options['UpToYear'] = $this->getUpToYear(); |
|
| 522 | + $options['ClassName']=$cssClass; |
|
| 523 | + $options['CalendarStyle']=$this->getCalendarStyle(); |
|
| 524 | + $options['FromYear']=$this->getFromYear(); |
|
| 525 | + $options['UpToYear']=$this->getUpToYear(); |
|
| 526 | 526 | switch($this->getMode()) |
| 527 | 527 | { |
| 528 | 528 | case TDatePickerMode::Basic: |
| 529 | 529 | break; |
| 530 | 530 | case TDatePickerMode::Clickable: |
| 531 | - $options['TriggerEvent'] = "click"; |
|
| 531 | + $options['TriggerEvent']="click"; |
|
| 532 | 532 | break; |
| 533 | 533 | default: |
| 534 | - $options['Trigger'] = $this->getDatePickerButtonID(); |
|
| 534 | + $options['Trigger']=$this->getDatePickerButtonID(); |
|
| 535 | 535 | break; |
| 536 | 536 | } |
| 537 | - $options['PositionMode'] = $this->getPositionMode(); |
|
| 537 | + $options['PositionMode']=$this->getPositionMode(); |
|
| 538 | 538 | |
| 539 | - $options = array_merge($options, $this->getCulturalOptions()); |
|
| 539 | + $options=array_merge($options, $this->getCulturalOptions()); |
|
| 540 | 540 | if($this->_clientScript!==null) |
| 541 | - $options = array_merge($options, |
|
| 541 | + $options=array_merge($options, |
|
| 542 | 542 | $this->_clientScript->getOptions()->toArray()); |
| 543 | 543 | return $options; |
| 544 | 544 | } |
@@ -549,13 +549,13 @@ discard block |
||
| 549 | 549 | */ |
| 550 | 550 | protected function getCulturalOptions() |
| 551 | 551 | { |
| 552 | - if($this->getCurrentCulture() == 'en') |
|
| 552 | + if($this->getCurrentCulture()=='en') |
|
| 553 | 553 | return array(); |
| 554 | 554 | |
| 555 | - $date = $this->getLocalizedCalendarInfo(); |
|
| 556 | - $options['MonthNames'] = $date->getMonthNames(); |
|
| 557 | - $options['AbbreviatedMonthNames'] = $date->getAbbreviatedMonthNames(); |
|
| 558 | - $options['ShortWeekDayNames'] = $date->getAbbreviatedDayNames(); |
|
| 555 | + $date=$this->getLocalizedCalendarInfo(); |
|
| 556 | + $options['MonthNames']=$date->getMonthNames(); |
|
| 557 | + $options['AbbreviatedMonthNames']=$date->getAbbreviatedMonthNames(); |
|
| 558 | + $options['ShortWeekDayNames']=$date->getAbbreviatedDayNames(); |
|
| 559 | 559 | |
| 560 | 560 | return $options; |
| 561 | 561 | } |
@@ -565,8 +565,8 @@ discard block |
||
| 565 | 565 | */ |
| 566 | 566 | protected function getCurrentCulture() |
| 567 | 567 | { |
| 568 | - $app = $this->getApplication()->getGlobalization(false); |
|
| 569 | - return $this->getCulture() == '' ? |
|
| 568 | + $app=$this->getApplication()->getGlobalization(false); |
|
| 569 | + return $this->getCulture()=='' ? |
|
| 570 | 570 | ($app ? $app->getCulture() : 'en') : $this->getCulture(); |
| 571 | 571 | } |
| 572 | 572 | |
@@ -576,9 +576,9 @@ discard block |
||
| 576 | 576 | protected function getLocalizedCalendarInfo() |
| 577 | 577 | { |
| 578 | 578 | //expensive operations |
| 579 | - $culture = $this->getCurrentCulture(); |
|
| 579 | + $culture=$this->getCurrentCulture(); |
|
| 580 | 580 | Prado::using('System.I18N.core.DateTimeFormatInfo'); |
| 581 | - $info = Prado::createComponent('System.I18N.core.CultureInfo', $culture); |
|
| 581 | + $info=Prado::createComponent('System.I18N.core.CultureInfo', $culture); |
|
| 582 | 582 | return $info->getDateTimeFormat(); |
| 583 | 583 | } |
| 584 | 584 | |
@@ -587,19 +587,19 @@ discard block |
||
| 587 | 587 | */ |
| 588 | 588 | protected function renderDropDownListCalendar($writer) |
| 589 | 589 | { |
| 590 | - if($this->getMode() == TDatePickerMode::Basic) |
|
| 590 | + if($this->getMode()==TDatePickerMode::Basic) |
|
| 591 | 591 | $this->setMode(TDatePickerMode::ImageButton); |
| 592 | 592 | parent::addAttributesToRender($writer); |
| 593 | 593 | $writer->removeAttribute('name'); |
| 594 | 594 | $writer->removeAttribute('type'); |
| 595 | 595 | $writer->addAttribute('id', $this->getClientID()); |
| 596 | 596 | |
| 597 | - if(strlen($class = $this->getCssClass()) > 0) |
|
| 597 | + if(strlen($class=$this->getCssClass()) > 0) |
|
| 598 | 598 | $writer->addAttribute('class', $class); |
| 599 | 599 | $writer->renderBeginTag('span'); |
| 600 | 600 | |
| 601 | - $s = Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 602 | - $date = $s->getDate($this->getTimeStampFromText()); |
|
| 601 | + $s=Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 602 | + $date=$s->getDate($this->getTimeStampFromText()); |
|
| 603 | 603 | //$date = @getdate($this->getTimeStampFromText()); |
| 604 | 604 | |
| 605 | 605 | $this->renderCalendarSelections($writer, $date); |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | |
| 617 | 617 | protected function hasDayPattern() |
| 618 | 618 | { |
| 619 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 619 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 620 | 620 | $this->getDateFormat()); |
| 621 | 621 | return ($formatter->getDayPattern()!==null); |
| 622 | 622 | } |
@@ -628,17 +628,17 @@ discard block |
||
| 628 | 628 | */ |
| 629 | 629 | protected function renderCalendarSelections($writer, $date) |
| 630 | 630 | { |
| 631 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 631 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 632 | 632 | $this->getDateFormat()); |
| 633 | 633 | |
| 634 | 634 | foreach($formatter->getDayMonthYearOrdering() as $type) |
| 635 | 635 | { |
| 636 | - if($type == 'day') |
|
| 637 | - $this->renderCalendarDayOptions($writer,$date['mday']); |
|
| 638 | - elseif($type == 'month') |
|
| 639 | - $this->renderCalendarMonthOptions($writer,$date['mon']); |
|
| 640 | - elseif($type == 'year') |
|
| 641 | - $this->renderCalendarYearOptions($writer,$date['year']); |
|
| 636 | + if($type=='day') |
|
| 637 | + $this->renderCalendarDayOptions($writer, $date['mday']); |
|
| 638 | + elseif($type=='month') |
|
| 639 | + $this->renderCalendarMonthOptions($writer, $date['mon']); |
|
| 640 | + elseif($type=='year') |
|
| 641 | + $this->renderCalendarYearOptions($writer, $date['year']); |
|
| 642 | 642 | } |
| 643 | 643 | } |
| 644 | 644 | |
@@ -648,9 +648,9 @@ discard block |
||
| 648 | 648 | */ |
| 649 | 649 | protected function getTimeStampFromText() |
| 650 | 650 | { |
| 651 | - $pattern = $this->getDateFormat(); |
|
| 652 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
| 653 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern); |
|
| 651 | + $pattern=$this->getDateFormat(); |
|
| 652 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
| 653 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 654 | 654 | return $formatter->parse($this->getText()); |
| 655 | 655 | } |
| 656 | 656 | |
@@ -660,12 +660,12 @@ discard block |
||
| 660 | 660 | * @param array list of selection options |
| 661 | 661 | * @param mixed selected key. |
| 662 | 662 | */ |
| 663 | - private function renderDropDownListOptions($writer,$options,$selected=null) |
|
| 663 | + private function renderDropDownListOptions($writer, $options, $selected=null) |
|
| 664 | 664 | { |
| 665 | 665 | foreach($options as $k => $v) |
| 666 | 666 | { |
| 667 | 667 | $writer->addAttribute('value', $k); |
| 668 | - if($k == $selected) |
|
| 668 | + if($k==$selected) |
|
| 669 | 669 | $writer->addAttribute('selected', 'selected'); |
| 670 | 670 | $writer->renderBeginTag('option'); |
| 671 | 671 | $writer->write($v); |
@@ -680,7 +680,7 @@ discard block |
||
| 680 | 680 | */ |
| 681 | 681 | protected function renderCalendarDayOptions($writer, $selected=null) |
| 682 | 682 | { |
| 683 | - $days = $this->getDropDownDayOptions(); |
|
| 683 | + $days=$this->getDropDownDayOptions(); |
|
| 684 | 684 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'day'); |
| 685 | 685 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'day'); |
| 686 | 686 | $writer->addAttribute('class', 'datepicker_day_options'); |
@@ -696,13 +696,13 @@ discard block |
||
| 696 | 696 | */ |
| 697 | 697 | protected function getDropDownDayOptions() |
| 698 | 698 | { |
| 699 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 699 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 700 | 700 | $this->getDateFormat()); |
| 701 | - $days = array(); |
|
| 702 | - $requiresPadding = $formatter->getDayPattern() === 'dd'; |
|
| 703 | - for($i=1;$i<=31;$i++) |
|
| 701 | + $days=array(); |
|
| 702 | + $requiresPadding=$formatter->getDayPattern()==='dd'; |
|
| 703 | + for($i=1; $i <= 31; $i++) |
|
| 704 | 704 | { |
| 705 | - $days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
| 705 | + $days[$i]=$requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i; |
|
| 706 | 706 | } |
| 707 | 707 | return $days; |
| 708 | 708 | } |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | */ |
| 715 | 715 | protected function renderCalendarMonthOptions($writer, $selected=null) |
| 716 | 716 | { |
| 717 | - $info = $this->getLocalizedCalendarInfo(); |
|
| 717 | + $info=$this->getLocalizedCalendarInfo(); |
|
| 718 | 718 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'month'); |
| 719 | 719 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'month'); |
| 720 | 720 | $writer->addAttribute('class', 'datepicker_month_options'); |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | $writer->addAttribute('disabled', 'disabled'); |
| 723 | 723 | $writer->renderBeginTag('select'); |
| 724 | 724 | $this->renderDropDownListOptions($writer, |
| 725 | - $this->getLocalizedMonthNames($info), $selected-1); |
|
| 725 | + $this->getLocalizedMonthNames($info), $selected - 1); |
|
| 726 | 726 | $writer->renderEndTag(); |
| 727 | 727 | } |
| 728 | 728 | |
@@ -735,18 +735,18 @@ discard block |
||
| 735 | 735 | */ |
| 736 | 736 | protected function getLocalizedMonthNames($info) |
| 737 | 737 | { |
| 738 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 738 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', |
|
| 739 | 739 | $this->getDateFormat()); |
| 740 | 740 | switch($formatter->getMonthPattern()) |
| 741 | 741 | { |
| 742 | 742 | case 'MMM': return $info->getAbbreviatedMonthNames(); |
| 743 | 743 | case 'MM': |
| 744 | - $array = array(); |
|
| 745 | - for($i=1;$i<=12;$i++) |
|
| 746 | - $array[$i-1] = $i < 10 ? '0'.$i : $i; |
|
| 744 | + $array=array(); |
|
| 745 | + for($i=1; $i <= 12; $i++) |
|
| 746 | + $array[$i - 1]=$i < 10 ? '0'.$i : $i; |
|
| 747 | 747 | return $array; |
| 748 | 748 | case 'M': |
| 749 | - $array = array(); for($i=1;$i<=12;$i++) $array[$i-1] = $i; |
|
| 749 | + $array=array(); for($i=1; $i <= 12; $i++) $array[$i - 1]=$i; |
|
| 750 | 750 | return $array; |
| 751 | 751 | default : return $info->getMonthNames(); |
| 752 | 752 | } |
@@ -759,9 +759,9 @@ discard block |
||
| 759 | 759 | */ |
| 760 | 760 | protected function renderCalendarYearOptions($writer, $selected=null) |
| 761 | 761 | { |
| 762 | - $years = array(); |
|
| 763 | - for($i = $this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
| 764 | - $years[$i] = $i; |
|
| 762 | + $years=array(); |
|
| 763 | + for($i=$this->getFromYear(); $i <= $this->getUpToYear(); $i++) |
|
| 764 | + $years[$i]=$i; |
|
| 765 | 765 | $writer->addAttribute('id', $this->getClientID().TControl::CLIENT_ID_SEPARATOR.'year'); |
| 766 | 766 | $writer->addAttribute('name', $this->getUniqueID().TControl::ID_SEPARATOR.'year'); |
| 767 | 767 | $writer->addAttribute('class', 'datepicker_year_options'); |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
| 791 | 791 | $writer->addAttribute('type', 'button'); |
| 792 | 792 | $writer->addAttribute('class', $this->getCssClass().' TDatePickerButton'); |
| 793 | - $writer->addAttribute('value',$this->getButtonText()); |
|
| 793 | + $writer->addAttribute('value', $this->getButtonText()); |
|
| 794 | 794 | if(!$this->getEnabled(true)) |
| 795 | 795 | $writer->addAttribute('disabled', 'disabled'); |
| 796 | 796 | $writer->renderBeginTag("input"); |
@@ -803,8 +803,8 @@ discard block |
||
| 803 | 803 | */ |
| 804 | 804 | protected function renderImageButtonDatePicker($writer) |
| 805 | 805 | { |
| 806 | - $url = $this->getButtonImageUrl(); |
|
| 807 | - $url = empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
| 806 | + $url=$this->getButtonImageUrl(); |
|
| 807 | + $url=empty($url) ? $this->getAssetUrl('calendar.png') : $url; |
|
| 808 | 808 | $writer->addAttribute('id', $this->getDatePickerButtonID()); |
| 809 | 809 | $writer->addAttribute('src', $url); |
| 810 | 810 | $writer->addAttribute('alt', ' '); |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | */ |
| 824 | 824 | protected function getAssetUrl($file='') |
| 825 | 825 | { |
| 826 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 826 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 827 | 827 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
| 828 | 828 | } |
| 829 | 829 | |
@@ -833,8 +833,8 @@ discard block |
||
| 833 | 833 | */ |
| 834 | 834 | protected function publishCalendarStyle() |
| 835 | 835 | { |
| 836 | - $url = $this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
| 837 | - $cs = $this->getPage()->getClientScript(); |
|
| 836 | + $url=$this->getAssetUrl($this->getCalendarStyle().'.css'); |
|
| 837 | + $cs=$this->getPage()->getClientScript(); |
|
| 838 | 838 | if(!$cs->isStyleSheetFileRegistered($url)) |
| 839 | 839 | $cs->registerStyleSheetFile($url, $url); |
| 840 | 840 | return $url; |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | protected function addAttributesToRender($writer) |
| 848 | 848 | { |
| 849 | 849 | parent::addAttributesToRender($writer); |
| 850 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 850 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | /** |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | { |
| 858 | 858 | if($this->getShowCalendar()) |
| 859 | 859 | { |
| 860 | - $cs = $this->getPage()->getClientScript(); |
|
| 860 | + $cs=$this->getPage()->getClientScript(); |
|
| 861 | 861 | $cs->registerPradoScript("datepicker"); |
| 862 | 862 | } |
| 863 | 863 | } |
@@ -866,16 +866,16 @@ discard block |
||
| 866 | 866 | { |
| 867 | 867 | if($this->getShowCalendar()) |
| 868 | 868 | { |
| 869 | - $cs = $this->getPage()->getClientScript(); |
|
| 869 | + $cs=$this->getPage()->getClientScript(); |
|
| 870 | 870 | if(!$cs->isEndScriptRegistered('TDatePicker.spacer')) |
| 871 | 871 | { |
| 872 | - $spacer = $this->getAssetUrl('spacer.gif'); |
|
| 873 | - $code = "Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 872 | + $spacer=$this->getAssetUrl('spacer.gif'); |
|
| 873 | + $code="Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 874 | 874 | $cs->registerEndScript('TDatePicker.spacer', $code); |
| 875 | 875 | } |
| 876 | 876 | |
| 877 | - $options = TJavaScript::encode($this->getDatePickerOptions()); |
|
| 878 | - $code = "new Prado.WebUI.TDatePicker($options);"; |
|
| 877 | + $options=TJavaScript::encode($this->getDatePickerOptions()); |
|
| 878 | + $code="new Prado.WebUI.TDatePicker($options);"; |
|
| 879 | 879 | $cs->registerEndScript("prado:".$this->getClientID(), $code); |
| 880 | 880 | } |
| 881 | 881 | } |
@@ -189,8 +189,7 @@ discard block |
||
| 189 | 189 | return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | - } |
|
| 193 | - else |
|
| 192 | + } else |
|
| 194 | 193 | return false; |
| 195 | 194 | } |
| 196 | 195 | |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | $this->_errorCode=$_FILES[$key]['error']; |
| 212 | 211 | $this->_localName=$_FILES[$key]['tmp_name']; |
| 213 | 212 | return $this->_dataChanged=true; |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | return false; |
| 217 | 215 | } |
| 218 | 216 | |
@@ -234,7 +234,11 @@ |
||
| 234 | 234 | * @param string button caption |
| 235 | 235 | * @param boolean whether the button should cause validation |
| 236 | 236 | * @param string the validation group that the button belongs to |
| 237 | - * @return mixed the newly created button. |
|
| 237 | + * @param string $commandName |
|
| 238 | + * @param string $text |
|
| 239 | + * @param boolean $causesValidation |
|
| 240 | + * @param string $validationGroup |
|
| 241 | + * @return TComponent the newly created button. |
|
| 238 | 242 | */ |
| 239 | 243 | protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
| 240 | 244 | { |
@@ -211,8 +211,7 @@ discard block |
||
| 211 | 211 | $button=$this->createButton('Edit',$this->getEditText(),false,''); |
| 212 | 212 | $cell->getControls()->add($button); |
| 213 | 213 | $cell->registerObject('EditButton',$button); |
| 214 | - } |
|
| 215 | - else if($itemType===TListItemType::EditItem) |
|
| 214 | + } else if($itemType===TListItemType::EditItem) |
|
| 216 | 215 | { |
| 217 | 216 | $controls=$cell->getControls(); |
| 218 | 217 | $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
@@ -222,8 +221,7 @@ discard block |
||
| 222 | 221 | $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
| 223 | 222 | $controls->add($button); |
| 224 | 223 | $cell->registerObject('CancelButton',$button); |
| 225 | - } |
|
| 226 | - else |
|
| 224 | + } else |
|
| 227 | 225 | parent::initializeCell($cell,$columnIndex,$itemType); |
| 228 | 226 | } |
| 229 | 227 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function getButtonType() |
| 58 | 58 | { |
| 59 | - return $this->getViewState('ButtonType',TButtonColumnType::LinkButton); |
|
| 59 | + return $this->getViewState('ButtonType', TButtonColumnType::LinkButton); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function setButtonType($value) |
| 66 | 66 | { |
| 67 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'TButtonColumnType'),TButtonColumnType::LinkButton); |
|
| 67 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'TButtonColumnType'), TButtonColumnType::LinkButton); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function getEditText() |
| 74 | 74 | { |
| 75 | - return $this->getViewState('EditText','Edit'); |
|
| 75 | + return $this->getViewState('EditText', 'Edit'); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function setEditText($value) |
| 82 | 82 | { |
| 83 | - $this->setViewState('EditText',$value,'Edit'); |
|
| 83 | + $this->setViewState('EditText', $value, 'Edit'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function getEditImageUrl() |
| 90 | 90 | { |
| 91 | - return $this->getViewState('EditImageUrl',''); |
|
| 91 | + return $this->getViewState('EditImageUrl', ''); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | public function setEditImageUrl($value) |
| 98 | 98 | { |
| 99 | - $this->setViewState('EditImageUrl',$value,''); |
|
| 99 | + $this->setViewState('EditImageUrl', $value, ''); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getUpdateText() |
| 106 | 106 | { |
| 107 | - return $this->getViewState('UpdateText','Update'); |
|
| 107 | + return $this->getViewState('UpdateText', 'Update'); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function setUpdateText($value) |
| 114 | 114 | { |
| 115 | - $this->setViewState('UpdateText',$value,'Update'); |
|
| 115 | + $this->setViewState('UpdateText', $value, 'Update'); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function getUpdateImageUrl() |
| 122 | 122 | { |
| 123 | - return $this->getViewState('UpdateImageUrl',''); |
|
| 123 | + return $this->getViewState('UpdateImageUrl', ''); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function setUpdateImageUrl($value) |
| 130 | 130 | { |
| 131 | - $this->setViewState('UpdateImageUrl',$value,''); |
|
| 131 | + $this->setViewState('UpdateImageUrl', $value, ''); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function getCancelText() |
| 138 | 138 | { |
| 139 | - return $this->getViewState('CancelText','Cancel'); |
|
| 139 | + return $this->getViewState('CancelText', 'Cancel'); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function setCancelText($value) |
| 146 | 146 | { |
| 147 | - $this->setViewState('CancelText',$value,'Cancel'); |
|
| 147 | + $this->setViewState('CancelText', $value, 'Cancel'); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function getCancelImageUrl() |
| 154 | 154 | { |
| 155 | - return $this->getViewState('CancelImageUrl',''); |
|
| 155 | + return $this->getViewState('CancelImageUrl', ''); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | public function setCancelImageUrl($value) |
| 162 | 162 | { |
| 163 | - $this->setViewState('CancelImageUrl',$value,''); |
|
| 163 | + $this->setViewState('CancelImageUrl', $value, ''); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function getCausesValidation() |
| 170 | 170 | { |
| 171 | - return $this->getViewState('CausesValidation',true); |
|
| 171 | + return $this->getViewState('CausesValidation', true); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | public function setCausesValidation($value) |
| 178 | 178 | { |
| 179 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
| 179 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function getValidationGroup() |
| 186 | 186 | { |
| 187 | - return $this->getViewState('ValidationGroup',''); |
|
| 187 | + return $this->getViewState('ValidationGroup', ''); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function setValidationGroup($value) |
| 194 | 194 | { |
| 195 | - $this->setViewState('ValidationGroup',$value,''); |
|
| 195 | + $this->setViewState('ValidationGroup', $value, ''); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -204,27 +204,27 @@ discard block |
||
| 204 | 204 | * @param integer the index to the Columns property that the cell resides in. |
| 205 | 205 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
| 206 | 206 | */ |
| 207 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
| 207 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
| 208 | 208 | { |
| 209 | 209 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem) |
| 210 | 210 | { |
| 211 | - $button=$this->createButton('Edit',$this->getEditText(),false,''); |
|
| 211 | + $button=$this->createButton('Edit', $this->getEditText(), false, ''); |
|
| 212 | 212 | $cell->getControls()->add($button); |
| 213 | - $cell->registerObject('EditButton',$button); |
|
| 213 | + $cell->registerObject('EditButton', $button); |
|
| 214 | 214 | } |
| 215 | 215 | else if($itemType===TListItemType::EditItem) |
| 216 | 216 | { |
| 217 | 217 | $controls=$cell->getControls(); |
| 218 | - $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
|
| 218 | + $button=$this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup()); |
|
| 219 | 219 | $controls->add($button); |
| 220 | - $cell->registerObject('UpdateButton',$button); |
|
| 220 | + $cell->registerObject('UpdateButton', $button); |
|
| 221 | 221 | $controls->add(' '); |
| 222 | - $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
|
| 222 | + $button=$this->createButton('Cancel', $this->getCancelText(), false, ''); |
|
| 223 | 223 | $controls->add($button); |
| 224 | - $cell->registerObject('CancelButton',$button); |
|
| 224 | + $cell->registerObject('CancelButton', $button); |
|
| 225 | 225 | } |
| 226 | 226 | else |
| 227 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
| 227 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @param string the validation group that the button belongs to |
| 237 | 237 | * @return mixed the newly created button. |
| 238 | 238 | */ |
| 239 | - protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
|
| 239 | + protected function createButton($commandName, $text, $causesValidation, $validationGroup) |
|
| 240 | 240 | { |
| 241 | 241 | if($this->getButtonType()===TButtonColumnType::LinkButton) |
| 242 | 242 | $button=Prado::createComponent('System.Web.UI.WebControls.TLinkButton'); |
@@ -245,9 +245,9 @@ discard block |
||
| 245 | 245 | else // image buttons |
| 246 | 246 | { |
| 247 | 247 | $button=Prado::createComponent('System.Web.UI.WebControls.TImageButton'); |
| 248 | - if(strcasecmp($commandName,'Update')===0) |
|
| 248 | + if(strcasecmp($commandName, 'Update')===0) |
|
| 249 | 249 | $url=$this->getUpdateImageUrl(); |
| 250 | - else if(strcasecmp($commandName,'Cancel')===0) |
|
| 250 | + else if(strcasecmp($commandName, 'Cancel')===0) |
|
| 251 | 251 | $url=$this->getCancelImageUrl(); |
| 252 | 252 | else |
| 253 | 253 | $url=$this->getEditImageUrl(); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Returns an array of javascript validator options. |
| 58 | - * @return array javascript validator options. |
|
| 58 | + * @return boolean javascript validator options. |
|
| 59 | 59 | */ |
| 60 | 60 | public function evaluateIsValid() |
| 61 | 61 | { |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | { |
| 71 | 71 | $domain=substr($value,$pos+1); |
| 72 | 72 | return $domain===''?false:checkdnsrr($domain,'MX'); |
| 73 | - } |
|
| 74 | - else |
|
| 73 | + } else |
|
| 75 | 74 | return false; |
| 76 | 75 | } |
| 77 | 76 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function getRegularExpression() |
| 51 | 51 | { |
| 52 | 52 | $regex=parent::getRegularExpression(); |
| 53 | - return $regex===''?self::EMAIL_REGEXP:$regex; |
|
| 53 | + return $regex==='' ? self::EMAIL_REGEXP : $regex; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | public function evaluateIsValid() |
| 61 | 61 | { |
| 62 | 62 | $value=$this->getValidationValue($this->getValidationTarget()); |
| 63 | - $valid=$valid=is_string($value) && strlen($value)<=254 && parent::evaluateIsValid(); |
|
| 63 | + $valid=$valid=is_string($value) && strlen($value) <= 254 && parent::evaluateIsValid(); |
|
| 64 | 64 | |
| 65 | 65 | if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) |
| 66 | 66 | { |
| 67 | 67 | if($value!=='') |
| 68 | 68 | { |
| 69 | - if(($pos=strpos($value,'@'))!==false) |
|
| 69 | + if(($pos=strpos($value, '@'))!==false) |
|
| 70 | 70 | { |
| 71 | - $domain=substr($value,$pos+1); |
|
| 72 | - return $domain===''?false:checkdnsrr($domain,'MX'); |
|
| 71 | + $domain=substr($value, $pos + 1); |
|
| 72 | + return $domain==='' ? false : checkdnsrr($domain, 'MX'); |
|
| 73 | 73 | } |
| 74 | 74 | else |
| 75 | 75 | return false; |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function getCheckMXRecord() |
| 85 | 85 | { |
| 86 | - return $this->getViewState('CheckMXRecord',false); |
|
| 86 | + return $this->getViewState('CheckMXRecord', false); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function setCheckMXRecord($value) |
| 94 | 94 | { |
| 95 | - $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),false); |
|
| 95 | + $this->setViewState('CheckMXRecord', TPropertyValue::ensureBoolean($value), false); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
@@ -177,6 +177,7 @@ discard block |
||
| 177 | 177 | * @param string the file name used to save the uploaded file |
| 178 | 178 | * @param boolean whether to delete the temporary file after saving. |
| 179 | 179 | * If true, you will not be able to save the uploaded file again. |
| 180 | + * @param string $fileName |
|
| 180 | 181 | * @return boolean true if the file saving is successful |
| 181 | 182 | */ |
| 182 | 183 | public function saveAs($fileName,$deleteTempFile=true) |
@@ -199,6 +200,7 @@ discard block |
||
| 199 | 200 | * This method is primarly used by framework developers. |
| 200 | 201 | * @param string the key that can be used to retrieve data from the input data collection |
| 201 | 202 | * @param array the input data collection |
| 203 | + * @param boolean $key |
|
| 202 | 204 | * @return boolean whether the data of the control has been changed |
| 203 | 205 | */ |
| 204 | 206 | public function loadPostData($key,$values) |
@@ -251,7 +253,7 @@ discard block |
||
| 251 | 253 | /** |
| 252 | 254 | * Returns the original file name as the property value to be validated. |
| 253 | 255 | * This method is required by IValidatable property. |
| 254 | - * @return mixed the property value to be validated |
|
| 256 | + * @return string the property value to be validated |
|
| 255 | 257 | */ |
| 256 | 258 | public function getValidationPropertyValue() |
| 257 | 259 | { |
@@ -463,14 +463,14 @@ |
||
| 463 | 463 | */ |
| 464 | 464 | public function getIsValid() |
| 465 | 465 | { |
| 466 | - return $this->_isValid; |
|
| 466 | + return $this->_isValid; |
|
| 467 | 467 | } |
| 468 | 468 | /** |
| 469 | 469 | * @param bool wether this control is valid. |
| 470 | 470 | */ |
| 471 | 471 | public function setIsValid($value) |
| 472 | 472 | { |
| 473 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
| 473 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | /** |
@@ -189,8 +189,7 @@ discard block |
||
| 189 | 189 | return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | - } |
|
| 193 | - else |
|
| 192 | + } else |
|
| 194 | 193 | return false; |
| 195 | 194 | } |
| 196 | 195 | |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | $this->_errorCode=$_FILES[$key]['error']; |
| 212 | 211 | $this->_localName=$_FILES[$key]['tmp_name']; |
| 213 | 212 | return $this->_dataChanged=true; |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | return false; |
| 217 | 215 | } |
| 218 | 216 | |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $this->getPage()->ensureRenderInForm($this); |
| 78 | 78 | parent::addAttributesToRender($writer); |
| 79 | - $writer->addAttribute('type','file'); |
|
| 80 | - $writer->addAttribute('name',$this->getUniqueID()); |
|
| 79 | + $writer->addAttribute('type', 'file'); |
|
| 80 | + $writer->addAttribute('name', $this->getUniqueID()); |
|
| 81 | 81 | $isEnabled=$this->getEnabled(true); |
| 82 | 82 | if(!$isEnabled && $this->getEnabled()) // in this case parent will not render 'disabled' |
| 83 | - $writer->addAttribute('disabled','disabled'); |
|
| 83 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | parent::onPreRender($param); |
| 94 | 94 | if(($form=$this->getPage()->getForm())!==null) |
| 95 | 95 | $form->setEnctype('multipart/form-data'); |
| 96 | - $this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE',$this->getMaxFileSize()); |
|
| 96 | + $this->getPage()->getClientScript()->registerHiddenField('MAX_FILE_SIZE', $this->getMaxFileSize()); |
|
| 97 | 97 | if($this->getEnabled(true)) |
| 98 | 98 | $this->getPage()->registerRequiresPostData($this); |
| 99 | 99 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getMaxFileSize() |
| 106 | 106 | { |
| 107 | - return $this->getViewState('MaxFileSize',self::MAX_FILE_SIZE); |
|
| 107 | + return $this->getViewState('MaxFileSize', self::MAX_FILE_SIZE); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function setMaxFileSize($size) |
| 119 | 119 | { |
| 120 | - $this->setViewState('MaxFileSize',TPropertyValue::ensureInteger($size),self::MAX_FILE_SIZE); |
|
| 120 | + $this->setViewState('MaxFileSize', TPropertyValue::ensureInteger($size), self::MAX_FILE_SIZE); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | * If true, you will not be able to save the uploaded file again. |
| 180 | 180 | * @return boolean true if the file saving is successful |
| 181 | 181 | */ |
| 182 | - public function saveAs($fileName,$deleteTempFile=true) |
|
| 182 | + public function saveAs($fileName, $deleteTempFile=true) |
|
| 183 | 183 | { |
| 184 | 184 | if($this->_errorCode===UPLOAD_ERR_OK) |
| 185 | 185 | { |
| 186 | 186 | if($deleteTempFile) |
| 187 | - return move_uploaded_file($this->_localName,$fileName); |
|
| 187 | + return move_uploaded_file($this->_localName, $fileName); |
|
| 188 | 188 | else if(is_uploaded_file($this->_localName)) |
| 189 | - return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
|
| 189 | + return file_put_contents($fileName, file_get_contents($this->_localName))!==false; |
|
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | 192 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | * @param array the input data collection |
| 202 | 202 | * @return boolean whether the data of the control has been changed |
| 203 | 203 | */ |
| 204 | - public function loadPostData($key,$values) |
|
| 204 | + public function loadPostData($key, $values) |
|
| 205 | 205 | { |
| 206 | 206 | if(isset($_FILES[$key])) |
| 207 | 207 | { |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function onFileUpload($param) |
| 237 | 237 | { |
| 238 | - $this->raiseEvent('OnFileUpload',$this,$param); |
|
| 238 | + $this->raiseEvent('OnFileUpload', $this, $param); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * @return Tells whether buffering of output can continue after this point |
|
| 52 | + * @return boolean whether buffering of output can continue after this point |
|
| 53 | 53 | */ |
| 54 | 54 | public function getContinueBuffering() |
| 55 | 55 | { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function __construct() |
| 46 | 46 | { |
| 47 | 47 | parent::__construct(); |
| 48 | - $this->EnableViewState = false; |
|
| 48 | + $this->EnableViewState=false; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function setContinueBuffering($value) |
| 63 | 63 | { |
| 64 | - $this->_continueBuffering = TPropertyValue::ensureBoolean($value); |
|
| 64 | + $this->_continueBuffering=TPropertyValue::ensureBoolean($value); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | //$writer->write('<!-- flush -->'); |
| 74 | 74 | // ajax responses can't be parsed by the client side before loaded and returned completely, |
| 75 | 75 | // so don't bother with flushing output somewhere mid-page if refreshing in a callback |
| 76 | - if (!$this->Page->IsCallback) |
|
| 76 | + if(!$this->Page->IsCallback) |
|
| 77 | 77 | { |
| 78 | 78 | $this->Page->flushWriter(); |
| 79 | 79 | // $this->Application->flushOutput($this->ContinueBuffering); |
@@ -422,6 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | /** |
| 424 | 424 | * Parse additional options set in the Options property. |
| 425 | + * @param string $string |
|
| 425 | 426 | * @return array additional custom options |
| 426 | 427 | */ |
| 427 | 428 | protected function parseEditorOptions($string) |
@@ -446,6 +447,7 @@ discard block |
||
| 446 | 447 | } |
| 447 | 448 | |
| 448 | 449 | /** |
| 450 | + * @param string $culture |
|
| 449 | 451 | * @return string localized editor interface language extension. |
| 450 | 452 | */ |
| 451 | 453 | 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 = array( |
|
| 63 | + private static $_langs=array( |
|
| 64 | 64 | 'ar' => 'ar', |
| 65 | 65 | 'bg_BG' => 'bg_BG', |
| 66 | 66 | 'bs' => 'bs', |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | /** |
| 119 | 119 | * @var array list of default plugins to load, override using getAvailablePlugins(); |
| 120 | 120 | */ |
| 121 | - private static $_plugins = array( |
|
| 121 | + private static $_plugins=array( |
|
| 122 | 122 | 'advlist', |
| 123 | 123 | 'anchor', |
| 124 | 124 | 'autolink', |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * @var array default themes to load |
| 164 | 164 | */ |
| 165 | - private static $_themes = array( |
|
| 165 | + private static $_themes=array( |
|
| 166 | 166 | 'modern', |
| 167 | 167 | ); |
| 168 | 168 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | */ |
| 210 | 210 | public function getEnableVisualEdit() |
| 211 | 211 | { |
| 212 | - return $this->getViewState('EnableVisualEdit',true); |
|
| 212 | + return $this->getViewState('EnableVisualEdit', true); |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public function setEnableVisualEdit($value) |
| 220 | 220 | { |
| 221 | - $this->setViewState('EnableVisualEdit',TPropertyValue::ensureBoolean($value),true); |
|
| 221 | + $this->setViewState('EnableVisualEdit', TPropertyValue::ensureBoolean($value), true); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | { |
| 304 | 304 | if($this->getEnableVisualEdit() && $this->getEnabled(true)) |
| 305 | 305 | { |
| 306 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 306 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 307 | 307 | $this->registerEditorClientScript($writer); |
| 308 | 308 | } |
| 309 | 309 | |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | protected function loadJavascriptLibrary() |
| 340 | 340 | { |
| 341 | - $scripts = $this->getPage()->getClientScript(); |
|
| 341 | + $scripts=$this->getPage()->getClientScript(); |
|
| 342 | 342 | $scripts->registerPradoScript('htmlarea4'); |
| 343 | 343 | $scripts->registerScriptFile('prado:THtmlArea4', $this->getScriptUrl()); |
| 344 | 344 | } |
@@ -349,14 +349,14 @@ discard block |
||
| 349 | 349 | protected function registerEditorClientScript($writer) |
| 350 | 350 | { |
| 351 | 351 | $this->loadJavascriptLibrary(); |
| 352 | - $scripts = $this->getPage()->getClientScript(); |
|
| 353 | - $options = array( |
|
| 352 | + $scripts=$this->getPage()->getClientScript(); |
|
| 353 | + $options=array( |
|
| 354 | 354 | 'EditorOptions' => $this->getEditorOptions() |
| 355 | 355 | ); |
| 356 | 356 | |
| 357 | - $options = TJavaScript::encode($options,true,true); |
|
| 358 | - $script = "new {$this->getClientClassName()}($options)"; |
|
| 359 | - $scripts->registerEndScript('prado:THtmlArea4'.$this->ClientID,$script); |
|
| 357 | + $options=TJavaScript::encode($options, true, true); |
|
| 358 | + $script="new {$this->getClientClassName()}($options)"; |
|
| 359 | + $scripts->registerEndScript('prado:THtmlArea4'.$this->ClientID, $script); |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | /** |
@@ -373,19 +373,19 @@ discard block |
||
| 373 | 373 | */ |
| 374 | 374 | protected function getScriptDeploymentPath() |
| 375 | 375 | { |
| 376 | - $basedir = Prado::getPathOfNamespace('System.Web.Javascripts.source.tinymce-405'); |
|
| 377 | - $url = $this->getApplication()->getAssetManager()->publishFilePath($basedir); |
|
| 376 | + $basedir=Prado::getPathOfNamespace('System.Web.Javascripts.source.tinymce-405'); |
|
| 377 | + $url=$this->getApplication()->getAssetManager()->publishFilePath($basedir); |
|
| 378 | 378 | $this->copyCustomPlugins($url); |
| 379 | 379 | return $url; |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | protected function copyCustomPlugins($url) |
| 383 | 383 | { |
| 384 | - if($plugins = $this->getCustomPluginPath()) |
|
| 384 | + if($plugins=$this->getCustomPluginPath()) |
|
| 385 | 385 | { |
| 386 | - $assets = $this->getApplication()->getAssetManager(); |
|
| 387 | - $path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
| 388 | - $dest = $assets->getBasePath().'/'.basename($url).'/plugins/'; |
|
| 386 | + $assets=$this->getApplication()->getAssetManager(); |
|
| 387 | + $path=is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
| 388 | + $dest=$assets->getBasePath().'/'.basename($url).'/plugins/'; |
|
| 389 | 389 | if(!is_dir($dest) || $this->getApplication()->getMode()!==TApplicationMode::Performance) |
| 390 | 390 | $assets->copyDirectory($path, $dest); |
| 391 | 391 | } |
@@ -397,26 +397,26 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | protected function getEditorOptions() |
| 399 | 399 | { |
| 400 | - $options['mode'] = 'exact'; |
|
| 401 | - $options['elements'] = $this->getClientID(); |
|
| 402 | - $options['language'] = $this->getLanguageSuffix($this->getCulture()); |
|
| 400 | + $options['mode']='exact'; |
|
| 401 | + $options['elements']=$this->getClientID(); |
|
| 402 | + $options['language']=$this->getLanguageSuffix($this->getCulture()); |
|
| 403 | 403 | //$options['theme'] = 'modern'; //default |
| 404 | 404 | // mimic previous (tinyMCE3) sizing behaviour |
| 405 | - $options['width'] = $this->getWidth(); |
|
| 406 | - $options['height'] = $this->getHeight(); |
|
| 407 | - $options['resize'] = 'both'; |
|
| 408 | - $options['menubar'] = false; |
|
| 405 | + $options['width']=$this->getWidth(); |
|
| 406 | + $options['height']=$this->getHeight(); |
|
| 407 | + $options['resize']='both'; |
|
| 408 | + $options['menubar']=false; |
|
| 409 | 409 | if($this->getReadOnly()) |
| 410 | 410 | { |
| 411 | - $options['readonly'] = true; |
|
| 412 | - $options['toolbar'] = false; |
|
| 413 | - $options['menubar'] = false; |
|
| 414 | - $options['statusbar'] = false; |
|
| 411 | + $options['readonly']=true; |
|
| 412 | + $options['toolbar']=false; |
|
| 413 | + $options['menubar']=false; |
|
| 414 | + $options['statusbar']=false; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | - $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]'; |
|
| 417 | + $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]'; |
|
| 418 | 418 | |
| 419 | - $options = array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
| 419 | + $options=array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
| 420 | 420 | return $options; |
| 421 | 421 | } |
| 422 | 422 | |
@@ -426,20 +426,20 @@ discard block |
||
| 426 | 426 | */ |
| 427 | 427 | protected function parseEditorOptions($string) |
| 428 | 428 | { |
| 429 | - $options = array(); |
|
| 430 | - $substrings = preg_split('/,\s*\n|\n/', trim($string)); |
|
| 429 | + $options=array(); |
|
| 430 | + $substrings=preg_split('/,\s*\n|\n/', trim($string)); |
|
| 431 | 431 | foreach($substrings as $bits) |
| 432 | 432 | { |
| 433 | - $option = explode(":",$bits,2); |
|
| 433 | + $option=explode(":", $bits, 2); |
|
| 434 | 434 | |
| 435 | - if(count($option) == 2) |
|
| 435 | + if(count($option)==2) |
|
| 436 | 436 | { |
| 437 | - $value=trim(trim($option[1]),"'\""); |
|
| 438 | - if (($s=strtolower($value))==='false') |
|
| 437 | + $value=trim(trim($option[1]), "'\""); |
|
| 438 | + if(($s=strtolower($value))==='false') |
|
| 439 | 439 | $value=false; |
| 440 | - elseif ($s==='true') |
|
| 440 | + elseif($s==='true') |
|
| 441 | 441 | $value=true; |
| 442 | - $options[trim($option[0])] = $value; |
|
| 442 | + $options[trim($option[0])]=$value; |
|
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | return $options; |
@@ -450,12 +450,12 @@ discard block |
||
| 450 | 450 | */ |
| 451 | 451 | protected function getLanguageSuffix($culture) |
| 452 | 452 | { |
| 453 | - $app = $this->getApplication()->getGlobalization(); |
|
| 453 | + $app=$this->getApplication()->getGlobalization(); |
|
| 454 | 454 | if(empty($culture) && ($app!==null)) |
| 455 | - $culture = $app->getCulture(); |
|
| 456 | - $variants = array(); |
|
| 455 | + $culture=$app->getCulture(); |
|
| 456 | + $variants=array(); |
|
| 457 | 457 | if($app!==null) |
| 458 | - $variants = $app->getCultureVariants($culture); |
|
| 458 | + $variants=$app->getCultureVariants($culture); |
|
| 459 | 459 | |
| 460 | 460 | foreach($variants as $variant) |
| 461 | 461 | { |
@@ -147,6 +147,7 @@ discard block |
||
| 147 | 147 | /** |
| 148 | 148 | * Sets the height of the image in the THyperLink |
| 149 | 149 | * @param string height of the image in the THyperLink |
| 150 | + * @param string $value |
|
| 150 | 151 | */ |
| 151 | 152 | public function setImageHeight($value) |
| 152 | 153 | { |
@@ -181,6 +182,7 @@ discard block |
||
| 181 | 182 | /** |
| 182 | 183 | * Sets the width of the image in the THyperLink |
| 183 | 184 | * @param string width of the image |
| 185 | + * @param string $value |
|
| 184 | 186 | */ |
| 185 | 187 | public function setImageWidth($value) |
| 186 | 188 | { |
@@ -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 | } |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $isEnabled=$this->getEnabled(true); |
| 48 | 48 | if($this->getEnabled() && !$isEnabled) |
| 49 | - $writer->addAttribute('disabled','disabled'); |
|
| 49 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 50 | 50 | parent::addAttributesToRender($writer); |
| 51 | 51 | if(($url=$this->getNavigateUrl())!=='' && $isEnabled) |
| 52 | - $writer->addAttribute('href',$url); |
|
| 52 | + $writer->addAttribute('href', $url); |
|
| 53 | 53 | if(($target=$this->getTarget())!=='') |
| 54 | - $writer->addAttribute('target',$target); |
|
| 54 | + $writer->addAttribute('target', $target); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getText() |
| 106 | 106 | { |
| 107 | - return $this->getViewState('Text',''); |
|
| 107 | + return $this->getViewState('Text', ''); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function setText($value) |
| 115 | 115 | { |
| 116 | - $this->setViewState('Text',$value,''); |
|
| 116 | + $this->setViewState('Text', $value, ''); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function getImageAlign() |
| 123 | 123 | { |
| 124 | - return $this->getViewState('ImageAlign',''); |
|
| 124 | + return $this->getViewState('ImageAlign', ''); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function setImageAlign($value) |
| 135 | 135 | { |
| 136 | - $this->setViewState('ImageAlign',$value,''); |
|
| 136 | + $this->setViewState('ImageAlign', $value, ''); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function getImageHeight() |
| 143 | 143 | { |
| 144 | - return $this->getViewState('ImageHeight',''); |
|
| 144 | + return $this->getViewState('ImageHeight', ''); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function setImageHeight($value) |
| 152 | 152 | { |
| 153 | - $this->setViewSTate('ImageHeight',$value,''); |
|
| 153 | + $this->setViewSTate('ImageHeight', $value, ''); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | public function getImageUrl() |
| 160 | 160 | { |
| 161 | - return $this->getViewState('ImageUrl',''); |
|
| 161 | + return $this->getViewState('ImageUrl', ''); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | public function setImageUrl($value) |
| 169 | 169 | { |
| 170 | - $this->setViewState('ImageUrl',$value,''); |
|
| 170 | + $this->setViewState('ImageUrl', $value, ''); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function getImageWidth() |
| 177 | 177 | { |
| 178 | - return $this->getViewState('ImageWidth',''); |
|
| 178 | + return $this->getViewState('ImageWidth', ''); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function setImageWidth($value) |
| 186 | 186 | { |
| 187 | - $this->setViewState('ImageWidth',$value,''); |
|
| 187 | + $this->setViewState('ImageWidth', $value, ''); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function getNavigateUrl() |
| 194 | 194 | { |
| 195 | - return $this->getViewState('NavigateUrl',''); |
|
| 195 | + return $this->getViewState('NavigateUrl', ''); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function setNavigateUrl($value) |
| 203 | 203 | { |
| 204 | - $this->setViewState('NavigateUrl',$value,''); |
|
| 204 | + $this->setViewState('NavigateUrl', $value, ''); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | */ |
| 236 | 236 | public function getTarget() |
| 237 | 237 | { |
| 238 | - return $this->getViewState('Target',''); |
|
| 238 | + return $this->getViewState('Target', ''); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | */ |
| 245 | 245 | public function setTarget($value) |
| 246 | 246 | { |
| 247 | - $this->setViewState('Target',$value,''); |
|
| 247 | + $this->setViewState('Target', $value, ''); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |