From c4ffe5fe2b3556f0fcbf6f7a28ef09ce24d06e74 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 1 Jan 2006 19:48:02 +0000 Subject: Added TDataSourceControl, TDataSourceView, TRepeatInfo. --- framework/Web/UI/WebControls/TWebControl.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'framework/Web/UI/WebControls/TWebControl.php') diff --git a/framework/Web/UI/WebControls/TWebControl.php b/framework/Web/UI/WebControls/TWebControl.php index 6e2a2c89..e86b9161 100644 --- a/framework/Web/UI/WebControls/TWebControl.php +++ b/framework/Web/UI/WebControls/TWebControl.php @@ -39,6 +39,23 @@ Prado::using('System.Web.UI.WebControls.TStyle'); */ class TWebControl extends TControl { + /** + * Copies basic control attributes from another control. + * Properties including AccessKey, ToolTip, TabIndex, Enabled + * and Attributes are copied. + * @param TWebControl source control + */ + public function copyBaseAttributes(TWebControl $control) + { + $this->setAccessKey($control->getAccessKey()); + $this->setToolTip($control->getToolTip()); + $this->setTabIndex($control->getTabIndex()); + if(!$control->getEnabled()) + $this->setEnabled(false); + if($control->getHasAttributes()) + $this->getAttributes()->copyFrom($control->getAttributes()); + } + /** * @return string the access key of the control */ -- cgit v1.2.3