@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TDataListItemRenderer class file |
|
| 4 | - * |
|
| 5 | - * @author Qiang Xue <[email protected]> |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System.Web.UI.WebControls |
|
| 10 | - */ |
|
| 3 | + * TDataListItemRenderer class file |
|
| 4 | + * |
|
| 5 | + * @author Qiang Xue <[email protected]> |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System.Web.UI.WebControls |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | Prado::using('System.Web.UI.WebControls.TDataList'); |
| 13 | 13 | Prado::using('System.Web.UI.WebControls.TItemDataRenderer'); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function getHasStyle() |
| 47 | 47 | { |
| 48 | - return $this->getViewState('Style',null)!==null; |
|
| 48 | + return $this->getViewState('Style', null)!==null; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getStyle() |
| 55 | 55 | { |
| 56 | - if($style=$this->getViewState('Style',null)) |
|
| 56 | + if($style=$this->getViewState('Style', null)) |
|
| 57 | 57 | return $style; |
| 58 | 58 | else |
| 59 | 59 | { |
| 60 | 60 | $style=$this->createStyle(); |
| 61 | - $this->setViewState('Style',$style,null); |
|
| 61 | + $this->setViewState('Style', $style, null); |
|
| 62 | 62 | return $style; |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -78,11 +78,11 @@ discard block |
||
| 78 | 78 | * @param TEventParameter event parameter |
| 79 | 79 | * @return boolean whether the event bubbling should stop here. |
| 80 | 80 | */ |
| 81 | - public function bubbleEvent($sender,$param) |
|
| 81 | + public function bubbleEvent($sender, $param) |
|
| 82 | 82 | { |
| 83 | 83 | if($param instanceof TCommandEventParameter) |
| 84 | 84 | { |
| 85 | - $this->raiseBubbleEvent($this,new TDataListCommandEventParameter($this,$sender,$param)); |
|
| 85 | + $this->raiseBubbleEvent($this, new TDataListCommandEventParameter($this, $sender, $param)); |
|
| 86 | 86 | return true; |
| 87 | 87 | } |
| 88 | 88 | else |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | protected function addAttributesToRender($writer) |
| 111 | 111 | { |
| 112 | - if($style=$this->getViewState('Style',null)) |
|
| 112 | + if($style=$this->getViewState('Style', null)) |
|
| 113 | 113 | $style->addAttributesToRender($writer); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -189,8 +189,7 @@ discard block |
||
| 189 | 189 | return file_put_contents($fileName,file_get_contents($this->_localName))!==false; |
| 190 | 190 | else |
| 191 | 191 | return false; |
| 192 | - } |
|
| 193 | - else |
|
| 192 | + } else |
|
| 194 | 193 | return false; |
| 195 | 194 | } |
| 196 | 195 | |
@@ -211,8 +210,7 @@ discard block |
||
| 211 | 210 | $this->_errorCode=$_FILES[$key]['error']; |
| 212 | 211 | $this->_localName=$_FILES[$key]['tmp_name']; |
| 213 | 212 | return $this->_dataChanged=true; |
| 214 | - } |
|
| 215 | - else |
|
| 213 | + } else |
|
| 216 | 214 | return false; |
| 217 | 215 | } |
| 218 | 216 | |
@@ -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) |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function getTableSection() |
| 125 | 125 | { |
| 126 | - return $this->getViewState('TableSection',TTableRowSection::Body); |
|
| 126 | + return $this->getViewState('TableSection', TTableRowSection::Body); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function setTableSection($value) |
| 133 | 133 | { |
| 134 | - $this->setViewState('TableSection',TPropertyValue::ensureEnum($value,'TTableRowSection'),TTableRowSection::Body); |
|
| 134 | + $this->setViewState('TableSection', TPropertyValue::ensureEnum($value, 'TTableRowSection'), TTableRowSection::Body); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | * @param mixed new item |
| 172 | 172 | * @throws TInvalidDataTypeException if the item to be inserted is not a TTableCell object. |
| 173 | 173 | */ |
| 174 | - public function insertAt($index,$item) |
|
| 174 | + public function insertAt($index, $item) |
|
| 175 | 175 | { |
| 176 | 176 | if($item instanceof TTableCell) |
| 177 | - parent::insertAt($index,$item); |
|
| 177 | + parent::insertAt($index, $item); |
|
| 178 | 178 | else |
| 179 | 179 | throw new TInvalidDataTypeException('tablecellcollection_tablecell_required'); |
| 180 | 180 | } |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TCompositeControl class file. |
|
| 4 | - * |
|
| 5 | - * @author Qiang Xue <[email protected]> |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System.Web.UI |
|
| 10 | - */ |
|
| 3 | + * TCompositeControl class file. |
|
| 4 | + * |
|
| 5 | + * @author Qiang Xue <[email protected]> |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System.Web.UI |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * TCompositeControl class. |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TJuiResizable class file. |
|
| 4 | - * |
|
| 5 | - * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2013-2015 PradoSoft |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System.Web.UI.JuiControls |
|
| 10 | - */ |
|
| 3 | + * TJuiResizable class file. |
|
| 4 | + * |
|
| 5 | + * @author Fabio Bas <ctrlaltca[at]gmail[dot]com> |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2013-2015 PradoSoft |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System.Web.UI.JuiControls |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | Prado::using('System.Web.UI.JuiControls.TJuiControlAdapter'); |
| 13 | 13 | Prado::using('System.Web.UI.ActiveControls.TActivePanel'); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function getOptions() |
| 76 | 76 | { |
| 77 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
| 77 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
| 78 | 78 | { |
| 79 | 79 | $options=new TJuiControlOptions($this); |
| 80 | 80 | $this->setViewState('JuiOptions', $options); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function getPostBackOptions() |
| 107 | 107 | { |
| 108 | - $options = $this->getOptions()->toArray(); |
|
| 108 | + $options=$this->getOptions()->toArray(); |
|
| 109 | 109 | return $options; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | parent::addAttributesToRender($writer); |
| 119 | 119 | |
| 120 | - $writer->addAttribute('id',$this->getClientID()); |
|
| 120 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 121 | 121 | $options=TJavascript::encode($this->getPostBackOptions()); |
| 122 | 122 | $cs=$this->getPage()->getClientScript(); |
| 123 | 123 | $code="jQuery('#".$this->getWidgetID()."').".$this->getWidget()."(".$options.");"; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | * Raises the OnCreate event |
| 139 | 139 | * @param object $params event parameters |
| 140 | 140 | */ |
| 141 | - public function onCreate ($params) |
|
| 141 | + public function onCreate($params) |
|
| 142 | 142 | { |
| 143 | 143 | $this->raiseEvent('OnCreate', $this, $params); |
| 144 | 144 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | * Raises the OnResize event |
| 148 | 148 | * @param object $params event parameters |
| 149 | 149 | */ |
| 150 | - public function onResize ($params) |
|
| 150 | + public function onResize($params) |
|
| 151 | 151 | { |
| 152 | 152 | $this->raiseEvent('OnResize', $this, $params); |
| 153 | 153 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * Raises the OnStart event |
| 157 | 157 | * @param object $params event parameters |
| 158 | 158 | */ |
| 159 | - public function onStart ($params) |
|
| 159 | + public function onStart($params) |
|
| 160 | 160 | { |
| 161 | 161 | $this->raiseEvent('OnStart', $this, $params); |
| 162 | 162 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * Raises the OnStop event |
| 166 | 166 | * @param object $params event parameters |
| 167 | 167 | */ |
| 168 | - public function onStop ($params) |
|
| 168 | + public function onStop($params) |
|
| 169 | 169 | { |
| 170 | 170 | $this->raiseEvent('OnStop', $this, $params); |
| 171 | 171 | } |
@@ -30,9 +30,9 @@ discard block |
||
| 30 | 30 | class TActiveMultiView extends TMultiView implements IActiveControl |
| 31 | 31 | { |
| 32 | 32 | /** |
| 33 | - * Creates a new callback control, sets the adapter to |
|
| 34 | - * TActiveControlAdapter. |
|
| 35 | - */ |
|
| 33 | + * Creates a new callback control, sets the adapter to |
|
| 34 | + * TActiveControlAdapter. |
|
| 35 | + */ |
|
| 36 | 36 | public function __construct() |
| 37 | 37 | { |
| 38 | 38 | parent::__construct(); |
@@ -40,28 +40,28 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | - * @return TBaseActiveControl standard active control options. |
|
| 44 | - */ |
|
| 43 | + * @return TBaseActiveControl standard active control options. |
|
| 44 | + */ |
|
| 45 | 45 | public function getActiveControl() |
| 46 | 46 | { |
| 47 | 47 | return $this->getAdapter()->getBaseActiveControl(); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * Returns the id of the surrounding container (span). |
|
| 52 | - * @return string container id |
|
| 53 | - */ |
|
| 51 | + * Returns the id of the surrounding container (span). |
|
| 52 | + * @return string container id |
|
| 53 | + */ |
|
| 54 | 54 | protected function getContainerID() |
| 55 | 55 | { |
| 56 | 56 | return $this->ClientID.'_Container'; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * Renders the TActiveMultiView. |
|
| 61 | - * If the MutliView did not pass the prerender phase yet, it will register itself for rendering later. |
|
| 62 | - * Else it will call the {@link renderMultiView()} method which will do the rendering of the MultiView. |
|
| 63 | - * @param THtmlWriter writer for the rendering purpose |
|
| 64 | - */ |
|
| 60 | + * Renders the TActiveMultiView. |
|
| 61 | + * If the MutliView did not pass the prerender phase yet, it will register itself for rendering later. |
|
| 62 | + * Else it will call the {@link renderMultiView()} method which will do the rendering of the MultiView. |
|
| 63 | + * @param THtmlWriter writer for the rendering purpose |
|
| 64 | + */ |
|
| 65 | 65 | public function render($writer) |
| 66 | 66 | { |
| 67 | 67 | if($this->getHasPreRendered()) { |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | - * Renders the TActiveMultiView by writing a span tag with the container id obtained from {@link getContainerID()} |
|
| 78 | - * which will be called by the replacement method of the client script to update it's content. |
|
| 79 | - * @param $writer THtmlWriter writer for the rendering purpose |
|
| 80 | - */ |
|
| 77 | + * Renders the TActiveMultiView by writing a span tag with the container id obtained from {@link getContainerID()} |
|
| 78 | + * which will be called by the replacement method of the client script to update it's content. |
|
| 79 | + * @param $writer THtmlWriter writer for the rendering purpose |
|
| 80 | + */ |
|
| 81 | 81 | protected function renderMultiView($writer) |
| 82 | 82 | { |
| 83 | 83 | $writer->addAttribute('id', $this->getContainerID()); |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * @param integer the zero-based index of the current view in the view collection. -1 if no active view. |
|
| 91 | - * @throws TInvalidDataValueException if the view index is invalid |
|
| 92 | - */ |
|
| 90 | + * @param integer the zero-based index of the current view in the view collection. -1 if no active view. |
|
| 91 | + * @throws TInvalidDataValueException if the view index is invalid |
|
| 92 | + */ |
|
| 93 | 93 | public function setActiveViewIndex($value) |
| 94 | 94 | { |
| 95 | 95 | $old=parent::getActiveViewIndex(); |
@@ -99,9 +99,9 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * @param TView the view to be activated |
|
| 103 | - * @throws TInvalidOperationException if the view is not in the view collection |
|
| 104 | - */ |
|
| 102 | + * @param TView the view to be activated |
|
| 103 | + * @throws TInvalidOperationException if the view is not in the view collection |
|
| 104 | + */ |
|
| 105 | 105 | public function setActiveView($value) |
| 106 | 106 | { |
| 107 | 107 | $old=parent::getActiveView(); |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if ($this->sourcepath === NULL) |
| 59 | 59 | { |
| 60 | 60 | $this->sourcepath = $sourcepath; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $this->sourcepath->append($sourcepath); |
| 65 | 64 | } |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | if($this->getHasPreRendered()) { |
| 68 | 68 | $this->renderMultiView($writer); |
| 69 | 69 | if($this->getActiveControl()->canUpdateClientSide()) |
| 70 | - $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer); |
|
| 70 | + $this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer); |
|
| 71 | 71 | } |
| 72 | 72 | else |
| 73 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
| 73 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $old=parent::getActiveViewIndex(); |
| 96 | 96 | parent::setActiveViewIndex($value); |
| 97 | 97 | if($this->getActiveControl()->canUpdateClientSide() && $old!=$value) |
| 98 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
| 98 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -107,6 +107,6 @@ discard block |
||
| 107 | 107 | $old=parent::getActiveView(); |
| 108 | 108 | parent::setActiveView($value); |
| 109 | 109 | if($this->getActiveControl()->canUpdateClientSide() && $old!=$value) |
| 110 | - $this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter()); |
|
| 110 | + $this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter()); |
|
| 111 | 111 | } |
| 112 | 112 | } |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TActivePager class file. |
|
| 4 | - * |
|
| 5 | - * @author "gevik" (forum contributor) and Christophe Boulain ([email protected]) |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System.Web.UI.ActiveControls |
|
| 10 | - */ |
|
| 3 | + * TActivePager class file. |
|
| 4 | + * |
|
| 5 | + * @author "gevik" (forum contributor) and Christophe Boulain ([email protected]) |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System.Web.UI.ActiveControls |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Load active control adapter. |
@@ -127,8 +127,7 @@ discard block |
||
| 127 | 127 | $button->setCssClass($this->getButtonCssClass()); |
| 128 | 128 | return $button; |
| 129 | 129 | } |
| 130 | - } |
|
| 131 | - else if($buttonType===TPagerButtonType::ImageButton) |
|
| 130 | + } else if($buttonType===TPagerButtonType::ImageButton) |
|
| 132 | 131 | { |
| 133 | 132 | $button = new TActiveImageButton; |
| 134 | 133 | $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
@@ -136,8 +135,7 @@ discard block |
||
| 136 | 135 | $button->Visible = true; |
| 137 | 136 | else |
| 138 | 137 | $button->Visible = false; |
| 139 | - } |
|
| 140 | - else |
|
| 138 | + } else |
|
| 141 | 139 | { |
| 142 | 140 | $button=new TActiveButton; |
| 143 | 141 | if(!$enabled) |
@@ -197,8 +195,7 @@ discard block |
||
| 197 | 195 | TWebControl::render($writer); |
| 198 | 196 | if($this->getActiveControl()->canUpdateClientSide()) |
| 199 | 197 | $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
| 200 | - } |
|
| 201 | - else |
|
| 198 | + } else |
|
| 202 | 199 | { |
| 203 | 200 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
| 204 | 201 | } |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | ); |
| 95 | 95 | |
| 96 | 96 | $this->getControls()->add($list); |
| 97 | - $list->setDataSource(range(1,$this->getPageCount())); |
|
| 97 | + $list->setDataSource(range(1, $this->getPageCount())); |
|
| 98 | 98 | $list->dataBind(); |
| 99 | 99 | $list->setSelectedIndex($this->getCurrentPageIndex()); |
| 100 | 100 | $list->setAutoPostBack(true); |
| 101 | - $list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged')); |
|
| 101 | + $list->attachEventHandler('OnSelectedIndexChanged', array($this, 'listIndexChanged')); |
|
| 102 | 102 | $list->attachEventHandler('OnCallback', array($this, 'handleCallback')); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * @param string CommandParameter corresponding to the OnCommand event of the button |
| 115 | 115 | * @return mixed the button instance |
| 116 | 116 | */ |
| 117 | - protected function createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter) |
|
| 117 | + protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter) |
|
| 118 | 118 | { |
| 119 | 119 | if($buttonType===TPagerButtonType::LinkButton) |
| 120 | 120 | { |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | else if($buttonType===TPagerButtonType::ImageButton) |
| 132 | 132 | { |
| 133 | - $button = new TActiveImageButton; |
|
| 134 | - $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
|
| 133 | + $button=new TActiveImageButton; |
|
| 134 | + $button->setImageUrl($this->getPageImageUrl($text, $commandName)); |
|
| 135 | 135 | if($enabled) |
| 136 | - $button->Visible = true; |
|
| 136 | + $button->Visible=true; |
|
| 137 | 137 | else |
| 138 | - $button->Visible = false; |
|
| 138 | + $button->Visible=false; |
|
| 139 | 139 | } |
| 140 | 140 | else |
| 141 | 141 | { |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if($buttonType===TPagerButtonType::ImageButton) |
| 148 | 148 | { |
| 149 | - $button->ImageUrl = $text; |
|
| 149 | + $button->ImageUrl=$text; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | $button->setText($text); |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | * @param mixed $sender |
| 171 | 171 | * @param TCallbackEventParameter $param |
| 172 | 172 | */ |
| 173 | - public function handleCallback ($sender,$param) |
|
| 173 | + public function handleCallback($sender, $param) |
|
| 174 | 174 | { |
| 175 | 175 | // Update all the buttons pagers attached to the same control. |
| 176 | 176 | // Dropdown pagers doesn't need to be re-rendered. |
| 177 | 177 | $controlToPaginate=$this->getControlToPaginate(); |
| 178 | - foreach ($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
| 178 | + foreach($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
| 179 | 179 | { |
| 180 | - if ($control->getMode() !== TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
| 180 | + if($control->getMode()!==TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
| 181 | 181 | { |
| 182 | 182 | $control->render($param->getNewWriter()); |
| 183 | 183 | // FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting |
@@ -189,18 +189,18 @@ discard block |
||
| 189 | 189 | $this->onCallback($param); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - public function render ($writer) |
|
| 192 | + public function render($writer) |
|
| 193 | 193 | { |
| 194 | 194 | if($this->getHasPreRendered()) |
| 195 | 195 | { |
| 196 | - $this->setDisplay(($this->getPageCount()==1)?TDisplayStyle::None:TDisplayStyle::Dynamic); |
|
| 196 | + $this->setDisplay(($this->getPageCount()==1) ? TDisplayStyle::None : TDisplayStyle::Dynamic); |
|
| 197 | 197 | TWebControl::render($writer); |
| 198 | 198 | if($this->getActiveControl()->canUpdateClientSide()) |
| 199 | - $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
|
| 199 | + $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
|
| 200 | 200 | } |
| 201 | 201 | else |
| 202 | 202 | { |
| 203 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
| 203 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | } |
@@ -32,8 +32,8 @@ |
||
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @return boolean a value indicating whether an automatic postback to the server |
| 35 | - * will occur whenever the user modifies the text in the TActiveDatePicker control and |
|
| 36 | - * then tabs out of the component. Defaults to true. |
|
| 35 | + * will occur whenever the user modifies the text in the TActiveDatePicker control and |
|
| 36 | + * then tabs out of the component. Defaults to true. |
|
| 37 | 37 | */ |
| 38 | 38 | public function getAutoPostBack() |
| 39 | 39 | { |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function getAutoPostBack() |
| 39 | 39 | { |
| 40 | - return $this->getViewState('AutoPostBack',true); |
|
| 40 | + return $this->getViewState('AutoPostBack', true); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function setAutoPostBack($value) |
| 50 | 50 | { |
| 51 | - $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true); |
|
| 51 | + $this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), true); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | protected function getDatePickerOptions() |
| 59 | 59 | { |
| 60 | - $options = parent::getDatePickerOptions(); |
|
| 60 | + $options=parent::getDatePickerOptions(); |
|
| 61 | 61 | $options['CausesValidation']=$this->getCausesValidation(); |
| 62 | 62 | $options['ValidationGroup']=$this->getValidationGroup(); |
| 63 | - $options['EventTarget'] = $this->getUniqueID(); |
|
| 64 | - $options['ShowCalendar'] = $this->getShowCalendar(); |
|
| 65 | - $options['AutoPostBack'] = $this->getAutoPostBack(); |
|
| 63 | + $options['EventTarget']=$this->getUniqueID(); |
|
| 64 | + $options['ShowCalendar']=$this->getShowCalendar(); |
|
| 65 | + $options['AutoPostBack']=$this->getAutoPostBack(); |
|
| 66 | 66 | return $options; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * @return TBaseActiveCallbackControl standard callback control options. |
| 82 | 82 | */ |
| 83 | - public function getActiveControl(){ |
|
| 83 | + public function getActiveControl() { |
|
| 84 | 84 | return $this->getAdapter()->getBaseActiveControl(); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -88,18 +88,18 @@ discard block |
||
| 88 | 88 | * Client-side Text property can only be updated after the OnLoad stage. |
| 89 | 89 | * @param string text content for the textbox |
| 90 | 90 | */ |
| 91 | - public function setText($value){ |
|
| 91 | + public function setText($value) { |
|
| 92 | 92 | parent::setText($value); |
| 93 | - if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){ |
|
| 93 | + if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) { |
|
| 94 | 94 | $cb=$this->getPage()->getCallbackClient(); |
| 95 | 95 | $cb->setValue($this, $value); |
| 96 | - if ($this->getInputMode()==TDatePickerInputMode::DropDownList) |
|
| 96 | + if($this->getInputMode()==TDatePickerInputMode::DropDownList) |
|
| 97 | 97 | { |
| 98 | - $s = Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 99 | - $date = $s->getDate($this->getTimeStampFromText()); |
|
| 98 | + $s=Prado::createComponent('System.Util.TDateTimeStamp'); |
|
| 99 | + $date=$s->getDate($this->getTimeStampFromText()); |
|
| 100 | 100 | $id=$this->getClientID(); |
| 101 | 101 | $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $date['mday'], 'select'); |
| 102 | - $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon']-1, 'select'); |
|
| 102 | + $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon'] - 1, 'select'); |
|
| 103 | 103 | $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $date['year'], 'select'); |
| 104 | 104 | |
| 105 | 105 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * This method is mainly used by framework and control developers. |
| 113 | 113 | * @param TCallbackEventParameter the event parameter |
| 114 | 114 | */ |
| 115 | - public function raiseCallbackEvent($param){ |
|
| 115 | + public function raiseCallbackEvent($param) { |
|
| 116 | 116 | $this->onCallback($param); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * handler can be invoked. |
| 124 | 124 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
| 125 | 125 | */ |
| 126 | - public function onCallback($param){ |
|
| 126 | + public function onCallback($param) { |
|
| 127 | 127 | $this->raiseEvent('OnCallback', $this, $param); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -133,22 +133,22 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | protected function registerCalendarClientScriptPre() |
| 135 | 135 | { |
| 136 | - $cs = $this->getPage()->getClientScript(); |
|
| 136 | + $cs=$this->getPage()->getClientScript(); |
|
| 137 | 137 | $cs->registerPradoScript("activedatepicker"); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | protected function renderClientControlScript($writer) |
| 141 | 141 | { |
| 142 | - $cs = $this->getPage()->getClientScript(); |
|
| 142 | + $cs=$this->getPage()->getClientScript(); |
|
| 143 | 143 | if(!$cs->isEndScriptRegistered('TDatePicker.spacer')) |
| 144 | 144 | { |
| 145 | - $spacer = $this->getAssetUrl('spacer.gif'); |
|
| 146 | - $code = "Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 145 | + $spacer=$this->getAssetUrl('spacer.gif'); |
|
| 146 | + $code="Prado.WebUI.TDatePicker.spacer = '$spacer';"; |
|
| 147 | 147 | $cs->registerEndScript('TDatePicker.spacer', $code); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - $options = TJavaScript::encode($this->getDatePickerOptions()); |
|
| 151 | - $code = "new Prado.WebUI.TActiveDatePicker($options);"; |
|
| 150 | + $options=TJavaScript::encode($this->getDatePickerOptions()); |
|
| 151 | + $code="new Prado.WebUI.TActiveDatePicker($options);"; |
|
| 152 | 152 | $cs->registerEndScript("prado:".$this->getClientID(), $code); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TActiveListControlAdapter class file. |
|
| 4 | - * |
|
| 5 | - * @author Wei Zhuo <weizhuo[at]gamil[dot]com> |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System.Web.UI.ActiveControls |
|
| 10 | - */ |
|
| 3 | + * TActiveListControlAdapter class file. |
|
| 4 | + * |
|
| 5 | + * @author Wei Zhuo <weizhuo[at]gamil[dot]com> |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System.Web.UI.ActiveControls |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Load active control adapter. |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - /** |
|
| 124 | - * Clears all existing selections on the client side. |
|
| 125 | - */ |
|
| 126 | - public function clearSelection() |
|
| 127 | - { |
|
| 123 | + /** |
|
| 124 | + * Clears all existing selections on the client side. |
|
| 125 | + */ |
|
| 126 | + public function clearSelection() |
|
| 127 | + { |
|
| 128 | 128 | if($this->canUpdateClientSide()) |
| 129 | 129 | { |
| 130 | 130 | $this->updateListItems(); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $this->getPage()->getCallbackClient()->select($this->getControl(), 'Clear'); |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | - } |
|
| 140 | + } |
|
| 141 | 141 | |
| 142 | 142 | /** |
| 143 | 143 | * Update the client-side list options. |
@@ -67,20 +67,20 @@ discard block |
||
| 67 | 67 | if($this->canUpdateClientSide()) |
| 68 | 68 | { |
| 69 | 69 | $this->updateListItems(); |
| 70 | - $n = $this->getControl()->getItemCount(); |
|
| 70 | + $n=$this->getControl()->getItemCount(); |
|
| 71 | 71 | |
| 72 | 72 | $promptValue=$this->getControl()->getPromptValue(); |
| 73 | 73 | if($promptValue==='') |
| 74 | 74 | $promptValue=$this->getControl()->getPromptText(); |
| 75 | 75 | |
| 76 | - $list = array(); |
|
| 76 | + $list=array(); |
|
| 77 | 77 | foreach($indices as $index) |
| 78 | 78 | { |
| 79 | - $index = intval($index); |
|
| 79 | + $index=intval($index); |
|
| 80 | 80 | if($promptValue!=='') |
| 81 | 81 | $index++; |
| 82 | 82 | if($index >= 0 && $index <= $n) |
| 83 | - $list[] = $index; |
|
| 83 | + $list[]=$index; |
|
| 84 | 84 | } |
| 85 | 85 | if(count($list) > 0) |
| 86 | 86 | $this->getPage()->getCallbackClient()->select( |
@@ -111,9 +111,9 @@ discard block |
||
| 111 | 111 | if($this->canUpdateClientSide()) |
| 112 | 112 | { |
| 113 | 113 | $this->updateListItems(); |
| 114 | - $list = array(); |
|
| 114 | + $list=array(); |
|
| 115 | 115 | foreach($values as $value) |
| 116 | - $list[] = $value; |
|
| 116 | + $list[]=$value; |
|
| 117 | 117 | if(count($list) > 0) |
| 118 | 118 | $this->getPage()->getCallbackClient()->select( |
| 119 | 119 | $this->getControl(), 'Values', $list); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | if($this->canUpdateClientSide()) |
| 148 | 148 | { |
| 149 | - $items = $this->getControl()->getItems(); |
|
| 149 | + $items=$this->getControl()->getItems(); |
|
| 150 | 150 | if($items instanceof TActiveListItemCollection |
| 151 | 151 | && $items->getListHasChanged()) |
| 152 | 152 | { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | */ |
| 198 | 198 | public function setControl(IActiveControl $control) |
| 199 | 199 | { |
| 200 | - $this->_control = $control; |
|
| 200 | + $this->_control=$control; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /** |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | public function updateClientSide() |
| 223 | 223 | { |
| 224 | - $client = $this->getControl()->getPage()->getCallbackClient(); |
|
| 224 | + $client=$this->getControl()->getPage()->getCallbackClient(); |
|
| 225 | 225 | $client->setListItems($this->getControl(), $this); |
| 226 | 226 | $this->_hasChanged=false; |
| 227 | 227 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | { |
| 239 | 239 | parent::insertAt($index, $value); |
| 240 | 240 | if($this->canUpdateClientSide()) |
| 241 | - $this->_hasChanged = true; |
|
| 241 | + $this->_hasChanged=true; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /** |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | { |
| 250 | 250 | parent::removeAt($index); |
| 251 | 251 | if($this->canUpdateClientSide()) |
| 252 | - $this->_hasChanged = true; |
|
| 252 | + $this->_hasChanged=true; |
|
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
@@ -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 | /** |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | if ($this->sourcepath === NULL) |
| 59 | 59 | { |
| 60 | 60 | $this->sourcepath = $sourcepath; |
| 61 | - } |
|
| 62 | - else |
|
| 61 | + } else |
|
| 63 | 62 | { |
| 64 | 63 | $this->sourcepath->append($sourcepath); |
| 65 | 64 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 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()); |
|
| 63 | + $writer->addAttribute('id', $this->getClientID()); |
|
| 64 | 64 | parent::addAttributesToRender($writer); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -77,17 +77,17 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | parent::render($writer); |
| 79 | 79 | if($this->getActiveControl()->canUpdateClientSide()) |
| 80 | - $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
|
| 80 | + $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
|
| 81 | 81 | } |
| 82 | 82 | else |
| 83 | 83 | { |
| 84 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
| 85 | - if ($this->getHasControls()) |
|
| 84 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
| 85 | + if($this->getHasControls()) |
|
| 86 | 86 | { |
| 87 | 87 | // If we update a TActivePanel on callback, |
| 88 | 88 | // We shouldn't update all childs, because the whole content will be replaced by |
| 89 | 89 | // the parent |
| 90 | - foreach ($this->findControlsByType('IActiveControl', false) as $control) |
|
| 90 | + foreach($this->findControlsByType('IActiveControl', false) as $control) |
|
| 91 | 91 | { |
| 92 | 92 | $control->getActiveControl()->setEnableUpdate(false); |
| 93 | 93 | } |