@@ -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. |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function createChildControls() |
45 | 45 | { |
46 | - if(null === ($_template = $this->getTemplate())) { |
|
46 | + if(null===($_template=$this->getTemplate())) { |
|
47 | 47 | return $this->doCreateChildControlsFor(get_class($this)); |
48 | 48 | } |
49 | 49 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function doCreateChildControlsFor($parentClass) |
68 | 68 | { |
69 | - if(false !== ($_parentClass = get_parent_class($parentClass)) && 'TTemplateControl' != $_parentClass) { |
|
69 | + if(false!==($_parentClass=get_parent_class($parentClass)) && 'TTemplateControl'!=$_parentClass) { |
|
70 | 70 | $this->doCreateChildControlsFor($_parentClass); |
71 | 71 | } |
72 | 72 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function doTemplateForClass($parentClass) |
84 | 84 | { |
85 | - if(null !== ($_template = $this->getService()->getTemplateManager()->getTemplateByClassName($parentClass))) { |
|
85 | + if(null!==($_template=$this->getService()->getTemplateManager()->getTemplateByClassName($parentClass))) { |
|
86 | 86 | foreach($_template->getDirective() as $_name => $_value) { |
87 | 87 | if(!is_string($_value)) { |
88 | 88 | throw new TConfigurationException('templatecontrol_directive_invalid', get_class(this), $_name); |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function getIsSourceTemplateControl() |
107 | 107 | { |
108 | - if(null !== ($_template = $this->getTemplate())) { |
|
108 | + if(null!==($_template=$this->getTemplate())) { |
|
109 | 109 | return $_template->getIsSourceTemplate(); |
110 | 110 | } |
111 | 111 | |
112 | - return ($_template = $this->getService()->getTemplateManager()->getTemplateByClassName(get_parent_class($this))) |
|
112 | + return ($_template=$this->getService()->getTemplateManager()->getTemplateByClassName(get_parent_class($this))) |
|
113 | 113 | ? $_template->getIsSourceTemplate() |
114 | 114 | : false; |
115 | 115 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function save($state) |
52 | 52 | { |
53 | - $this->_page->setClientState(TPageStateFormatter::serialize($this->_page,$state)); |
|
53 | + $this->_page->setClientState(TPageStateFormatter::serialize($this->_page, $state)); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function load() |
62 | 62 | { |
63 | - if(($data=TPageStateFormatter::unserialize($this->_page,$this->_page->getRequestClientState()))!==null) |
|
63 | + if(($data=TPageStateFormatter::unserialize($this->_page, $this->_page->getRequestClientState()))!==null) |
|
64 | 64 | return $data; |
65 | 65 | else |
66 | - throw new THttpException(400,'pagestatepersister_pagestate_corrupted'); |
|
66 | + throw new THttpException(400, 'pagestatepersister_pagestate_corrupted'); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $this->_urlPrefix=$request->getApplicationUrl(); |
117 | 117 | } |
118 | 118 | } |
119 | - $this->_urlPrefix=rtrim($this->_urlPrefix,'/'); |
|
119 | + $this->_urlPrefix=rtrim($this->_urlPrefix, '/'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP) |
131 | 131 | { |
132 | - $config = include $this->_configFile; |
|
132 | + $config=include $this->_configFile; |
|
133 | 133 | $this->loadUrlMappings($dom); |
134 | 134 | } |
135 | 135 | else |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | } |
142 | 142 | else |
143 | - throw new TConfigurationException('urlmapping_configfile_inexistent',$this->_configFile); |
|
143 | + throw new TConfigurationException('urlmapping_configfile_inexistent', $this->_configFile); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function setConfigFile($value) |
203 | 203 | { |
204 | - if(($this->_configFile=Prado::getPathOfNamespace($value,$this->getApplication()->getConfigurationFileExt()))===null) |
|
205 | - throw new TConfigurationException('urlmapping_configfile_invalid',$value); |
|
204 | + if(($this->_configFile=Prado::getPathOfNamespace($value, $this->getApplication()->getConfigurationFileExt()))===null) |
|
205 | + throw new TConfigurationException('urlmapping_configfile_invalid', $value); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | protected function loadUrlMappings($config) |
235 | 235 | { |
236 | - $defaultClass = $this->getDefaultMappingClass(); |
|
236 | + $defaultClass=$this->getDefaultMappingClass(); |
|
237 | 237 | |
238 | 238 | if(is_array($config)) |
239 | 239 | { |
@@ -241,9 +241,9 @@ discard block |
||
241 | 241 | { |
242 | 242 | foreach($config['urls'] as $url) |
243 | 243 | { |
244 | - $class=isset($url['class'])?$url['class']:$defaultClass; |
|
245 | - $properties = isset($url['properties'])?$url['properties']:array(); |
|
246 | - $this->buildUrlMapping($class,$properties,$url); |
|
244 | + $class=isset($url['class']) ? $url['class'] : $defaultClass; |
|
245 | + $properties=isset($url['properties']) ? $url['properties'] : array(); |
|
246 | + $this->buildUrlMapping($class, $properties, $url); |
|
247 | 247 | } |
248 | 248 | } |
249 | 249 | } |
@@ -254,24 +254,24 @@ discard block |
||
254 | 254 | $properties=$url->getAttributes(); |
255 | 255 | if(($class=$properties->remove('class'))===null) |
256 | 256 | $class=$defaultClass; |
257 | - $this->buildUrlMapping($class,$properties,$url); |
|
257 | + $this->buildUrlMapping($class, $properties, $url); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | } |
261 | 261 | |
262 | 262 | private function buildUrlMapping($class, $properties, $url) |
263 | 263 | { |
264 | - $pattern=Prado::createComponent($class,$this); |
|
264 | + $pattern=Prado::createComponent($class, $this); |
|
265 | 265 | if(!($pattern instanceof TUrlMappingPattern)) |
266 | 266 | throw new TConfigurationException('urlmapping_urlmappingpattern_required'); |
267 | 267 | foreach($properties as $name=>$value) |
268 | - $pattern->setSubproperty($name,$value); |
|
268 | + $pattern->setSubproperty($name, $value); |
|
269 | 269 | |
270 | 270 | if($url instanceof TXmlElement) { |
271 | - $text = $url -> getValue(); |
|
271 | + $text=$url -> getValue(); |
|
272 | 272 | if($text) { |
273 | - $text = preg_replace('/(\s+)/S', '', $text); |
|
274 | - if(($regExp = $pattern->getRegularExpression()) !== '') |
|
273 | + $text=preg_replace('/(\s+)/S', '', $text); |
|
274 | + if(($regExp=$pattern->getRegularExpression())!=='') |
|
275 | 275 | trigger_error(sPrintF('%s.RegularExpression property value "%s" for ServiceID="%s" and ServiceParameter="%s" was replaced by node value "%s"', |
276 | 276 | get_class($pattern), |
277 | 277 | $regExp, |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | foreach($this->_patterns as $pattern) |
305 | 305 | { |
306 | 306 | $matches=$pattern->getPatternMatches($request); |
307 | - if(count($matches)>0) |
|
307 | + if(count($matches) > 0) |
|
308 | 308 | { |
309 | 309 | $this->_matched=$pattern; |
310 | 310 | $params=array(); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | if(is_string($key)) |
314 | 314 | $params[$key]=$value; |
315 | 315 | } |
316 | - if (!$pattern->getIsWildCardPattern()) |
|
316 | + if(!$pattern->getIsWildCardPattern()) |
|
317 | 317 | $params[$pattern->getServiceID()]=$pattern->getServiceParameter(); |
318 | 318 | return $params; |
319 | 319 | } |
@@ -345,21 +345,21 @@ discard block |
||
345 | 345 | * @see parseUrl |
346 | 346 | * @since 3.1.1 |
347 | 347 | */ |
348 | - public function constructUrl($serviceID,$serviceParam,$getItems,$encodeAmpersand,$encodeGetItems) |
|
348 | + public function constructUrl($serviceID, $serviceParam, $getItems, $encodeAmpersand, $encodeGetItems) |
|
349 | 349 | { |
350 | 350 | if($this->_customUrl) |
351 | 351 | { |
352 | 352 | if(!(is_array($getItems) || ($getItems instanceof Traversable))) |
353 | 353 | $getItems=array(); |
354 | 354 | $key=$serviceID.':'.$serviceParam; |
355 | - $wildCardKey = ($pos=strrpos($serviceParam,'.'))!==false ? |
|
356 | - $serviceID.':'.substr($serviceParam,0,$pos).'.*' : $serviceID.':*'; |
|
355 | + $wildCardKey=($pos=strrpos($serviceParam, '.'))!==false ? |
|
356 | + $serviceID.':'.substr($serviceParam, 0, $pos).'.*' : $serviceID.':*'; |
|
357 | 357 | if(isset($this->_constructRules[$key])) |
358 | 358 | { |
359 | 359 | foreach($this->_constructRules[$key] as $rule) |
360 | 360 | { |
361 | 361 | if($rule->supportCustomUrl($getItems)) |
362 | - return $rule->constructUrl($getItems,$encodeAmpersand,$encodeGetItems); |
|
362 | + return $rule->constructUrl($getItems, $encodeAmpersand, $encodeGetItems); |
|
363 | 363 | } |
364 | 364 | } |
365 | 365 | elseif(isset($this->_constructRules[$wildCardKey])) |
@@ -368,13 +368,13 @@ discard block |
||
368 | 368 | { |
369 | 369 | if($rule->supportCustomUrl($getItems)) |
370 | 370 | { |
371 | - $getItems['*']= $pos ? substr($serviceParam,$pos+1) : $serviceParam; |
|
372 | - return $rule->constructUrl($getItems,$encodeAmpersand,$encodeGetItems); |
|
371 | + $getItems['*']=$pos ? substr($serviceParam, $pos + 1) : $serviceParam; |
|
372 | + return $rule->constructUrl($getItems, $encodeAmpersand, $encodeGetItems); |
|
373 | 373 | } |
374 | 374 | } |
375 | 375 | } |
376 | 376 | } |
377 | - return parent::constructUrl($serviceID,$serviceParam,$getItems,$encodeAmpersand,$encodeGetItems); |
|
377 | + return parent::constructUrl($serviceID, $serviceParam, $getItems, $encodeAmpersand, $encodeGetItems); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | * @var TUrlMappingPatternSecureConnection |
529 | 529 | * @since 3.2 |
530 | 530 | */ |
531 | - private $_secureConnection = TUrlMappingPatternSecureConnection::Automatic; |
|
531 | + private $_secureConnection=TUrlMappingPatternSecureConnection::Automatic; |
|
532 | 532 | |
533 | 533 | /** |
534 | 534 | * Constructor. |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | { |
557 | 557 | if($this->_serviceParameter===null) |
558 | 558 | throw new TConfigurationException('urlmappingpattern_serviceparameter_required', $this->getPattern()); |
559 | - if(strpos($this->_serviceParameter,'*')!==false) |
|
559 | + if(strpos($this->_serviceParameter, '*')!==false) |
|
560 | 560 | $this->_isWildCardPattern=true; |
561 | 561 | } |
562 | 562 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | { |
570 | 570 | $params=array(); |
571 | 571 | $values=array(); |
572 | - if ($this->_parameters) |
|
572 | + if($this->_parameters) |
|
573 | 573 | { |
574 | 574 | foreach($this->_parameters as $key=>$value) |
575 | 575 | { |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | $values[]='(?P<'.$key.'>'.$value.')'; |
578 | 578 | } |
579 | 579 | } |
580 | - if ($this->getIsWildCardPattern()) |
|
580 | + if($this->getIsWildCardPattern()) |
|
581 | 581 | { |
582 | 582 | $params[]='{*}'; |
583 | 583 | // service parameter must not contain '=' and '/' |
@@ -585,8 +585,8 @@ discard block |
||
585 | 585 | } |
586 | 586 | $params[]='/'; |
587 | 587 | $values[]='\\/'; |
588 | - $regexp=str_replace($params,$values,trim($this->getPattern(),'/').'/'); |
|
589 | - if ($this->_urlFormat===THttpRequestUrlFormat::Get) |
|
588 | + $regexp=str_replace($params, $values, trim($this->getPattern(), '/').'/'); |
|
589 | + if($this->_urlFormat===THttpRequestUrlFormat::Get) |
|
590 | 590 | $regexp='/^'.$regexp.'$/u'; |
591 | 591 | else |
592 | 592 | $regexp='/^'.$regexp.'(?P<urlparams>.*)$/u'; |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | */ |
674 | 674 | public function setPattern($value) |
675 | 675 | { |
676 | - $this->_pattern = $value; |
|
676 | + $this->_pattern=$value; |
|
677 | 677 | } |
678 | 678 | |
679 | 679 | /** |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | */ |
682 | 682 | public function getParameters() |
683 | 683 | { |
684 | - if (!$this->_parameters) |
|
684 | + if(!$this->_parameters) |
|
685 | 685 | { |
686 | 686 | $this->_parameters=new TAttributeCollection; |
687 | 687 | $this->_parameters->setCaseSensitive(true); |
@@ -703,9 +703,9 @@ discard block |
||
703 | 703 | */ |
704 | 704 | public function getConstants() |
705 | 705 | { |
706 | - if (!$this->_constants) |
|
706 | + if(!$this->_constants) |
|
707 | 707 | { |
708 | - $this->_constants = new TAttributeCollection; |
|
708 | + $this->_constants=new TAttributeCollection; |
|
709 | 709 | $this->_constants->setCaseSensitive(true); |
710 | 710 | } |
711 | 711 | return $this->_constants; |
@@ -721,17 +721,17 @@ discard block |
||
721 | 721 | { |
722 | 722 | $matches=array(); |
723 | 723 | if(($pattern=$this->getRegularExpression())!=='') |
724 | - preg_match($pattern,$request->getPathInfo(),$matches); |
|
724 | + preg_match($pattern, $request->getPathInfo(), $matches); |
|
725 | 725 | else |
726 | - preg_match($this->getParameterizedPattern(),trim($request->getPathInfo(),'/').'/',$matches); |
|
726 | + preg_match($this->getParameterizedPattern(), trim($request->getPathInfo(), '/').'/', $matches); |
|
727 | 727 | |
728 | 728 | if($this->getIsWildCardPattern() && isset($matches[$this->_serviceID])) |
729 | - $matches[$this->_serviceID]=str_replace('*',$matches[$this->_serviceID],$this->_serviceParameter); |
|
729 | + $matches[$this->_serviceID]=str_replace('*', $matches[$this->_serviceID], $this->_serviceParameter); |
|
730 | 730 | |
731 | - if (isset($matches['urlparams'])) |
|
731 | + if(isset($matches['urlparams'])) |
|
732 | 732 | { |
733 | - $params=explode('/',$matches['urlparams']); |
|
734 | - if ($this->_separator==='/') |
|
733 | + $params=explode('/', $matches['urlparams']); |
|
734 | + if($this->_separator==='/') |
|
735 | 735 | { |
736 | 736 | while($key=array_shift($params)) |
737 | 737 | $matches[$key]=($value=array_shift($params)) ? $value : ''; |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | array_pop($params); |
742 | 742 | foreach($params as $param) |
743 | 743 | { |
744 | - list($key,$value)=explode($this->_separator,$param,2); |
|
744 | + list($key, $value)=explode($this->_separator, $param, 2); |
|
745 | 745 | $matches[$key]=$value; |
746 | 746 | } |
747 | 747 | } |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | if(count($matches) > 0 && $this->_constants) |
752 | 752 | { |
753 | 753 | foreach($this->_constants->toArray() as $key=>$value) |
754 | - $matches[$key] = $value; |
|
754 | + $matches[$key]=$value; |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | return $matches; |
@@ -805,7 +805,7 @@ discard block |
||
805 | 805 | */ |
806 | 806 | public function setUrlFormat($value) |
807 | 807 | { |
808 | - $this->_urlFormat=TPropertyValue::ensureEnum($value,'THttpRequestUrlFormat'); |
|
808 | + $this->_urlFormat=TPropertyValue::ensureEnum($value, 'THttpRequestUrlFormat'); |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | /** |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | */ |
844 | 844 | public function setSecureConnection($value) |
845 | 845 | { |
846 | - $this->_secureConnection = TPropertyValue::ensureEnum($value, 'TUrlMappingPatternSecureConnection'); |
|
846 | + $this->_secureConnection=TPropertyValue::ensureEnum($value, 'TUrlMappingPatternSecureConnection'); |
|
847 | 847 | } |
848 | 848 | |
849 | 849 | /** |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | { |
856 | 856 | if(!$this->_customUrl || $this->getPattern()===null) |
857 | 857 | return false; |
858 | - if ($this->_parameters) |
|
858 | + if($this->_parameters) |
|
859 | 859 | { |
860 | 860 | foreach($this->_parameters as $key=>$value) |
861 | 861 | { |
@@ -864,13 +864,13 @@ discard block |
||
864 | 864 | } |
865 | 865 | } |
866 | 866 | |
867 | - if ($this->_constants) |
|
867 | + if($this->_constants) |
|
868 | 868 | { |
869 | 869 | foreach($this->_constants->toArray() as $key=>$value) |
870 | 870 | { |
871 | - if (!isset($getItems[$key])) |
|
871 | + if(!isset($getItems[$key])) |
|
872 | 872 | return false; |
873 | - if ($getItems[$key]!=$value) |
|
873 | + if($getItems[$key]!=$value) |
|
874 | 874 | return false; |
875 | 875 | } |
876 | 876 | } |
@@ -885,9 +885,9 @@ discard block |
||
885 | 885 | * @return string the constructed URL |
886 | 886 | * @since 3.1.1 |
887 | 887 | */ |
888 | - public function constructUrl($getItems,$encodeAmpersand,$encodeGetItems) |
|
888 | + public function constructUrl($getItems, $encodeAmpersand, $encodeGetItems) |
|
889 | 889 | { |
890 | - if ($this->_constants) |
|
890 | + if($this->_constants) |
|
891 | 891 | { |
892 | 892 | foreach($this->_constants->toArray() as $key=>$value) |
893 | 893 | { |
@@ -906,19 +906,19 @@ discard block |
||
906 | 906 | $extra[$key]=$value; |
907 | 907 | } |
908 | 908 | |
909 | - $url=$this->_manager->getUrlPrefix().'/'.ltrim(strtr($this->getPattern(),$replace),'/'); |
|
909 | + $url=$this->_manager->getUrlPrefix().'/'.ltrim(strtr($this->getPattern(), $replace), '/'); |
|
910 | 910 | |
911 | 911 | // for the rest of the GET variables, put them in the query string |
912 | - if(count($extra)>0) |
|
912 | + if(count($extra) > 0) |
|
913 | 913 | { |
914 | - if ($this->_urlFormat===THttpRequestUrlFormat::Path && $this->getIsWildCardPattern()) { |
|
915 | - foreach ($extra as $name=>$value) |
|
916 | - $url.='/'.$name.$this->_separator.($encodeGetItems?rawurlencode($value):$value); |
|
914 | + if($this->_urlFormat===THttpRequestUrlFormat::Path && $this->getIsWildCardPattern()) { |
|
915 | + foreach($extra as $name=>$value) |
|
916 | + $url.='/'.$name.$this->_separator.($encodeGetItems ? rawurlencode($value) : $value); |
|
917 | 917 | return $url; |
918 | 918 | } |
919 | 919 | |
920 | 920 | $url2=''; |
921 | - $amp=$encodeAmpersand?'&':'&'; |
|
921 | + $amp=$encodeAmpersand ? '&' : '&'; |
|
922 | 922 | if($encodeGetItems) |
923 | 923 | { |
924 | 924 | foreach($extra as $name=>$value) |
@@ -946,7 +946,7 @@ discard block |
||
946 | 946 | $url2.=$amp.$name.'='.$value; |
947 | 947 | } |
948 | 948 | } |
949 | - $url=$url.'?'.substr($url2,strlen($amp)); |
|
949 | + $url=$url.'?'.substr($url2, strlen($amp)); |
|
950 | 950 | } |
951 | 951 | return $this -> applySecureConnectionPrefix($url); |
952 | 952 | } |
@@ -962,26 +962,26 @@ discard block |
||
962 | 962 | protected function applySecureConnectionPrefix($url) |
963 | 963 | { |
964 | 964 | static $request; |
965 | - if($request === null) $request = Prado::getApplication() -> getRequest(); |
|
965 | + if($request===null) $request=Prado::getApplication() -> getRequest(); |
|
966 | 966 | |
967 | 967 | static $isSecureConnection; |
968 | - if($isSecureConnection === null) $isSecureConnection = $request -> getIsSecureConnection(); |
|
968 | + if($isSecureConnection===null) $isSecureConnection=$request -> getIsSecureConnection(); |
|
969 | 969 | |
970 | 970 | switch($this -> getSecureConnection()) |
971 | 971 | { |
972 | 972 | case TUrlMappingPatternSecureConnection::EnableIfNotSecure: |
973 | 973 | if($isSecureConnection) return $url; |
974 | - return $request -> getBaseUrl(true) . $url; |
|
974 | + return $request -> getBaseUrl(true).$url; |
|
975 | 975 | break; |
976 | 976 | case TUrlMappingPatternSecureConnection::DisableIfSecure: |
977 | 977 | if(!$isSecureConnection) return $url; |
978 | - return $request -> getBaseUrl(false) . $url; |
|
978 | + return $request -> getBaseUrl(false).$url; |
|
979 | 979 | break; |
980 | 980 | case TUrlMappingPatternSecureConnection::Enable: |
981 | - return $request -> getBaseUrl(true) . $url; |
|
981 | + return $request -> getBaseUrl(true).$url; |
|
982 | 982 | break; |
983 | 983 | case TUrlMappingPatternSecureConnection::Disable: |
984 | - return $request -> getBaseUrl(false) . $url; |
|
984 | + return $request -> getBaseUrl(false).$url; |
|
985 | 985 | break; |
986 | 986 | case TUrlMappingPatternSecureConnection::Automatic: |
987 | 987 | default: |
@@ -1007,29 +1007,29 @@ discard block |
||
1007 | 1007 | * Keep current SecureConnection status |
1008 | 1008 | * means no prefixing |
1009 | 1009 | */ |
1010 | - const Automatic = 'Automatic'; |
|
1010 | + const Automatic='Automatic'; |
|
1011 | 1011 | |
1012 | 1012 | /** |
1013 | 1013 | * Force use secured connection |
1014 | 1014 | * always prefixing with https://example.com/path/to/app |
1015 | 1015 | */ |
1016 | - const Enable = 'Enable'; |
|
1016 | + const Enable='Enable'; |
|
1017 | 1017 | |
1018 | 1018 | /** |
1019 | 1019 | * Force use unsecured connection |
1020 | 1020 | * always prefixing with http://example.com/path/to/app |
1021 | 1021 | */ |
1022 | - const Disable = 'Disable'; |
|
1022 | + const Disable='Disable'; |
|
1023 | 1023 | |
1024 | 1024 | /** |
1025 | 1025 | * Force use secured connection, if in unsecured mode |
1026 | 1026 | * prefixing with https://example.com/path/to/app |
1027 | 1027 | */ |
1028 | - const EnableIfNotSecure = 'EnableIfNotSecure'; |
|
1028 | + const EnableIfNotSecure='EnableIfNotSecure'; |
|
1029 | 1029 | |
1030 | 1030 | /** |
1031 | 1031 | * Force use unsecured connection, if in secured mode |
1032 | 1032 | * prefixing with https://example.com/path/to/app |
1033 | 1033 | */ |
1034 | - const DisableIfSecure = 'DisableIfSecure'; |
|
1034 | + const DisableIfSecure='DisableIfSecure'; |
|
1035 | 1035 | } |