summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls/protected/pages/DMessagesPanel.php
blob: 7949883e8260c37cd1ab88470e90e7d977fc0dd3 (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
<?php

class DMessagesPanel extends TTemplateControl
{
    private $_panelCssClass = '';
    
    public function onInit($param)
    {
        parent::onInit($param);
    	$this->MessagesPanelEffect->Text = "";
    }
    
    public function setMessage($value)
    {
        $this->Message->Text = $value;
        if ($value != '') 
			$this->setVisible(true);
        else 
			$this->setVisible(false);
    }
    
    public function setVisible($value)
    {
		$this->ensureChildControls();
        if ($value === true) {
			echo "set visible";
            $this->MessagesPanel->Visible = true;
    	    $this->Message->Visible = true;
    	    $this->setEffect(null);
        } else {
            $this->MessagesPanel->Visible = false;
        }
    }
    
    public function setEffect($effect = null)
    {
        if ($effect !== null) {
            $text = "<script type=\"text/javascript\" language=\"javascript\">\r\n";
            $text .= "// <![CDATA[\r\n";
            //$text .= "new Effect.$effect(\"" . $this->Page->DMessagesPanel->MessagesPanel->ClientID . "\");\r\n";
            $text .= "new Effect.$effect(\"" . $this->ClientID . "\");\r\n";
            $text .= "// ]]>\r\n";
            $text .= "</script>";
            $this->MessagesPanelEffect->Text = $text;
        } else {
            $this->MessagesPanelEffect->Text = '';
        }
    }
    
    public function setPanelCssClass($value)
    {
		$this->ensureChildControls();
    	$this->MessagesPanel->CssClass = $value;
    }
    
    public function setMessageCssClass($value)
    {
		$this->ensureChildControls();
    	$this->Message->CssClass = $value;
    }
}