@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function getOptions() |
| 76 | 76 | { |
| 77 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 77 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 78 | 78 | { |
| 79 | 79 | $options=new TJuiControlOptions($this); |
| 80 | 80 | $this->setViewState('JuiOptions', $options); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function getPostBackOptions() |
| 107 | 107 | { |
| 108 | - $options = $this->getOptions()->toArray(); |
|
| 108 | + $options=$this->getOptions()->toArray(); |
|
| 109 | 109 | return $options; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | parent::addAttributesToRender($writer); |
| 119 | 119 | |
| 120 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 120 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 121 | 121 | $options=TJavascript::encode($this->getPostBackOptions()); |
| 122 | 122 | $cs=$this->getPage()->getClientScript(); |
| 123 | 123 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * Raises the OnCreate event |
| 139 | 139 | * @param object $params event parameters |
| 140 | 140 | */ |
| 141 | - public function onCreate ($params) |
|
| 141 | + public function onCreate($params) |
|
| 142 | 142 | { |
| 143 | 143 | $this->raiseEvent('OnCreate', $this, $params); |
| 144 | 144 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * Raises the OnResize event |
| 148 | 148 | * @param object $params event parameters |
| 149 | 149 | */ |
| 150 | - public function onResize ($params) |
|
| 150 | + public function onResize($params) |
|
| 151 | 151 | { |
| 152 | 152 | $this->raiseEvent('OnResize', $this, $params); |
| 153 | 153 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * Raises the OnStart event |
| 157 | 157 | * @param object $params event parameters |
| 158 | 158 | */ |
| 159 | - public function onStart ($params) |
|
| 159 | + public function onStart($params) |
|
| 160 | 160 | { |
| 161 | 161 | $this->raiseEvent('OnStart', $this, $params); |
| 162 | 162 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * Raises the OnStop event |
| 166 | 166 | * @param object $params event parameters |
| 167 | 167 | */ |
| 168 | - public function onStop ($params) |
|
| 168 | + public function onStop($params) |
|
| 169 | 169 | { |
| 170 | 170 | $this->raiseEvent('OnStop', $this, $params); |
| 171 | 171 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * it will register an additional clientscript to set the language specific global default settings. |
| 40 | 40 | * @var boolean true, if this is the first instance of TJuiDatePicker, false otherwise |
| 41 | 41 | */ |
| 42 | - private static $_first = true; |
|
| 42 | + private static $_first=true; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Creates a new callback control, sets the adapter to |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function getOptions() |
| 76 | 76 | { |
| 77 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 77 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 78 | 78 | { |
| 79 | 79 | $options=new TJuiControlOptions($this); |
| 80 | 80 | $this->setViewState('JuiOptions', $options); |
@@ -168,8 +168,8 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | protected function getCurrentCulture() |
| 170 | 170 | { |
| 171 | - $app = $this->getApplication()->getGlobalization(false); |
|
| 172 | - return $this->getCulture() == '' ? |
|
| 171 | + $app=$this->getApplication()->getGlobalization(false); |
|
| 172 | + return $this->getCulture()=='' ? |
|
| 173 | 173 | ($app ? $app->getCulture() : 'en') : $this->getCulture(); |
| 174 | 174 | } |
| 175 | 175 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | */ |
| 179 | 179 | public function getDateFormat() |
| 180 | 180 | { |
| 181 | - return $this->getViewState('DateFormat','dd-MM-yyyy'); |
|
| 181 | + return $this->getViewState('DateFormat', 'dd-MM-yyyy'); |
|
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /** |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function setDateFormat($value) |
| 189 | 189 | { |
| 190 | - $this->setViewState('DateFormat',$value,'dd-MM-yyyy'); |
|
| 190 | + $this->setViewState('DateFormat', $value, 'dd-MM-yyyy'); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | $this->setText(''); |
| 254 | 254 | else |
| 255 | 255 | { |
| 256 | - $date = TPropertyValue::ensureFloat($value); |
|
| 257 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat()); |
|
| 256 | + $date=TPropertyValue::ensureFloat($value); |
|
| 257 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat()); |
|
| 258 | 258 | $this->setText($formatter->format($date)); |
| 259 | 259 | } |
| 260 | 260 | } |
@@ -265,9 +265,9 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | protected function getTimeStampFromText() |
| 267 | 267 | { |
| 268 | - $pattern = $this->getDateFormat(); |
|
| 269 | - $pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern); |
|
| 270 | - $formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern); |
|
| 268 | + $pattern=$this->getDateFormat(); |
|
| 269 | + $pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern); |
|
| 270 | + $formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern); |
|
| 271 | 271 | return $formatter->parse($this->getText()); |
| 272 | 272 | } |
| 273 | 273 | |
@@ -278,10 +278,10 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | public function getValidationPropertyValue() |
| 280 | 280 | { |
| 281 | - if(($text = $this->getText()) === '') |
|
| 281 | + if(($text=$this->getText())==='') |
|
| 282 | 282 | return ''; |
| 283 | - $date = $this->getTimeStamp(); |
|
| 284 | - return $date == null ? $text : $date; |
|
| 283 | + $date=$this->getTimeStamp(); |
|
| 284 | + return $date==null ? $text : $date; |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | } |
| 288 | 288 | \ No newline at end of file |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function getOptions() |
| 74 | 74 | { |
| 75 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 75 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 76 | 76 | { |
| 77 | 77 | $options=new TJuiControlOptions($this); |
| 78 | 78 | $this->setViewState('JuiOptions', $options); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | { |
| 115 | 115 | parent::addAttributesToRender($writer); |
| 116 | 116 | |
| 117 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 117 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 118 | 118 | $options=TJavascript::encode($this->getPostBackOptions()); |
| 119 | 119 | $cs=$this->getPage()->getClientScript(); |
| 120 | 120 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | * Raises the OnCreate event |
| 136 | 136 | * @param object $params event parameters |
| 137 | 137 | */ |
| 138 | - public function onCreate ($params) |
|
| 138 | + public function onCreate($params) |
|
| 139 | 139 | { |
| 140 | 140 | $this->raiseEvent('OnCreate', $this, $params); |
| 141 | 141 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * Raises the OnDrag event |
| 145 | 145 | * @param object $params event parameters |
| 146 | 146 | */ |
| 147 | - public function onDrag ($params) |
|
| 147 | + public function onDrag($params) |
|
| 148 | 148 | { |
| 149 | 149 | $this->raiseEvent('OnDrag', $this, $params); |
| 150 | 150 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | * Raises the OnStart event |
| 154 | 154 | * @param object $params event parameters |
| 155 | 155 | */ |
| 156 | - public function onStart ($params) |
|
| 156 | + public function onStart($params) |
|
| 157 | 157 | { |
| 158 | 158 | $this->raiseEvent('OnStart', $this, $params); |
| 159 | 159 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * Raises the OnStop event |
| 163 | 163 | * @param object $params event parameters |
| 164 | 164 | */ |
| 165 | - public function onStop ($params) |
|
| 165 | + public function onStop($params) |
|
| 166 | 166 | { |
| 167 | 167 | $this->raiseEvent('OnStop', $this, $params); |
| 168 | 168 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function setControl($control) |
| 73 | 73 | { |
| 74 | 74 | if(!$control instanceof IJuiOptions) |
| 75 | - throw new THttpException(500,'juioptions_control_invalid',$control->ID); |
|
| 75 | + throw new THttpException(500, 'juioptions_control_invalid', $control->ID); |
|
| 76 | 76 | $this->_control=$control; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -83,36 +83,36 @@ discard block |
||
| 83 | 83 | * @param mixed option value. |
| 84 | 84 | * @throws THttpException |
| 85 | 85 | */ |
| 86 | - public function __set($name,$value) |
|
| 86 | + public function __set($name, $value) |
|
| 87 | 87 | { |
| 88 | 88 | if($this->_options===null) |
| 89 | 89 | $this->_options=array(); |
| 90 | 90 | |
| 91 | 91 | foreach($this->_control->getValidOptions() as $option) |
| 92 | 92 | { |
| 93 | - if(0 == strcasecmp($name, $option)) |
|
| 93 | + if(0==strcasecmp($name, $option)) |
|
| 94 | 94 | { |
| 95 | - $low = strtolower($value); |
|
| 96 | - if($low === 'null') |
|
| 95 | + $low=strtolower($value); |
|
| 96 | + if($low==='null') |
|
| 97 | 97 | { |
| 98 | - $this->_options[$option] = null; |
|
| 99 | - } elseif($low === 'true') { |
|
| 100 | - $this->_options[$option] = true; |
|
| 101 | - } elseif($low === 'false') { |
|
| 102 | - $this->_options[$option] = false; |
|
| 98 | + $this->_options[$option]=null; |
|
| 99 | + } elseif($low==='true') { |
|
| 100 | + $this->_options[$option]=true; |
|
| 101 | + } elseif($low==='false') { |
|
| 102 | + $this->_options[$option]=false; |
|
| 103 | 103 | } elseif(is_numeric($value)) { |
| 104 | 104 | // trick to get float or integer automatically when needed |
| 105 | - $this->_options[$option] = $value + 0; |
|
| 106 | - } elseif(substr($low,0,8)=='function') { |
|
| 107 | - $this->_options[$option] = new TJavaScriptLiteral($value); |
|
| 105 | + $this->_options[$option]=$value + 0; |
|
| 106 | + } elseif(substr($low, 0, 8)=='function') { |
|
| 107 | + $this->_options[$option]=new TJavaScriptLiteral($value); |
|
| 108 | 108 | } else { |
| 109 | - $this->_options[$option] = $value; |
|
| 109 | + $this->_options[$option]=$value; |
|
| 110 | 110 | } |
| 111 | 111 | return; |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - throw new TConfigurationException('juioptions_option_invalid',$this->_control->ID, $name); |
|
| 115 | + throw new TConfigurationException('juioptions_option_invalid', $this->_control->ID, $name); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | foreach($this->_control->getValidOptions() as $option) |
| 130 | 130 | { |
| 131 | - if(0 == strcasecmp($name, $option) && isset($this->_options[$option])) |
|
| 131 | + if(0==strcasecmp($name, $option) && isset($this->_options[$option])) |
|
| 132 | 132 | { |
| 133 | 133 | return $this->_options[$option]; |
| 134 | 134 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function toArray() |
| 152 | 152 | { |
| 153 | - $ret= ($this->_options===null) ? array() : $this->_options; |
|
| 153 | + $ret=($this->_options===null) ? array() : $this->_options; |
|
| 154 | 154 | |
| 155 | 155 | foreach($this->_control->getValidEvents() as $event) |
| 156 | 156 | if($this->_control->hasEventHandler('on'.$event)) |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | $callbackParam=$param->CallbackParameter; |
| 169 | 169 | if(isset($callbackParam->event)) |
| 170 | 170 | { |
| 171 | - $eventName = 'On'.ucfirst($callbackParam->event); |
|
| 171 | + $eventName='On'.ucfirst($callbackParam->event); |
|
| 172 | 172 | if($this->_control->hasEventHandler($eventName)) |
| 173 | 173 | { |
| 174 | - $this->_control->$eventName( new TJuiEventParameter( |
|
| 174 | + $this->_control->$eventName(new TJuiEventParameter( |
|
| 175 | 175 | $this->_control->getResponse(), |
| 176 | 176 | isset($callbackParam->ui) ? $callbackParam->ui : null) |
| 177 | 177 | ); |
@@ -25,9 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | class TJuiControlAdapter extends TActiveControlAdapter |
| 27 | 27 | { |
| 28 | - const SCRIPT_PATH = 'jquery'; |
|
| 29 | - const CSS_PATH = 'css'; |
|
| 30 | - const BASE_CSS_FILENAME ='jquery-ui.css'; |
|
| 28 | + const SCRIPT_PATH='jquery'; |
|
| 29 | + const CSS_PATH='css'; |
|
| 30 | + const BASE_CSS_FILENAME='jquery-ui.css'; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Replace default StateTracker with {@link TJuiCallbackPageStateTracker} for |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | protected function getAssetUrl($file='') |
| 74 | 74 | { |
| 75 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 75 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
| 76 | 76 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function publishJuiStyle($file) |
| 85 | 85 | { |
| 86 | - $url = $this->getAssetUrl(self::CSS_PATH.'/'.$this->getJuiBaseStyle().'/'.$file); |
|
| 87 | - $cs = $this->getPage()->getClientScript(); |
|
| 86 | + $url=$this->getAssetUrl(self::CSS_PATH.'/'.$this->getJuiBaseStyle().'/'.$file); |
|
| 87 | + $cs=$this->getPage()->getClientScript(); |
|
| 88 | 88 | if(!$cs->isStyleSheetFileRegistered($url)) |
| 89 | 89 | $cs->registerStyleSheetFile($url, $url); |
| 90 | 90 | return $url; |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $control=null; |
| 141 | 141 | $service=prado::getApplication()->getService(); |
| 142 | - if ($service instanceof TPageService) |
|
| 142 | + if($service instanceof TPageService) |
|
| 143 | 143 | { |
| 144 | 144 | // Find the control |
| 145 | 145 | // Warning, this will not work if you have a '_' in your control Id ! |
| 146 | - $controlId=str_replace(TControl::CLIENT_ID_SEPARATOR,TControl::ID_SEPARATOR,$id); |
|
| 146 | + $controlId=str_replace(TControl::CLIENT_ID_SEPARATOR, TControl::ID_SEPARATOR, $id); |
|
| 147 | 147 | $control=$service->getRequestedPage()->findControl($controlId); |
| 148 | 148 | } |
| 149 | 149 | return $control; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function __get($name) |
| 159 | 159 | { |
| 160 | - $pos=strpos($name, 'Control',1); |
|
| 160 | + $pos=strpos($name, 'Control', 1); |
|
| 161 | 161 | $name=strtolower(substr($name, 0, $pos)); |
| 162 | 162 | |
| 163 | 163 | $cp=$this->getCallbackParameter(); |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | protected function addStatesToTrack() |
| 186 | 186 | { |
| 187 | 187 | parent::addStatesToTrack(); |
| 188 | - $states = $this->getStatesToTrack(); |
|
| 189 | - $states['JuiOptions'] = array('TMapCollectionDiff', array($this, 'updateJuiOptions')); |
|
| 188 | + $states=$this->getStatesToTrack(); |
|
| 189 | + $states['JuiOptions']=array('TMapCollectionDiff', array($this, 'updateJuiOptions')); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | protected function updateJuiOptions($options) |
| 197 | 197 | { |
| 198 | - foreach ($options as $key => $value) $options[$key] = $key . ': ' . (is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value)); |
|
| 199 | - $code = "jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { " . implode(', ', $options) . " });"; |
|
| 198 | + foreach($options as $key => $value) $options[$key]=$key.': '.(is_string($value) ? "'{$value}'" : TPropertyValue::ensureString($value)); |
|
| 199 | + $code="jQuery('#{$this->_control->getWidgetID()}').{$this->_control->getWidget()}('option', { ".implode(', ', $options)." });"; |
|
| 200 | 200 | $this->_control->getPage()->getClientScript()->registerEndScript(sprintf('%08X', crc32($code)), $code); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function getOptions() |
| 94 | 94 | { |
| 95 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 95 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 96 | 96 | { |
| 97 | 97 | $options=new TJuiControlOptions($this); |
| 98 | 98 | $this->setViewState('JuiOptions', $options); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | parent::addAttributesToRender($writer); |
| 136 | 136 | |
| 137 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 137 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 138 | 138 | $options=TJavascript::encode($this->getPostBackOptions()); |
| 139 | 139 | $cs=$this->getPage()->getClientScript(); |
| 140 | 140 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * Raises the OnActivate event |
| 156 | 156 | * @param object $params event parameters |
| 157 | 157 | */ |
| 158 | - public function onActivate ($params) |
|
| 158 | + public function onActivate($params) |
|
| 159 | 159 | { |
| 160 | 160 | $this->raiseEvent('OnActivate', $this, $params); |
| 161 | 161 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * Raises the OnCreate event |
| 165 | 165 | * @param object $params event parameters |
| 166 | 166 | */ |
| 167 | - public function onCreate ($params) |
|
| 167 | + public function onCreate($params) |
|
| 168 | 168 | { |
| 169 | 169 | $this->raiseEvent('OnCreate', $this, $params); |
| 170 | 170 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * Raises the OnDeactivate event |
| 174 | 174 | * @param object $params event parameters |
| 175 | 175 | */ |
| 176 | - public function onDeactivate ($params) |
|
| 176 | + public function onDeactivate($params) |
|
| 177 | 177 | { |
| 178 | 178 | $this->raiseEvent('OnDeactivate', $this, $params); |
| 179 | 179 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * Raises the OnDrop event |
| 183 | 183 | * @param object $params event parameters |
| 184 | 184 | */ |
| 185 | - public function onDrop ($params) |
|
| 185 | + public function onDrop($params) |
|
| 186 | 186 | { |
| 187 | 187 | $this->raiseEvent('OnDrop', $this, $params); |
| 188 | 188 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * Raises the OnOut event |
| 192 | 192 | * @param object $params event parameters |
| 193 | 193 | */ |
| 194 | - public function OnOut ($params) |
|
| 194 | + public function OnOut($params) |
|
| 195 | 195 | { |
| 196 | 196 | $this->raiseEvent('OnOut', $this, $params); |
| 197 | 197 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | * Raises the OnOver event |
| 201 | 201 | * @param object $params event parameters |
| 202 | 202 | */ |
| 203 | - public function OnOver ($params) |
|
| 203 | + public function OnOver($params) |
|
| 204 | 204 | { |
| 205 | 205 | $this->raiseEvent('OnOver', $this, $params); |
| 206 | 206 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function getOptions() |
| 70 | 70 | { |
| 71 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 71 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 72 | 72 | { |
| 73 | 73 | $options=new TJuiControlOptions($this); |
| 74 | 74 | $this->setViewState('JuiOptions', $options); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | parent::addAttributesToRender($writer); |
| 112 | 112 | |
| 113 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 113 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 114 | 114 | $options=TJavascript::encode($this->getPostBackOptions()); |
| 115 | 115 | $cs=$this->getPage()->getClientScript(); |
| 116 | 116 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function getWidgetID() |
| 64 | 64 | { |
| 65 | - return $this->getClientID() . '_0'; |
|
| 65 | + return $this->getClientID().'_0'; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function getOptions() |
| 73 | 73 | { |
| 74 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 74 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 75 | 75 | { |
| 76 | 76 | $options=new TJuiControlOptions($this); |
| 77 | 77 | $this->setViewState('JuiOptions', $options); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | protected function getPostBackOptions() |
| 104 | 104 | { |
| 105 | - $options = $this->getOptions()->toArray(); |
|
| 105 | + $options=$this->getOptions()->toArray(); |
|
| 106 | 106 | // overload some events to add information about the items order |
| 107 | 107 | foreach($options as $event => $implementation) |
| 108 | 108 | { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | protected function addAttributesToRender($writer) |
| 120 | 120 | { |
| 121 | 121 | parent::addAttributesToRender($writer); |
| 122 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 122 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 123 | 123 | $options=TJavascript::encode($this->getPostBackOptions()); |
| 124 | 124 | $cs=$this->getPage()->getClientScript(); |
| 125 | 125 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * Raises the OnActivate event |
| 141 | 141 | * @param object $params event parameters |
| 142 | 142 | */ |
| 143 | - public function onActivate ($params) |
|
| 143 | + public function onActivate($params) |
|
| 144 | 144 | { |
| 145 | 145 | $this->raiseEvent('OnActivate', $this, $params); |
| 146 | 146 | } |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * Raises the OnBeforeStop event |
| 150 | 150 | * @param object $params event parameters |
| 151 | 151 | */ |
| 152 | - public function onBeforeStop ($params) |
|
| 152 | + public function onBeforeStop($params) |
|
| 153 | 153 | { |
| 154 | 154 | $this->raiseEvent('OnBeforeStop', $this, $params); |
| 155 | 155 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * Raises the OnChange event |
| 159 | 159 | * @param object $params event parameters |
| 160 | 160 | */ |
| 161 | - public function onChange ($params) |
|
| 161 | + public function onChange($params) |
|
| 162 | 162 | { |
| 163 | 163 | $this->raiseEvent('OnChange', $this, $params); |
| 164 | 164 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * Raises the OnCreate event |
| 168 | 168 | * @param object $params event parameters |
| 169 | 169 | */ |
| 170 | - public function onCreate ($params) |
|
| 170 | + public function onCreate($params) |
|
| 171 | 171 | { |
| 172 | 172 | $this->raiseEvent('OnCreate', $this, $params); |
| 173 | 173 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * Raises the OnDeactivate event |
| 177 | 177 | * @param object $params event parameters |
| 178 | 178 | */ |
| 179 | - public function onDeactivate ($params) |
|
| 179 | + public function onDeactivate($params) |
|
| 180 | 180 | { |
| 181 | 181 | $this->raiseEvent('OnDeactivate', $this, $params); |
| 182 | 182 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * Raises the OnOut event |
| 186 | 186 | * @param object $params event parameters |
| 187 | 187 | */ |
| 188 | - public function onOut ($params) |
|
| 188 | + public function onOut($params) |
|
| 189 | 189 | { |
| 190 | 190 | $this->raiseEvent('OnOut', $this, $params); |
| 191 | 191 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | * Raises the OnOver event |
| 195 | 195 | * @param object $params event parameters |
| 196 | 196 | */ |
| 197 | - public function onOver ($params) |
|
| 197 | + public function onOver($params) |
|
| 198 | 198 | { |
| 199 | 199 | $this->raiseEvent('OnOver', $this, $params); |
| 200 | 200 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | * Raises the OnReceive event |
| 204 | 204 | * @param object $params event parameters |
| 205 | 205 | */ |
| 206 | - public function onReceive ($params) |
|
| 206 | + public function onReceive($params) |
|
| 207 | 207 | { |
| 208 | 208 | $this->raiseEvent('OnReceive', $this, $params); |
| 209 | 209 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * Raises the OnRemove event |
| 213 | 213 | * @param object $params event parameters |
| 214 | 214 | */ |
| 215 | - public function onRemove ($params) |
|
| 215 | + public function onRemove($params) |
|
| 216 | 216 | { |
| 217 | 217 | $this->raiseEvent('OnRemove', $this, $params); |
| 218 | 218 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | * Raises the OnSort event |
| 222 | 222 | * @param object $params event parameters |
| 223 | 223 | */ |
| 224 | - public function onSort ($params) |
|
| 224 | + public function onSort($params) |
|
| 225 | 225 | { |
| 226 | 226 | $this->raiseEvent('OnSort', $this, $params); |
| 227 | 227 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | * Raises the OnStart event |
| 231 | 231 | * @param object $params event parameters |
| 232 | 232 | */ |
| 233 | - public function onStart ($params) |
|
| 233 | + public function onStart($params) |
|
| 234 | 234 | { |
| 235 | 235 | $this->raiseEvent('OnStart', $this, $params); |
| 236 | 236 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | * Raises the OnStop event |
| 240 | 240 | * @param object $params event parameters |
| 241 | 241 | */ |
| 242 | - public function OnStop ($params) |
|
| 242 | + public function OnStop($params) |
|
| 243 | 243 | { |
| 244 | 244 | $this->raiseEvent('OnStop', $this, $params); |
| 245 | 245 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * Raises the OnUpdate event |
| 249 | 249 | * @param object $params event parameters |
| 250 | 250 | */ |
| 251 | - public function onUpdate ($params) |
|
| 251 | + public function onUpdate($params) |
|
| 252 | 252 | { |
| 253 | 253 | $this->raiseEvent('OnUpdate', $this, $params); |
| 254 | 254 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | public function getSortables() |
| 284 | 284 | { |
| 285 | 285 | if($this->_repeater===null) |
| 286 | - $this->_repeater = $this->createRepeater(); |
|
| 286 | + $this->_repeater=$this->createRepeater(); |
|
| 287 | 287 | return $this->_repeater; |
| 288 | 288 | } |
| 289 | 289 | |
@@ -292,10 +292,10 @@ discard block |
||
| 292 | 292 | */ |
| 293 | 293 | protected function createRepeater() |
| 294 | 294 | { |
| 295 | - $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
| 295 | + $repeater=Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
| 296 | 296 | $repeater->setHeaderTemplate(new TJuiSortableTemplate('<ul id="'.$this->getWidgetID().'">')); |
| 297 | 297 | $repeater->setFooterTemplate(new TJuiSortableTemplate('</ul>')); |
| 298 | - $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>',null)); |
|
| 298 | + $repeater->setItemTemplate(new TTemplate('<li id="<%# $this->ItemIndex %>"><%# $this->Data %></li>', null)); |
|
| 299 | 299 | $repeater->setEmptyTemplate(new TJuiSortableTemplate('<ul></ul>')); |
| 300 | 300 | $this->getControls()->add($repeater); |
| 301 | 301 | return $repeater; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | |
| 320 | 320 | public function __construct($template) |
| 321 | 321 | { |
| 322 | - $this->_template = $template; |
|
| 322 | + $this->_template=$template; |
|
| 323 | 323 | } |
| 324 | 324 | /** |
| 325 | 325 | * Instantiates the template. |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function getOptions() |
| 125 | 125 | { |
| 126 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 126 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 127 | 127 | { |
| 128 | 128 | $options=new TJuiControlOptions($this); |
| 129 | 129 | $this->setViewState('JuiOptions', $options); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | public function getMinChars() |
| 206 | 206 | { |
| 207 | - return $this->getViewState('minChars',''); |
|
| 207 | + return $this->getViewState('minChars', ''); |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | /** |
@@ -228,17 +228,17 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | public function raiseCallbackEvent($param) |
| 230 | 230 | { |
| 231 | - $token = $param->getCallbackParameter(); |
|
| 232 | - if(is_array($token) && count($token) == 2) |
|
| 231 | + $token=$param->getCallbackParameter(); |
|
| 232 | + if(is_array($token) && count($token)==2) |
|
| 233 | 233 | { |
| 234 | - if($token[1] === '__TJuiAutoComplete_onSuggest__') |
|
| 234 | + if($token[1]==='__TJuiAutoComplete_onSuggest__') |
|
| 235 | 235 | { |
| 236 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
| 236 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
| 237 | 237 | $this->onSuggest($parameter); |
| 238 | 238 | } |
| 239 | - else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
| 239 | + else if($token[1]==='__TJuiAutoComplete_onSuggestionSelected__') |
|
| 240 | 240 | { |
| 241 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
| 241 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
| 242 | 242 | $this->onSuggestionSelected($parameter); |
| 243 | 243 | } |
| 244 | 244 | } |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | public function getResultPanel() |
| 296 | 296 | { |
| 297 | 297 | if($this->_resultPanel===null) |
| 298 | - $this->_resultPanel = $this->createResultPanel(); |
|
| 298 | + $this->_resultPanel=$this->createResultPanel(); |
|
| 299 | 299 | return $this->_resultPanel; |
| 300 | 300 | } |
| 301 | 301 | |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | protected function createResultPanel() |
| 306 | 306 | { |
| 307 | - $panel = Prado::createComponent('System.Web.UI.WebControls.TPanel'); |
|
| 307 | + $panel=Prado::createComponent('System.Web.UI.WebControls.TPanel'); |
|
| 308 | 308 | $this->getControls()->add($panel); |
| 309 | 309 | $panel->setID('result'); |
| 310 | 310 | return $panel; |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | public function getSuggestions() |
| 317 | 317 | { |
| 318 | 318 | if($this->_repeater===null) |
| 319 | - $this->_repeater = $this->createRepeater(); |
|
| 319 | + $this->_repeater=$this->createRepeater(); |
|
| 320 | 320 | return $this->_repeater; |
| 321 | 321 | } |
| 322 | 322 | |
@@ -325,8 +325,8 @@ discard block |
||
| 325 | 325 | */ |
| 326 | 326 | protected function createRepeater() |
| 327 | 327 | { |
| 328 | - $repeater = Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
| 329 | - $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>',null)); |
|
| 328 | + $repeater=Prado::createComponent('System.Web.UI.WebControls.TRepeater'); |
|
| 329 | + $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>', null)); |
|
| 330 | 330 | $this->getControls()->add($repeater); |
| 331 | 331 | return $repeater; |
| 332 | 332 | } |
@@ -368,12 +368,12 @@ discard block |
||
| 368 | 368 | { |
| 369 | 369 | $data=array(); |
| 370 | 370 | $items=$this->getSuggestions()->getItems(); |
| 371 | - $writer = new TTextWriter; |
|
| 372 | - for($i=0; $i<$items->Count; $i++) |
|
| 371 | + $writer=new TTextWriter; |
|
| 372 | + for($i=0; $i < $items->Count; $i++) |
|
| 373 | 373 | { |
| 374 | 374 | $items->itemAt($i)->render($writer); |
| 375 | 375 | $item=$writer->flush(); |
| 376 | - $data[]=array( 'id' => $i, 'label' => $item); |
|
| 376 | + $data[]=array('id' => $i, 'label' => $item); |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | $this->getResponse()->getAdapter()->setResponseData($data); |
@@ -385,25 +385,25 @@ discard block |
||
| 385 | 385 | */ |
| 386 | 386 | protected function getPostBackOptions() |
| 387 | 387 | { |
| 388 | - $options = $this->getOptions()->toArray(); |
|
| 388 | + $options=$this->getOptions()->toArray(); |
|
| 389 | 389 | |
| 390 | - if(strlen($separator = $this->getSeparator())) |
|
| 391 | - $options['Separators'] = $separator; |
|
| 390 | + if(strlen($separator=$this->getSeparator())) |
|
| 391 | + $options['Separators']=$separator; |
|
| 392 | 392 | |
| 393 | 393 | if($this->getAutoPostBack()) |
| 394 | 394 | { |
| 395 | - $options = array_merge($options,parent::getPostBackOptions()); |
|
| 396 | - $options['AutoPostBack'] = true; |
|
| 395 | + $options=array_merge($options, parent::getPostBackOptions()); |
|
| 396 | + $options['AutoPostBack']=true; |
|
| 397 | 397 | } |
| 398 | - if(strlen($textCssClass = $this->getTextCssClass())) |
|
| 399 | - $options['textCssClass'] = $textCssClass; |
|
| 400 | - $options['minLength'] = $this->getMinChars(); |
|
| 401 | - $options['delay'] = $this->getFrequency()*1000.0; |
|
| 402 | - $options['appendTo'] = '#'.$this->getResultPanel()->getClientID(); |
|
| 403 | - $options['ID'] = $this->getClientID(); |
|
| 404 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 405 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
| 406 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
| 398 | + if(strlen($textCssClass=$this->getTextCssClass())) |
|
| 399 | + $options['textCssClass']=$textCssClass; |
|
| 400 | + $options['minLength']=$this->getMinChars(); |
|
| 401 | + $options['delay']=$this->getFrequency() * 1000.0; |
|
| 402 | + $options['appendTo']='#'.$this->getResultPanel()->getClientID(); |
|
| 403 | + $options['ID']=$this->getClientID(); |
|
| 404 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 405 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
| 406 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
| 407 | 407 | return $options; |
| 408 | 408 | } |
| 409 | 409 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | |
| 482 | 482 | public function __construct($template) |
| 483 | 483 | { |
| 484 | - $this->_template = $template; |
|
| 484 | + $this->_template=$template; |
|
| 485 | 485 | } |
| 486 | 486 | /** |
| 487 | 487 | * Instantiates the template. |