@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | /** |
91 | 91 | * Sets the horizontal alignment of the contents within the table item. |
92 | - * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center' |
|
92 | + * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center' |
|
93 | 93 | * @param string the horizontal alignment |
94 | 94 | */ |
95 | 95 | public function setHorizontalAlign($value) |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | /** |
112 | 112 | * Sets the vertical alignment of the contents within the table item. |
113 | - * Valid values include 'NotSet','Top','Bottom','Middle' |
|
113 | + * Valid values include 'NotSet','Top','Bottom','Middle' |
|
114 | 114 | * @param string the horizontal alignment |
115 | 115 | */ |
116 | 116 | public function setVerticalAlign($value) |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getText() |
153 | 153 | { |
154 | - return $this->getViewState('Text',''); |
|
154 | + return $this->getViewState('Text', ''); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function setText($value) |
163 | 163 | { |
164 | - $this->setViewState('Text',$value,''); |
|
164 | + $this->setViewState('Text', $value, ''); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | protected function addAttributesToRender($writer) |
198 | 198 | { |
199 | 199 | parent::addAttributesToRender($writer); |
200 | - if(($colspan=$this->getColumnSpan())>0) |
|
201 | - $writer->addAttribute('colspan',"$colspan"); |
|
202 | - if(($rowspan=$this->getRowSpan())>0) |
|
203 | - $writer->addAttribute('rowspan',"$rowspan"); |
|
200 | + if(($colspan=$this->getColumnSpan()) > 0) |
|
201 | + $writer->addAttribute('colspan', "$colspan"); |
|
202 | + if(($rowspan=$this->getRowSpan()) > 0) |
|
203 | + $writer->addAttribute('rowspan', "$rowspan"); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -101,7 +101,7 @@ |
||
101 | 101 | |
102 | 102 | /** |
103 | 103 | * Sets the horizontal alignment of the contents within the panel. |
104 | - * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center' |
|
104 | + * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center' |
|
105 | 105 | * @param string the horizontal alignment |
106 | 106 | */ |
107 | 107 | public function setHorizontalAlign($value) |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | { |
72 | 72 | parent::addAttributesToRender($writer); |
73 | 73 | if(($butt=$this->getDefaultButton())!=='') |
74 | - $writer->addAttribute('id',$this->getClientID()); |
|
74 | + $writer->addAttribute('id', $this->getClientID()); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function getGroupingText() |
170 | 170 | { |
171 | - return $this->getViewState('GroupingText',''); |
|
171 | + return $this->getViewState('GroupingText', ''); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function setGroupingText($value) |
178 | 178 | { |
179 | - $this->setViewState('GroupingText',$value,''); |
|
179 | + $this->setViewState('GroupingText', $value, ''); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | if(($butt=$this->getDefaultButton())!=='') |
231 | 231 | { |
232 | 232 | if(($button=$this->findControl($butt))===null) |
233 | - throw new TInvalidDataValueException('panel_defaultbutton_invalid',$butt); |
|
233 | + throw new TInvalidDataValueException('panel_defaultbutton_invalid', $butt); |
|
234 | 234 | else |
235 | 235 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
236 | 236 | } |
@@ -60,8 +60,8 @@ |
||
60 | 60 | * @param THtmlWriter the writer used for the rendering purpose |
61 | 61 | */ |
62 | 62 | protected function addAttributesToRender($writer) { |
63 | - $writer->addAttribute('id',$this->getClientID()); |
|
64 | - parent::addAttributesToRender($writer); |
|
63 | + $writer->addAttribute('id',$this->getClientID()); |
|
64 | + parent::addAttributesToRender($writer); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setText($value) |
57 | 57 | { |
58 | - if(parent::getText() === $value) |
|
58 | + if(parent::getText()===$value) |
|
59 | 59 | return; |
60 | 60 | |
61 | 61 | parent::setText($value); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function setForControl($value) |
73 | 73 | { |
74 | - if(parent::getForControl() === $value) |
|
74 | + if(parent::getForControl()===$value) |
|
75 | 75 | return; |
76 | 76 | |
77 | 77 | parent::setForControl($value); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @param THtmlWriter the writer used for the rendering purpose |
88 | 88 | */ |
89 | 89 | protected function addAttributesToRender($writer) { |
90 | - $writer->addAttribute('id',$this->getClientID()); |
|
90 | + $writer->addAttribute('id', $this->getClientID()); |
|
91 | 91 | parent::addAttributesToRender($writer); |
92 | 92 | } |
93 | 93 | } |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function __construct() |
33 | 33 | { |
34 | - parent::__construct(); |
|
35 | - $this->setAdapter(new TActiveControlAdapter($this)); |
|
34 | + parent::__construct(); |
|
35 | + $this->setAdapter(new TActiveControlAdapter($this)); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getActiveControl() |
42 | 42 | { |
43 | - return $this->getAdapter()->getBaseActiveControl(); |
|
43 | + return $this->getAdapter()->getBaseActiveControl(); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function setDataSource($value) |
54 | 54 | { |
55 | - parent::setDataSource($value); |
|
56 | - if($this->getActiveControl()->canUpdateClientSide()) { |
|
57 | - $this->renderPager(); |
|
58 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
59 | - } |
|
55 | + parent::setDataSource($value); |
|
56 | + if($this->getActiveControl()->canUpdateClientSide()) { |
|
57 | + $this->renderPager(); |
|
58 | + $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
59 | + } |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function getContainerID() |
67 | 67 | { |
68 | - return $this->ClientID.'_Container'; |
|
68 | + return $this->ClientID.'_Container'; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function render($writer) |
78 | 78 | { |
79 | - if($this->getHasPreRendered()) { |
|
80 | - $this->renderDataList($writer); |
|
81 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
82 | - } |
|
83 | - else { |
|
84 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
85 | - } |
|
79 | + if($this->getHasPreRendered()) { |
|
80 | + $this->renderDataList($writer); |
|
81 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
82 | + } |
|
83 | + else { |
|
84 | + $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -92,14 +92,14 @@ discard block |
||
92 | 92 | */ |
93 | 93 | private function renderPager() |
94 | 94 | { |
95 | - $pager=$this->getPage()->findControlsByType('TActivePager', false); |
|
96 | - foreach($pager as $item) |
|
97 | - { |
|
98 | - if($item->ControlToPaginate==$this->ID) { |
|
99 | - $writer=$this->getResponse()->createHtmlWriter(); |
|
100 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
101 | - } |
|
102 | - } |
|
95 | + $pager=$this->getPage()->findControlsByType('TActivePager', false); |
|
96 | + foreach($pager as $item) |
|
97 | + { |
|
98 | + if($item->ControlToPaginate==$this->ID) { |
|
99 | + $writer=$this->getResponse()->createHtmlWriter(); |
|
100 | + $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
101 | + } |
|
102 | + } |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | */ |
110 | 110 | private function renderDataList($writer) |
111 | 111 | { |
112 | - $writer->write('<span id="'.$this->getContainerID().'">'); |
|
113 | - parent::render($writer); |
|
114 | - $writer->write('</span>'); |
|
112 | + $writer->write('<span id="'.$this->getContainerID().'">'); |
|
113 | + parent::render($writer); |
|
114 | + $writer->write('</span>'); |
|
115 | 115 | } |
116 | 116 | } |
@@ -79,8 +79,7 @@ |
||
79 | 79 | if($this->getHasPreRendered()) { |
80 | 80 | $this->renderDataList($writer); |
81 | 81 | if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
82 | - } |
|
83 | - else { |
|
82 | + } else { |
|
84 | 83 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
85 | 84 | } |
86 | 85 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | parent::setDataSource($value); |
56 | 56 | if($this->getActiveControl()->canUpdateClientSide()) { |
57 | 57 | $this->renderPager(); |
58 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
58 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | { |
79 | 79 | if($this->getHasPreRendered()) { |
80 | 80 | $this->renderDataList($writer); |
81 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
81 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer); |
|
82 | 82 | } |
83 | 83 | else { |
84 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
84 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | if($item->ControlToPaginate==$this->ID) { |
99 | 99 | $writer=$this->getResponse()->createHtmlWriter(); |
100 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
100 | + $this->getPage()->getAdapter()->registerControlToRender($item, $writer); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | } |
@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | 3 | * TDateTimeStamp class file. |
4 | - |
|
5 | 4 | * @author Fabio Bas ctrlaltca[AT]gmail[DOT]com |
6 | 5 | * @link https://github.com/pradosoft/prado |
7 | 6 | * @copyright Copyright © 2005-2015 The PRADO Group |
@@ -186,7 +185,7 @@ discard block |
||
186 | 185 | |
187 | 186 | /** |
188 | 187 | * @return integer|float a timestamp given a local time |
189 | - */ |
|
188 | + */ |
|
190 | 189 | function getTimeStamp($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_gmt=false) |
191 | 190 | { |
192 | 191 | $dt = new DateTime(); |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | */ |
26 | 26 | class TDateTimeStamp |
27 | 27 | { |
28 | - protected static $_month_normal = array("",31,28,31,30,31,30,31,31,30,31,30,31); |
|
29 | - protected static $_month_leaf = array("",31,29,31,30,31,30,31,31,30,31,30,31); |
|
28 | + protected static $_month_normal=array("", 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
|
29 | + protected static $_month_leaf=array("", 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Returns the day of the week (0=Sunday, 1=Monday, .. 6=Saturday) |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function getDayofWeek($year, $month, $day) |
38 | 38 | { |
39 | - $dt = new DateTime(); |
|
39 | + $dt=new DateTime(); |
|
40 | 40 | $dt->setDate($year, $month, $day); |
41 | 41 | return (int) $dt->format('w'); |
42 | 42 | } |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function isLeapYear($year) |
51 | 51 | { |
52 | - $year = $this->digitCheck($year); |
|
53 | - $dt = new DateTime(); |
|
52 | + $year=$this->digitCheck($year); |
|
53 | + $dt=new DateTime(); |
|
54 | 54 | $dt->setDate($year, 1, 1); |
55 | 55 | return (bool) $dt->format('L'); |
56 | 56 | } |
@@ -62,22 +62,22 @@ discard block |
||
62 | 62 | */ |
63 | 63 | protected function digitCheck($y) |
64 | 64 | { |
65 | - if ($y < 100){ |
|
66 | - $yr = (integer) date("Y"); |
|
67 | - $century = (integer) ($yr /100); |
|
65 | + if($y < 100) { |
|
66 | + $yr=(integer) date("Y"); |
|
67 | + $century=(integer) ($yr / 100); |
|
68 | 68 | |
69 | - if ($yr%100 > 50) { |
|
70 | - $c1 = $century + 1; |
|
71 | - $c0 = $century; |
|
69 | + if($yr % 100 > 50) { |
|
70 | + $c1=$century + 1; |
|
71 | + $c0=$century; |
|
72 | 72 | } else { |
73 | - $c1 = $century; |
|
74 | - $c0 = $century - 1; |
|
73 | + $c1=$century; |
|
74 | + $c0=$century - 1; |
|
75 | 75 | } |
76 | - $c1 *= 100; |
|
76 | + $c1*=100; |
|
77 | 77 | // if 2-digit year is less than 30 years in future, set it to this century |
78 | 78 | // otherwise if more than 30 years in future, then we set 2-digit year to the prev century. |
79 | - if (($y + $c1) < $yr+30) $y = $y + $c1; |
|
80 | - else $y = $y + $c0*100; |
|
79 | + if(($y + $c1) < $yr + 30) $y=$y + $c1; |
|
80 | + else $y=$y + $c0 * 100; |
|
81 | 81 | } |
82 | 82 | return $y; |
83 | 83 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getGMTDiff($ts=false) |
94 | 94 | { |
95 | - $dt = new DateTime(); |
|
95 | + $dt=new DateTime(); |
|
96 | 96 | if($ts) |
97 | 97 | $dt->setTimeStamp($ts); |
98 | 98 | else |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | */ |
107 | 107 | function parseDate($txt=false) |
108 | 108 | { |
109 | - if ($txt === false) return getdate(); |
|
109 | + if($txt===false) return getdate(); |
|
110 | 110 | |
111 | - $dt = new DateTime($txt); |
|
111 | + $dt=new DateTime($txt); |
|
112 | 112 | |
113 | 113 | return array( |
114 | 114 | 'seconds' => (int) $dt->format('s'), |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * @return array an array with date info. |
130 | 130 | */ |
131 | - function getDate($d=false,$fast=false) |
|
131 | + function getDate($d=false, $fast=false) |
|
132 | 132 | { |
133 | - if ($d === false) return getdate(); |
|
133 | + if($d===false) return getdate(); |
|
134 | 134 | |
135 | - $dt = new DateTime(); |
|
135 | + $dt=new DateTime(); |
|
136 | 136 | $dt->setTimestamp($d); |
137 | 137 | |
138 | 138 | return array( |
@@ -153,20 +153,20 @@ discard block |
||
153 | 153 | /** |
154 | 154 | * @return boolean true if valid date, semantic check only. |
155 | 155 | */ |
156 | - public function isValidDate($y,$m,$d) |
|
156 | + public function isValidDate($y, $m, $d) |
|
157 | 157 | { |
158 | - if ($this->isLeapYear($y)) |
|
159 | - $marr =& self::$_month_leaf; |
|
158 | + if($this->isLeapYear($y)) |
|
159 | + $marr=& self::$_month_leaf; |
|
160 | 160 | else |
161 | - $marr =& self::$_month_normal; |
|
161 | + $marr=& self::$_month_normal; |
|
162 | 162 | |
163 | - if ($m > 12 || $m < 1) return false; |
|
163 | + if($m > 12 || $m < 1) return false; |
|
164 | 164 | |
165 | - if ($d > 31 || $d < 1) return false; |
|
165 | + if($d > 31 || $d < 1) return false; |
|
166 | 166 | |
167 | - if ($marr[$m] < $d) return false; |
|
167 | + if($marr[$m] < $d) return false; |
|
168 | 168 | |
169 | - if ($y < 1000 && $y > 3000) return false; |
|
169 | + if($y < 1000 && $y > 3000) return false; |
|
170 | 170 | |
171 | 171 | return true; |
172 | 172 | } |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | /** |
175 | 175 | * @return string formatted date based on timestamp $d |
176 | 176 | */ |
177 | - function formatDate($fmt,$ts=false,$is_gmt=false) |
|
177 | + function formatDate($fmt, $ts=false, $is_gmt=false) |
|
178 | 178 | { |
179 | - $dt = new DateTime(); |
|
179 | + $dt=new DateTime(); |
|
180 | 180 | if($is_gmt) |
181 | 181 | $dt->setTimeZone(new DateTimeZone('UTC')); |
182 | 182 | $dt->setTimestamp($ts); |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | /** |
188 | 188 | * @return integer|float a timestamp given a local time |
189 | 189 | */ |
190 | - function getTimeStamp($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_gmt=false) |
|
190 | + function getTimeStamp($hr, $min, $sec, $mon=false, $day=false, $year=false, $is_gmt=false) |
|
191 | 191 | { |
192 | - $dt = new DateTime(); |
|
192 | + $dt=new DateTime(); |
|
193 | 193 | if($is_gmt) |
194 | 194 | $dt->setTimeZone(new DateTimeZone('UTC')); |
195 | 195 | $dt->setDate($year!==false ? $year : date('Y'), |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
202 | - * @return boolean true to post the inputs of the form on callback, default |
|
202 | + * @return string true to post the inputs of the form on callback, default |
|
203 | 203 | * is post the inputs on callback. |
204 | 204 | */ |
205 | 205 | public function getPostState() |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
220 | - * @return integer callback request timeout. |
|
220 | + * @return string callback request timeout. |
|
221 | 221 | */ |
222 | 222 | public function getRequestTimeOut() |
223 | 223 | { |
@@ -261,6 +261,7 @@ discard block |
||
261 | 261 | * update. This will automatically set HasPrority to true. |
262 | 262 | * @param boolean true enables the callback response to update the |
263 | 263 | * viewstate. |
264 | + * @param boolean $value |
|
264 | 265 | */ |
265 | 266 | public function setEnablePageStateUpdate($value) |
266 | 267 | { |
@@ -269,7 +270,7 @@ discard block |
||
269 | 270 | } |
270 | 271 | |
271 | 272 | /** |
272 | - * @return boolean client-side viewstate will be updated on callback |
|
273 | + * @return boolean|string client-side viewstate will be updated on callback |
|
273 | 274 | * response if true. Default is true. |
274 | 275 | */ |
275 | 276 | public function getEnablePageStateUpdate() |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | */ |
265 | 265 | public function setEnablePageStateUpdate($value) |
266 | 266 | { |
267 | - $enabled = TPropertyValue::ensureBoolean($value); |
|
267 | + $enabled=TPropertyValue::ensureBoolean($value); |
|
268 | 268 | $this->setOption('EnablePageStateUpdate', $enabled); |
269 | 269 | } |
270 | 270 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | */ |
275 | 275 | public function getEnablePageStateUpdate() |
276 | 276 | { |
277 | - $option = $this->getOption('EnablePageStateUpdate'); |
|
277 | + $option=$this->getOption('EnablePageStateUpdate'); |
|
278 | 278 | return ($option===null) ? true : $option; |
279 | 279 | } |
280 | 280 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | public function setPostBackTarget($value) |
293 | 293 | { |
294 | 294 | if($value instanceof TControl) |
295 | - $value = $value->getUniqueID(); |
|
295 | + $value=$value->getUniqueID(); |
|
296 | 296 | $this->setOption('EventTarget', $value); |
297 | 297 | } |
298 | 298 |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * Creates a new callback control, sets the adapter to |
|
72 | - * TActiveControlAdapter. |
|
73 | - */ |
|
71 | + * Creates a new callback control, sets the adapter to |
|
72 | + * TActiveControlAdapter. |
|
73 | + */ |
|
74 | 74 | public function __construct() { |
75 | 75 | parent::__construct(); |
76 | 76 | $this->setAdapter(new TActiveControlAdapter($this)); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @param string $value container tag |
112 | 112 | */ |
113 | 113 | public function setSurroundingTag($value) { |
114 | - $this->_surroundingTag=TPropertyValue::ensureString($value); |
|
114 | + $this->_surroundingTag=TPropertyValue::ensureString($value); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -145,8 +145,7 @@ discard block |
||
145 | 145 | $button->setText($text); |
146 | 146 | return $button; |
147 | 147 | } |
148 | - } |
|
149 | - else { |
|
148 | + } else { |
|
150 | 149 | $button=new TActiveButton; |
151 | 150 | if(!$enabled) |
152 | 151 | $button->setEnabled(false); |
@@ -180,8 +179,7 @@ discard block |
||
180 | 179 | if($this->getHasPreRendered()) { |
181 | 180 | $this->renderDataGrid($writer); |
182 | 181 | if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer); |
183 | - } |
|
184 | - else { |
|
182 | + } else { |
|
185 | 183 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
186 | 184 | } |
187 | 185 | } |
@@ -248,8 +246,7 @@ discard block |
||
248 | 246 | $control->setData($text); |
249 | 247 | } |
250 | 248 | $cell->getControls()->add($control); |
251 | - } |
|
252 | - else if($this->getAllowSorting()) { |
|
249 | + } else if($this->getAllowSorting()) { |
|
253 | 250 | $sortExpression=$this->getSortExpression(); |
254 | 251 | if(($url=$this->getHeaderImageUrl())!=='') { |
255 | 252 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton'); |
@@ -262,19 +259,16 @@ discard block |
||
262 | 259 | } |
263 | 260 | $button->setCausesValidation(false); |
264 | 261 | $cell->getControls()->add($button); |
265 | - } |
|
266 | - else if($text!=='') { |
|
262 | + } else if($text!=='') { |
|
267 | 263 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton'); |
268 | 264 | $button->setText($text); |
269 | 265 | $button->setCommandName(TDataGrid::CMD_SORT); |
270 | 266 | $button->setCommandParameter($sortExpression); |
271 | 267 | $button->setCausesValidation(false); |
272 | 268 | $cell->getControls()->add($button); |
273 | - } |
|
274 | - else |
|
269 | + } else |
|
275 | 270 | $cell->setText(' '); |
276 | - } |
|
277 | - else { |
|
271 | + } else { |
|
278 | 272 | if(($url=$this->getHeaderImageUrl())!=='') { |
279 | 273 | $image=Prado::createComponent('System.Web.UI.WebControls.TActiveImage'); |
280 | 274 | $image->setImageUrl($url); |
@@ -283,8 +277,7 @@ discard block |
||
283 | 277 | $image->setToolTip($text); |
284 | 278 | } |
285 | 279 | $cell->getControls()->add($image); |
286 | - } |
|
287 | - else if($text!=='') |
|
280 | + } else if($text!=='') |
|
288 | 281 | $cell->setText($text); |
289 | 282 | else |
290 | 283 | $cell->setText(' '); |
@@ -376,8 +369,7 @@ discard block |
||
376 | 369 | $button->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
377 | 370 | $cell->getControls()->add($button); |
378 | 371 | $cell->registerObject('Button',$button); |
379 | - } |
|
380 | - else |
|
372 | + } else |
|
381 | 373 | parent::initializeCell($cell,$columnIndex,$itemType); |
382 | 374 | } |
383 | 375 | } |
@@ -416,8 +408,7 @@ discard block |
||
416 | 408 | $control->setData($text); |
417 | 409 | } |
418 | 410 | $cell->getControls()->add($control); |
419 | - } |
|
420 | - else if($this->getAllowSorting()) { |
|
411 | + } else if($this->getAllowSorting()) { |
|
421 | 412 | $sortExpression=$this->getSortExpression(); |
422 | 413 | if(($url=$this->getHeaderImageUrl())!=='') { |
423 | 414 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton'); |
@@ -428,27 +419,23 @@ discard block |
||
428 | 419 | $button->setAlternateText($text); |
429 | 420 | $button->setCausesValidation(false); |
430 | 421 | $cell->getControls()->add($button); |
431 | - } |
|
432 | - else if($text!=='') { |
|
422 | + } else if($text!=='') { |
|
433 | 423 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton'); |
434 | 424 | $button->setText($text); |
435 | 425 | $button->setCommandName(TDataGrid::CMD_SORT); |
436 | 426 | $button->setCommandParameter($sortExpression); |
437 | 427 | $button->setCausesValidation(false); |
438 | 428 | $cell->getControls()->add($button); |
439 | - } |
|
440 | - else |
|
429 | + } else |
|
441 | 430 | $cell->setText(' '); |
442 | - } |
|
443 | - else { |
|
431 | + } else { |
|
444 | 432 | if(($url=$this->getHeaderImageUrl())!=='') { |
445 | 433 | $image=Prado::createComponent('System.Web.UI.WebControls.TActiveImage'); |
446 | 434 | $image->setImageUrl($url); |
447 | 435 | if($text!=='') |
448 | 436 | $image->setAlternateText($text); |
449 | 437 | $cell->getControls()->add($image); |
450 | - } |
|
451 | - else if($text!=='') |
|
438 | + } else if($text!=='') |
|
452 | 439 | $cell->setText($text); |
453 | 440 | else |
454 | 441 | $cell->setText(' '); |
@@ -491,8 +478,7 @@ discard block |
||
491 | 478 | $control->setData($text); |
492 | 479 | } |
493 | 480 | $cell->getControls()->add($control); |
494 | - } |
|
495 | - else if($this->getAllowSorting()) |
|
481 | + } else if($this->getAllowSorting()) |
|
496 | 482 | { |
497 | 483 | $sortExpression=$this->getSortExpression(); |
498 | 484 | if(($url=$this->getHeaderImageUrl())!=='') |
@@ -505,8 +491,7 @@ discard block |
||
505 | 491 | $button->setAlternateText($text); |
506 | 492 | $button->setCausesValidation(false); |
507 | 493 | $cell->getControls()->add($button); |
508 | - } |
|
509 | - else if($text!=='') |
|
494 | + } else if($text!=='') |
|
510 | 495 | { |
511 | 496 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton'); |
512 | 497 | $button->setText($text); |
@@ -514,11 +499,9 @@ discard block |
||
514 | 499 | $button->setCommandParameter($sortExpression); |
515 | 500 | $button->setCausesValidation(false); |
516 | 501 | $cell->getControls()->add($button); |
517 | - } |
|
518 | - else |
|
502 | + } else |
|
519 | 503 | $cell->setText(' '); |
520 | - } |
|
521 | - else |
|
504 | + } else |
|
522 | 505 | { |
523 | 506 | if(($url=$this->getHeaderImageUrl())!=='') |
524 | 507 | { |
@@ -527,8 +510,7 @@ discard block |
||
527 | 510 | if($text!=='') |
528 | 511 | $image->setAlternateText($text); |
529 | 512 | $cell->getControls()->add($image); |
530 | - } |
|
531 | - else if($text!=='') |
|
513 | + } else if($text!=='') |
|
532 | 514 | $cell->setText($text); |
533 | 515 | else |
534 | 516 | $cell->setText(' '); |
@@ -574,8 +556,7 @@ discard block |
||
574 | 556 | $cell->registerObject('CheckBox',$checkBox); |
575 | 557 | if($this->getDataField()!=='') |
576 | 558 | $checkBox->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
577 | - } |
|
578 | - else |
|
559 | + } else |
|
579 | 560 | parent::initializeCell($cell,$columnIndex,$itemType); |
580 | 561 | } |
581 | 562 | |
@@ -597,8 +578,7 @@ discard block |
||
597 | 578 | $control->setData($text); |
598 | 579 | } |
599 | 580 | $cell->getControls()->add($control); |
600 | - } |
|
601 | - else if($this->getAllowSorting()) |
|
581 | + } else if($this->getAllowSorting()) |
|
602 | 582 | { |
603 | 583 | $sortExpression=$this->getSortExpression(); |
604 | 584 | if(($url=$this->getHeaderImageUrl())!=='') |
@@ -611,8 +591,7 @@ discard block |
||
611 | 591 | $button->setAlternateText($text); |
612 | 592 | $button->setCausesValidation(false); |
613 | 593 | $cell->getControls()->add($button); |
614 | - } |
|
615 | - else if($text!=='') |
|
594 | + } else if($text!=='') |
|
616 | 595 | { |
617 | 596 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton'); |
618 | 597 | $button->setText($text); |
@@ -620,11 +599,9 @@ discard block |
||
620 | 599 | $button->setCommandParameter($sortExpression); |
621 | 600 | $button->setCausesValidation(false); |
622 | 601 | $cell->getControls()->add($button); |
623 | - } |
|
624 | - else |
|
602 | + } else |
|
625 | 603 | $cell->setText(' '); |
626 | - } |
|
627 | - else |
|
604 | + } else |
|
628 | 605 | { |
629 | 606 | if(($url=$this->getHeaderImageUrl())!=='') |
630 | 607 | { |
@@ -633,8 +610,7 @@ discard block |
||
633 | 610 | if($text!=='') |
634 | 611 | $image->setAlternateText($text); |
635 | 612 | $cell->getControls()->add($image); |
636 | - } |
|
637 | - else if($text!=='') |
|
613 | + } else if($text!=='') |
|
638 | 614 | $cell->setText($text); |
639 | 615 | else |
640 | 616 | $cell->setText(' '); |
@@ -676,8 +652,7 @@ discard block |
||
676 | 652 | $control->setData($text); |
677 | 653 | } |
678 | 654 | $cell->getControls()->add($control); |
679 | - } |
|
680 | - else if($this->getAllowSorting()) |
|
655 | + } else if($this->getAllowSorting()) |
|
681 | 656 | { |
682 | 657 | $sortExpression=$this->getSortExpression(); |
683 | 658 | if(($url=$this->getHeaderImageUrl())!=='') |
@@ -690,8 +665,7 @@ discard block |
||
690 | 665 | $button->setAlternateText($text); |
691 | 666 | $button->setCausesValidation(false); |
692 | 667 | $cell->getControls()->add($button); |
693 | - } |
|
694 | - else if($text!=='') |
|
668 | + } else if($text!=='') |
|
695 | 669 | { |
696 | 670 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton'); |
697 | 671 | $button->setText($text); |
@@ -699,11 +673,9 @@ discard block |
||
699 | 673 | $button->setCommandParameter($sortExpression); |
700 | 674 | $button->setCausesValidation(false); |
701 | 675 | $cell->getControls()->add($button); |
702 | - } |
|
703 | - else |
|
676 | + } else |
|
704 | 677 | $cell->setText(' '); |
705 | - } |
|
706 | - else |
|
678 | + } else |
|
707 | 679 | { |
708 | 680 | if(($url=$this->getHeaderImageUrl())!=='') |
709 | 681 | { |
@@ -712,8 +684,7 @@ discard block |
||
712 | 684 | if($text!=='') |
713 | 685 | $image->setAlternateText($text); |
714 | 686 | $cell->getControls()->add($image); |
715 | - } |
|
716 | - else if($text!=='') |
|
687 | + } else if($text!=='') |
|
717 | 688 | $cell->setText($text); |
718 | 689 | else |
719 | 690 | $cell->setText(' '); |
@@ -759,8 +730,7 @@ discard block |
||
759 | 730 | $control->setData($text); |
760 | 731 | } |
761 | 732 | $cell->getControls()->add($control); |
762 | - } |
|
763 | - else if($this->getAllowSorting()) { |
|
733 | + } else if($this->getAllowSorting()) { |
|
764 | 734 | $sortExpression=$this->getSortExpression(); |
765 | 735 | if(($url=$this->getHeaderImageUrl())!=='') { |
766 | 736 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton'); |
@@ -773,19 +743,16 @@ discard block |
||
773 | 743 | } |
774 | 744 | $button->setCausesValidation(false); |
775 | 745 | $cell->getControls()->add($button); |
776 | - } |
|
777 | - else if($text!=='') { |
|
746 | + } else if($text!=='') { |
|
778 | 747 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton'); |
779 | 748 | $button->setText($text); |
780 | 749 | $button->setCommandName(TDataGrid::CMD_SORT); |
781 | 750 | $button->setCommandParameter($sortExpression); |
782 | 751 | $button->setCausesValidation(false); |
783 | 752 | $cell->getControls()->add($button); |
784 | - } |
|
785 | - else |
|
753 | + } else |
|
786 | 754 | $cell->setText(' '); |
787 | - } |
|
788 | - else { |
|
755 | + } else { |
|
789 | 756 | if(($url=$this->getHeaderImageUrl())!=='') { |
790 | 757 | $image=Prado::createComponent('System.Web.UI.WebControls.TActiveImage'); |
791 | 758 | $image->setImageUrl($url); |
@@ -794,8 +761,7 @@ discard block |
||
794 | 761 | $image->setToolTip($text); |
795 | 762 | } |
796 | 763 | $cell->getControls()->add($image); |
797 | - } |
|
798 | - else if($text!=='') |
|
764 | + } else if($text!=='') |
|
799 | 765 | $cell->setText($text); |
800 | 766 | else |
801 | 767 | $cell->setText(' '); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | parent::setDataSource($value); |
95 | 95 | if($this->getActiveControl()->canUpdateClientSide()) { |
96 | 96 | $this->renderPager(); |
97 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
97 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @param string CommandParameter corresponding to the OnCommand event of the button |
137 | 137 | * @return mixed the button instance |
138 | 138 | */ |
139 | - protected function createPagerButton($pager,$buttonType,$enabled,$text,$commandName,$commandParameter) { |
|
139 | + protected function createPagerButton($pager, $buttonType, $enabled, $text, $commandName, $commandParameter) { |
|
140 | 140 | if($buttonType===TDataGridPagerButtonType::LinkButton) { |
141 | 141 | if($enabled) |
142 | 142 | $button=new TActiveLinkButton; |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | public function render($writer) { |
180 | 180 | if($this->getHasPreRendered()) { |
181 | 181 | $this->renderDataGrid($writer); |
182 | - if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(),$writer); |
|
182 | + if($this->getActiveControl()->canUpdateClientSide()) $this->getPage()->getCallbackClient()->replaceContent($this->getSurroundingTagId(), $writer); |
|
183 | 183 | } |
184 | 184 | else { |
185 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
185 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
186 | 186 | } |
187 | 187 | } |
188 | 188 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | foreach($pager as $item) { |
197 | 197 | if($item->ControlToPaginate==$this->ID) { |
198 | 198 | $writer=$this->getResponse()->createHtmlWriter(); |
199 | - $this->getPage()->getAdapter()->registerControlToRender($item,$writer); |
|
199 | + $this->getPage()->getAdapter()->registerControlToRender($item, $writer); |
|
200 | 200 | } |
201 | 201 | } |
202 | 202 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | * @param THtmlWriter writer for the rendering purpose |
209 | 209 | */ |
210 | 210 | private function renderDataGrid($writer) { |
211 | - $writer->addAttribute('id',$this->getSurroundingTagID()); |
|
211 | + $writer->addAttribute('id', $this->getSurroundingTagID()); |
|
212 | 212 | $writer->renderBeginTag($this->getSurroundingTag()); |
213 | 213 | parent::render($writer); |
214 | 214 | $writer->renderEndTag(); |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | * @since 3.1.9 |
235 | 235 | */ |
236 | 236 | class TActiveBoundColumn extends TBoundColumn { |
237 | - protected function initializeHeaderCell($cell,$columnIndex) { |
|
237 | + protected function initializeHeaderCell($cell, $columnIndex) { |
|
238 | 238 | $text=$this->getHeaderText(); |
239 | 239 | |
240 | 240 | if(($classPath=$this->getHeaderRenderer())!=='') { |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | * @since 3.1.9 |
314 | 314 | */ |
315 | 315 | class TActiveEditCommandColumn extends TEditCommandColumn { |
316 | - protected function createButton($commandName,$text,$causesValidation,$validationGroup) { |
|
316 | + protected function createButton($commandName, $text, $causesValidation, $validationGroup) { |
|
317 | 317 | if($this->getButtonType()===TButtonColumnType::LinkButton) |
318 | 318 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveLinkButton'); |
319 | 319 | else if($this->getButtonType()===TButtonColumnType::PushButton) |
@@ -322,9 +322,9 @@ discard block |
||
322 | 322 | { |
323 | 323 | $button=Prado::createComponent('System.Web.UI.WebControls.TActiveImageButton'); |
324 | 324 | $button->setToolTip($text); |
325 | - if(strcasecmp($commandName,'Update')===0) |
|
325 | + if(strcasecmp($commandName, 'Update')===0) |
|
326 | 326 | $url=$this->getUpdateImageUrl(); |
327 | - else if(strcasecmp($commandName,'Cancel')===0) |
|
327 | + else if(strcasecmp($commandName, 'Cancel')===0) |
|
328 | 328 | $url=$this->getCancelImageUrl(); |
329 | 329 | else |
330 | 330 | $url=$this->getEditImageUrl(); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | * @since 3.1.9 |
356 | 356 | */ |
357 | 357 | class TActiveButtonColumn extends TButtonColumn { |
358 | - public function initializeCell($cell,$columnIndex,$itemType) { |
|
358 | + public function initializeCell($cell, $columnIndex, $itemType) { |
|
359 | 359 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) { |
360 | 360 | $buttonType=$this->getButtonType(); |
361 | 361 | if($buttonType===TButtonColumnType::LinkButton) |
@@ -373,12 +373,12 @@ discard block |
||
373 | 373 | $button->setCausesValidation($this->getCausesValidation()); |
374 | 374 | $button->setValidationGroup($this->getValidationGroup()); |
375 | 375 | if($this->getDataTextField()!=='' || ($buttonType===TButtonColumnType::ImageButton && $this->getDataImageUrlField()!=='')) |
376 | - $button->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
376 | + $button->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
377 | 377 | $cell->getControls()->add($button); |
378 | - $cell->registerObject('Button',$button); |
|
378 | + $cell->registerObject('Button', $button); |
|
379 | 379 | } |
380 | 380 | else |
381 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
381 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | * @since 3.1.9 |
403 | 403 | */ |
404 | 404 | class TActiveTemplateColumn extends TTemplateColumn { |
405 | - protected function initializeHeaderCell($cell,$columnIndex) { |
|
405 | + protected function initializeHeaderCell($cell, $columnIndex) { |
|
406 | 406 | $text=$this->getHeaderText(); |
407 | 407 | |
408 | 408 | if(($classPath=$this->getHeaderRenderer())!=='') { |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | class TActiveHyperLinkColumn extends THyperLinkColumn |
474 | 474 | { |
475 | 475 | |
476 | - protected function initializeHeaderCell($cell,$columnIndex) |
|
476 | + protected function initializeHeaderCell($cell, $columnIndex) |
|
477 | 477 | { |
478 | 478 | $text=$this->getHeaderText(); |
479 | 479 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | * @param integer the index to the Columns property that the cell resides in. |
563 | 563 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
564 | 564 | */ |
565 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
565 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
566 | 566 | { |
567 | 567 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) |
568 | 568 | { |
@@ -571,15 +571,15 @@ discard block |
||
571 | 571 | $checkBox->setEnabled(false); |
572 | 572 | $cell->setHorizontalAlign('Center'); |
573 | 573 | $cell->getControls()->add($checkBox); |
574 | - $cell->registerObject('CheckBox',$checkBox); |
|
574 | + $cell->registerObject('CheckBox', $checkBox); |
|
575 | 575 | if($this->getDataField()!=='') |
576 | - $checkBox->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
576 | + $checkBox->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
577 | 577 | } |
578 | 578 | else |
579 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
579 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
580 | 580 | } |
581 | 581 | |
582 | - protected function initializeHeaderCell($cell,$columnIndex) |
|
582 | + protected function initializeHeaderCell($cell, $columnIndex) |
|
583 | 583 | { |
584 | 584 | $text=$this->getHeaderText(); |
585 | 585 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | */ |
659 | 659 | class TActiveDropDownListColumn extends TDropDownListColumn |
660 | 660 | { |
661 | - protected function initializeHeaderCell($cell,$columnIndex) |
|
661 | + protected function initializeHeaderCell($cell, $columnIndex) |
|
662 | 662 | { |
663 | 663 | $text=$this->getHeaderText(); |
664 | 664 | |
@@ -745,7 +745,7 @@ discard block |
||
745 | 745 | * @since 3.1.9 |
746 | 746 | */ |
747 | 747 | class TActiveLiteralColumn extends TLiteralColumn { |
748 | - protected function initializeHeaderCell($cell,$columnIndex) { |
|
748 | + protected function initializeHeaderCell($cell, $columnIndex) { |
|
749 | 749 | $text=$this->getHeaderText(); |
750 | 750 | |
751 | 751 | if(($classPath=$this->getHeaderRenderer())!=='') { |
@@ -821,8 +821,8 @@ discard block |
||
821 | 821 | */ |
822 | 822 | public function getClientSide() |
823 | 823 | { |
824 | - if($this->_callbackoptions === null) |
|
825 | - $this->_callbackoptions = new TCallbackOptions; |
|
824 | + if($this->_callbackoptions===null) |
|
825 | + $this->_callbackoptions=new TCallbackOptions; |
|
826 | 826 | return $this->_callbackoptions->getClientSide(); |
827 | 827 | } |
828 | 828 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | /** |
108 | 108 | * @param string a key identifying a value to be cached |
109 | - * @return sring a key generated from the provided key which ensures the uniqueness across applications |
|
109 | + * @return string a key generated from the provided key which ensures the uniqueness across applications |
|
110 | 110 | */ |
111 | 111 | protected function generateUniqueKey($key) |
112 | 112 | { |
@@ -198,6 +198,7 @@ discard block |
||
198 | 198 | * in {@link get()} already. So only the implementation of data retrieval |
199 | 199 | * is needed. |
200 | 200 | * @param string a unique key identifying the cached value |
201 | + * @param string $key |
|
201 | 202 | * @return string the value stored in cache, false if the value is not in the cache or expired. |
202 | 203 | */ |
203 | 204 | abstract protected function getValue($key); |
@@ -212,6 +213,8 @@ discard block |
||
212 | 213 | * @param string the key identifying the value to be cached |
213 | 214 | * @param string the value to be cached |
214 | 215 | * @param integer the number of seconds in which the cached value will expire. 0 means never expire. |
216 | + * @param string $key |
|
217 | + * @param integer $expire |
|
215 | 218 | * @return boolean true if the value is successfully stored into cache, false otherwise |
216 | 219 | */ |
217 | 220 | abstract protected function setValue($key,$value,$expire); |
@@ -226,6 +229,8 @@ discard block |
||
226 | 229 | * @param string the key identifying the value to be cached |
227 | 230 | * @param string the value to be cached |
228 | 231 | * @param integer the number of seconds in which the cached value will expire. 0 means never expire. |
232 | + * @param string $key |
|
233 | + * @param integer $expire |
|
229 | 234 | * @return boolean true if the value is successfully stored into cache, false otherwise |
230 | 235 | */ |
231 | 236 | abstract protected function addValue($key,$value,$expire); |
@@ -234,6 +239,7 @@ discard block |
||
234 | 239 | * Deletes a value with the specified key from cache |
235 | 240 | * This method should be implemented by child classes to delete the data from actual cache storage. |
236 | 241 | * @param string the key of the value to be deleted |
242 | + * @param string $key |
|
237 | 243 | * @return boolean if no error happens during deletion |
238 | 244 | */ |
239 | 245 | abstract protected function deleteValue($key); |
@@ -490,6 +496,7 @@ discard block |
||
490 | 496 | * By default, it always returns true, meaning the file should be checked. |
491 | 497 | * You may override this method to check only certain files. |
492 | 498 | * @param string the name of the file that may be checked for dependency. |
499 | + * @param string $fileName |
|
493 | 500 | * @return boolean whether this file should be checked. |
494 | 501 | */ |
495 | 502 | protected function validateFile($fileName) |
@@ -503,6 +510,7 @@ discard block |
||
503 | 510 | * By default, it always returns true, meaning the subdirectory should be checked. |
504 | 511 | * You may override this method to check only certain subdirectories. |
505 | 512 | * @param string the name of the subdirectory that may be checked for dependency. |
513 | + * @param string $directory |
|
506 | 514 | * @return boolean whether this subdirectory should be checked. |
507 | 515 | */ |
508 | 516 | protected function validateDirectory($directory) |
@@ -516,6 +524,7 @@ discard block |
||
516 | 524 | * {@link setRecursiveCheck RecursiveCheck} is set true. |
517 | 525 | * @param string the directory name |
518 | 526 | * @param int level of the recursion |
527 | + * @param string $directory |
|
519 | 528 | * @return array list of file modification time indexed by the file path |
520 | 529 | */ |
521 | 530 | protected function generateTimestamps($directory,$level=0) |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if($this->getApplication()->getCache()===null) |
65 | 65 | $this->getApplication()->setCache($this); |
66 | 66 | else |
67 | - throw new TConfigurationException('cache_primary_duplicated',get_class($this)); |
|
67 | + throw new TConfigurationException('cache_primary_duplicated', get_class($this)); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
@@ -142,14 +142,14 @@ discard block |
||
142 | 142 | * @param ICacheDependency dependency of the cached item. If the dependency changes, the item is labeled invalid. |
143 | 143 | * @return boolean true if the value is successfully stored into cache, false otherwise |
144 | 144 | */ |
145 | - public function set($id,$value,$expire=0,$dependency=null) |
|
145 | + public function set($id, $value, $expire=0, $dependency=null) |
|
146 | 146 | { |
147 | - if(empty($value) && $expire === 0) |
|
147 | + if(empty($value) && $expire===0) |
|
148 | 148 | $this->delete($id); |
149 | 149 | else |
150 | 150 | { |
151 | - $data=array($value,$dependency); |
|
152 | - return $this->setValue($this->generateUniqueKey($id),$data,$expire); |
|
151 | + $data=array($value, $dependency); |
|
152 | + return $this->setValue($this->generateUniqueKey($id), $data, $expire); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | * @param ICacheDependency dependency of the cached item. If the dependency changes, the item is labeled invalid. |
163 | 163 | * @return boolean true if the value is successfully stored into cache, false otherwise |
164 | 164 | */ |
165 | - public function add($id,$value,$expire=0,$dependency=null) |
|
165 | + public function add($id, $value, $expire=0, $dependency=null) |
|
166 | 166 | { |
167 | - if(empty($value) && $expire === 0) |
|
167 | + if(empty($value) && $expire===0) |
|
168 | 168 | return false; |
169 | - $data=array($value,$dependency); |
|
170 | - return $this->addValue($this->generateUniqueKey($id),$data,$expire); |
|
169 | + $data=array($value, $dependency); |
|
170 | + return $this->addValue($this->generateUniqueKey($id), $data, $expire); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * @param integer the number of seconds in which the cached value will expire. 0 means never expire. |
215 | 215 | * @return boolean true if the value is successfully stored into cache, false otherwise |
216 | 216 | */ |
217 | - abstract protected function setValue($key,$value,$expire); |
|
217 | + abstract protected function setValue($key, $value, $expire); |
|
218 | 218 | |
219 | 219 | /** |
220 | 220 | * Stores a value identified by a key into cache if the cache does not contain this key. |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * @param integer the number of seconds in which the cached value will expire. 0 means never expire. |
229 | 229 | * @return boolean true if the value is successfully stored into cache, false otherwise |
230 | 230 | */ |
231 | - abstract protected function addValue($key,$value,$expire); |
|
231 | + abstract protected function addValue($key, $value, $expire); |
|
232 | 232 | |
233 | 233 | /** |
234 | 234 | * Deletes a value with the specified key from cache |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function offsetExists($id) |
248 | 248 | { |
249 | - return $this->get($id) !== false; |
|
249 | + return $this->get($id)!==false; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | public function setDirectory($directory) |
431 | 431 | { |
432 | 432 | if(($path=realpath($directory))===false || !is_dir($path)) |
433 | - throw new TInvalidDataValueException('directorycachedependency_directory_invalid',$directory); |
|
433 | + throw new TInvalidDataValueException('directorycachedependency_directory_invalid', $directory); |
|
434 | 434 | $this->_directory=$path; |
435 | 435 | $this->_timestamps=$this->generateTimestamps($path); |
436 | 436 | } |
@@ -518,10 +518,10 @@ discard block |
||
518 | 518 | * @param int level of the recursion |
519 | 519 | * @return array list of file modification time indexed by the file path |
520 | 520 | */ |
521 | - protected function generateTimestamps($directory,$level=0) |
|
521 | + protected function generateTimestamps($directory, $level=0) |
|
522 | 522 | { |
523 | 523 | if(($dir=opendir($directory))===false) |
524 | - throw new TIOException('directorycachedependency_directory_invalid',$directory); |
|
524 | + throw new TIOException('directorycachedependency_directory_invalid', $directory); |
|
525 | 525 | $timestamps=array(); |
526 | 526 | while(($file=readdir($dir))!==false) |
527 | 527 | { |
@@ -530,8 +530,8 @@ discard block |
||
530 | 530 | continue; |
531 | 531 | else if(is_dir($path)) |
532 | 532 | { |
533 | - if(($this->_recursiveLevel<0 || $level<$this->_recursiveLevel) && $this->validateDirectory($path)) |
|
534 | - $timestamps=array_merge($this->generateTimestamps($path,$level+1)); |
|
533 | + if(($this->_recursiveLevel < 0 || $level < $this->_recursiveLevel) && $this->validateDirectory($path)) |
|
534 | + $timestamps=array_merge($this->generateTimestamps($path, $level + 1)); |
|
535 | 535 | } |
536 | 536 | else if($this->validateFile($path)) |
537 | 537 | $timestamps[$path]=filemtime($path); |
@@ -699,10 +699,10 @@ discard block |
||
699 | 699 | * @param mixed new item |
700 | 700 | * @throws TInvalidDataTypeException if the item to be inserted is not a dependency instance |
701 | 701 | */ |
702 | - public function insertAt($index,$item) |
|
702 | + public function insertAt($index, $item) |
|
703 | 703 | { |
704 | 704 | if($item instanceof ICacheDependency) |
705 | - parent::insertAt($index,$item); |
|
705 | + parent::insertAt($index, $item); |
|
706 | 706 | else |
707 | 707 | throw new TInvalidDataTypeException('cachedependencylist_cachedependency_required'); |
708 | 708 | } |
@@ -532,8 +532,7 @@ |
||
532 | 532 | { |
533 | 533 | if(($this->_recursiveLevel<0 || $level<$this->_recursiveLevel) && $this->validateDirectory($path)) |
534 | 534 | $timestamps=array_merge($this->generateTimestamps($path,$level+1)); |
535 | - } |
|
536 | - else if($this->validateFile($path)) |
|
535 | + } else if($this->validateFile($path)) |
|
537 | 536 | $timestamps[$path]=filemtime($path); |
538 | 537 | } |
539 | 538 | closedir($dir); |
@@ -93,6 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | /** |
95 | 95 | * @param boolean whether the keys are case-sensitive. |
96 | + * @param boolean $value |
|
96 | 97 | */ |
97 | 98 | public function setCaseSensitive($value) |
98 | 99 | { |
@@ -126,6 +127,7 @@ discard block |
||
126 | 127 | * Removes an item from the map by its key. |
127 | 128 | * This overrides the parent implementation by converting the key to lower case first if CaseSensitive is false. |
128 | 129 | * @param mixed the key of the item to be removed |
130 | + * @param string $key |
|
129 | 131 | * @return mixed the removed value, null if no such key exists. |
130 | 132 | */ |
131 | 133 | public function remove($key) |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | protected function __getZappableSleepProps(&$exprops) |
54 | 54 | { |
55 | 55 | parent::__getZappableSleepProps($exprops); |
56 | - if ($this->_caseSensitive===false) |
|
57 | - $exprops[] = "\0TAttributeCollection\0_caseSensitive"; |
|
56 | + if($this->_caseSensitive===false) |
|
57 | + $exprops[]="\0TAttributeCollection\0_caseSensitive"; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | public function __get($name) |
69 | 69 | { |
70 | - return $this->contains($name)?$this->itemAt($name):parent::__get($name); |
|
70 | + return $this->contains($name) ? $this->itemAt($name) : parent::__get($name); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | * @param mixed the property value or event handler |
79 | 79 | * @throws TInvalidOperationException If the property is not defined or read-only. |
80 | 80 | */ |
81 | - public function __set($name,$value) |
|
81 | + public function __set($name, $value) |
|
82 | 82 | { |
83 | - $this->add($name,$value); |
|
83 | + $this->add($name, $value); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function itemAt($key) |
109 | 109 | { |
110 | - return parent::itemAt($this->_caseSensitive?$key:strtolower($key)); |
|
110 | + return parent::itemAt($this->_caseSensitive ? $key : strtolower($key)); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | * @param mixed key |
118 | 118 | * @param mixed value |
119 | 119 | */ |
120 | - public function add($key,$value) |
|
120 | + public function add($key, $value) |
|
121 | 121 | { |
122 | - parent::add($this->_caseSensitive?$key:strtolower($key),$value); |
|
122 | + parent::add($this->_caseSensitive ? $key : strtolower($key), $value); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function remove($key) |
132 | 132 | { |
133 | - return parent::remove($this->_caseSensitive?$key:strtolower($key)); |
|
133 | + return parent::remove($this->_caseSensitive ? $key : strtolower($key)); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function contains($key) |
143 | 143 | { |
144 | - return parent::contains($this->_caseSensitive?$key:strtolower($key)); |
|
144 | + return parent::contains($this->_caseSensitive ? $key : strtolower($key)); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |