All pastes #418036 Raw Edit

Mine

public text v1 · immutable
#418036 ·published 2007-03-31 11:30 UTC
rendered paste body
	static public function countControls($control)
	{
		$currentCount=0;
		$controls=$control->getControls();
		
		if (($count=$controls->getCount()) > 0)
		{
			for ($i=0; $i < $count; $i++)
			{
				if (($currControl=$controls->itemAt($i)) instanceof TControl)
				{
					$currentCount++;
					$currentCount+=self::countControls($currControl);
				}
			}
		}
		
		return $currentCount;
		
	}