summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.php
blob: 86fc8f7bb21dc6eb997b5a3e3c5bd423336ed668 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php

class Home extends TPage
{

	public function bt1Click($sender, $param)
	{
		$this->dlg1->open();
	}

	public function bt2Click($sender, $param)
	{
		$this->dlg2->open();
	}

	public function bt3Click($sender, $param)
	{
		$this->dlg3->open();
	}

	public function bt4Click($sender, $param)
	{
		$this->dlg4->open();
	}

	public function bt5Click($sender, $param)
	{
		$this->dlg5->open();
	}

	public function dlg3Ok($sender, $param)
	{
		$this->lbl3->Text="Button Ok clicked";
		$this->dlg3->close();
	}

	public function dlg3Cancel($sender, $param)
	{
		$this->lbl3->Text="Button Cancel clicked";
		$this->dlg3->close();
	}

	public function dlg4title($sender, $param)
	{
		$this->dlg4->getOptions()->title = 'Title changed at ' . date('Y-m-d H:i:s');
	}

	public function dlg4width($sender, $param)
	{
		$this->dlg4->getOptions()->width += $this->dlg4->getOptions()->width > 400 ? -200 : 200;
	}

	public function dlg4pos($sender, $param)
	{
	  list($x, $y) = explode(' ', $this->dlg4->getOptions()->position);
	  if ($x == 'left') {
	    if ($y == 'top') $x = 'right';
	    else $y = 'top';
	  }
	  elseif ($x == 'right') {
	    if ($y == 'top') $y = 'bottom';
	    else $x = 'left';
	  }
	  else {
	    $x = 'left';
	    $y = 'top';
	  }
	  $this->dlg4->getOptions()->position = "$x $y";
	}

	public function dlg5Ok($sender, $param)
	{
		$this->lbl5->Text="Button Ok clicked. You wrote: ".$this->txtSomething->Text;
		$this->dlg5->close();
	}

	public function dlg5Cancel($sender, $param)
	{
		$this->lbl5->Text="Button Cancel clicked. You wrote: ".$this->txtSomething->Text;
		$this->dlg5->close();
	}
}