@@ -112,8 +112,7 @@ |
||
| 112 | 112 | && strlen($datetime[1]) == 1) |
| 113 | 113 | { |
| 114 | 114 | $pattern = $datetime; |
| 115 | - } |
|
| 116 | - else //no subpattern, try the presets |
|
| 115 | + } else //no subpattern, try the presets |
|
| 117 | 116 | $pattern = $this->getPreset($string); |
| 118 | 117 | |
| 119 | 118 | //no presets found, use the string as the pattern |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | * A set of pattern presets and their respective formatting shorthand. |
| 71 | 71 | * @var array |
| 72 | 72 | */ |
| 73 | - static private $_patternPresets = array( |
|
| 74 | - 'fulldate'=>'P','full'=>'P', |
|
| 75 | - 'longdate'=>'D','long'=>'d', |
|
| 76 | - 'mediumdate'=>'p','medium'=>'p', |
|
| 77 | - 'shortdate'=>'d','short'=>'d', |
|
| 73 | + static private $_patternPresets=array( |
|
| 74 | + 'fulldate'=>'P', 'full'=>'P', |
|
| 75 | + 'longdate'=>'D', 'long'=>'d', |
|
| 76 | + 'mediumdate'=>'p', 'medium'=>'p', |
|
| 77 | + 'shortdate'=>'d', 'short'=>'d', |
|
| 78 | 78 | 'fulltime'=>'Q', 'longtime'=>'T', |
| 79 | 79 | 'mediumtime'=>'q', 'shorttime'=>'t'); |
| 80 | 80 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function setPattern($value) |
| 86 | 86 | { |
| 87 | - $this->setViewState('Pattern',$value,''); |
|
| 87 | + $this->setViewState('Pattern', $value, ''); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -93,35 +93,35 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function getPattern() |
| 95 | 95 | { |
| 96 | - $string = $this->getViewState('Pattern',''); |
|
| 96 | + $string=$this->getViewState('Pattern', ''); |
|
| 97 | 97 | |
| 98 | - $pattern = null; |
|
| 98 | + $pattern=null; |
|
| 99 | 99 | |
| 100 | 100 | //try the subpattern of "date time" presets |
| 101 | - $subpatterns = explode(' ',$string,2); |
|
| 102 | - $datetime = array(); |
|
| 101 | + $subpatterns=explode(' ', $string, 2); |
|
| 102 | + $datetime=array(); |
|
| 103 | 103 | if(count($subpatterns)==2) |
| 104 | 104 | { |
| 105 | - $datetime[] = $this->getPreset($subpatterns[0]); |
|
| 106 | - $datetime[] = $this->getPreset($subpatterns[1]); |
|
| 105 | + $datetime[]=$this->getPreset($subpatterns[0]); |
|
| 106 | + $datetime[]=$this->getPreset($subpatterns[1]); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | //we have a good subpattern |
| 110 | - if(count($datetime) == 2 |
|
| 111 | - && strlen($datetime[0]) == 1 |
|
| 112 | - && strlen($datetime[1]) == 1) |
|
| 110 | + if(count($datetime)==2 |
|
| 111 | + && strlen($datetime[0])==1 |
|
| 112 | + && strlen($datetime[1])==1) |
|
| 113 | 113 | { |
| 114 | - $pattern = $datetime; |
|
| 114 | + $pattern=$datetime; |
|
| 115 | 115 | } |
| 116 | 116 | else //no subpattern, try the presets |
| 117 | - $pattern = $this->getPreset($string); |
|
| 117 | + $pattern=$this->getPreset($string); |
|
| 118 | 118 | |
| 119 | 119 | //no presets found, use the string as the pattern |
| 120 | 120 | //and let the DateFormat handle it. |
| 121 | 121 | if($pattern===null) |
| 122 | - $pattern = $string; |
|
| 123 | - if (!is_array($pattern) && strlen($pattern) == 0) |
|
| 124 | - $pattern = null; |
|
| 122 | + $pattern=$string; |
|
| 123 | + if(!is_array($pattern) && strlen($pattern)==0) |
|
| 124 | + $pattern=null; |
|
| 125 | 125 | return $pattern; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -132,10 +132,10 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | protected function getPreset($string) |
| 134 | 134 | { |
| 135 | - $string = strtolower($string); |
|
| 135 | + $string=strtolower($string); |
|
| 136 | 136 | foreach(self::$_patternPresets as $pattern => $preset) |
| 137 | 137 | { |
| 138 | - if($string == $pattern) |
|
| 138 | + if($string==$pattern) |
|
| 139 | 139 | return $preset; |
| 140 | 140 | } |
| 141 | 141 | } |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function getValue() |
| 148 | 148 | { |
| 149 | - $value = $this->getViewState('Value',''); |
|
| 149 | + $value=$this->getViewState('Value', ''); |
|
| 150 | 150 | if(empty($value)) |
| 151 | 151 | { |
| 152 | - $defaultText = $this->getDefaultText(); |
|
| 152 | + $defaultText=$this->getDefaultText(); |
|
| 153 | 153 | if(empty($defaultText)) |
| 154 | 154 | return time(); |
| 155 | 155 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function setValue($value) |
| 164 | 164 | { |
| 165 | - $this->setViewState('Value',$value,''); |
|
| 165 | + $this->setViewState('Value', $value, ''); |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public function getDefaultText() |
| 173 | 173 | { |
| 174 | - return $this->getViewState('DefaultText',''); |
|
| 174 | + return $this->getViewState('DefaultText', ''); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function setDefaultText($value) |
| 182 | 182 | { |
| 183 | - $this->setViewState('DefaultText',$value,''); |
|
| 183 | + $this->setViewState('DefaultText', $value, ''); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /** |
@@ -217,29 +217,29 @@ discard block |
||
| 217 | 217 | */ |
| 218 | 218 | protected function getFormattedDate() |
| 219 | 219 | { |
| 220 | - $value = $this->getValue(); |
|
| 221 | - $defaultText = $this->getDefaultText(); |
|
| 220 | + $value=$this->getValue(); |
|
| 221 | + $defaultText=$this->getDefaultText(); |
|
| 222 | 222 | if(empty($value) && !empty($defaultText)) |
| 223 | 223 | return $this->getDefaultText(); |
| 224 | 224 | |
| 225 | - $app = $this->getApplication()->getGlobalization(); |
|
| 225 | + $app=$this->getApplication()->getGlobalization(); |
|
| 226 | 226 | |
| 227 | 227 | //initialized the default class wide formatter |
| 228 | 228 | if(self::$formatter===null) |
| 229 | - self::$formatter = new DateFormat($app->getCulture()); |
|
| 229 | + self::$formatter=new DateFormat($app->getCulture()); |
|
| 230 | 230 | |
| 231 | - $culture = $this->getCulture(); |
|
| 231 | + $culture=$this->getCulture(); |
|
| 232 | 232 | |
| 233 | 233 | //return the specific cultural formatted date time |
| 234 | - if(strlen($culture) && $app->getCulture() !== $culture) |
|
| 234 | + if(strlen($culture) && $app->getCulture()!==$culture) |
|
| 235 | 235 | { |
| 236 | - $formatter = new DateFormat($culture); |
|
| 236 | + $formatter=new DateFormat($culture); |
|
| 237 | 237 | return $formatter->format($value, |
| 238 | 238 | $this->getPattern(), |
| 239 | 239 | $this->getCharset()); |
| 240 | 240 | } |
| 241 | 241 | //return the application wide culture formatted date time. |
| 242 | - $result = self::$formatter->format($value, |
|
| 242 | + $result=self::$formatter->format($value, |
|
| 243 | 243 | $this->getPattern(), |
| 244 | 244 | $this->getCharset()); |
| 245 | 245 | return $result; |
@@ -120,11 +120,9 @@ |
||
| 120 | 120 | { |
| 121 | 121 | $this->setChecked(true); |
| 122 | 122 | return true; |
| 123 | - } |
|
| 124 | - else |
|
| 123 | + } else |
|
| 125 | 124 | return false; |
| 126 | - } |
|
| 127 | - else if($this->getChecked()) |
|
| 125 | + } else if($this->getChecked()) |
|
| 128 | 126 | $this->setChecked(false); |
| 129 | 127 | return false; |
| 130 | 128 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function __construct() |
| 77 | 77 | { |
| 78 | 78 | parent::__construct(); |
| 79 | - $this->_globalID = self::$_buttonCount++; |
|
| 79 | + $this->_globalID=self::$_buttonCount++; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | * @param array the input data collection |
| 109 | 109 | * @return boolean whether the data of the control has been changed |
| 110 | 110 | */ |
| 111 | - public function loadPostData($key,$values) |
|
| 111 | + public function loadPostData($key, $values) |
|
| 112 | 112 | { |
| 113 | 113 | $uniqueGroupName=$this->getUniqueGroupName(); |
| 114 | - $value=isset($values[$uniqueGroupName])?$values[$uniqueGroupName]:null; |
|
| 114 | + $value=isset($values[$uniqueGroupName]) ? $values[$uniqueGroupName] : null; |
|
| 115 | 115 | if($value!==null && $value===$this->getValueAttribute()) |
| 116 | 116 | { |
| 117 | 117 | if(!$this->getChecked()) |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function getGroupName() |
| 134 | 134 | { |
| 135 | - return $this->getViewState('GroupName',''); |
|
| 135 | + return $this->getViewState('GroupName', ''); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function setGroupName($value) |
| 145 | 145 | { |
| 146 | - $this->setViewState('GroupName',$value,''); |
|
| 146 | + $this->setViewState('GroupName', $value, ''); |
|
| 147 | 147 | $this->_uniqueGroupName=null; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function getUniqueGroupName() |
| 154 | 154 | { |
| 155 | - if(($groupName=$this->getViewState('UniqueGroupName',''))!=='') |
|
| 155 | + if(($groupName=$this->getViewState('UniqueGroupName', ''))!=='') |
|
| 156 | 156 | return $groupName; |
| 157 | 157 | else if(($uniqueID=$this->getUniqueID())!==$this->_previousUniqueID || $this->_uniqueGroupName===null) |
| 158 | 158 | { |
@@ -160,12 +160,12 @@ discard block |
||
| 160 | 160 | $this->_previousUniqueID=$uniqueID; |
| 161 | 161 | if($uniqueID!=='') |
| 162 | 162 | { |
| 163 | - if(($pos=strrpos($uniqueID,\Prado\Web\UI\TControl::ID_SEPARATOR))!==false) |
|
| 163 | + if(($pos=strrpos($uniqueID, \Prado\Web\UI\TControl::ID_SEPARATOR))!==false) |
|
| 164 | 164 | { |
| 165 | 165 | if($groupName!=='') |
| 166 | - $groupName=substr($uniqueID,0,$pos+1).$groupName; |
|
| 166 | + $groupName=substr($uniqueID, 0, $pos + 1).$groupName; |
|
| 167 | 167 | else if($this->getNamingContainer() instanceof TRadioButtonList) |
| 168 | - $groupName=substr($uniqueID,0,$pos); |
|
| 168 | + $groupName=substr($uniqueID, 0, $pos); |
|
| 169 | 169 | } |
| 170 | 170 | if($groupName==='') |
| 171 | 171 | $groupName=$uniqueID; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function setUniqueGroupName($value) |
| 195 | 195 | { |
| 196 | - $this->setViewState('UniqueGroupName',$value,''); |
|
| 196 | + $this->setViewState('UniqueGroupName', $value, ''); |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
@@ -204,12 +204,12 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | public function getRadioButtonsInGroup() |
| 206 | 206 | { |
| 207 | - $group = $this->getUniqueGroupName(); |
|
| 208 | - $buttons = array(); |
|
| 207 | + $group=$this->getUniqueGroupName(); |
|
| 208 | + $buttons=array(); |
|
| 209 | 209 | foreach(self::$_activeButtons as $control) |
| 210 | 210 | { |
| 211 | - if($control->getUniqueGroupName() === $group) |
|
| 212 | - $buttons[] = $control; |
|
| 211 | + if($control->getUniqueGroupName()===$group) |
|
| 212 | + $buttons[]=$control; |
|
| 213 | 213 | } |
| 214 | 214 | return $buttons; |
| 215 | 215 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | public function getEnableClientScript() |
| 232 | 232 | { |
| 233 | - return $this->getViewState('EnableClientScript',true); |
|
| 233 | + return $this->getViewState('EnableClientScript', true); |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public function setEnableClientScript($value) |
| 240 | 240 | { |
| 241 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
| 241 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /** |
@@ -247,19 +247,19 @@ discard block |
||
| 247 | 247 | * @param string checkbox id |
| 248 | 248 | * @param string onclick js |
| 249 | 249 | */ |
| 250 | - protected function renderInputTag($writer,$clientID,$onclick) |
|
| 250 | + protected function renderInputTag($writer, $clientID, $onclick) |
|
| 251 | 251 | { |
| 252 | 252 | if($clientID!=='') |
| 253 | - $writer->addAttribute('id',$clientID); |
|
| 254 | - $writer->addAttribute('type','radio'); |
|
| 255 | - $writer->addAttribute('name',$this->getUniqueGroupName()); |
|
| 256 | - $writer->addAttribute('value',$this->getValueAttribute()); |
|
| 253 | + $writer->addAttribute('id', $clientID); |
|
| 254 | + $writer->addAttribute('type', 'radio'); |
|
| 255 | + $writer->addAttribute('name', $this->getUniqueGroupName()); |
|
| 256 | + $writer->addAttribute('value', $this->getValueAttribute()); |
|
| 257 | 257 | if(!empty($onclick)) |
| 258 | - $writer->addAttribute('onclick',$onclick); |
|
| 258 | + $writer->addAttribute('onclick', $onclick); |
|
| 259 | 259 | if($this->getChecked()) |
| 260 | - $writer->addAttribute('checked','checked'); |
|
| 260 | + $writer->addAttribute('checked', 'checked'); |
|
| 261 | 261 | if(!$this->getEnabled(true)) |
| 262 | - $writer->addAttribute('disabled','disabled'); |
|
| 262 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 263 | 263 | |
| 264 | 264 | $page=$this->getPage(); |
| 265 | 265 | if($this->getEnabled(true) |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | if(($accesskey=$this->getAccessKey())!=='') |
| 274 | - $writer->addAttribute('accesskey',$accesskey); |
|
| 275 | - if(($tabindex=$this->getTabIndex())>0) |
|
| 276 | - $writer->addAttribute('tabindex',"$tabindex"); |
|
| 277 | - if($attributes=$this->getViewState('InputAttributes',null)) |
|
| 274 | + $writer->addAttribute('accesskey', $accesskey); |
|
| 275 | + if(($tabindex=$this->getTabIndex()) > 0) |
|
| 276 | + $writer->addAttribute('tabindex', "$tabindex"); |
|
| 277 | + if($attributes=$this->getViewState('InputAttributes', null)) |
|
| 278 | 278 | $writer->addAttributes($attributes); |
| 279 | 279 | $writer->renderBeginTag('input'); |
| 280 | 280 | $writer->renderEndTag(); |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | protected function renderClientControlScript($writer) |
| 287 | 287 | { |
| 288 | - $cs = $this->getPage()->getClientScript(); |
|
| 289 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
| 288 | + $cs=$this->getPage()->getClientScript(); |
|
| 289 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | /** |
@@ -107,8 +107,7 @@ discard block |
||
| 107 | 107 | { |
| 108 | 108 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
| 109 | 109 | $this->renderClientControlScript($writer); |
| 110 | - } |
|
| 111 | - else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 110 | + } else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 112 | 111 | $writer->addAttribute('disabled','disabled'); |
| 113 | 112 | |
| 114 | 113 | parent::addAttributesToRender($writer); |
@@ -142,8 +141,7 @@ discard block |
||
| 142 | 141 | { |
| 143 | 142 | $group=$this->getValidationGroup(); |
| 144 | 143 | return $this->getPage()->getValidators($group)->getCount()>0; |
| 145 | - } |
|
| 146 | - else |
|
| 144 | + } else |
|
| 147 | 145 | return false; |
| 148 | 146 | } |
| 149 | 147 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function getButtonTag() |
| 66 | 66 | { |
| 67 | - return $this->getViewState('ButtonTag',TButtonTag::Input); |
|
| 67 | + return $this->getViewState('ButtonTag', TButtonTag::Input); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function setButtonTag($value) |
| 74 | 74 | { |
| 75 | - $this->setViewState('ButtonTag',TPropertyValue::ensureEnum($value,'TButtonTag'),TButtonTag::Input); |
|
| 75 | + $this->setViewState('ButtonTag', TPropertyValue::ensureEnum($value, 'TButtonTag'), TButtonTag::Input); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | /** |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function getEnableClientScript() |
| 82 | 82 | { |
| 83 | - return $this->getViewState('EnableClientScript',true); |
|
| 83 | + return $this->getViewState('EnableClientScript', true); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function setEnableClientScript($value) |
| 90 | 90 | { |
| 91 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
| 91 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -100,20 +100,20 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $page=$this->getPage(); |
| 102 | 102 | $page->ensureRenderInForm($this); |
| 103 | - $writer->addAttribute('type',strtolower($this->getButtonType())); |
|
| 103 | + $writer->addAttribute('type', strtolower($this->getButtonType())); |
|
| 104 | 104 | if(($uniqueID=$this->getUniqueID())!=='') |
| 105 | - $writer->addAttribute('name',$uniqueID); |
|
| 105 | + $writer->addAttribute('name', $uniqueID); |
|
| 106 | 106 | if($this->getButtonTag()===TButtonTag::Button) |
| 107 | 107 | $this->addParsedObject($this->getText()); |
| 108 | 108 | else |
| 109 | - $writer->addAttribute('value',$this->getText()); |
|
| 109 | + $writer->addAttribute('value', $this->getText()); |
|
| 110 | 110 | if($this->getEnabled(true)) |
| 111 | 111 | { |
| 112 | 112 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
| 113 | 113 | $this->renderClientControlScript($writer); |
| 114 | 114 | } |
| 115 | 115 | else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
| 116 | - $writer->addAttribute('disabled','disabled'); |
|
| 116 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 117 | 117 | |
| 118 | 118 | parent::addAttributesToRender($writer); |
| 119 | 119 | } |
@@ -123,8 +123,8 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | protected function renderClientControlScript($writer) |
| 125 | 125 | { |
| 126 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 127 | - $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
| 126 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 127 | + $this->getPage()->getClientScript()->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if($this->getCausesValidation()) |
| 146 | 146 | { |
| 147 | 147 | $group=$this->getValidationGroup(); |
| 148 | - return $this->getPage()->getValidators($group)->getCount()>0; |
|
| 148 | + return $this->getPage()->getValidators($group)->getCount() > 0; |
|
| 149 | 149 | } |
| 150 | 150 | else |
| 151 | 151 | return false; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function setIsDefaultButton($value) |
| 158 | 158 | { |
| 159 | - $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value),false); |
|
| 159 | + $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value), false); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | /** |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | { |
| 187 | 187 | $options['ID']=$this->getClientID(); |
| 188 | 188 | $options['CausesValidation']=$this->getCausesValidation(); |
| 189 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 189 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 190 | 190 | $options['ValidationGroup']=$this->getValidationGroup(); |
| 191 | 191 | |
| 192 | 192 | return $options; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function onClick($param) |
| 215 | 215 | { |
| 216 | - $this->raiseEvent('OnClick',$this,$param); |
|
| 216 | + $this->raiseEvent('OnClick', $this, $param); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -225,8 +225,8 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function onCommand($param) |
| 227 | 227 | { |
| 228 | - $this->raiseEvent('OnCommand',$this,$param); |
|
| 229 | - $this->raiseBubbleEvent($this,$param); |
|
| 228 | + $this->raiseEvent('OnCommand', $this, $param); |
|
| 229 | + $this->raiseBubbleEvent($this, $param); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | if($this->getCausesValidation()) |
| 244 | 244 | $this->getPage()->validate($this->getValidationGroup()); |
| 245 | 245 | $this->onClick(null); |
| 246 | - $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(),$this->getCommandParameter())); |
|
| 246 | + $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /** |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | */ |
| 252 | 252 | public function getText() |
| 253 | 253 | { |
| 254 | - return $this->getViewState('Text',''); |
|
| 254 | + return $this->getViewState('Text', ''); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | */ |
| 260 | 260 | public function setText($value) |
| 261 | 261 | { |
| 262 | - $this->setViewState('Text',$value,''); |
|
| 262 | + $this->setViewState('Text', $value, ''); |
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | /** |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | public function getCausesValidation() |
| 295 | 295 | { |
| 296 | - return $this->getViewState('CausesValidation',true); |
|
| 296 | + return $this->getViewState('CausesValidation', true); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | public function setCausesValidation($value) |
| 303 | 303 | { |
| 304 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
| 304 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | /** |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | public function getCommandName() |
| 311 | 311 | { |
| 312 | - return $this->getViewState('CommandName',''); |
|
| 312 | + return $this->getViewState('CommandName', ''); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | */ |
| 318 | 318 | public function setCommandName($value) |
| 319 | 319 | { |
| 320 | - $this->setViewState('CommandName',$value,''); |
|
| 320 | + $this->setViewState('CommandName', $value, ''); |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | */ |
| 326 | 326 | public function getCommandParameter() |
| 327 | 327 | { |
| 328 | - return $this->getViewState('CommandParameter',''); |
|
| 328 | + return $this->getViewState('CommandParameter', ''); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | public function setCommandParameter($value) |
| 335 | 335 | { |
| 336 | - $this->setViewState('CommandParameter',$value,''); |
|
| 336 | + $this->setViewState('CommandParameter', $value, ''); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | */ |
| 342 | 342 | public function getValidationGroup() |
| 343 | 343 | { |
| 344 | - return $this->getViewState('ValidationGroup',''); |
|
| 344 | + return $this->getViewState('ValidationGroup', ''); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | public function setValidationGroup($value) |
| 351 | 351 | { |
| 352 | - $this->setViewState('ValidationGroup',$value,''); |
|
| 352 | + $this->setViewState('ValidationGroup', $value, ''); |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | /** |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | */ |
| 358 | 358 | public function getButtonType() |
| 359 | 359 | { |
| 360 | - return $this->getViewState('ButtonType',TButtonType::Submit); |
|
| 360 | + return $this->getViewState('ButtonType', TButtonType::Submit); |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
@@ -365,6 +365,6 @@ discard block |
||
| 365 | 365 | */ |
| 366 | 366 | public function setButtonType($value) |
| 367 | 367 | { |
| 368 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TButtonType'),TButtonType::Submit); |
|
| 368 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TButtonType'), TButtonType::Submit); |
|
| 369 | 369 | } |
| 370 | 370 | } |
@@ -222,6 +222,7 @@ |
||
| 222 | 222 | * If you override this method, be sure to call the parent implementation |
| 223 | 223 | * so that the event handlers can be invoked. |
| 224 | 224 | * @param \Prado\Web\UI\TCommandEventParameter event parameter to be passed to the event handlers |
| 225 | + * @param TCommandEventParameter $param |
|
| 225 | 226 | */ |
| 226 | 227 | public function onCommand($param) |
| 227 | 228 | { |
@@ -69,11 +69,9 @@ |
||
| 69 | 69 | $this->_forControl=$control->getClientID(); |
| 70 | 70 | parent::render($writer); |
| 71 | 71 | } |
| 72 | - } |
|
| 73 | - else |
|
| 72 | + } else |
|
| 74 | 73 | throw new TInvalidDataValueException('label_associatedcontrol_invalid',$aid); |
| 75 | - } |
|
| 76 | - else |
|
| 74 | + } else |
|
| 77 | 75 | parent::render($writer); |
| 78 | 76 | } |
| 79 | 77 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | protected function getTagName() |
| 39 | 39 | { |
| 40 | - return ($this->getForControl()==='')?'span':'label'; |
|
| 40 | + return ($this->getForControl()==='') ? 'span' : 'label'; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | protected function addAttributesToRender($writer) |
| 49 | 49 | { |
| 50 | 50 | if($this->_forControl!=='') |
| 51 | - $writer->addAttribute('for',$this->_forControl); |
|
| 51 | + $writer->addAttribute('for', $this->_forControl); |
|
| 52 | 52 | parent::addAttributesToRender($writer); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | else |
| 74 | - throw new TInvalidDataValueException('label_associatedcontrol_invalid',$aid); |
|
| 74 | + throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid); |
|
| 75 | 75 | } |
| 76 | 76 | else |
| 77 | 77 | parent::render($writer); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function getText() |
| 96 | 96 | { |
| 97 | - return $this->getViewState('Text',''); |
|
| 97 | + return $this->getViewState('Text', ''); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function setText($value) |
| 104 | 104 | { |
| 105 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
| 105 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function getForControl() |
| 138 | 138 | { |
| 139 | - return $this->getViewState('ForControl',''); |
|
| 139 | + return $this->getViewState('ForControl', ''); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /** |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function setForControl($value) |
| 148 | 148 | { |
| 149 | - $this->setViewState('ForControl',$value,''); |
|
| 149 | + $this->setViewState('ForControl', $value, ''); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | |
@@ -270,8 +270,7 @@ discard block |
||
| 270 | 270 | $cell->getControls()->add($listControl); |
| 271 | 271 | $cell->registerObject('DropDownList',$listControl); |
| 272 | 272 | $control=$listControl; |
| 273 | - } |
|
| 274 | - else |
|
| 273 | + } else |
|
| 275 | 274 | $control=$cell; |
| 276 | 275 | $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
| 277 | 276 | break; |
@@ -307,8 +306,7 @@ discard block |
||
| 307 | 306 | $value=$text; |
| 308 | 307 | $formatString=$this->getDataTextFormatString(); |
| 309 | 308 | $text=$this->formatDataValue($formatString,$text); |
| 310 | - } |
|
| 311 | - else |
|
| 309 | + } else |
|
| 312 | 310 | $text=$value; |
| 313 | 311 | if($sender instanceof TTableCell) |
| 314 | 312 | $sender->setText($text); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | parent::loadState($state); |
| 78 | 78 | $this->_stateLoaded=true; |
| 79 | 79 | if(!$this->_dataBound) |
| 80 | - $this->_listControl->getItems()->loadState($this->getViewState('Items',null)); |
|
| 80 | + $this->_listControl->getItems()->loadState($this->getViewState('Items', null)); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function saveState() |
| 88 | 88 | { |
| 89 | - $this->setViewState('Items',$this->_listControl->getItems()->saveState(),null); |
|
| 89 | + $this->setViewState('Items', $this->_listControl->getItems()->saveState(), null); |
|
| 90 | 90 | return parent::saveState(); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function getDataTextField() |
| 113 | 113 | { |
| 114 | - return $this->getViewState('DataTextField',''); |
|
| 114 | + return $this->getViewState('DataTextField', ''); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function setDataTextField($value) |
| 124 | 124 | { |
| 125 | - $this->setViewState('DataTextField',$value,''); |
|
| 125 | + $this->setViewState('DataTextField', $value, ''); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function getDataTextFormatString() |
| 132 | 132 | { |
| 133 | - return $this->getViewState('DataTextFormatString',''); |
|
| 133 | + return $this->getViewState('DataTextFormatString', ''); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function setDataTextFormatString($value) |
| 140 | 140 | { |
| 141 | - $this->setViewState('DataTextFormatString',$value,''); |
|
| 141 | + $this->setViewState('DataTextFormatString', $value, ''); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /** |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | */ |
| 147 | 147 | public function getDataValueField() |
| 148 | 148 | { |
| 149 | - return $this->getViewState('DataValueField',''); |
|
| 149 | + return $this->getViewState('DataValueField', ''); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function setDataValueField($value) |
| 159 | 159 | { |
| 160 | - $this->setViewState('DataValueField',$value,''); |
|
| 160 | + $this->setViewState('DataValueField', $value, ''); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function getReadOnly() |
| 167 | 167 | { |
| 168 | - return $this->getViewState('ReadOnly',false); |
|
| 168 | + return $this->getViewState('ReadOnly', false); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function setReadOnly($value) |
| 175 | 175 | { |
| 176 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
| 176 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function getListValueField() |
| 199 | 199 | { |
| 200 | - return $this->getViewState('ListValueField',''); |
|
| 200 | + return $this->getViewState('ListValueField', ''); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | public function setListValueField($value) |
| 207 | 207 | { |
| 208 | - $this->setViewState('ListValueField',$value,''); |
|
| 208 | + $this->setViewState('ListValueField', $value, ''); |
|
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | /** |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function getListTextField() |
| 215 | 215 | { |
| 216 | - return $this->getViewState('ListTextField',''); |
|
| 216 | + return $this->getViewState('ListTextField', ''); |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /** |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | public function setListTextField($value) |
| 223 | 223 | { |
| 224 | - $this->setViewState('ListTextField',$value,''); |
|
| 224 | + $this->setViewState('ListTextField', $value, ''); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /** |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | public function getListTextFormatString() |
| 231 | 231 | { |
| 232 | - return $this->getViewState('ListTextFormatString',''); |
|
| 232 | + return $this->getViewState('ListTextFormatString', ''); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /** |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public function setListTextFormatString($value) |
| 239 | 239 | { |
| 240 | - $this->setViewState('ListTextFormatString',$value,''); |
|
| 240 | + $this->setViewState('ListTextFormatString', $value, ''); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /** |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | * @param integer the index to the Columns property that the cell resides in. |
| 252 | 252 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
| 253 | 253 | */ |
| 254 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
| 254 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
| 255 | 255 | { |
| 256 | 256 | if(!$this->_dataBound && $this->_listControl->getDataSource()!==null) |
| 257 | 257 | { |
@@ -268,21 +268,21 @@ discard block |
||
| 268 | 268 | { |
| 269 | 269 | $listControl=clone $this->_listControl; |
| 270 | 270 | $cell->getControls()->add($listControl); |
| 271 | - $cell->registerObject('DropDownList',$listControl); |
|
| 271 | + $cell->registerObject('DropDownList', $listControl); |
|
| 272 | 272 | $control=$listControl; |
| 273 | 273 | } |
| 274 | 274 | else |
| 275 | 275 | $control=$cell; |
| 276 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
| 276 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
| 277 | 277 | break; |
| 278 | 278 | case TListItemType::Item: |
| 279 | 279 | case TListItemType::AlternatingItem: |
| 280 | 280 | case TListItemType::SelectedItem: |
| 281 | 281 | if($this->getDataTextField()!=='' || $this->getDataValueField()!=='') |
| 282 | - $cell->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
| 282 | + $cell->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
| 283 | 283 | break; |
| 284 | 284 | default: |
| 285 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
| 285 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
| 286 | 286 | break; |
| 287 | 287 | } |
| 288 | 288 | } |
@@ -292,21 +292,21 @@ discard block |
||
| 292 | 292 | * This method is invoked when datagrid performs databinding. |
| 293 | 293 | * It populates the content of the cell with the relevant data from data source. |
| 294 | 294 | */ |
| 295 | - public function dataBindColumn($sender,$param) |
|
| 295 | + public function dataBindColumn($sender, $param) |
|
| 296 | 296 | { |
| 297 | 297 | $item=$sender->getNamingContainer(); |
| 298 | 298 | $data=$item->getData(); |
| 299 | 299 | if(($valueField=$this->getDataValueField())!=='') |
| 300 | - $value=$this->getDataFieldValue($data,$valueField); |
|
| 300 | + $value=$this->getDataFieldValue($data, $valueField); |
|
| 301 | 301 | else |
| 302 | 302 | $value=''; |
| 303 | 303 | if(($textField=$this->getDataTextField())!=='') |
| 304 | 304 | { |
| 305 | - $text=$this->getDataFieldValue($data,$textField); |
|
| 305 | + $text=$this->getDataFieldValue($data, $textField); |
|
| 306 | 306 | if($valueField==='') |
| 307 | 307 | $value=$text; |
| 308 | 308 | $formatString=$this->getDataTextFormatString(); |
| 309 | - $text=$this->formatDataValue($formatString,$text); |
|
| 309 | + $text=$this->formatDataValue($formatString, $text); |
|
| 310 | 310 | } |
| 311 | 311 | else |
| 312 | 312 | $text=$value; |
@@ -98,8 +98,7 @@ |
||
| 98 | 98 | { |
| 99 | 99 | $this->renderLinkButtonHref($writer); |
| 100 | 100 | $this->renderClientControlScript($writer); |
| 101 | - } |
|
| 102 | - else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 101 | + } else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
| 103 | 102 | $writer->addAttribute('disabled','disabled'); |
| 104 | 103 | } |
| 105 | 104 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function getEnableClientScript() |
| 72 | 72 | { |
| 73 | - return $this->getViewState('EnableClientScript',true); |
|
| 73 | + return $this->getViewState('EnableClientScript', true); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function setEnableClientScript($value) |
| 80 | 80 | { |
| 81 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
| 81 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $page=$this->getPage(); |
| 92 | 92 | $page->ensureRenderInForm($this); |
| 93 | 93 | |
| 94 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 94 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 95 | 95 | |
| 96 | 96 | // We call parent implementation here because some attributes |
| 97 | 97 | // may be overwritten in the following |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $this->renderClientControlScript($writer); |
| 104 | 104 | } |
| 105 | 105 | else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
| 106 | - $writer->addAttribute('disabled','disabled'); |
|
| 106 | + $writer->addAttribute('disabled', 'disabled'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | protected function renderClientControlScript($writer) |
| 114 | 114 | { |
| 115 | - $cs = $this->getPage()->getClientScript(); |
|
| 116 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
| 115 | + $cs=$this->getPage()->getClientScript(); |
|
| 116 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function setIsDefaultButton($value) |
| 123 | 123 | { |
| 124 | - $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value),false); |
|
| 124 | + $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value), false); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | protected function renderLinkButtonHref($writer) |
| 140 | 140 | { |
| 141 | 141 | //create unique no-op url references |
| 142 | - $nop = "javascript:;//".$this->getClientID(); |
|
| 142 | + $nop="javascript:;//".$this->getClientID(); |
|
| 143 | 143 | $writer->addAttribute('href', $nop); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | protected function getPostBackOptions() |
| 162 | 162 | { |
| 163 | - $options['ID'] = $this->getClientID(); |
|
| 164 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 165 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
| 166 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
| 167 | - $options['StopEvent'] = true; |
|
| 163 | + $options['ID']=$this->getClientID(); |
|
| 164 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 165 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
| 166 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
| 167 | + $options['StopEvent']=true; |
|
| 168 | 168 | |
| 169 | 169 | return $options; |
| 170 | 170 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | public function getText() |
| 190 | 190 | { |
| 191 | - return $this->getViewState('Text',''); |
|
| 191 | + return $this->getViewState('Text', ''); |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function setText($value) |
| 198 | 198 | { |
| 199 | - $this->setViewState('Text',$value,''); |
|
| 199 | + $this->setViewState('Text', $value, ''); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | /** |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | public function getCommandName() |
| 232 | 232 | { |
| 233 | - return $this->getViewState('CommandName',''); |
|
| 233 | + return $this->getViewState('CommandName', ''); |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public function setCommandName($value) |
| 240 | 240 | { |
| 241 | - $this->setViewState('CommandName',$value,''); |
|
| 241 | + $this->setViewState('CommandName', $value, ''); |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /** |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | public function getCommandParameter() |
| 248 | 248 | { |
| 249 | - return $this->getViewState('CommandParameter',''); |
|
| 249 | + return $this->getViewState('CommandParameter', ''); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /** |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public function setCommandParameter($value) |
| 256 | 256 | { |
| 257 | - $this->setViewState('CommandParameter',$value,''); |
|
| 257 | + $this->setViewState('CommandParameter', $value, ''); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | public function getCausesValidation() |
| 264 | 264 | { |
| 265 | - return $this->getViewState('CausesValidation',true); |
|
| 265 | + return $this->getViewState('CausesValidation', true); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | public function setCausesValidation($value) |
| 273 | 273 | { |
| 274 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
| 274 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function getValidationGroup() |
| 281 | 281 | { |
| 282 | - return $this->getViewState('ValidationGroup',''); |
|
| 282 | + return $this->getViewState('ValidationGroup', ''); |
|
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | /** |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | public function setValidationGroup($value) |
| 289 | 289 | { |
| 290 | - $this->setViewState('ValidationGroup',$value,''); |
|
| 290 | + $this->setViewState('ValidationGroup', $value, ''); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | if($this->getCausesValidation()) |
| 305 | 305 | $this->getPage()->validate($this->getValidationGroup()); |
| 306 | 306 | $this->onClick(null); |
| 307 | - $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(),$this->getCommandParameter())); |
|
| 307 | + $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
|
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | /** |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | */ |
| 317 | 317 | public function onClick($param) |
| 318 | 318 | { |
| 319 | - $this->raiseEvent('OnClick',$this,$param); |
|
| 319 | + $this->raiseEvent('OnClick', $this, $param); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | /** |
@@ -328,8 +328,8 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | public function onCommand($param) |
| 330 | 330 | { |
| 331 | - $this->raiseEvent('OnCommand',$this,$param); |
|
| 332 | - $this->raiseBubbleEvent($this,$param); |
|
| 331 | + $this->raiseEvent('OnCommand', $this, $param); |
|
| 332 | + $this->raiseBubbleEvent($this, $param); |
|
| 333 | 333 | } |
| 334 | 334 | } |
| 335 | 335 | |
@@ -325,6 +325,7 @@ |
||
| 325 | 325 | * If you override this method, be sure to call the parent implementation |
| 326 | 326 | * so that the event handlers can be invoked. |
| 327 | 327 | * @param \Prado\Web\UI\TCommandEventParameter event parameter to be passed to the event handlers |
| 328 | + * @param \Prado\Web\UI\TCommandEventParameter $param |
|
| 328 | 329 | */ |
| 329 | 330 | public function onCommand($param) |
| 330 | 331 | { |
@@ -84,8 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param)); |
| 86 | 86 | return true; |
| 87 | - } |
|
| 88 | - else |
|
| 87 | + } else |
|
| 89 | 88 | return false; |
| 90 | 89 | } |
| 91 | 90 | |
@@ -130,8 +129,7 @@ discard block |
||
| 130 | 129 | $this->renderBeginTag($writer); |
| 131 | 130 | $this->renderContents($writer); |
| 132 | 131 | $this->renderEndTag($writer); |
| 133 | - } |
|
| 134 | - else |
|
| 132 | + } else |
|
| 135 | 133 | $this->renderContents($writer); |
| 136 | 134 | } |
| 137 | 135 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function getHasStyle() |
| 46 | 46 | { |
| 47 | - return $this->getViewState('Style',null)!==null; |
|
| 47 | + return $this->getViewState('Style', null)!==null; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function getStyle() |
| 54 | 54 | { |
| 55 | - if($style=$this->getViewState('Style',null)) |
|
| 55 | + if($style=$this->getViewState('Style', null)) |
|
| 56 | 56 | return $style; |
| 57 | 57 | else |
| 58 | 58 | { |
| 59 | 59 | $style=$this->createStyle(); |
| 60 | - $this->setViewState('Style',$style,null); |
|
| 60 | + $this->setViewState('Style', $style, null); |
|
| 61 | 61 | return $style; |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | * @param TEventParameter event parameter |
| 78 | 78 | * @return boolean whether the event bubbling should stop here. |
| 79 | 79 | */ |
| 80 | - public function bubbleEvent($sender,$param) |
|
| 80 | + public function bubbleEvent($sender, $param) |
|
| 81 | 81 | { |
| 82 | 82 | if($param instanceof \Prado\Web\UI\TCommandEventParameter) |
| 83 | 83 | { |
| 84 | - $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param)); |
|
| 84 | + $this->raiseBubbleEvent($this, new TDataListCommandEventParameter($this, $sender, $param)); |
|
| 85 | 85 | return true; |
| 86 | 86 | } |
| 87 | 87 | else |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | protected function addAttributesToRender($writer) |
| 110 | 110 | { |
| 111 | - if($style=$this->getViewState('Style',null)) |
|
| 111 | + if($style=$this->getViewState('Style', null)) |
|
| 112 | 112 | $style->addAttributesToRender($writer); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -97,8 +97,7 @@ discard block |
||
| 97 | 97 | $this->_cachedActiveViewIndex=-1; |
| 98 | 98 | if($index>=0) |
| 99 | 99 | $this->activateView($views->itemAt($index),true); |
| 100 | - } |
|
| 101 | - else |
|
| 100 | + } else |
|
| 102 | 101 | throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
| 103 | 102 | } |
| 104 | 103 | |
@@ -153,8 +152,7 @@ discard block |
||
| 153 | 152 | $view->onActivate(null); |
| 154 | 153 | $this->onActiveViewChanged(null); |
| 155 | 154 | } |
| 156 | - } |
|
| 157 | - else if($v->getActive()) |
|
| 155 | + } else if($v->getActive()) |
|
| 158 | 156 | { |
| 159 | 157 | $v->setActive(false); |
| 160 | 158 | if($triggerEvent) |
@@ -232,8 +230,7 @@ discard block |
||
| 232 | 230 | { |
| 233 | 231 | $this->setActiveView($view); |
| 234 | 232 | return true; |
| 235 | - } |
|
| 236 | - else |
|
| 233 | + } else |
|
| 237 | 234 | throw new TInvalidDataValueException('multiview_viewid_invalid', $viewID); |
| 238 | 235 | case self::CMD_SWITCHVIEWINDEX: |
| 239 | 236 | $index=TPropertyValue::ensureInteger($param->getCommandParameter()); |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function getActiveViewIndex() |
| 82 | 82 | { |
| 83 | - if($this->_cachedActiveViewIndex>-1) |
|
| 83 | + if($this->_cachedActiveViewIndex > -1) |
|
| 84 | 84 | return $this->_cachedActiveViewIndex; |
| 85 | 85 | else |
| 86 | - return $this->getControlState('ActiveViewIndex',-1); |
|
| 86 | + return $this->getControlState('ActiveViewIndex', -1); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -92,21 +92,21 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function setActiveViewIndex($value) |
| 94 | 94 | { |
| 95 | - if(($index=TPropertyValue::ensureInteger($value))<0) |
|
| 95 | + if(($index=TPropertyValue::ensureInteger($value)) < 0) |
|
| 96 | 96 | $index=-1; |
| 97 | 97 | $views=$this->getViews(); |
| 98 | 98 | $count=$views->getCount(); |
| 99 | - if($count===0 && $this->getControlStage()<TControl::CS_CHILD_INITIALIZED) |
|
| 99 | + if($count===0 && $this->getControlStage() < TControl::CS_CHILD_INITIALIZED) |
|
| 100 | 100 | $this->_cachedActiveViewIndex=$index; |
| 101 | - else if($index<$count) |
|
| 101 | + else if($index < $count) |
|
| 102 | 102 | { |
| 103 | - $this->setControlState('ActiveViewIndex',$index,-1); |
|
| 103 | + $this->setControlState('ActiveViewIndex', $index, -1); |
|
| 104 | 104 | $this->_cachedActiveViewIndex=-1; |
| 105 | - if($index>=0) |
|
| 106 | - $this->activateView($views->itemAt($index),true); |
|
| 105 | + if($index >= 0) |
|
| 106 | + $this->activateView($views->itemAt($index), true); |
|
| 107 | 107 | } |
| 108 | 108 | else |
| 109 | - throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
|
| 109 | + throw new TInvalidDataValueException('multiview_activeviewindex_invalid', $index); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -117,13 +117,13 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $index=$this->getActiveViewIndex(); |
| 119 | 119 | $views=$this->getViews(); |
| 120 | - if($index>=$views->getCount()) |
|
| 121 | - throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
|
| 122 | - if($index<0) |
|
| 120 | + if($index >= $views->getCount()) |
|
| 121 | + throw new TInvalidDataValueException('multiview_activeviewindex_invalid', $index); |
|
| 122 | + if($index < 0) |
|
| 123 | 123 | return null; |
| 124 | 124 | $view=$views->itemAt($index); |
| 125 | 125 | if(!$view->getActive()) |
| 126 | - $this->activateView($view,false); |
|
| 126 | + $this->activateView($view, false); |
|
| 127 | 127 | return $view; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function setActiveView($view) |
| 135 | 135 | { |
| 136 | - if(($index=$this->getViews()->indexOf($view))>=0) |
|
| 136 | + if(($index=$this->getViews()->indexOf($view)) >= 0) |
|
| 137 | 137 | $this->setActiveViewIndex($index); |
| 138 | 138 | else |
| 139 | 139 | throw new TInvalidOperationException('multiview_view_inexistent'); |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | * @param TView the view to be activated |
| 146 | 146 | * @param boolean whether to trigger OnActiveViewChanged event. |
| 147 | 147 | */ |
| 148 | - protected function activateView($view,$triggerViewChangedEvent=true) |
|
| 148 | + protected function activateView($view, $triggerViewChangedEvent=true) |
|
| 149 | 149 | { |
| 150 | 150 | if($view->getActive()) |
| 151 | 151 | return; |
| 152 | - $triggerEvent=$triggerViewChangedEvent && ($this->getControlStage()>=\Prado\Web\UI\TControl::CS_STATE_LOADED || ($this->getPage() && !$this->getPage()->getIsPostBack())); |
|
| 152 | + $triggerEvent=$triggerViewChangedEvent && ($this->getControlStage() >= \Prado\Web\UI\TControl::CS_STATE_LOADED || ($this->getPage() && !$this->getPage()->getIsPostBack())); |
|
| 153 | 153 | foreach($this->getViews() as $v) |
| 154 | 154 | { |
| 155 | 155 | if($v===$view) |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | public function onInit($param) |
| 197 | 197 | { |
| 198 | 198 | parent::onInit($param); |
| 199 | - if($this->_cachedActiveViewIndex>=0) |
|
| 199 | + if($this->_cachedActiveViewIndex >= 0) |
|
| 200 | 200 | $this->setActiveViewIndex($this->_cachedActiveViewIndex); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public function onActiveViewChanged($param) |
| 209 | 209 | { |
| 210 | - $this->raiseEvent('OnActiveViewChanged',$this,$param); |
|
| 210 | + $this->raiseEvent('OnActiveViewChanged', $this, $param); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -217,21 +217,21 @@ discard block |
||
| 217 | 217 | * @param mixed event parameter |
| 218 | 218 | * @return boolean whether this event is handled |
| 219 | 219 | */ |
| 220 | - public function bubbleEvent($sender,$param) |
|
| 220 | + public function bubbleEvent($sender, $param) |
|
| 221 | 221 | { |
| 222 | 222 | if(!$this->_ignoreBubbleEvents && ($param instanceof \Prado\Web\UI\TCommandEventParameter)) |
| 223 | 223 | { |
| 224 | 224 | switch($param->getCommandName()) |
| 225 | 225 | { |
| 226 | 226 | case self::CMD_NEXTVIEW: |
| 227 | - if(($index=$this->getActiveViewIndex())<$this->getViews()->getCount()-1) |
|
| 228 | - $this->setActiveViewIndex($index+1); |
|
| 227 | + if(($index=$this->getActiveViewIndex()) < $this->getViews()->getCount() - 1) |
|
| 228 | + $this->setActiveViewIndex($index + 1); |
|
| 229 | 229 | else |
| 230 | 230 | $this->setActiveViewIndex(-1); |
| 231 | 231 | return true; |
| 232 | 232 | case self::CMD_PREVIOUSVIEW: |
| 233 | - if(($index=$this->getActiveViewIndex())>=0) |
|
| 234 | - $this->setActiveViewIndex($index-1); |
|
| 233 | + if(($index=$this->getActiveViewIndex()) >= 0) |
|
| 234 | + $this->setActiveViewIndex($index - 1); |
|
| 235 | 235 | return true; |
| 236 | 236 | case self::CMD_SWITCHVIEWID: |
| 237 | 237 | $view=$this->findControl($viewID=$param->getCommandParameter()); |
@@ -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 | |
@@ -233,6 +233,10 @@ |
||
| 233 | 233 | * @param string button caption |
| 234 | 234 | * @param boolean whether the button should cause validation |
| 235 | 235 | * @param string the validation group that the button belongs to |
| 236 | + * @param string $commandName |
|
| 237 | + * @param string $text |
|
| 238 | + * @param boolean $causesValidation |
|
| 239 | + * @param string $validationGroup |
|
| 236 | 240 | * @return mixed the newly created button. |
| 237 | 241 | */ |
| 238 | 242 | protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function getButtonType() |
| 57 | 57 | { |
| 58 | - return $this->getViewState('ButtonType',TButtonColumnType::LinkButton); |
|
| 58 | + return $this->getViewState('ButtonType', TButtonColumnType::LinkButton); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function setButtonType($value) |
| 65 | 65 | { |
| 66 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TButtonColumnType'),TButtonColumnType::LinkButton); |
|
| 66 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TButtonColumnType'), TButtonColumnType::LinkButton); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function getEditText() |
| 73 | 73 | { |
| 74 | - return $this->getViewState('EditText','Edit'); |
|
| 74 | + return $this->getViewState('EditText', 'Edit'); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public function setEditText($value) |
| 81 | 81 | { |
| 82 | - $this->setViewState('EditText',$value,'Edit'); |
|
| 82 | + $this->setViewState('EditText', $value, 'Edit'); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | public function getEditImageUrl() |
| 89 | 89 | { |
| 90 | - return $this->getViewState('EditImageUrl',''); |
|
| 90 | + return $this->getViewState('EditImageUrl', ''); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function setEditImageUrl($value) |
| 97 | 97 | { |
| 98 | - $this->setViewState('EditImageUrl',$value,''); |
|
| 98 | + $this->setViewState('EditImageUrl', $value, ''); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function getUpdateText() |
| 105 | 105 | { |
| 106 | - return $this->getViewState('UpdateText','Update'); |
|
| 106 | + return $this->getViewState('UpdateText', 'Update'); |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function setUpdateText($value) |
| 113 | 113 | { |
| 114 | - $this->setViewState('UpdateText',$value,'Update'); |
|
| 114 | + $this->setViewState('UpdateText', $value, 'Update'); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | /** |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function getUpdateImageUrl() |
| 121 | 121 | { |
| 122 | - return $this->getViewState('UpdateImageUrl',''); |
|
| 122 | + return $this->getViewState('UpdateImageUrl', ''); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | */ |
| 128 | 128 | public function setUpdateImageUrl($value) |
| 129 | 129 | { |
| 130 | - $this->setViewState('UpdateImageUrl',$value,''); |
|
| 130 | + $this->setViewState('UpdateImageUrl', $value, ''); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | /** |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function getCancelText() |
| 137 | 137 | { |
| 138 | - return $this->getViewState('CancelText','Cancel'); |
|
| 138 | + return $this->getViewState('CancelText', 'Cancel'); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function setCancelText($value) |
| 145 | 145 | { |
| 146 | - $this->setViewState('CancelText',$value,'Cancel'); |
|
| 146 | + $this->setViewState('CancelText', $value, 'Cancel'); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public function getCancelImageUrl() |
| 153 | 153 | { |
| 154 | - return $this->getViewState('CancelImageUrl',''); |
|
| 154 | + return $this->getViewState('CancelImageUrl', ''); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | public function setCancelImageUrl($value) |
| 161 | 161 | { |
| 162 | - $this->setViewState('CancelImageUrl',$value,''); |
|
| 162 | + $this->setViewState('CancelImageUrl', $value, ''); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | public function getCausesValidation() |
| 169 | 169 | { |
| 170 | - return $this->getViewState('CausesValidation',true); |
|
| 170 | + return $this->getViewState('CausesValidation', true); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | /** |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function setCausesValidation($value) |
| 177 | 177 | { |
| 178 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
| 178 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | /** |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | */ |
| 184 | 184 | public function getValidationGroup() |
| 185 | 185 | { |
| 186 | - return $this->getViewState('ValidationGroup',''); |
|
| 186 | + return $this->getViewState('ValidationGroup', ''); |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function setValidationGroup($value) |
| 193 | 193 | { |
| 194 | - $this->setViewState('ValidationGroup',$value,''); |
|
| 194 | + $this->setViewState('ValidationGroup', $value, ''); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -203,27 +203,27 @@ discard block |
||
| 203 | 203 | * @param integer the index to the Columns property that the cell resides in. |
| 204 | 204 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
| 205 | 205 | */ |
| 206 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
| 206 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
| 207 | 207 | { |
| 208 | 208 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem) |
| 209 | 209 | { |
| 210 | - $button=$this->createButton('Edit',$this->getEditText(),false,''); |
|
| 210 | + $button=$this->createButton('Edit', $this->getEditText(), false, ''); |
|
| 211 | 211 | $cell->getControls()->add($button); |
| 212 | - $cell->registerObject('EditButton',$button); |
|
| 212 | + $cell->registerObject('EditButton', $button); |
|
| 213 | 213 | } |
| 214 | 214 | else if($itemType===TListItemType::EditItem) |
| 215 | 215 | { |
| 216 | 216 | $controls=$cell->getControls(); |
| 217 | - $button=$this->createButton('Update',$this->getUpdateText(),$this->getCausesValidation(),$this->getValidationGroup()); |
|
| 217 | + $button=$this->createButton('Update', $this->getUpdateText(), $this->getCausesValidation(), $this->getValidationGroup()); |
|
| 218 | 218 | $controls->add($button); |
| 219 | - $cell->registerObject('UpdateButton',$button); |
|
| 219 | + $cell->registerObject('UpdateButton', $button); |
|
| 220 | 220 | $controls->add(' '); |
| 221 | - $button=$this->createButton('Cancel',$this->getCancelText(),false,''); |
|
| 221 | + $button=$this->createButton('Cancel', $this->getCancelText(), false, ''); |
|
| 222 | 222 | $controls->add($button); |
| 223 | - $cell->registerObject('CancelButton',$button); |
|
| 223 | + $cell->registerObject('CancelButton', $button); |
|
| 224 | 224 | } |
| 225 | 225 | else |
| 226 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
| 226 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -235,18 +235,18 @@ discard block |
||
| 235 | 235 | * @param string the validation group that the button belongs to |
| 236 | 236 | * @return mixed the newly created button. |
| 237 | 237 | */ |
| 238 | - protected function createButton($commandName,$text,$causesValidation,$validationGroup) |
|
| 238 | + protected function createButton($commandName, $text, $causesValidation, $validationGroup) |
|
| 239 | 239 | { |
| 240 | 240 | if($this->getButtonType()===TButtonColumnType::LinkButton) |
| 241 | - $button= new TLinkButton; |
|
| 241 | + $button=new TLinkButton; |
|
| 242 | 242 | else if($this->getButtonType()===TButtonColumnType::PushButton) |
| 243 | - $button= new TButton; |
|
| 243 | + $button=new TButton; |
|
| 244 | 244 | else // image buttons |
| 245 | 245 | { |
| 246 | - $button= new TImageButton; |
|
| 247 | - if(strcasecmp($commandName,'Update')===0) |
|
| 246 | + $button=new TImageButton; |
|
| 247 | + if(strcasecmp($commandName, 'Update')===0) |
|
| 248 | 248 | $url=$this->getUpdateImageUrl(); |
| 249 | - else if(strcasecmp($commandName,'Cancel')===0) |
|
| 249 | + else if(strcasecmp($commandName, 'Cancel')===0) |
|
| 250 | 250 | $url=$this->getCancelImageUrl(); |
| 251 | 251 | else |
| 252 | 252 | $url=$this->getEditImageUrl(); |