From 2b194248b9bbd75887c1d5f991dca1f3fd441dd5 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 15 Feb 2006 01:38:39 +0000 Subject: Added SourceTemplateControl property for TControl. --- framework/Web/UI/TControl.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'framework/Web/UI/TControl.php') diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php index 50648d93..6fd25f76 100644 --- a/framework/Web/UI/TControl.php +++ b/framework/Web/UI/TControl.php @@ -255,6 +255,22 @@ class TControl extends TComponent return $this->_tplControl; } + /** + * @return TTemplateControl the control whose template is loaded from + * some external storage, such as file, db, and whose template ultimately + * contains this control. + */ + public function getSourceTemplateControl() + { + $control=$this; + while(($control instanceof TControl) && ($control=$control->getTemplateControl())!==null) + { + if(($control instanceof TTemplateControl) && $control->getIsSourceTemplateControl()) + return $control; + } + return $this->getPage(); + } + /** * Publishes a private asset and gets its URL. * This method will publish a private asset (file or directory) -- cgit v1.2.3