@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getItemRenderer() |
55 | 55 | { |
56 | - return $this->getViewState('ItemRenderer',''); |
|
56 | + return $this->getViewState('ItemRenderer', ''); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function setItemRenderer($value) |
71 | 71 | { |
72 | - $this->setViewState('ItemRenderer',$value,''); |
|
72 | + $this->setViewState('ItemRenderer', $value, ''); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getEditItemRenderer() |
80 | 80 | { |
81 | - return $this->getViewState('EditItemRenderer',''); |
|
81 | + return $this->getViewState('EditItemRenderer', ''); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function setEditItemRenderer($value) |
96 | 96 | { |
97 | - $this->setViewState('EditItemRenderer',$value,''); |
|
97 | + $this->setViewState('EditItemRenderer', $value, ''); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if($value instanceof ITemplate || $value===null) |
115 | 115 | $this->_editItemTemplate=$value; |
116 | 116 | else |
117 | - throw new TInvalidDataTypeException('templatecolumn_template_required','EditItemTemplate'); |
|
117 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'EditItemTemplate'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | if($value instanceof ITemplate || $value===null) |
135 | 135 | $this->_itemTemplate=$value; |
136 | 136 | else |
137 | - throw new TInvalidDataTypeException('templatecolumn_template_required','ItemTemplate'); |
|
137 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'ItemTemplate'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if($value instanceof ITemplate || $value===null) |
155 | 155 | $this->_headerTemplate=$value; |
156 | 156 | else |
157 | - throw new TInvalidDataTypeException('templatecolumn_template_required','HeaderTemplate'); |
|
157 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'HeaderTemplate'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if($value instanceof ITemplate || $value===null) |
175 | 175 | $this->_footerTemplate=$value; |
176 | 176 | else |
177 | - throw new TInvalidDataTypeException('templatecolumn_template_required','FooterTemplate'); |
|
177 | + throw new TInvalidDataTypeException('templatecolumn_template_required', 'FooterTemplate'); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * @param integer the index to the Columns property that the cell resides in. |
187 | 187 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
188 | 188 | */ |
189 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
189 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
190 | 190 | { |
191 | 191 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) |
192 | 192 | { |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $control->setItemType($itemType); |
214 | 214 | } |
215 | 215 | if($control instanceof IDataRenderer) |
216 | - $control->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
216 | + $control->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
217 | 217 | } |
218 | 218 | else if($template!==null) |
219 | 219 | $template->instantiateIn($cell); |
@@ -223,20 +223,20 @@ discard block |
||
223 | 223 | else if($itemType===TListItemType::Header) |
224 | 224 | { |
225 | 225 | if(($classPath=$this->getHeaderRenderer())!=='') |
226 | - $this->initializeHeaderCell($cell,$columnIndex); |
|
226 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
227 | 227 | else if($this->_headerTemplate!==null) |
228 | 228 | $this->_headerTemplate->instantiateIn($cell); |
229 | 229 | else |
230 | - $this->initializeHeaderCell($cell,$columnIndex); |
|
230 | + $this->initializeHeaderCell($cell, $columnIndex); |
|
231 | 231 | } |
232 | 232 | else if($itemType===TListItemType::Footer) |
233 | 233 | { |
234 | 234 | if(($classPath=$this->getFooterRenderer())!=='') |
235 | - $this->initializeFooterCell($cell,$columnIndex); |
|
235 | + $this->initializeFooterCell($cell, $columnIndex); |
|
236 | 236 | else if($this->_footerTemplate!==null) |
237 | 237 | $this->_footerTemplate->instantiateIn($cell); |
238 | 238 | else |
239 | - $this->initializeFooterCell($cell,$columnIndex); |
|
239 | + $this->initializeFooterCell($cell, $columnIndex); |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * This method is invoked when datagrid performs databinding. |
246 | 246 | * It populates the content of the cell with the relevant data from data source. |
247 | 247 | */ |
248 | - public function dataBindColumn($sender,$param) |
|
248 | + public function dataBindColumn($sender, $param) |
|
249 | 249 | { |
250 | 250 | $item=$sender->getNamingContainer(); |
251 | 251 | $sender->setData($item->getData()); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getInitialValue() |
53 | 53 | { |
54 | - return $this->getViewState('InitialValue',$this->getControlPromptValue()); |
|
54 | + return $this->getViewState('InitialValue', $this->getControlPromptValue()); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected function getControlPromptValue() |
63 | 63 | { |
64 | - $control = $this->getValidationTarget(); |
|
64 | + $control=$this->getValidationTarget(); |
|
65 | 65 | if($control instanceof TListControl) |
66 | 66 | return $control->getPromptValue(); |
67 | 67 | return ''; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function setInitialValue($value) |
75 | 75 | { |
76 | - $this->setViewState('InitialValue',TPropertyValue::ensureString($value),''); |
|
76 | + $this->setViewState('InitialValue', TPropertyValue::ensureString($value), ''); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | protected function evaluateIsValid() |
91 | 91 | { |
92 | - $control = $this->getValidationTarget(); |
|
92 | + $control=$this->getValidationTarget(); |
|
93 | 93 | if($control instanceof TListControl) |
94 | 94 | return $this->validateListControl($control); |
95 | 95 | else if($control instanceof TRadioButton && strlen($control->getGroupName()) > 0) |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | |
101 | 101 | private function validateListControl($control) |
102 | 102 | { |
103 | - $initial = trim($this->getInitialValue()); |
|
104 | - $count = 0; |
|
103 | + $initial=trim($this->getInitialValue()); |
|
104 | + $count=0; |
|
105 | 105 | foreach($control->getItems() as $item) |
106 | 106 | { |
107 | - if($item->getSelected() && $item->getValue() != $initial) |
|
107 | + if($item->getSelected() && $item->getValue()!=$initial) |
|
108 | 108 | $count++; |
109 | 109 | } |
110 | 110 | return $count > 0; |
@@ -112,13 +112,13 @@ discard block |
||
112 | 112 | |
113 | 113 | private function validateRadioButtonGroup($control) |
114 | 114 | { |
115 | - $initial = trim($this->getInitialValue()); |
|
115 | + $initial=trim($this->getInitialValue()); |
|
116 | 116 | foreach($control->getRadioButtonsInGroup() as $radio) |
117 | 117 | { |
118 | 118 | if($radio->getChecked()) |
119 | 119 | { |
120 | - if(strlen($value = $radio->getValue()) > 0) |
|
121 | - return $value !== $initial; |
|
120 | + if(strlen($value=$radio->getValue()) > 0) |
|
121 | + return $value!==$initial; |
|
122 | 122 | else |
123 | 123 | return true; |
124 | 124 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | private function validateStandardControl($control) |
130 | 130 | { |
131 | - $initial = trim($this->getInitialValue()); |
|
131 | + $initial=trim($this->getInitialValue()); |
|
132 | 132 | $value=$this->getValidationValue($control); |
133 | 133 | return (is_bool($value) && $value) || trim($value)!==$initial; |
134 | 134 | } |
@@ -139,13 +139,13 @@ discard block |
||
139 | 139 | */ |
140 | 140 | protected function getClientScriptOptions() |
141 | 141 | { |
142 | - $options = parent::getClientScriptOptions(); |
|
142 | + $options=parent::getClientScriptOptions(); |
|
143 | 143 | $options['InitialValue']=$this->getInitialValue(); |
144 | - $control = $this->getValidationTarget(); |
|
144 | + $control=$this->getValidationTarget(); |
|
145 | 145 | if($control instanceof TListControl) |
146 | - $options['TotalItems'] = $control->getItemCount(); |
|
146 | + $options['TotalItems']=$control->getItemCount(); |
|
147 | 147 | if($control instanceof TRadioButton && strlen($control->getGroupName()) > 0) |
148 | - $options['GroupName'] = $control->getGroupName(); |
|
148 | + $options['GroupName']=$control->getGroupName(); |
|
149 | 149 | return $options; |
150 | 150 | } |
151 | 151 | } |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | */ |
37 | 37 | class TXmlTransform extends TControl { |
38 | 38 | |
39 | - const EXT_XML_FILE = '.xml'; |
|
40 | - const EXT_XSL_FILE = '.xsl'; |
|
39 | + const EXT_XML_FILE='.xml'; |
|
40 | + const EXT_XSL_FILE='.xsl'; |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Constructor |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function setTransformPath($value) { |
65 | 65 | if(!is_file($value)) { |
66 | - $value = Prado::getPathOfNamespace($value, self::EXT_XSL_FILE); |
|
67 | - if($value === null) { |
|
66 | + $value=Prado::getPathOfNamespace($value, self::EXT_XSL_FILE); |
|
67 | + if($value===null) { |
|
68 | 68 | throw new TInvalidDataValueException('xmltransform_transformpath_invalid', $value); |
69 | 69 | } |
70 | 70 | } |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function setDocumentPath($value) { |
100 | 100 | if(!is_file($value)) { |
101 | - $value = Prado::getPathOfNamespace($value, self::EXT_XML_FILE); |
|
102 | - if($value === null) { |
|
101 | + $value=Prado::getPathOfNamespace($value, self::EXT_XML_FILE); |
|
102 | + if($value===null) { |
|
103 | 103 | throw new TInvalidDataValueException('xmltransform_documentpath_invalid', $value); |
104 | 104 | } |
105 | 105 | } |
@@ -125,22 +125,22 @@ discard block |
||
125 | 125 | * @return TAttributeCollection the list of custom parameters |
126 | 126 | */ |
127 | 127 | public function getParameters() { |
128 | - if($params = $this->getViewState('Parameters',null)) { |
|
128 | + if($params=$this->getViewState('Parameters', null)) { |
|
129 | 129 | return $params; |
130 | 130 | } else { |
131 | - $params = new TAttributeCollection(); |
|
131 | + $params=new TAttributeCollection(); |
|
132 | 132 | $this->setViewState('Parameters', $params, null); |
133 | 133 | return $params; |
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | 137 | private function getTransformXmlDocument() { |
138 | - if(($content = $this->getTransformContent()) !== '') { |
|
139 | - $document = new DOMDocument(); |
|
138 | + if(($content=$this->getTransformContent())!=='') { |
|
139 | + $document=new DOMDocument(); |
|
140 | 140 | $document->loadXML($content); |
141 | 141 | return $document; |
142 | - } else if(($path = $this->getTransformPath()) !== '') { |
|
143 | - $document = new DOMDocument(); |
|
142 | + } else if(($path=$this->getTransformPath())!=='') { |
|
143 | + $document=new DOMDocument(); |
|
144 | 144 | $document->load($path); |
145 | 145 | return $document; |
146 | 146 | } else { |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | private function getSourceXmlDocument() { |
152 | - if(($content = $this->getDocumentContent()) !== '') { |
|
153 | - $document = new DOMDocument(); |
|
152 | + if(($content=$this->getDocumentContent())!=='') { |
|
153 | + $document=new DOMDocument(); |
|
154 | 154 | $document->loadXML($content); |
155 | 155 | return $document; |
156 | - } else if(($path = $this->getDocumentPath()) !== '') { |
|
157 | - $document = new DOMDocument(); |
|
156 | + } else if(($path=$this->getDocumentPath())!=='') { |
|
157 | + $document=new DOMDocument(); |
|
158 | 158 | $document->load($path); |
159 | 159 | return $document; |
160 | 160 | } else { |
@@ -167,24 +167,24 @@ discard block |
||
167 | 167 | * @param THtmlWriter The writer used for the rendering purpose |
168 | 168 | */ |
169 | 169 | public function render($writer) { |
170 | - if(($document=$this->getSourceXmlDocument()) === null) { |
|
171 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
170 | + if(($document=$this->getSourceXmlDocument())===null) { |
|
171 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
172 | 172 | parent::render($htmlWriter); |
173 | - $document = new DOMDocument(); |
|
173 | + $document=new DOMDocument(); |
|
174 | 174 | $document->loadXML($htmlWriter->flush()); |
175 | 175 | } |
176 | - $stylesheet = $this->getTransformXmlDocument(); |
|
176 | + $stylesheet=$this->getTransformXmlDocument(); |
|
177 | 177 | |
178 | 178 | // Perform XSL transformation |
179 | - $xslt = new XSLTProcessor(); |
|
179 | + $xslt=new XSLTProcessor(); |
|
180 | 180 | $xslt->importStyleSheet($stylesheet); |
181 | 181 | |
182 | 182 | // Check for parameters |
183 | - $parameters = $this->getParameters(); |
|
183 | + $parameters=$this->getParameters(); |
|
184 | 184 | foreach($parameters as $name => $value) { |
185 | 185 | $xslt->setParameter('', $name, $value); |
186 | 186 | } |
187 | - $output = $xslt->transformToXML($document); |
|
187 | + $output=$xslt->transformToXML($document); |
|
188 | 188 | |
189 | 189 | // Write output |
190 | 190 | $writer->write($output); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | public function getRegularExpression() |
51 | 51 | { |
52 | 52 | $regex=parent::getRegularExpression(); |
53 | - return $regex===''?self::EMAIL_REGEXP:$regex; |
|
53 | + return $regex==='' ? self::EMAIL_REGEXP : $regex; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -60,16 +60,16 @@ discard block |
||
60 | 60 | public function evaluateIsValid() |
61 | 61 | { |
62 | 62 | $value=$this->getValidationValue($this->getValidationTarget()); |
63 | - $valid=$valid=is_string($value) && strlen($value)<=254 && parent::evaluateIsValid(); |
|
63 | + $valid=$valid=is_string($value) && strlen($value) <= 254 && parent::evaluateIsValid(); |
|
64 | 64 | |
65 | 65 | if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) |
66 | 66 | { |
67 | 67 | if($value!=='') |
68 | 68 | { |
69 | - if(($pos=strpos($value,'@'))!==false) |
|
69 | + if(($pos=strpos($value, '@'))!==false) |
|
70 | 70 | { |
71 | - $domain=substr($value,$pos+1); |
|
72 | - return $domain===''?false:checkdnsrr($domain,'MX'); |
|
71 | + $domain=substr($value, $pos + 1); |
|
72 | + return $domain==='' ? false : checkdnsrr($domain, 'MX'); |
|
73 | 73 | } |
74 | 74 | else |
75 | 75 | return false; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function getCheckMXRecord() |
85 | 85 | { |
86 | - return $this->getViewState('CheckMXRecord',false); |
|
86 | + return $this->getViewState('CheckMXRecord', false); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function setCheckMXRecord($value) |
94 | 94 | { |
95 | - $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),false); |
|
95 | + $this->setViewState('CheckMXRecord', TPropertyValue::ensureBoolean($value), false); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class TReCaptchaValidator extends TBaseValidator |
32 | 32 | { |
33 | - protected $_isvalid = null; |
|
33 | + protected $_isvalid=null; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Gets the name of the javascript class responsible for performing validation for this control. |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | |
50 | 50 | protected function getCaptchaControl() |
51 | 51 | { |
52 | - $control = $this->getValidationTarget(); |
|
53 | - if (!$control) |
|
52 | + $control=$this->getValidationTarget(); |
|
53 | + if(!$control) |
|
54 | 54 | throw new Exception('No target control specified for TReCaptchaValidator'); |
55 | - if (!($control instanceof TReCaptcha)) |
|
55 | + if(!($control instanceof TReCaptcha)) |
|
56 | 56 | throw new Exception('TReCaptchaValidator only works with TReCaptcha controls'); |
57 | 57 | return $control; |
58 | 58 | } |
59 | 59 | |
60 | 60 | public function getClientScriptOptions() |
61 | 61 | { |
62 | - $options = parent::getClientScriptOptions(); |
|
63 | - $options['ResponseFieldName'] = $this->getCaptchaControl()->getResponseFieldName(); |
|
62 | + $options=parent::getClientScriptOptions(); |
|
63 | + $options['ResponseFieldName']=$this->getCaptchaControl()->getResponseFieldName(); |
|
64 | 64 | return $options; |
65 | 65 | } |
66 | 66 | |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | protected function evaluateIsValid() |
75 | 75 | { |
76 | 76 | // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) |
77 | - if (is_null($this->_isvalid)) |
|
77 | + if(is_null($this->_isvalid)) |
|
78 | 78 | { |
79 | - $control = $this->getCaptchaControl(); |
|
80 | - $this->_isvalid = $control->validate(); |
|
79 | + $control=$this->getCaptchaControl(); |
|
80 | + $this->_isvalid=$control->validate(); |
|
81 | 81 | } |
82 | 82 | return ($this->_isvalid==true); |
83 | 83 | } |
@@ -86,23 +86,23 @@ discard block |
||
86 | 86 | { |
87 | 87 | parent::onPreRender($param); |
88 | 88 | |
89 | - $cs = $this->Page->getClientScript(); |
|
89 | + $cs=$this->Page->getClientScript(); |
|
90 | 90 | $cs->registerPradoScript('validator'); |
91 | 91 | |
92 | 92 | // communicate validation status to the client side |
93 | - $value = $this->_isvalid===false ? '0' : '1'; |
|
94 | - $cs->registerHiddenField($this->getClientID().'_1',$value); |
|
93 | + $value=$this->_isvalid===false ? '0' : '1'; |
|
94 | + $cs->registerHiddenField($this->getClientID().'_1', $value); |
|
95 | 95 | |
96 | 96 | // update validator display |
97 | - if ($control = $this->getValidationTarget()) |
|
97 | + if($control=$this->getValidationTarget()) |
|
98 | 98 | { |
99 | - $fn = 'captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
99 | + $fn='captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
100 | 100 | |
101 | 101 | // check if we need to request a new captcha too |
102 | - if ($this->Page->IsCallback) |
|
102 | + if($this->Page->IsCallback) |
|
103 | 103 | { |
104 | - if ($control->getVisible(true)) |
|
105 | - if (!is_null($this->_isvalid)) |
|
104 | + if($control->getVisible(true)) |
|
105 | + if(!is_null($this->_isvalid)) |
|
106 | 106 | { |
107 | 107 | // if the response has been tested and we reach the pre-render phase |
108 | 108 | // then we need to regenerate the token, because it won't test positive |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | - $cs->registerEndScript($this->getClientID().'::validate', implode(' ',array( |
|
115 | + $cs->registerEndScript($this->getClientID().'::validate', implode(' ', array( |
|
116 | 116 | // this function will be used to update the validator |
117 | 117 | 'function '.$fn.'(valid)', |
118 | 118 | '{', |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function getDataKeyField() |
136 | 136 | { |
137 | - return $this->getViewState('DataKeyField',''); |
|
137 | + return $this->getViewState('DataKeyField', ''); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function setDataKeyField($value) |
144 | 144 | { |
145 | - $this->setViewState('DataKeyField',$value,''); |
|
145 | + $this->setViewState('DataKeyField', $value, ''); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function getDataKeys() |
152 | 152 | { |
153 | - if(($dataKeys=$this->getViewState('DataKeys',null))===null) |
|
153 | + if(($dataKeys=$this->getViewState('DataKeys', null))===null) |
|
154 | 154 | { |
155 | 155 | $dataKeys=new TList; |
156 | - $this->setViewState('DataKeys',$dataKeys,null); |
|
156 | + $this->setViewState('DataKeys', $dataKeys, null); |
|
157 | 157 | } |
158 | 158 | return $dataKeys; |
159 | 159 | } |
@@ -169,9 +169,9 @@ discard block |
||
169 | 169 | * @return mixed data value at the specified field |
170 | 170 | * @throws TInvalidDataValueException if the data is invalid |
171 | 171 | */ |
172 | - protected function getDataFieldValue($data,$field) |
|
172 | + protected function getDataFieldValue($data, $field) |
|
173 | 173 | { |
174 | - return TDataFieldAccessor::getDataFieldValue($data,$field); |
|
174 | + return TDataFieldAccessor::getDataFieldValue($data, $field); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function onSelectedIndexChanged($param) |
184 | 184 | { |
185 | - $this->raiseEvent('OnSelectedIndexChanged',$this,$param); |
|
185 | + $this->raiseEvent('OnSelectedIndexChanged', $this, $param); |
|
186 | 186 | } |
187 | 187 | } |
188 | 188 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class TJavascriptLogger extends TWebControl |
32 | 32 | { |
33 | - private static $_keyCodes = array( |
|
33 | + private static $_keyCodes=array( |
|
34 | 34 | '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57, |
35 | 35 | 'a'=>65, 'b'=>66, 'c'=>67, 'd'=>68, 'e'=>69, 'f'=>70, 'g'=>71, 'h'=>72, |
36 | 36 | 'i'=>73, 'j'=>74, 'k'=>75, 'l'=>76, 'm'=>77, 'n'=>78, 'o'=>79, 'p'=>80, |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function onPreRender($param) |
68 | 68 | { |
69 | - $key = strtolower($this->getToggleKey()); |
|
70 | - $code = isset(self::$_keyCodes[$key]) ? self::$_keyCodes[$key] : 74; |
|
71 | - $js = "var logConsole; jQuery(function() { logConsole = new LogConsole($code)}); "; |
|
72 | - $cs = $this->getPage()->getClientScript(); |
|
73 | - $cs->registerBeginScript($this->getClientID(),$js); |
|
69 | + $key=strtolower($this->getToggleKey()); |
|
70 | + $code=isset(self::$_keyCodes[$key]) ? self::$_keyCodes[$key] : 74; |
|
71 | + $js="var logConsole; jQuery(function() { logConsole = new LogConsole($code)}); "; |
|
72 | + $cs=$this->getPage()->getClientScript(); |
|
73 | + $cs->registerBeginScript($this->getClientID(), $js); |
|
74 | 74 | $cs->registerPradoScript('logger'); |
75 | 75 | } |
76 | 76 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function renderContents($writer) |
83 | 83 | { |
84 | - $code = strtoupper($this->getToggleKey()); |
|
85 | - $info = '(<a href="http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/" target="_blank">more info</a>).'; |
|
86 | - $link = '<a href="javascript:if(logConsole)logConsole.toggle()">toggle the javascript log console.</a>'; |
|
87 | - $usage = 'Press ALT-'.$code.' (Or CTRL-'.$code.' on OS X) to'; |
|
84 | + $code=strtoupper($this->getToggleKey()); |
|
85 | + $info='(<a href="http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/" target="_blank">more info</a>).'; |
|
86 | + $link='<a href="javascript:if(logConsole)logConsole.toggle()">toggle the javascript log console.</a>'; |
|
87 | + $usage='Press ALT-'.$code.' (Or CTRL-'.$code.' on OS X) to'; |
|
88 | 88 | $writer->write("{$usage} {$link} {$info}"); |
89 | 89 | } |
90 | 90 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function getDataField() |
49 | 49 | { |
50 | - return $this->getViewState('DataField',''); |
|
50 | + return $this->getViewState('DataField', ''); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setDataField($value) |
57 | 57 | { |
58 | - $this->setViewState('DataField',$value,''); |
|
58 | + $this->setViewState('DataField', $value, ''); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function getReadOnly() |
65 | 65 | { |
66 | - return $this->getViewState('ReadOnly',false); |
|
66 | + return $this->getViewState('ReadOnly', false); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function setReadOnly($value) |
73 | 73 | { |
74 | - $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false); |
|
74 | + $this->setViewState('ReadOnly', TPropertyValue::ensureBoolean($value), false); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @param integer the index to the Columns property that the cell resides in. |
85 | 85 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
86 | 86 | */ |
87 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
87 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
88 | 88 | { |
89 | 89 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) |
90 | 90 | { |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | $checkBox->setEnabled(false); |
94 | 94 | $cell->setHorizontalAlign('Center'); |
95 | 95 | $cell->getControls()->add($checkBox); |
96 | - $cell->registerObject('CheckBox',$checkBox); |
|
96 | + $cell->registerObject('CheckBox', $checkBox); |
|
97 | 97 | if($this->getDataField()!=='') |
98 | - $checkBox->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
98 | + $checkBox->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
99 | 99 | } |
100 | 100 | else |
101 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
101 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | * This method is invoked when datagrid performs databinding. |
107 | 107 | * It populates the content of the cell with the relevant data from data source. |
108 | 108 | */ |
109 | - public function dataBindColumn($sender,$param) |
|
109 | + public function dataBindColumn($sender, $param) |
|
110 | 110 | { |
111 | 111 | $item=$sender->getNamingContainer(); |
112 | 112 | $data=$item->getData(); |
113 | 113 | if(($field=$this->getDataField())!=='') |
114 | - $value=TPropertyValue::ensureBoolean($this->getDataFieldValue($data,$field)); |
|
114 | + $value=TPropertyValue::ensureBoolean($this->getDataFieldValue($data, $field)); |
|
115 | 115 | else |
116 | 116 | $value=TPropertyValue::ensureBoolean($data); |
117 | 117 | if($sender instanceof TCheckBox) |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function getForControl() |
44 | 44 | { |
45 | - return $this->getViewState('ForControl',''); |
|
45 | + return $this->getViewState('ForControl', ''); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | { |
132 | 132 | parent::addAttributesToRender($writer); |
133 | 133 | if($this->getPage()->getClientSupportsJavaScript()) |
134 | - $writer->addAttribute('id',$this->getClientID()); |
|
134 | + $writer->addAttribute('id', $this->getClientID()); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | if(($url=$this->getCssUrl())==='') |
145 | 145 | $url=$this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'keyboard.css'); |
146 | - $this->getPage()->getClientScript()->registerStyleSheetFile($url,$url); |
|
146 | + $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | if(($forControl=$this->getForControl())==='') |
175 | 175 | throw new TConfigurationException('keyboard_forcontrol_required'); |
176 | 176 | if(($target=$this->findControl($forControl))===null) |
177 | - throw new TConfigurationException('keyboard_forcontrol_invalid',$forControl); |
|
177 | + throw new TConfigurationException('keyboard_forcontrol_invalid', $forControl); |
|
178 | 178 | |
179 | - $options['ID'] = $this->getClientID(); |
|
180 | - $options['ForControl'] = $target->getClientID(); |
|
181 | - $options['AutoHide'] = $this->getAutoHide(); |
|
182 | - $options['CssClass'] = $this->getKeyboardCssClass(); |
|
179 | + $options['ID']=$this->getClientID(); |
|
180 | + $options['ForControl']=$target->getClientID(); |
|
181 | + $options['AutoHide']=$this->getAutoHide(); |
|
182 | + $options['CssClass']=$this->getKeyboardCssClass(); |
|
183 | 183 | |
184 | 184 | return $options; |
185 | 185 | } |