summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/Web/UI/TControl.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 1663b783..34e9b92f 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -809,6 +809,27 @@ class TControl extends TComponent
}
/**
+ * Finds all child and grand-child controls that are of the specified type.
+ * @param string the class name
+ * @return array list of controls found
+ */
+ public function findControlsByType($type)
+ {
+ $controls=array();
+ if($this->getHasControls())
+ {
+ foreach($this->_rf[self::RF_CONTROLS] as $control)
+ {
+ if($control instanceof $type)
+ $controls[]=$control;
+ if(($control instanceof TControl) && $control->getHasControls())
+ $controls=array_merge($controls,$control->findControlsByType($type));
+ }
+ }
+ return $controls;
+ }
+
+ /**
* Resets the control as a naming container.
* Only framework developers should use this method.
*/