From 99ecc26ddd9c6f0233aff2770e82c9db80fd0b4c Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 31 Jan 2006 01:30:28 +0000 Subject: All events are now defined with public on-functions. This is to comply with the new change introduced since 5.1. --- framework/Web/UI/TControl.php | 16 +-- framework/Web/UI/TForm.php | 2 +- framework/Web/UI/TPage.php | 16 +-- framework/Web/UI/WebControls/TBaseValidator.php | 6 +- framework/Web/UI/WebControls/TCheckBox.php | 4 +- framework/Web/UI/WebControls/TCheckBoxList.php | 2 +- framework/Web/UI/WebControls/TDataBoundControl.php | 8 +- framework/Web/UI/WebControls/TDataGrid.php | 8 +- framework/Web/UI/WebControls/TDataGridColumn.php | 2 +- framework/Web/UI/WebControls/TDataList.php | 18 +-- framework/Web/UI/WebControls/TDataSourceView.php | 2 +- framework/Web/UI/WebControls/TDatePicker.php | 32 +++--- framework/Web/UI/WebControls/TFileUpload.php | 4 +- framework/Web/UI/WebControls/THead.php | 2 +- framework/Web/UI/WebControls/TImageButton.php | 2 +- framework/Web/UI/WebControls/TListBox.php | 2 +- framework/Web/UI/WebControls/TListControl.php | 4 +- framework/Web/UI/WebControls/TRepeater.php | 14 +-- framework/Web/UI/WebControls/TTextBox.php | 2 +- framework/Web/UI/WebControls/TTextHighlighter.php | 2 +- framework/Web/UI/WebControls/TWizard.php | 128 ++++++++++----------- 21 files changed, 138 insertions(+), 138 deletions(-) (limited to 'framework') diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index ee1b8e11..b5fccd7b 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -1101,7 +1101,7 @@ class TControl extends TComponent * so that the event handlers can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onInit($param) + public function onInit($param) { $this->raiseEvent('OnInit',$this,$param); } @@ -1113,7 +1113,7 @@ class TControl extends TComponent * so that the event handlers can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onLoad($param) + public function onLoad($param) { $this->raiseEvent('OnLoad',$this,$param); } @@ -1123,7 +1123,7 @@ class TControl extends TComponent * This method is invoked when {@link dataBind} is invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onDataBinding($param) + public function onDataBinding($param) { $this->raiseEvent('OnDataBinding',$this,$param); } @@ -1136,7 +1136,7 @@ class TControl extends TComponent * so that the event handlers can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onUnload($param) + public function onUnload($param) { $this->raiseEvent('OnUnload',$this,$param); } @@ -1148,7 +1148,7 @@ class TControl extends TComponent * so that the event handlers can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onPreRender($param) + public function onPreRender($param) { $this->raiseEvent('OnPreRender',$this,$param); } @@ -1179,7 +1179,7 @@ class TControl extends TComponent * @return boolean true if the event bubbling is handled and no more bubbling. * @see raiseBubbleEvent */ - protected function onBubbleEvent($sender,$param) + public function onBubbleEvent($sender,$param) { return false; } @@ -1269,7 +1269,7 @@ class TControl extends TComponent * Parent implementation must be invoked. * @param TEventParameter event parameter */ - protected function onSaveState($param) + public function onSaveState($param) { $this->raiseEvent('OnSaveState',$this,$param); } @@ -1280,7 +1280,7 @@ class TControl extends TComponent * Parent implementation must be invoked. * @param TEventParameter */ - protected function onLoadState($param) + public function onLoadState($param) { $this->raiseEvent('OnLoadState',$this,$param); } diff --git a/framework/Web/UI/TForm.php b/framework/Web/UI/TForm.php index 7155627a..4cd7e5cc 100644 --- a/framework/Web/UI/TForm.php +++ b/framework/Web/UI/TForm.php @@ -2,7 +2,7 @@ class TForm extends TControl { - protected function onInit($param) + public function onInit($param) { parent::onInit($param); $this->getPage()->setForm($this); diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php index b7c1bae6..4e23681a 100644 --- a/framework/Web/UI/TPage.php +++ b/framework/Web/UI/TPage.php @@ -391,7 +391,7 @@ class TPage extends TTemplateControl * Remember to call the parent implementation to ensure PreInit event is raised. * @param mixed event parameter */ - protected function onPreInit($param) + public function onPreInit($param) { $this->raiseEvent('OnPreInit',$this,$param); } @@ -404,7 +404,7 @@ class TPage extends TTemplateControl * Remember to call the parent implementation to ensure InitComplete event is raised. * @param mixed event parameter */ - protected function onInitComplete($param) + public function onInitComplete($param) { $this->raiseEvent('OnInitComplete',$this,$param); } @@ -417,7 +417,7 @@ class TPage extends TTemplateControl * Remember to call the parent implementation to ensure PreLoad event is raised. * @param mixed event parameter */ - protected function onPreLoad($param) + public function onPreLoad($param) { $this->raiseEvent('OnPreLoad',$this,$param); } @@ -430,7 +430,7 @@ class TPage extends TTemplateControl * Remember to call the parent implementation to ensure LoadComplete event is raised. * @param mixed event parameter */ - protected function onLoadComplete($param) + public function onLoadComplete($param) { $this->raiseEvent('OnLoadComplete',$this,$param); } @@ -443,7 +443,7 @@ class TPage extends TTemplateControl * Remember to call the parent implementation to ensure PreRenderComplete event is raised. * @param mixed event parameter */ - protected function onPreRenderComplete($param) + public function onPreRenderComplete($param) { $this->raiseEvent('OnPreRenderComplete',$this,$param); $cs=$this->getClientScript(); @@ -470,7 +470,7 @@ class TPage extends TTemplateControl * Remember to call the parent implementation to ensure SaveStateComplete event is raised. * @param mixed event parameter */ - protected function onSaveStateComplete($param) + public function onSaveStateComplete($param) { $this->raiseEvent('OnSaveStateComplete',$this,$param); } @@ -508,7 +508,7 @@ class TPage extends TTemplateControl * Parent implementation must be invoked. * @param TEventParameter event parameter */ - protected function onSaveState($param) + public function onSaveState($param) { parent::onSaveState($param); $this->setViewState('ControlsRequiringPostBack',$this->_controlsRegisteredForPostData,array()); @@ -520,7 +520,7 @@ class TPage extends TTemplateControl * Parent implementation must be invoked. * @param TEventParameter */ - protected function onLoadState($param) + public function onLoadState($param) { $this->_controlsRequiringPostData=$this->getViewState('ControlsRequiringPostBack',array()); parent::onLoadState($param); diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index eeb5d0e8..7520933a 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -90,7 +90,7 @@ abstract class TBaseValidator extends TLabel implements IValidator * Registers the validator with page. * @param mixed event parameter */ - protected function onInit($param) + public function onInit($param) { parent::onInit($param); $this->getPage()->getValidators()->add($this); @@ -101,7 +101,7 @@ abstract class TBaseValidator extends TLabel implements IValidator * Unregisters the validator from page. * @param mixed event parameter */ - protected function onUnload($param) + public function onUnload($param) { if($this->_registered && ($page=$this->getPage())!==null) $page->getValidators()->remove($this); @@ -147,7 +147,7 @@ abstract class TBaseValidator extends TLabel implements IValidator * so that the event handlers can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onPreRender($param) + public function onPreRender($param) { $scripts = $this->getPage()->getClientScript(); $formID=$this->getPage()->getForm()->getClientID(); diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php index 5d3779b9..0a628674 100644 --- a/framework/Web/UI/WebControls/TCheckBox.php +++ b/framework/Web/UI/WebControls/TCheckBox.php @@ -87,7 +87,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl * so that the event delegates can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onCheckedChanged($param) + public function onCheckedChanged($param) { $this->raiseEvent('OnCheckedChanged',$this,$param); } @@ -100,7 +100,7 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl * This method overrides the parent implementation and is invoked before render. * @param mixed event parameter */ - protected function onPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); if($this->getEnabled(true)) diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php index 34ff005f..b4f21ca7 100644 --- a/framework/Web/UI/WebControls/TCheckBoxList.php +++ b/framework/Web/UI/WebControls/TCheckBoxList.php @@ -338,7 +338,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont * This method overrides the parent implementation. * @param mixed event parameter */ - protected function onPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); $this->_repeatedControl->setAutoPostBack($this->getAutoPostBack()); diff --git a/framework/Web/UI/WebControls/TDataBoundControl.php b/framework/Web/UI/WebControls/TDataBoundControl.php index 5145b532..026d2e86 100644 --- a/framework/Web/UI/WebControls/TDataBoundControl.php +++ b/framework/Web/UI/WebControls/TDataBoundControl.php @@ -98,7 +98,7 @@ abstract class TDataBoundControl extends TWebControl * Sets {@link setRequiresDataBinding RequiresDataBinding} as true if the control is initialized. * This method is invoked when either {@link setDataSource} or {@link setDataSourceID} is changed. */ - protected function onDataSourceChanged() + public function onDataSourceChanged() { $this->_currentViewValid=false; $this->_currentDataSourceValid=false; @@ -280,7 +280,7 @@ abstract class TDataBoundControl extends TWebControl * This method overrides the parent implementation. * @param TEventParameter event parameter */ - protected function onInit($param) + public function onInit($param) { parent::onInit($param); $page=$this->getPage(); @@ -293,7 +293,7 @@ abstract class TDataBoundControl extends TWebControl * @param mixed event sender * @param TEventParameter event parameter */ - protected function onPagePreLoad($sender,$param) + public function onPagePreLoad($sender,$param) { $this->_initialized=true; $isPostBack=$this->getPage()->getIsPostBack(); @@ -306,7 +306,7 @@ abstract class TDataBoundControl extends TWebControl * This method overrides the parent implementation. * @param TEventParameter event parameter */ - protected function onPreRender($param) + public function onPreRender($param) { $this->_prerendered=true; $this->ensureDataBound(); diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php index 0aad717d..9d55f37e 100644 --- a/framework/Web/UI/WebControls/TDataGrid.php +++ b/framework/Web/UI/WebControls/TDataGrid.php @@ -565,7 +565,7 @@ class TDataGrid extends TBaseDataList * @param TEventParameter event parameter * @return boolean whether the event bubbling should stop here. */ - protected function onBubbleEvent($sender,$param) + public function onBubbleEvent($sender,$param) { if($param instanceof TDataGridCommandEventParameter) { @@ -720,7 +720,7 @@ class TDataGrid extends TBaseDataList * This method is invoked right before control state is to be saved. * @param mixed event parameter */ - protected function onSaveState($param) + public function onSaveState($param) { if($this->_items) $this->setViewState('ItemCount',$this->_items->getCount(),0); @@ -742,7 +742,7 @@ class TDataGrid extends TBaseDataList * This method is invoked right after control state is loaded. * @param mixed event parameter */ - protected function onLoadState($param) + public function onLoadState($param) { if(!$this->getIsDataBound()) { @@ -1527,7 +1527,7 @@ class TDataGridItem extends TTableRow implements INamingContainer * @param TEventParameter event parameter * @return boolean whether the event bubbling should stop here. */ - protected function onBubbleEvent($sender,$param) + public function onBubbleEvent($sender,$param) { if($param instanceof TCommandEventParameter) { diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php index abd06b80..a48efa1d 100644 --- a/framework/Web/UI/WebControls/TDataGridColumn.php +++ b/framework/Web/UI/WebControls/TDataGridColumn.php @@ -216,7 +216,7 @@ abstract class TDataGridColumn extends TComponent $this->_owner=$value; } - protected function onColumnChanged() + public function onColumnChanged() { if($this->_owner) $this->_owner->onColumnsChanged(); diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php index 47b60cd6..819febd6 100644 --- a/framework/Web/UI/WebControls/TDataList.php +++ b/framework/Web/UI/WebControls/TDataList.php @@ -634,7 +634,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * @param TEventParameter event parameter * @return boolean whether the event bubbling should stop here. */ - protected function onBubbleEvent($sender,$param) + public function onBubbleEvent($sender,$param) { if($param instanceof TDataListCommandEventParameter) { @@ -706,7 +706,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * raises an Command event. * @param TDataListCommandEventParameter event parameter */ - protected function onItemCommand($param) + public function onItemCommand($param) { $this->raiseEvent('OnItemCommand',$this,$param); } @@ -717,7 +717,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * raises an Command event and the command name is 'edit' (case-insensitive). * @param TDataListCommandEventParameter event parameter */ - protected function onEditCommand($param) + public function onEditCommand($param) { $this->raiseEvent('OnEditCommand',$this,$param); } @@ -728,7 +728,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * raises an Command event and the command name is 'delete' (case-insensitive). * @param TDataListCommandEventParameter event parameter */ - protected function onDeleteCommand($param) + public function onDeleteCommand($param) { $this->raiseEvent('OnDeleteCommand',$this,$param); } @@ -739,7 +739,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * raises an Command event and the command name is 'update' (case-insensitive). * @param TDataListCommandEventParameter event parameter */ - protected function onUpdateCommand($param) + public function onUpdateCommand($param) { $this->raiseEvent('OnUpdateCommand',$this,$param); } @@ -750,7 +750,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * raises an Command event and the command name is 'cancel' (case-insensitive). * @param TDataListCommandEventParameter event parameter */ - protected function onCancelCommand($param) + public function onCancelCommand($param) { $this->raiseEvent('OnCancelCommand',$this,$param); } @@ -1015,7 +1015,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * This method is invoked right before control state is to be saved. * @param mixed event parameter */ - protected function onSaveState($param) + public function onSaveState($param) { if($this->_items) $this->setViewState('ItemCount',$this->_items->getCount(),0); @@ -1028,7 +1028,7 @@ class TDataList extends TBaseDataList implements INamingContainer, IRepeatInfoUs * This method is invoked right after control state is loaded. * @param mixed event parameter */ - protected function onLoadState($param) + public function onLoadState($param) { if(!$this->getIsDataBound()) $this->restoreItemsFromViewState(); @@ -1328,7 +1328,7 @@ class TDataListItem extends TWebControl implements INamingContainer * @param TEventParameter event parameter * @return boolean whether the event bubbling should stop here. */ - protected function onBubbleEvent($sender,$param) + public function onBubbleEvent($sender,$param) { if($param instanceof TCommandEventParameter) { diff --git a/framework/Web/UI/WebControls/TDataSourceView.php b/framework/Web/UI/WebControls/TDataSourceView.php index c20556bb..1e0ffcef 100644 --- a/framework/Web/UI/WebControls/TDataSourceView.php +++ b/framework/Web/UI/WebControls/TDataSourceView.php @@ -169,7 +169,7 @@ abstract class TDataSourceView extends TComponent return $this->_owner; } - protected function onDataSourceViewChanged($param) + public function onDataSourceViewChanged($param) { $this->raiseEvent('OnDataSourceViewChanged',$this,$param); } diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php index 60cf882d..30b14add 100644 --- a/framework/Web/UI/WebControls/TDatePicker.php +++ b/framework/Web/UI/WebControls/TDatePicker.php @@ -18,7 +18,7 @@ * When the text box receives focus, a calendar will pop up and users can * pick up from it a date that will be automatically entered into the text box. * The format of the date string displayed in the text box is determined by - * the DateFormat property. Valid formats are the combination of the + * the DateFormat property. Valid formats are the combination of the * following tokens, * * @@ -34,14 +34,14 @@ * ----------------------------------------- * * - * TDatePicker has three Mode to show the date picker popup. - * - * # Basic -- Only shows a text input, focusing on the input shows the + * TDatePicker has three Mode to show the date picker popup. + * + * # Basic -- Only shows a text input, focusing on the input shows the * date picker. * # Button -- Shows a button next to the text input, clicking on the - * button shows the date, button text can be by the + * button shows the date, button text can be by the * ButtonText property - * # ImageButton -- Shows an image next to the text input, clicking on + * # ImageButton -- Shows an image next to the text input, clicking on * the image shows the date picker, image source can be * change through the ImageUrl property. * @@ -89,7 +89,7 @@ class TDatePicker extends TTextBox { $this->setViewState('ShowCalendar',TPropertyValue::ensureBoolean($value),true); } - + /** * Gets the current culture. * @return string current culture, e.g. en_AU. @@ -140,7 +140,7 @@ class TDatePicker extends TTextBox } /** - * @param string set the calendar style + * @param string set the calendar style */ public function setCalendarStyle($value) { @@ -153,7 +153,7 @@ class TDatePicker extends TTextBox public function getCalendarStyle() { return $this->getViewState('CalendarStyle', 'default'); - } + } /** * Set the first day of week, with 0 as Sunday, 1 as Monday, etc. @@ -233,7 +233,7 @@ class TDatePicker extends TTextBox $options['UpToYear'] = $this->getUpToYear(); if($this->getMode()!=='Basic') $options['Trigger'] = $this->getDatePickerButtonID(); - + $options = array_merge($options, $this->getCulturalOptions()); return $options; } @@ -247,7 +247,7 @@ class TDatePicker extends TTextBox $app = $this->getApplication()->getGlobalization(); $culture = $this->getCulture() == '' ? $app->getCulture() : $this->getCulture(); if($culture == 'en') return array(); - + //expensive operations Prado::using('System.I18N.core.DateTimeFormatInfo'); $info = Prado::createComponent('System.I18N.core.CultureInfo', $culture); @@ -262,7 +262,7 @@ class TDatePicker extends TTextBox /** * Publish the date picker Css asset files. */ - protected function OnPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); $this->publishCalendarStyle(); @@ -281,7 +281,7 @@ class TDatePicker extends TTextBox { case 'Button': $this->renderButtonDatePicker($writer); break; case 'ImageButton' : $this->renderImageButtonDatePicker($writer); break; - + } } @@ -300,7 +300,7 @@ class TDatePicker extends TTextBox */ protected function renderButtonDatePicker($writer) { - $writer->addAttribute('id', $this->getDatePickerButtonID()); + $writer->addAttribute('id', $this->getDatePickerButtonID()); $writer->addAttribute('type', 'button'); $writer->addAttribute('class', $this->getCssClass().' TDatePickerButton'); $writer->addAttribute('value',$this->getButtonText()); @@ -340,7 +340,7 @@ class TDatePicker extends TTextBox protected function publishCalendarStyle() { $cs = $this->getPage()->getClientScript(); - $style = 'System.Web.Javascripts.datepicker.'.$this->getCalendarStyle(); + $style = 'System.Web.Javascripts.datepicker.'.$this->getCalendarStyle(); $cssFile=Prado::getPathOfNamespace($style,'.css'); $url = $this->getService()->getAsset($cssFile); if(!$cs->isStyleSheetFileRegistered($style)) @@ -350,7 +350,7 @@ class TDatePicker extends TTextBox /** * Registers the javascript code to initialize the date picker. - * Must use "Event.OnLoad" to initialize the date picker when the + * Must use "Event.OnLoad" to initialize the date picker when the * full page is loaded, otherwise IE will throw an error. * @param THtmlWriter writer */ diff --git a/framework/Web/UI/WebControls/TFileUpload.php b/framework/Web/UI/WebControls/TFileUpload.php index 4a3d3a08..ebb1b5ae 100644 --- a/framework/Web/UI/WebControls/TFileUpload.php +++ b/framework/Web/UI/WebControls/TFileUpload.php @@ -84,7 +84,7 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata * This method overrides the parent implementation and is invoked before render. * @param mixed event parameter */ - protected function onPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); if(($form=$this->getPage()->getForm())!==null) @@ -229,7 +229,7 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata * so that the event delegates can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onFileUpload($param) + public function onFileUpload($param) { $this->raiseEvent('OnFileUpload',$this,$param); } diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php index 3cdd19aa..3c52b666 100644 --- a/framework/Web/UI/WebControls/THead.php +++ b/framework/Web/UI/WebControls/THead.php @@ -48,7 +48,7 @@ class THead extends TControl * so that the event handlers can be invoked. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onInit($param) + public function onInit($param) { parent::onInit($param); $this->getPage()->setHead($this); diff --git a/framework/Web/UI/WebControls/TImageButton.php b/framework/Web/UI/WebControls/TImageButton.php index 72a7df61..8578ee83 100644 --- a/framework/Web/UI/WebControls/TImageButton.php +++ b/framework/Web/UI/WebControls/TImageButton.php @@ -285,7 +285,7 @@ class TImageButton extends TImage implements IPostBackDataHandler, IPostBackEven * This method overrides the parent implementation and is invoked before render. * @param mixed event parameter */ - protected function onPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); $this->getPage()->registerRequiresPostData($this); diff --git a/framework/Web/UI/WebControls/TListBox.php b/framework/Web/UI/WebControls/TListBox.php index 50cf3873..5ee3f58e 100644 --- a/framework/Web/UI/WebControls/TListBox.php +++ b/framework/Web/UI/WebControls/TListBox.php @@ -52,7 +52,7 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl * This method overrides the parent implementation. * @param mixed event parameter */ - protected function onPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); if($this->getEnabled(true)) diff --git a/framework/Web/UI/WebControls/TListControl.php b/framework/Web/UI/WebControls/TListControl.php index 8d2959b4..cf254bad 100644 --- a/framework/Web/UI/WebControls/TListControl.php +++ b/framework/Web/UI/WebControls/TListControl.php @@ -192,7 +192,7 @@ abstract class TListControl extends TDataBoundControl * This method is invoked right before control state is to be saved. * @param mixed event parameter */ - protected function onSaveState($param) + public function onSaveState($param) { if($this->_items) $this->setViewState('Items',$this->_items->saveState(),null); @@ -205,7 +205,7 @@ abstract class TListControl extends TDataBoundControl * This method is invoked right after control state is loaded. * @param mixed event parameter */ - protected function onLoadState($param) + public function onLoadState($param) { $this->_loadedFromState=true; if(!$this->getIsDataBound()) diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php index a122f387..43b70d2d 100644 --- a/framework/Web/UI/WebControls/TRepeater.php +++ b/framework/Web/UI/WebControls/TRepeater.php @@ -307,7 +307,7 @@ class TRepeater extends TDataBoundControl implements INamingContainer * This method is invoked right before control state is to be saved. * @param mixed event parameter */ - protected function onSaveState($param) + public function onSaveState($param) { if($this->_items) $this->setViewState('ItemCount',$this->_items->getCount(),0); @@ -320,7 +320,7 @@ class TRepeater extends TDataBoundControl implements INamingContainer * This method is invoked right after control state is loaded. * @param mixed event parameter */ - protected function onLoadState($param) + public function onLoadState($param) { if(!$this->getIsDataBound()) $this->restoreItemsFromViewState(); @@ -400,7 +400,7 @@ class TRepeater extends TDataBoundControl implements INamingContainer * @param TEventParameter event parameter * @return boolean whether the event bubbling should stop here. */ - protected function onBubbleEvent($sender,$param) + public function onBubbleEvent($sender,$param) { if($param instanceof TRepeaterCommandEventParameter) { @@ -421,7 +421,7 @@ class TRepeater extends TDataBoundControl implements INamingContainer * so that event handlers have chance to respond to the event. * @param TRepeaterItemEventParameter event parameter */ - protected function onItemCreated($param) + public function onItemCreated($param) { $this->raiseEvent('OnItemCreated',$this,$param); } @@ -435,7 +435,7 @@ class TRepeater extends TDataBoundControl implements INamingContainer * so that event handlers have chance to respond to the event. * @param TRepeaterItemEventParameter event parameter */ - protected function onItemDataBound($param) + public function onItemDataBound($param) { $this->raiseEvent('OnItemDataBound',$this,$param); } @@ -454,7 +454,7 @@ class TRepeater extends TDataBoundControl implements INamingContainer * event handlers have chance to respond to the event. * @param TRepeaterCommandEventParameter event parameter */ - protected function onItemCommand($param) + public function onItemCommand($param) { $this->raiseEvent('OnItemCommand',$this,$param); } @@ -636,7 +636,7 @@ class TRepeaterItem extends TControl implements INamingContainer * @param TEventParameter event parameter * @return boolean whether the event bubbling should stop here. */ - protected function onBubbleEvent($sender,$param) + public function onBubbleEvent($sender,$param) { if($param instanceof TCommandEventParameter) { diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php index 12f90c7b..af73de35 100644 --- a/framework/Web/UI/WebControls/TTextBox.php +++ b/framework/Web/UI/WebControls/TTextBox.php @@ -219,7 +219,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable * the invocation of the attached event handlers. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onTextChanged($param) + public function onTextChanged($param) { $this->raiseEvent('OnTextChanged',$this,$param); } diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php index be104896..35f3cc23 100644 --- a/framework/Web/UI/WebControls/TTextHighlighter.php +++ b/framework/Web/UI/WebControls/TTextHighlighter.php @@ -81,7 +81,7 @@ class TTextHighlighter extends TWebControl * This method overrides parent implementation. * @param THtmlWriter writer */ - protected function onPreRender($writer) + public function onPreRender($writer) { parent::onPreRender($writer); $this->registerHighlightStyleSheet(); diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php index fec48d1f..9bc6a1e0 100644 --- a/framework/Web/UI/WebControls/TWizard.php +++ b/framework/Web/UI/WebControls/TWizard.php @@ -1,11 +1,11 @@ next, TWizard fires OnNextCommand event. * - previous, TWizard fires OnPreviousCommand event. * - finish, TWizard fires OnFinishCommand event. - * - cancel, TWizard fires OnCancelCommand event. - * - jumpto, TWizard fires OnJumpToCommand event. + * - cancel, TWizard fires OnCancelCommand event. + * - jumpto, TWizard fires OnJumpToCommand event. * jumpto requires a parameter, the destination step. - * + * * E.g. anywhere within the TWizard, a button like the following * * when click will bubble to TWizard and in turn fires the OnJumpToCommand @@ -74,7 +74,7 @@ * Namespace: System.Web.UI.WebControls * * Properties - * - ActiveStep, TWizardStep, + * - ActiveStep, TWizardStep, *
Gets the current active step. * - ActiveStepIndex, integer, *
Gets or sets the active step specified by a zero-starting index. @@ -88,15 +88,15 @@ *
Gets or sets the string for the "Previous" button. * - CancelButtonText, string *
Gets or sets the string for the "Cancel" button. - * + * * Events * - OnStepChanged Occurs when the step is changed. * - OnCancelCommand Occurs when the "Cancel" button is pressed. * - OnFinishCommand Occurs when the "Finish" button is pressed. * - OnNextCommand Occurs when the "Next" button is pressed. * - OnPreviousCommand Occurs when the "Previous" button is pressed. - * - OnJumpToCommand Occurs when the "JumpTo" button is pressed. - * + * - OnJumpToCommand Occurs when the "JumpTo" button is pressed. + * * @author Xiang Wei Zhuo * @version v1.0, last update on Sat Dec 11 15:25:11 EST 2004 * @package System.Web.UI.WebControls @@ -105,43 +105,43 @@ class TWizard extends TPanel { /** * The command name for the OnNextCommand. - * @var string + * @var string */ const CMD_NEXT = 'next'; /** * The command name for the OnPreviousCommand. - * @var string + * @var string */ const CMD_PREVIOUS = 'previous'; /** * The command name for the OnFinishCommand. - * @var string + * @var string */ const CMD_FINISH = 'finish'; - + /** * The command name for the OnCancelCommand. - * @var string + * @var string */ const CMD_CANCEL = 'cancel'; /** * The command name for the OnJumpToCommand. - * @var string + * @var string */ const CMD_JUMP = 'jumpto'; /** * A list of steps. - * @var array + * @var array */ protected $steps=array(); - + /** * A list of navigation templates, including built-in defaults. - * @var array + * @var array */ protected $navigation = array(); @@ -162,7 +162,7 @@ class TWizard extends TPanel /** * Get the Finish button text. - * @return string button text. + * @return string button text. */ public function getFinishStepButtonText() { @@ -174,14 +174,14 @@ class TWizard extends TPanel * @param string button text */ public function setNextStepButtonText($value) - { + { $this->setViewState('NextStepButtonText', $value, 'Next >'); - + } /** * Get the Next button text. - * @return string button text. + * @return string button text. */ public function getNextStepButtonText() { @@ -191,7 +191,7 @@ class TWizard extends TPanel /** * Set the Previous button text. * @param string button text - */ + */ public function setPreviousStepButtonText($value) { $this->setViewState('PreviousStepButtonText',$value, '< Back'); @@ -199,8 +199,8 @@ class TWizard extends TPanel /** * Get the Previous button text. - * @return string button text. - */ + * @return string button text. + */ public function getPreviousStepButtonText() { return $this->getViewState('PreviousStepButtonText', '< Back'); @@ -217,8 +217,8 @@ class TWizard extends TPanel /** * Get the Cancel button text. - * @return string button text. - */ + * @return string button text. + */ public function getCancelButtonText() { return $this->getViewState('CancelButtonText', 'Cancel'); @@ -235,7 +235,7 @@ class TWizard extends TPanel /** * Determine if the side bar's visibility. - * @return boolean true if visible, false otherwise. + * @return boolean true if visible, false otherwise. */ public function isSideBarVisible() { @@ -244,7 +244,7 @@ class TWizard extends TPanel /** * Get the current step. null if the ActiveStepIndex is not valid. - * @return TWizardStep + * @return TWizardStep */ public function getActiveStep() { @@ -252,7 +252,7 @@ class TWizard extends TPanel if(isset($this->steps[$index])) return $this->steps[$index]; } - + /** * Set the active step index. This determines which step to show. * @param int the current step to show. @@ -264,7 +264,7 @@ class TWizard extends TPanel /** * Get the current step index. - * @return int current step index. + * @return int current step index. */ public function getActiveStepIndex() { @@ -272,9 +272,9 @@ class TWizard extends TPanel } /** - * Override the parent implementation. + * Override the parent implementation. * It adds any components that are instance of TWizardStep or TWizardTemplate - * as a child and body of the TWizard. Other components are handled by the parent. + * as a child and body of the TWizard. Other components are handled by the parent. * By adding components as child of TWizard, these component's parent * is the TWizard. * @param object a component object. @@ -305,21 +305,21 @@ class TWizard extends TPanel * if required. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onLoad($param) + public function onLoad($param) { parent::onLoad($param); - + $this->addNavigationButtons(); if($this->isSideBarVisible()) - $this->addNavigationSideBar(); + $this->addNavigationSideBar(); } /** * Determins which wizard step to show and appropriate navigation elements. * @param TEventParameter event parameter to be passed to the event handlers */ - protected function onPreRender($param) + public function onPreRender($param) { parent::onPreRender($param); @@ -329,7 +329,7 @@ class TWizard extends TPanel //show the current step for($i = 0; $i < $totalSteps; $i++) $this->steps[$i]->setVisible($i == $index); - + //determine which link is active for($i = 0; $i < count($this->sidebarLinks); $i++) $this->sidebarLinks[$i]->CssClass= ($i == $index)?'active':''; @@ -342,13 +342,13 @@ class TWizard extends TPanel } $final = $this->steps[$index]->Type == TWizardStep::TYPE_FINAL; - + //if it is not the final step - if(!$final && $this->isSideBarVisible()) + if(!$final && $this->isSideBarVisible()) $this->showNavigation(TWizardTemplate::ID_SIDEBAR); - + $finishStep = $index == $totalSteps-1; - $finishStep = $finishStep || (isset($this->steps[$index+1]) && + $finishStep = $finishStep || (isset($this->steps[$index+1]) && $this->steps[$index+1]->Type == TWizardStep::TYPE_FINAL); //now show the appropriate navigation elements. @@ -371,7 +371,7 @@ class TWizard extends TPanel foreach($this->navigation[$index] as $nav) { $nav->setVisible(true); - $nav->dataBind(); + $nav->dataBind(); } } @@ -381,17 +381,17 @@ class TWizard extends TPanel * particular navigation type is not customized. */ private function addNavigationButtons() - { - //create the 3 navigation components + { + //create the 3 navigation components $start = $this->createComponent('TPanel',TWizardTemplate::ID_START); $start->CssClass = 'navigation'; - + $step = $this->createComponent('TPanel',TWizardTemplate::ID_STEP); $step->CssClass = 'navigation'; $finish = $this->createComponent('TPanel',TWizardTemplate::ID_FINISH); $finish->CssClass = 'navigation'; - + $previousButton = $this->createComponent('TButton'); $previousButton->setText($this->getPreviousStepButtonText()); $previousButton->setCommandName(self::CMD_PREVIOUS); @@ -400,7 +400,7 @@ class TWizard extends TPanel $finishButton = $this->createComponent('TButton'); $finishButton->setText($this->getFinishStepButtonText()); $finishButton->setCommandName(self::CMD_FINISH); - + $nextButton = $this->createComponent('TButton'); $nextButton->setText($this->getNextStepButtonText()); $nextButton->setCommandName(self::CMD_NEXT); @@ -414,18 +414,18 @@ class TWizard extends TPanel $cancelButton->setCommandName(self::CMD_CANCEL); $cancelButton->CssClass='Cancel'; $cancelButton->setCausesValidation(false); - + if(!isset($this->navigation[TWizardTemplate::ID_START])) { $start->addBody($nextButton); - $start->addBody($cancelButton); + $start->addBody($cancelButton); $this->addBody($start); $this->navigation[TWizardTemplate::ID_START][] = $start; } if(!isset($this->navigation[TWizardTemplate::ID_STEP])) { - + $step->addBody($hiddenButton); $step->addBody($previousButton); $step->addBody($nextButton); @@ -433,7 +433,7 @@ class TWizard extends TPanel $this->addBody($step); $this->navigation[TWizardTemplate::ID_STEP][] = $step; } - + if(!isset($this->navigation[TWizardTemplate::ID_FINISH])) { $finish->addBody($previousButton); @@ -460,7 +460,7 @@ class TWizard extends TPanel $sidebar = $this->createComponent('TPanel',TWizardTemplate::ID_SIDEBAR); $sidebar->CssClass = 'sidebar'; - + if($total > 0) $sidebar->addBody("\n"); - + $this->addBody($sidebar); $this->navigation[TWizardTemplate::ID_SIDEBAR][] = $sidebar; } @@ -489,16 +489,16 @@ class TWizard extends TPanel * is set to true. * @param TComponent sender of the event * @param TEventParameter event parameters - */ - protected function onBubbleEvent($sender,$param) + */ + public function onBubbleEvent($sender,$param) { //if false on validation, do nothing. - if (!$this->Page->isValid()) return; + if (!$this->Page->isValid()) return; $event = new TWizardCommandEventParameter(); $event->currentStepIndex = $this->getActiveStepIndex(); $event->nextStepIndex = $event->currentStepIndex; - + switch($param->name) { case self::CMD_NEXT: @@ -521,7 +521,7 @@ class TWizard extends TPanel break; case self::CMD_FINISH: if(isset($this->steps[$event->nextStepIndex+1])) - $event->nextStepIndex++; + $event->nextStepIndex++; $this->raiseEvent('OnFinishCommand',$this,$event); if(!$event->cancel) { @@ -547,8 +547,8 @@ class TWizard extends TPanel } /** - * TWizard command event parameter. - * + * TWizard command event parameter. + * * This is passed as the parameter to all event orginating from TWizard. * If the event was a particular OnXXXXCommand, the variable $cancel * determine if the step will be changed. e.g in handling the "next" command -- cgit v1.2.3