@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * @var TCallbackResponseWriter[] list of writers. |
| 35 | 35 | */ |
| 36 | - private $_writers = []; |
|
| 36 | + private $_writers=[]; |
|
| 37 | 37 | /** |
| 38 | 38 | * @var mixed callback response data. |
| 39 | 39 | */ |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function createNewHtmlWriter($type, $response) |
| 51 | 51 | { |
| 52 | - $writer = new TCallbackResponseWriter(); |
|
| 53 | - $this->_writers[] = $writer; |
|
| 52 | + $writer=new TCallbackResponseWriter(); |
|
| 53 | + $this->_writers[]=$writer; |
|
| 54 | 54 | return parent::createNewHtmlWriter($type, $writer); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function setResponseData($data) |
| 71 | 71 | { |
| 72 | - $this->_data = $data; |
|
| 72 | + $this->_data=$data; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -86,9 +86,9 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function httpRedirect($url) |
| 88 | 88 | { |
| 89 | - if($url[0] === '/') |
|
| 90 | - $url = $this->getRequest()->getBaseUrl() . $url; |
|
| 91 | - $this->_redirectUrl = str_replace('&', '&', $url); |
|
| 89 | + if($url[0]==='/') |
|
| 90 | + $url=$this->getRequest()->getBaseUrl().$url; |
|
| 91 | + $this->_redirectUrl=str_replace('&', '&', $url); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | protected function createListItemCollection() |
| 88 | 88 | { |
| 89 | - $collection = new TActiveListItemCollection; |
|
| 89 | + $collection=new TActiveListItemCollection; |
|
| 90 | 90 | $collection->setControl($this); |
| 91 | 91 | return $collection; |
| 92 | 92 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | parent::addAttributesToRender($writer); |
| 109 | 109 | $writer->addAttribute('id', $this->getClientID()); |
| 110 | - if ($this->getAutoPostBack()) |
|
| 110 | + if($this->getAutoPostBack()) |
|
| 111 | 111 | $this->getActiveControl()->registerCallbackClientScript( |
| 112 | 112 | $this->getClientClassName(), $this->getPostBackOptions()); |
| 113 | 113 | } |
@@ -36,20 +36,20 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | class TActiveEditCommandColumn extends TEditCommandColumn { |
| 38 | 38 | protected function createButton($commandName, $text, $causesValidation, $validationGroup) { |
| 39 | - if($this->getButtonType() === TButtonColumnType::LinkButton) |
|
| 40 | - $button = new TActiveLinkButton; |
|
| 41 | - elseif($this->getButtonType() === TButtonColumnType::PushButton) |
|
| 42 | - $button = new TActiveButton; |
|
| 39 | + if($this->getButtonType()===TButtonColumnType::LinkButton) |
|
| 40 | + $button=new TActiveLinkButton; |
|
| 41 | + elseif($this->getButtonType()===TButtonColumnType::PushButton) |
|
| 42 | + $button=new TActiveButton; |
|
| 43 | 43 | else // image buttons |
| 44 | 44 | { |
| 45 | - $button = new TActiveImageButton; |
|
| 45 | + $button=new TActiveImageButton; |
|
| 46 | 46 | $button->setToolTip($text); |
| 47 | - if(strcasecmp($commandName, 'Update') === 0) |
|
| 48 | - $url = $this->getUpdateImageUrl(); |
|
| 49 | - elseif(strcasecmp($commandName, 'Cancel') === 0) |
|
| 50 | - $url = $this->getCancelImageUrl(); |
|
| 47 | + if(strcasecmp($commandName, 'Update')===0) |
|
| 48 | + $url=$this->getUpdateImageUrl(); |
|
| 49 | + elseif(strcasecmp($commandName, 'Cancel')===0) |
|
| 50 | + $url=$this->getCancelImageUrl(); |
|
| 51 | 51 | else |
| 52 | - $url = $this->getEditImageUrl(); |
|
| 52 | + $url=$this->getEditImageUrl(); |
|
| 53 | 53 | $button->setImageUrl($url); |
| 54 | 54 | } |
| 55 | 55 | $button->setText($text); |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | */ |
| 90 | 90 | public function getObserveChanges() |
| 91 | 91 | { |
| 92 | - $changes = $this->getOption('ObserveChanges'); |
|
| 93 | - return ($changes === null) ? true : $changes; |
|
| 92 | + $changes=$this->getOption('ObserveChanges'); |
|
| 93 | + return ($changes===null) ? true : $changes; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | \ No newline at end of file |
@@ -35,16 +35,16 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | protected function initializeHeaderCell($cell, $columnIndex) |
| 37 | 37 | { |
| 38 | - $text = $this->getHeaderText(); |
|
| 38 | + $text=$this->getHeaderText(); |
|
| 39 | 39 | |
| 40 | - if(($classPath = $this->getHeaderRenderer()) !== '') |
|
| 40 | + if(($classPath=$this->getHeaderRenderer())!=='') |
|
| 41 | 41 | { |
| 42 | - $control = Prado::createComponent($classPath); |
|
| 42 | + $control=Prado::createComponent($classPath); |
|
| 43 | 43 | if($control instanceof \Prado\IDataRenderer) |
| 44 | 44 | { |
| 45 | 45 | if($control instanceof IItemDataRenderer) |
| 46 | 46 | { |
| 47 | - $item = $cell->getParent(); |
|
| 47 | + $item=$cell->getParent(); |
|
| 48 | 48 | $control->setItemIndex($item->getItemIndex()); |
| 49 | 49 | $control->setItemType($item->getItemType()); |
| 50 | 50 | } |
@@ -54,21 +54,21 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | elseif($this->getAllowSorting()) |
| 56 | 56 | { |
| 57 | - $sortExpression = $this->getSortExpression(); |
|
| 58 | - if(($url = $this->getHeaderImageUrl()) !== '') |
|
| 57 | + $sortExpression=$this->getSortExpression(); |
|
| 58 | + if(($url=$this->getHeaderImageUrl())!=='') |
|
| 59 | 59 | { |
| 60 | - $button = new TActiveImageButton; |
|
| 60 | + $button=new TActiveImageButton; |
|
| 61 | 61 | $button->setImageUrl($url); |
| 62 | 62 | $button->setCommandName(TDataGrid::CMD_SORT); |
| 63 | 63 | $button->setCommandParameter($sortExpression); |
| 64 | - if($text !== '') |
|
| 64 | + if($text!=='') |
|
| 65 | 65 | $button->setAlternateText($text); |
| 66 | 66 | $button->setCausesValidation(false); |
| 67 | 67 | $cell->getControls()->add($button); |
| 68 | 68 | } |
| 69 | - elseif($text !== '') |
|
| 69 | + elseif($text!=='') |
|
| 70 | 70 | { |
| 71 | - $button = new TActiveLinkButton; |
|
| 71 | + $button=new TActiveLinkButton; |
|
| 72 | 72 | $button->setText($text); |
| 73 | 73 | $button->setCommandName(TDataGrid::CMD_SORT); |
| 74 | 74 | $button->setCommandParameter($sortExpression); |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | else |
| 82 | 82 | { |
| 83 | - if(($url = $this->getHeaderImageUrl()) !== '') |
|
| 83 | + if(($url=$this->getHeaderImageUrl())!=='') |
|
| 84 | 84 | { |
| 85 | - $image = new TActiveImage; |
|
| 85 | + $image=new TActiveImage; |
|
| 86 | 86 | $image->setImageUrl($url); |
| 87 | - if($text !== '') |
|
| 87 | + if($text!=='') |
|
| 88 | 88 | $image->setAlternateText($text); |
| 89 | 89 | $cell->getControls()->add($image); |
| 90 | 90 | } |
| 91 | - elseif($text !== '') |
|
| 91 | + elseif($text!=='') |
|
| 92 | 92 | $cell->setText($text); |
| 93 | 93 | else |
| 94 | 94 | $cell->setText(' '); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function setDisplayTextBox($value) |
| 82 | 82 | { |
| 83 | - $value = TPropertyValue::ensureBoolean($value); |
|
| 83 | + $value=TPropertyValue::ensureBoolean($value); |
|
| 84 | 84 | $this->setViewState('DisplayTextBox', $value, false); |
| 85 | 85 | if($this->getActiveControl()->canUpdateClientSide()) |
| 86 | 86 | $this->callClientFunction('setDisplayTextBox', $value); |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | protected function callClientFunction($func, $value) |
| 103 | 103 | { |
| 104 | - $client = $this->getPage()->getCallbackClient(); |
|
| 105 | - $code = $this->getClientClassName() . '.' . $func; |
|
| 106 | - $client->callClientFunction($code, [$this,$value]); |
|
| 104 | + $client=$this->getPage()->getCallbackClient(); |
|
| 105 | + $code=$this->getClientClassName().'.'.$func; |
|
| 106 | + $client->callClientFunction($code, [$this, $value]); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | protected function getExternalControlID() |
| 129 | 129 | { |
| 130 | - $extID = $this->getEditTriggerControlID(); |
|
| 131 | - if($extID === null) return ''; |
|
| 132 | - if(($control = $this->findControl($extID)) !== null) |
|
| 130 | + $extID=$this->getEditTriggerControlID(); |
|
| 131 | + if($extID===null) return ''; |
|
| 132 | + if(($control=$this->findControl($extID))!==null) |
|
| 133 | 133 | return $control->getClientID(); |
| 134 | 134 | return $extID; |
| 135 | 135 | } |
@@ -141,13 +141,13 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function setText($value) |
| 143 | 143 | { |
| 144 | - if(TTextBox::getText() === $value) |
|
| 144 | + if(TTextBox::getText()===$value) |
|
| 145 | 145 | return; |
| 146 | 146 | |
| 147 | 147 | TTextBox::setText($value); |
| 148 | 148 | if($this->getActiveControl()->canUpdateClientSide()) |
| 149 | 149 | { |
| 150 | - $client = $this->getPage()->getCallbackClient(); |
|
| 150 | + $client=$this->getPage()->getCallbackClient(); |
|
| 151 | 151 | $client->update($this->getLabelClientID(), $value); |
| 152 | 152 | $client->setValue($this, $value); |
| 153 | 153 | } |
@@ -158,14 +158,14 @@ discard block |
||
| 158 | 158 | * @param boolean value |
| 159 | 159 | * @since 3.1.2 |
| 160 | 160 | */ |
| 161 | - public function setReadOnly ($value) |
|
| 161 | + public function setReadOnly($value) |
|
| 162 | 162 | { |
| 163 | - $value = TPropertyValue::ensureBoolean($value); |
|
| 164 | - if(TTextBox::getReadOnly() === $value) |
|
| 163 | + $value=TPropertyValue::ensureBoolean($value); |
|
| 164 | + if(TTextBox::getReadOnly()===$value) |
|
| 165 | 165 | return; |
| 166 | 166 | |
| 167 | 167 | TTextBox::setReadOnly($value); |
| 168 | - if ($this->getActiveControl()->canUpdateClientSide()) |
|
| 168 | + if($this->getActiveControl()->canUpdateClientSide()) |
|
| 169 | 169 | { |
| 170 | 170 | $this->callClientFunction('setReadOnly', $value); |
| 171 | 171 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | public function renderContents($writer) |
| 187 | 187 | { |
| 188 | - if(($text = $this->getText()) === '') |
|
| 188 | + if(($text=$this->getText())==='') |
|
| 189 | 189 | parent::renderContents($writer); |
| 190 | 190 | else |
| 191 | 191 | $writer->write($text); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | protected function getLabelClientID() |
| 198 | 198 | { |
| 199 | - return $this->getClientID() . '__label'; |
|
| 199 | + return $this->getClientID().'__label'; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -208,10 +208,10 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | public function onCallback($param) |
| 210 | 210 | { |
| 211 | - $action = $param->getCallbackParameter(); |
|
| 212 | - if(is_array($action) && $action[0] === '__InlineEditor_loadExternalText__') |
|
| 211 | + $action=$param->getCallbackParameter(); |
|
| 212 | + if(is_array($action) && $action[0]==='__InlineEditor_loadExternalText__') |
|
| 213 | 213 | { |
| 214 | - $parameter = new TCallbackEventParameter($this->getResponse(), $action[1]); |
|
| 214 | + $parameter=new TCallbackEventParameter($this->getResponse(), $action[1]); |
|
| 215 | 215 | $this->onLoadingText($parameter); |
| 216 | 216 | } |
| 217 | 217 | $this->raiseEvent('OnCallback', $this, $param); |
@@ -222,28 +222,28 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | protected function getPostBackOptions() |
| 224 | 224 | { |
| 225 | - $options = parent::getPostBackOptions(); |
|
| 226 | - $options['ID'] = $this->getLabelClientID(); |
|
| 227 | - $options['TextBoxID'] = $this->getClientID(); |
|
| 228 | - $options['ExternalControl'] = $this->getExternalControlID(); |
|
| 229 | - $options['AutoHide'] = $this->getAutoHideTextBox() == false ? '' : true; |
|
| 230 | - $options['AutoPostBack'] = $this->getAutoPostBack() == false ? '' : true; |
|
| 231 | - $options['Columns'] = $this->getColumns(); |
|
| 232 | - if($this->getTextMode() === 'MultiLine') |
|
| 225 | + $options=parent::getPostBackOptions(); |
|
| 226 | + $options['ID']=$this->getLabelClientID(); |
|
| 227 | + $options['TextBoxID']=$this->getClientID(); |
|
| 228 | + $options['ExternalControl']=$this->getExternalControlID(); |
|
| 229 | + $options['AutoHide']=$this->getAutoHideTextBox()==false ? '' : true; |
|
| 230 | + $options['AutoPostBack']=$this->getAutoPostBack()==false ? '' : true; |
|
| 231 | + $options['Columns']=$this->getColumns(); |
|
| 232 | + if($this->getTextMode()==='MultiLine') |
|
| 233 | 233 | { |
| 234 | - $options['Rows'] = $this->getRows(); |
|
| 235 | - $options['Wrap'] = $this->getWrap() == false ? '' : true; |
|
| 234 | + $options['Rows']=$this->getRows(); |
|
| 235 | + $options['Wrap']=$this->getWrap()==false ? '' : true; |
|
| 236 | 236 | } |
| 237 | 237 | else |
| 238 | 238 | { |
| 239 | - $length = $this->getMaxLength(); |
|
| 240 | - $options['MaxLength'] = $length > 0 ? $length : ''; |
|
| 239 | + $length=$this->getMaxLength(); |
|
| 240 | + $options['MaxLength']=$length > 0 ? $length : ''; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | if($this->hasEventHandler('OnLoadingText')) |
| 244 | - $options['LoadTextOnEdit'] = true; |
|
| 244 | + $options['LoadTextOnEdit']=true; |
|
| 245 | 245 | |
| 246 | - $options['ReadOnly'] = $this->getReadOnly(); |
|
| 246 | + $options['ReadOnly']=$this->getReadOnly(); |
|
| 247 | 247 | return $options; |
| 248 | 248 | } |
| 249 | 249 | |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | protected function registerClientScript() |
| 296 | 296 | { |
| 297 | - $cs = $this->getPage()->getClientScript(); |
|
| 297 | + $cs=$this->getPage()->getClientScript(); |
|
| 298 | 298 | $cs->registerPradoScript('inlineeditor'); |
| 299 | 299 | } |
| 300 | 300 | } |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | $this->updateListItems(); |
| 50 | 50 | // if a prompt is set, we mimic the postback behaviour of not counting it |
| 51 | 51 | // in the index. We assume the prompt is _always_ the first item (Issue #368) |
| 52 | - $promptValue = $this->getControl()->getPromptValue(); |
|
| 53 | - if($promptValue === '') |
|
| 54 | - $promptValue = $this->getControl()->getPromptText(); |
|
| 55 | - if($promptValue !== '') |
|
| 52 | + $promptValue=$this->getControl()->getPromptValue(); |
|
| 53 | + if($promptValue==='') |
|
| 54 | + $promptValue=$this->getControl()->getPromptText(); |
|
| 55 | + if($promptValue!=='') |
|
| 56 | 56 | $index++; |
| 57 | 57 | |
| 58 | 58 | if($index >= 0 && $index <= $this->getControl()->getItemCount()) |
@@ -70,20 +70,20 @@ discard block |
||
| 70 | 70 | if($this->canUpdateClientSide()) |
| 71 | 71 | { |
| 72 | 72 | $this->updateListItems(); |
| 73 | - $n = $this->getControl()->getItemCount(); |
|
| 73 | + $n=$this->getControl()->getItemCount(); |
|
| 74 | 74 | |
| 75 | - $promptValue = $this->getControl()->getPromptValue(); |
|
| 76 | - if($promptValue === '') |
|
| 77 | - $promptValue = $this->getControl()->getPromptText(); |
|
| 75 | + $promptValue=$this->getControl()->getPromptValue(); |
|
| 76 | + if($promptValue==='') |
|
| 77 | + $promptValue=$this->getControl()->getPromptText(); |
|
| 78 | 78 | |
| 79 | - $list = []; |
|
| 79 | + $list=[]; |
|
| 80 | 80 | foreach($indices as $index) |
| 81 | 81 | { |
| 82 | - $index = intval($index); |
|
| 83 | - if($promptValue !== '') |
|
| 82 | + $index=intval($index); |
|
| 83 | + if($promptValue!=='') |
|
| 84 | 84 | $index++; |
| 85 | 85 | if($index >= 0 && $index <= $n) |
| 86 | - $list[] = $index; |
|
| 86 | + $list[]=$index; |
|
| 87 | 87 | } |
| 88 | 88 | if(count($list) > 0) |
| 89 | 89 | $this->getPage()->getCallbackClient()->select( |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | if($this->canUpdateClientSide()) |
| 115 | 115 | { |
| 116 | 116 | $this->updateListItems(); |
| 117 | - $list = []; |
|
| 117 | + $list=[]; |
|
| 118 | 118 | foreach($values as $value) |
| 119 | - $list[] = $value; |
|
| 119 | + $list[]=$value; |
|
| 120 | 120 | if(count($list) > 0) |
| 121 | 121 | $this->getPage()->getCallbackClient()->select( |
| 122 | 122 | $this->getControl(), 'Values', $list); |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | { |
| 150 | 150 | if($this->canUpdateClientSide()) |
| 151 | 151 | { |
| 152 | - $items = $this->getControl()->getItems(); |
|
| 152 | + $items=$this->getControl()->getItems(); |
|
| 153 | 153 | if($items instanceof TActiveListItemCollection |
| 154 | 154 | && $items->getListHasChanged()) |
| 155 | 155 | { |
@@ -34,16 +34,16 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | protected function initializeHeaderCell($cell, $columnIndex) |
| 36 | 36 | { |
| 37 | - $text = $this->getHeaderText(); |
|
| 37 | + $text=$this->getHeaderText(); |
|
| 38 | 38 | |
| 39 | - if(($classPath = $this->getHeaderRenderer()) !== '') |
|
| 39 | + if(($classPath=$this->getHeaderRenderer())!=='') |
|
| 40 | 40 | { |
| 41 | - $control = Prado::createComponent($classPath); |
|
| 41 | + $control=Prado::createComponent($classPath); |
|
| 42 | 42 | if($control instanceof \Prado\IDataRenderer) |
| 43 | 43 | { |
| 44 | 44 | if($control instanceof IItemDataRenderer) |
| 45 | 45 | { |
| 46 | - $item = $cell->getParent(); |
|
| 46 | + $item=$cell->getParent(); |
|
| 47 | 47 | $control->setItemIndex($item->getItemIndex()); |
| 48 | 48 | $control->setItemType($item->getItemType()); |
| 49 | 49 | } |
@@ -53,21 +53,21 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | elseif($this->getAllowSorting()) |
| 55 | 55 | { |
| 56 | - $sortExpression = $this->getSortExpression(); |
|
| 57 | - if(($url = $this->getHeaderImageUrl()) !== '') |
|
| 56 | + $sortExpression=$this->getSortExpression(); |
|
| 57 | + if(($url=$this->getHeaderImageUrl())!=='') |
|
| 58 | 58 | { |
| 59 | - $button = new TActiveImageButton; |
|
| 59 | + $button=new TActiveImageButton; |
|
| 60 | 60 | $button->setImageUrl($url); |
| 61 | 61 | $button->setCommandName(TDataGrid::CMD_SORT); |
| 62 | 62 | $button->setCommandParameter($sortExpression); |
| 63 | - if($text !== '') |
|
| 63 | + if($text!=='') |
|
| 64 | 64 | $button->setAlternateText($text); |
| 65 | 65 | $button->setCausesValidation(false); |
| 66 | 66 | $cell->getControls()->add($button); |
| 67 | 67 | } |
| 68 | - elseif($text !== '') |
|
| 68 | + elseif($text!=='') |
|
| 69 | 69 | { |
| 70 | - $button = new TActiveLinkButton; |
|
| 70 | + $button=new TActiveLinkButton; |
|
| 71 | 71 | $button->setText($text); |
| 72 | 72 | $button->setCommandName(TDataGrid::CMD_SORT); |
| 73 | 73 | $button->setCommandParameter($sortExpression); |
@@ -79,15 +79,15 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | else |
| 81 | 81 | { |
| 82 | - if(($url = $this->getHeaderImageUrl()) !== '') |
|
| 82 | + if(($url=$this->getHeaderImageUrl())!=='') |
|
| 83 | 83 | { |
| 84 | - $image = new TActiveImage; |
|
| 84 | + $image=new TActiveImage; |
|
| 85 | 85 | $image->setImageUrl($url); |
| 86 | - if($text !== '') |
|
| 86 | + if($text!=='') |
|
| 87 | 87 | $image->setAlternateText($text); |
| 88 | 88 | $cell->getControls()->add($image); |
| 89 | 89 | } |
| 90 | - elseif($text !== '') |
|
| 90 | + elseif($text!=='') |
|
| 91 | 91 | $cell->setText($text); |
| 92 | 92 | else |
| 93 | 93 | $cell->setText(' '); |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | protected function getDatePickerOptions() |
| 66 | 66 | { |
| 67 | - $options = parent::getDatePickerOptions(); |
|
| 68 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
| 69 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
| 70 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 71 | - $options['ShowCalendar'] = $this->getShowCalendar(); |
|
| 72 | - $options['AutoPostBack'] = $this->getAutoPostBack(); |
|
| 67 | + $options=parent::getDatePickerOptions(); |
|
| 68 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
| 69 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
| 70 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 71 | + $options['ShowCalendar']=$this->getShowCalendar(); |
|
| 72 | + $options['AutoPostBack']=$this->getAutoPostBack(); |
|
| 73 | 73 | return $options; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * @return TBaseActiveCallbackControl standard callback control options. |
| 89 | 89 | */ |
| 90 | - public function getActiveControl(){ |
|
| 90 | + public function getActiveControl() { |
|
| 91 | 91 | return $this->getAdapter()->getBaseActiveControl(); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -95,22 +95,22 @@ discard block |
||
| 95 | 95 | * Client-side Text property can only be updated after the OnLoad stage. |
| 96 | 96 | * @param string text content for the textbox |
| 97 | 97 | */ |
| 98 | - public function setText($value){ |
|
| 99 | - if(parent::getText() === $value) |
|
| 98 | + public function setText($value) { |
|
| 99 | + if(parent::getText()===$value) |
|
| 100 | 100 | return; |
| 101 | 101 | |
| 102 | 102 | parent::setText($value); |
| 103 | - if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){ |
|
| 104 | - $cb = $this->getPage()->getCallbackClient(); |
|
| 103 | + if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) { |
|
| 104 | + $cb=$this->getPage()->getCallbackClient(); |
|
| 105 | 105 | $cb->setValue($this, $value); |
| 106 | - if ($this->getInputMode() == TDatePickerInputMode::DropDownList) |
|
| 106 | + if($this->getInputMode()==TDatePickerInputMode::DropDownList) |
|
| 107 | 107 | { |
| 108 | - $dt = new \DateTime; |
|
| 108 | + $dt=new \DateTime; |
|
| 109 | 109 | $dt->setTimeStamp($this->getTimeStampFromText()); |
| 110 | - $id = $this->getClientID(); |
|
| 111 | - $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'day', 'Value', $dt->format('j'), 'select'); |
|
| 112 | - $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'month', 'Value', $dt->format('n') - 1, 'select'); |
|
| 113 | - $cb->select($id . TControl::CLIENT_ID_SEPARATOR . 'year', 'Value', $dt->format('Y'), 'select'); |
|
| 110 | + $id=$this->getClientID(); |
|
| 111 | + $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $dt->format('j'), 'select'); |
|
| 112 | + $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $dt->format('n') - 1, 'select'); |
|
| 113 | + $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $dt->format('Y'), 'select'); |
|
| 114 | 114 | |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * This method is mainly used by framework and control developers. |
| 123 | 123 | * @param TCallbackEventParameter the event parameter |
| 124 | 124 | */ |
| 125 | - public function raiseCallbackEvent($param){ |
|
| 125 | + public function raiseCallbackEvent($param) { |
|
| 126 | 126 | $this->onCallback($param); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * handler can be invoked. |
| 134 | 134 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
| 135 | 135 | */ |
| 136 | - public function onCallback($param){ |
|
| 136 | + public function onCallback($param) { |
|
| 137 | 137 | $this->raiseEvent('OnCallback', $this, $param); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -143,23 +143,23 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | protected function registerCalendarClientScriptPre() |
| 145 | 145 | { |
| 146 | - $cs = $this->getPage()->getClientScript(); |
|
| 146 | + $cs=$this->getPage()->getClientScript(); |
|
| 147 | 147 | $cs->registerPradoScript("activedatepicker"); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | protected function renderClientControlScript($writer) |
| 151 | 151 | { |
| 152 | - $cs = $this->getPage()->getClientScript(); |
|
| 152 | + $cs=$this->getPage()->getClientScript(); |
|
| 153 | 153 | if(!$cs->isEndScriptRegistered('TDatePicker.spacer')) |
| 154 | 154 | { |
| 155 | - $spacer = $this->getAssetUrl('spacer.gif'); |
|
| 156 | - $code = "Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 155 | + $spacer=$this->getAssetUrl('spacer.gif'); |
|
| 156 | + $code="Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 157 | 157 | $cs->registerEndScript('TDatePicker.spacer', $code); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $options = TJavaScript::encode($this->getDatePickerOptions()); |
|
| 161 | - $code = "new Prado.WebUI.TActiveDatePicker($options);"; |
|
| 162 | - $cs->registerEndScript("prado:" . $this->getClientID(), $code); |
|
| 160 | + $options=TJavaScript::encode($this->getDatePickerOptions()); |
|
| 161 | + $code="new Prado.WebUI.TActiveDatePicker($options);"; |
|
| 162 | + $cs->registerEndScript("prado:".$this->getClientID(), $code); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |