summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/features/protected/pages/ActiveControls/ActiveControl.php
blob: ace6291bf2782a54fa3f69ba4ce542ea457eb755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/*
 * Created on 2/05/2006
 */
 
class ActiveControl extends TPage
{
	static private $_colors = array('red', 'green', 'blue', 'purple','black','orange');
	
	public function slowResponse($sender, $param)
	{
		sleep(3);
		$this->label1->setText("The time is ".time()." from ".$sender->ID);
		$this->label1->setForeColor($this->getColor());
		$this->label1->renderControl($param->getOutput());

		$this->panel2->setVisible(true);
		$this->panel1->setBackColor($this->getColor());
		$this->panel1->renderControl($param->getOutput());
		$this->getCallbackClient()->shake($this->panel1);
	}
	
	public function fastResponse($sender, $param)
	{
		$this->label2->setText("Muahaha !!! the time is ".time()." from ".$sender->ID);
		$style['color'] = $this->getColor();
		$this->getCallbackClient()->setStyle($this->label2, $style);
		$this->getCallbackClient()->shake($this->label2);
	}
	
	private function getColor()
	{
		return self::$_colors[rand(0,count(self::$_colors)-1)];
	}
}
?>