@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * Set the handle id or css class |
| 33 | 33 | * @param string |
| 34 | 34 | */ |
| 35 | - public function setHandle ($value) |
|
| 35 | + public function setHandle($value) |
|
| 36 | 36 | { |
| 37 | 37 | $this->setViewState('DragHandle', TPropertyValue::ensureString($value), null); |
| 38 | 38 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * Get the handle id or css class |
| 42 | 42 | * @return string |
| 43 | 43 | */ |
| 44 | - public function getHandle () |
|
| 44 | + public function getHandle() |
|
| 45 | 45 | { |
| 46 | 46 | return $this->getViewState('DragHandle', null); |
| 47 | 47 | } |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function setRevert($value) |
| 73 | 73 | { |
| 74 | - if (strcasecmp($value,'true')==0 || $value===true) |
|
| 74 | + if(strcasecmp($value, 'true')==0 || $value===true) |
|
| 75 | 75 | $value=TDraggableRevertOptions::Revert; |
| 76 | - elseif (strcasecmp($value,'false')==0 || $value===false) |
|
| 76 | + elseif(strcasecmp($value, 'false')==0 || $value===false) |
|
| 77 | 77 | $value=TDraggableRevertOptions::None; |
| 78 | 78 | $this->setViewState('Revert', TPropertyValue::ensureEnum($value, 'TDraggableRevertOptions'), true); |
| 79 | 79 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return TDraggableGhostingOption to clone the element |
| 92 | 92 | */ |
| 93 | - public function getGhosting () |
|
| 93 | + public function getGhosting() |
|
| 94 | 94 | { |
| 95 | 95 | return $this->getViewState('Ghosting', TDraggableGhostingOptions::None); |
| 96 | 96 | } |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | * o "False" or "None" means no Ghosting options |
| 108 | 108 | * |
| 109 | 109 | */ |
| 110 | - public function setGhosting ($value) |
|
| 110 | + public function setGhosting($value) |
|
| 111 | 111 | { |
| 112 | - if (strcasecmp($value,'true')==0 || $value===true) |
|
| 112 | + if(strcasecmp($value, 'true')==0 || $value===true) |
|
| 113 | 113 | $value=TDraggableGhostingOptions::Ghosting; |
| 114 | - elseif (strcasecmp($value,'false')==0 || $value===false) |
|
| 114 | + elseif(strcasecmp($value, 'false')==0 || $value===false) |
|
| 115 | 115 | $value=TDraggableGhostingOptions::None; |
| 116 | 116 | $this->setViewState('Ghosting', TPropertyValue::ensureEnum($value, 'TDraggableGhostingOptions'), TDraggableGhostingOptions::None); |
| 117 | 117 | } |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | parent::addAttributesToRender($writer); |
| 155 | 155 | |
| 156 | 156 | $cs=$this->getPage()->getClientScript(); |
| 157 | - if ($this->getGhosting()==TDraggableGhostingOptions::SuperGhosting) |
|
| 157 | + if($this->getGhosting()==TDraggableGhostingOptions::SuperGhosting) |
|
| 158 | 158 | $cs->registerPradoScript('dragdropextra'); |
| 159 | 159 | else |
| 160 | 160 | $cs->registerPradoScript('dragdrop'); |
| 161 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 161 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 162 | 162 | $options=TJavascript::encode($this->getPostBackOptions()); |
| 163 | 163 | $class=$this->getClientClassName(); |
| 164 | 164 | $code="new {$class}('{$this->getClientId()}', {$options}) "; |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * This method overrides the parent implementation. |
| 171 | 171 | * @return string the javascript class name |
| 172 | 172 | */ |
| 173 | - protected function getClientClassName () |
|
| 173 | + protected function getClientClassName() |
|
| 174 | 174 | { |
| 175 | 175 | return 'Draggable'; |
| 176 | 176 | } |
@@ -181,17 +181,17 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | protected function getPostBackOptions() |
| 183 | 183 | { |
| 184 | - $options['ID'] = $this->getClientID(); |
|
| 184 | + $options['ID']=$this->getClientID(); |
|
| 185 | 185 | |
| 186 | - if (($handle=$this->getHandle())!== null) $options['handle']=$handle; |
|
| 187 | - if (($revert=$this->getRevert())===TDraggableRevertOptions::None) |
|
| 186 | + if(($handle=$this->getHandle())!==null) $options['handle']=$handle; |
|
| 187 | + if(($revert=$this->getRevert())===TDraggableRevertOptions::None) |
|
| 188 | 188 | $options['revert']=false; |
| 189 | - elseif ($revert==TDraggableRevertOptions::Revert) |
|
| 189 | + elseif($revert==TDraggableRevertOptions::Revert) |
|
| 190 | 190 | $options['revert']=true; |
| 191 | 191 | else |
| 192 | 192 | $options['revert']=strtolower($revert); |
| 193 | - if (($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint); |
|
| 194 | - switch ($this->getGhosting()) |
|
| 193 | + if(($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint); |
|
| 194 | + switch($this->getGhosting()) |
|
| 195 | 195 | { |
| 196 | 196 | case TDraggableGhostingOptions::SuperGhosting: |
| 197 | 197 | $options['superghosting']=true; |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | public function getClientSide() |
| 37 | 37 | { |
| 38 | 38 | if($this->_clientSide===null) |
| 39 | - $this->_clientSide = $this->createClientSide(); |
|
| 39 | + $this->_clientSide=$this->createClientSide(); |
|
| 40 | 40 | return $this->_clientSide; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | protected function getTargetControl() |
| 46 | 46 | { |
| 47 | - $id = $this->getControlID(); |
|
| 47 | + $id=$this->getControlID(); |
|
| 48 | 48 | if(($control=$this->findControl($id)) instanceof TControl) |
| 49 | 49 | return $control->getClientID(); |
| 50 | 50 | if($id==='') |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function getTriggerOptions() |
| 62 | 62 | { |
| 63 | - $options['ID'] = $this->getClientID(); |
|
| 64 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 65 | - $options['ControlID'] = $this->getTargetControl(); |
|
| 63 | + $options['ID']=$this->getClientID(); |
|
| 64 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 65 | + $options['ControlID']=$this->getTargetControl(); |
|
| 66 | 66 | return $options; |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @param THtmlWriter the writer used for the rendering purpose |
| 61 | 61 | */ |
| 62 | 62 | protected function addAttributesToRender($writer) { |
| 63 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 63 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 64 | 64 | parent::addAttributesToRender($writer); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -77,17 +77,17 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | parent::render($writer); |
| 79 | 79 | if($this->getActiveControl()->canUpdateClientSide()) |
| 80 | - $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
|
| 80 | + $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
|
| 81 | 81 | } |
| 82 | 82 | else |
| 83 | 83 | { |
| 84 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
| 85 | - if ($this->getHasControls()) |
|
| 84 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
| 85 | + if($this->getHasControls()) |
|
| 86 | 86 | { |
| 87 | 87 | // If we update a TActivePanel on callback, |
| 88 | 88 | // We shouldn't update all childs, because the whole content will be replaced by |
| 89 | 89 | // the parent |
| 90 | - foreach ($this->findControlsByType('IActiveControl', false) as $control) |
|
| 90 | + foreach($this->findControlsByType('IActiveControl', false) as $control) |
|
| 91 | 91 | { |
| 92 | 92 | $control->getActiveControl()->setEnableUpdate(false); |
| 93 | 93 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | protected function createListItemCollection() |
| 84 | 84 | { |
| 85 | - $collection = new TActiveListItemCollection; |
|
| 85 | + $collection=new TActiveListItemCollection; |
|
| 86 | 86 | $collection->setControl($this); |
| 87 | 87 | return $collection; |
| 88 | 88 | } |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | protected function addAttributesToRender($writer) |
| 103 | 103 | { |
| 104 | 104 | parent::addAttributesToRender($writer); |
| 105 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 106 | - if ($this->getAutoPostBack()) |
|
| 105 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 106 | + if($this->getAutoPostBack()) |
|
| 107 | 107 | $this->getActiveControl()->registerCallbackClientScript( |
| 108 | 108 | $this->getClientClassName(), $this->getPostBackOptions()); |
| 109 | 109 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | */ |
| 265 | 265 | public function setEnablePageStateUpdate($value) |
| 266 | 266 | { |
| 267 | - $enabled = TPropertyValue::ensureBoolean($value); |
|
| 267 | + $enabled=TPropertyValue::ensureBoolean($value); |
|
| 268 | 268 | $this->setOption('EnablePageStateUpdate', $enabled); |
| 269 | 269 | } |
| 270 | 270 | |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | public function getEnablePageStateUpdate() |
| 276 | 276 | { |
| 277 | - $option = $this->getOption('EnablePageStateUpdate'); |
|
| 277 | + $option=$this->getOption('EnablePageStateUpdate'); |
|
| 278 | 278 | return ($option===null) ? true : $option; |
| 279 | 279 | } |
| 280 | 280 | |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | public function setPostBackTarget($value) |
| 293 | 293 | { |
| 294 | 294 | if($value instanceof TControl) |
| 295 | - $value = $value->getUniqueID(); |
|
| 295 | + $value=$value->getUniqueID(); |
|
| 296 | 296 | $this->setOption('EventTarget', $value); |
| 297 | 297 | } |
| 298 | 298 | |
@@ -47,8 +47,8 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | public function __construct($response, $parameter) |
| 49 | 49 | { |
| 50 | - $this->_response = $response; |
|
| 51 | - $this->_parameter = $parameter; |
|
| 50 | + $this->_response=$response; |
|
| 51 | + $this->_parameter=$parameter; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | parent::setDataSource($value); |
| 56 | 56 | if($this->getActiveControl()->canUpdateClientSide()) { |
| 57 | 57 | $this->renderPager(); |
| 58 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
| 58 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | if($this->getHasPreRendered()) { |
| 80 | 80 | $this->renderDataList($writer); |
| 81 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
| 81 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer); |
|
| 82 | 82 | } |
| 83 | 83 | else { |
| 84 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
| 84 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | if($item->ControlToPaginate==$this->ID) { |
| 99 | 99 | $writer=$this->getResponse()->createHtmlWriter(); |
| 100 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
| 100 | + $this->getPage()->getAdapter()->registerControlToRender($item, $writer); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | ); |
| 95 | 95 | |
| 96 | 96 | $this->getControls()->add($list); |
| 97 | - $list->setDataSource(range(1,$this->getPageCount())); |
|
| 97 | + $list->setDataSource(range(1, $this->getPageCount())); |
|
| 98 | 98 | $list->dataBind(); |
| 99 | 99 | $list->setSelectedIndex($this->getCurrentPageIndex()); |
| 100 | 100 | $list->setAutoPostBack(true); |
| 101 | - $list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged')); |
|
| 101 | + $list->attachEventHandler('OnSelectedIndexChanged', array($this, 'listIndexChanged')); |
|
| 102 | 102 | $list->attachEventHandler('OnCallback', array($this, 'handleCallback')); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @param string CommandParameter corresponding to the OnCommand event of the button |
| 115 | 115 | * @return mixed the button instance |
| 116 | 116 | */ |
| 117 | - protected function createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter) |
|
| 117 | + protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter) |
|
| 118 | 118 | { |
| 119 | 119 | if($buttonType===TPagerButtonType::LinkButton) |
| 120 | 120 | { |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | else if($buttonType===TPagerButtonType::ImageButton) |
| 132 | 132 | { |
| 133 | - $button = new TActiveImageButton; |
|
| 134 | - $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
|
| 133 | + $button=new TActiveImageButton; |
|
| 134 | + $button->setImageUrl($this->getPageImageUrl($text, $commandName)); |
|
| 135 | 135 | if($enabled) |
| 136 | - $button->Visible = true; |
|
| 136 | + $button->Visible=true; |
|
| 137 | 137 | else |
| 138 | - $button->Visible = false; |
|
| 138 | + $button->Visible=false; |
|
| 139 | 139 | } |
| 140 | 140 | else |
| 141 | 141 | { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if($buttonType===TPagerButtonType::ImageButton) |
| 148 | 148 | { |
| 149 | - $button->ImageUrl = $text; |
|
| 149 | + $button->ImageUrl=$text; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | $button->setText($text); |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | * @param mixed $sender |
| 171 | 171 | * @param TCallbackEventParameter $param |
| 172 | 172 | */ |
| 173 | - public function handleCallback ($sender,$param) |
|
| 173 | + public function handleCallback($sender, $param) |
|
| 174 | 174 | { |
| 175 | 175 | // Update all the buttons pagers attached to the same control. |
| 176 | 176 | // Dropdown pagers doesn't need to be re-rendered. |
| 177 | 177 | $controlToPaginate=$this->getControlToPaginate(); |
| 178 | - foreach ($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
| 178 | + foreach($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
| 179 | 179 | { |
| 180 | - if ($control->getMode() !== TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
| 180 | + if($control->getMode()!==TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
| 181 | 181 | { |
| 182 | 182 | $control->render($param->getNewWriter()); |
| 183 | 183 | // FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting |
@@ -189,18 +189,18 @@ discard block |
||
| 189 | 189 | $this->onCallback($param); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - public function render ($writer) |
|
| 192 | + public function render($writer) |
|
| 193 | 193 | { |
| 194 | 194 | if($this->getHasPreRendered()) |
| 195 | 195 | { |
| 196 | - $this->setDisplay(($this->getPageCount()==1)?TDisplayStyle::None:TDisplayStyle::Dynamic); |
|
| 196 | + $this->setDisplay(($this->getPageCount()==1) ? TDisplayStyle::None : TDisplayStyle::Dynamic); |
|
| 197 | 197 | TWebControl::render($writer); |
| 198 | 198 | if($this->getActiveControl()->canUpdateClientSide()) |
| 199 | - $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
|
| 199 | + $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
|
| 200 | 200 | } |
| 201 | 201 | else |
| 202 | 202 | { |
| 203 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
| 203 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | } |