summaryrefslogtreecommitdiff
path: root/framework/Web/UI/TControl.php
diff options
context:
space:
mode:
authorxue <>2006-02-15 01:38:39 +0000
committerxue <>2006-02-15 01:38:39 +0000
commit2b194248b9bbd75887c1d5f991dca1f3fd441dd5 (patch)
tree833dc5c56d702d5188b383d3124759965d9b972f /framework/Web/UI/TControl.php
parentcd1ffb47a6c07deda47052eff80452e78a52495d (diff)
Added SourceTemplateControl property for TControl.
Diffstat (limited to 'framework/Web/UI/TControl.php')
-rw-r--r--framework/Web/UI/TControl.php16
1 files changed, 16 insertions, 0 deletions
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
@@ -256,6 +256,22 @@ class TControl extends TComponent
}
/**
+ * @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)
* and gets the URL to the asset. Note, if the asset refers to