All pastes #418027 Raw Edit

Untitled

public text v1 · immutable
#418027 ·published 2007-03-31 11:16 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, $currentCount);
				}
			}
			return $currentCount;
		}
		else
		{
			return $currentCount;
		}
		
	}