/adei/ui

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/ui

« back to all changes in this revision

Viewing changes to modules/source.php

  • Committer: Suren A. Chilingaryan
  • Date: 2008-04-02 10:23:22 UTC
  • Revision ID: csa@dside.dyndns.org-20080402102322-okib92sicg2dx3o3
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
$source_title = _("Data Source");
 
3
 
 
4
function sourceJS() {
 
5
    global $config_options;
 
6
    global $SOURCE_KEEP_WINDOW;
 
7
    
 
8
?>
 
9
    function source_moduleSetDisplayInfo(s, module_name) {
 
10
        if (module_name == "time") {
 
11
            s.interval.window.module_on_display = true;
 
12
            s.interval.module_on_display = true;
 
13
            s.module_on_display = false;
 
14
        } else /* source */ {
 
15
            s.interval.window.module_on_display = false;
 
16
            s.interval.module_on_display = false;
 
17
            s.module_on_display = true;
 
18
        }
 
19
        s.FixHidden();
 
20
    }
 
21
 
 
22
    function source_popupSetDisplayInfo(s, status) {
 
23
        if (status) {
 
24
            source_moduleSetDisplayInfo(s, source_modules.current_module);
 
25
        } else {
 
26
            s.interval.window.module_on_display = false;
 
27
            s.interval.module_on_display = false;
 
28
            s.module_on_display = false;
 
29
        }
 
30
    }
 
31
    
 
32
    function source_fixItemSelSize() {
 
33
        /* We defined a source_db_item_sel size in procents, to fill completely two table cells.
 
34
        However, this causes problems in Gecko while using adaptive SetWidth. The SELECT would
 
35
        be extend during first step, but not shrinked back on the second. */
 
36
         
 
37
        var itemsel = document.getElementById("source_db_item_sel");
 
38
        domSetWidth(itemsel,itemsel.offsetWidth);
 
39
    }
 
40
 
 
41
    if (!isIE()) {
 
42
            /* This problem only occurs in Gecko 1.8. The fix by iteself causes problems in IE (no
 
43
            idea why). The Opera does not need the fix, but it not harmless as well */
 
44
        domShow("popup_source");
 
45
        source_fixItemSelSize();
 
46
        domHide("popup_source");
 
47
    }
 
48
 
 
49
 
 
50
 
 
51
    source_modules = new MODULE("source");
 
52
    source_modules.RegisterGeometryCallback(popupUpdateGeometryCallback, { 'popup': adei.popup, 'module': "source" });
 
53
    source_modules.Open("source");
 
54
    adei.popup.RegisterOnCallback("source", moduleUpdateGeometry, source_modules);
 
55
 
 
56
    var source_opts = new Object();
 
57
    <?if ($SOURCE_KEEP_WINDOW) {?> source_opts.keep_window = true; <?}?>
 
58
 
 
59
    source_window = new WINDOW("source_timewindow_sel", "source_winstart_inp", "source_winend_inp", "source_miny_inp", "source_maxy_inp");
 
60
    source_interval = new INTERVAL(source_window, "source_db_experiment_sel", "source_timestart_inp", "source_timeend_inp");
 
61
    source = new SOURCE(source_interval, "source_db_server_sel", "source_db_name_sel", "source_db_group_sel", "source_db_mask_sel", "source_db_item_sel", source_opts);
 
62
 
 
63
    adei.AttachSourceModule(source, source_interval, source_window);
 
64
 
 
65
    source.RegisterGeometryCallback(moduleUpdateGeometry, source_modules);
 
66
    if (isIE()) {
 
67
        adei.popup.RegisterOffCallback("source", source_popupSetDisplayInfo, source);
 
68
        adei.popup.RegisterOnCallback("source", source_popupSetDisplayInfo, source);
 
69
        source_modules.RegisterCallback(source_moduleSetDisplayInfo, source);
 
70
    }
 
71
<?
 
72
}
 
73
 
 
74
function sourcePage() {
 
75
    global $ZEUS_TIMINGS;
 
76
?>
 
77
<table width="100%"><tr>
 
78
    <th class="module_source_link_current" id="module_link_source_source"><a href="javascript:source_modules.Open('source')"><?echo _("Source");?></a></th>
 
79
    <th class="module_source_link" id="module_link_source_time"><a href="javascript:source_modules.Open('time')"><?echo _("Time");?></a></th>
 
80
</tr><tr><td colspan="2">
 
81
<div class="module" id="module_source_source">
 
82
        <table><tr><?
 
83
            echo "<td>" . _("Server") . "</td><td><select id=\"source_db_server_sel\" onchange='javascript:source.UpdateServer(this.value)'><option>Loading...</option></select></td>";
 
84
        ?></tr><tr><?
 
85
            echo "<td>" . _("Database") . "</td><td><select id=\"source_db_name_sel\" onchange='javascript:source.UpdateDatabase(this.value)'><option>Loading...</option></select></td>";
 
86
        ?></tr><tr><?
 
87
            echo "<td>" . _("LogGroup") . "</td><td><select id=\"source_db_group_sel\" onchange='javascript:source.UpdateGroup(this.value)'><option>Loading...</option></select></td>";
 
88
        ?></tr><tr><?
 
89
            echo "<td>" . _("ItemMask") . "</td><td><select id=\"source_db_mask_sel\" onchange='javascript:source.UpdateMask(this.value)'><option>Loading...</option></select></td>";
 
90
        ?></tr><tr id="source_db_item_tr"><?
 
91
            echo "<td colspan=\"2\"><select id=\"source_db_item_sel\" onchange='javascript:source.UpdateItem(this.value)'><option>Loading...</option></select></td>";
 
92
        ?></tr></table>
 
93
</div>
 
94
<div class="module" id="module_source_time" style="display: none;">
 
95
        <table><tr><?
 
96
            echo "<td>" . _("Experiment") . "</td><td><select id=\"source_db_experiment_sel\" onchange='javascript:source_interval.UpdateExperiment(this.value)'><option>Loading...</option></select></td>";
 
97
        ?></tr><tr>
 
98
            <td><div class="hide_experiment_custom"><?echo _("Start");?></div></td>
 
99
            <td id="source_timestart"><div class="hide_experiment_custom">
 
100
                <input type="text" id="source_timestart_inp" maxlength="25" onchange="javascript:source_window.UpdateRange()"/>
 
101
                <a href="javascript:NewCal('source_timestart_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window))">
 
102
                    <img src="images/cal.gif"/>
 
103
                </a>
 
104
            </div></td>
 
105
        </tr><tr>
 
106
            <td><div class="hide_experiment_custom"><?echo _("End");?></div></td>
 
107
            <td id="source_timeend"><div class="hide_experiment_custom">
 
108
                <input type="text" id="source_timeend_inp" maxlength="25" onchange="javascript:source_window.UpdateRange()"/>
 
109
                <a href="javascript:NewCal('source_timeend_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window))">
 
110
                    <img src="images/cal.gif"/>
 
111
                </a>
 
112
            </div></td>
 
113
        </tr><tr>
 
114
            <td><?echo _("Window");?></td><td><select id="source_timewindow_sel" onchange='javascript:source_window.UpdateWidth(this.value)'><option>Loading...</option></select></td>
 
115
        </tr><tr>
 
116
            <td><div class="hide_window_custom"><?echo _("Start");?></div></td>
 
117
            <td id="source_winstart"><div class="hide_window_custom">
 
118
                <input type="text" id="source_winstart_inp" maxlength="31" onchange="javascript:source_window.UpdateRange()"/>
 
119
                <a href="javascript:NewCal('source_winstart_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window))">
 
120
                    <img src="images/cal.gif"/>
 
121
                </a>
 
122
            </div></td>
 
123
        </tr><tr>
 
124
            <td><div class="hide_window_custom"><?echo _("End");?></div></td>
 
125
            <td id="source_winend"><div class="hide_window_custom">
 
126
                <input type="text" id="source_winend_inp" maxlength="31" onchange="javascript:source_window.UpdateRange()" />
 
127
                <a href="javascript:NewCal('source_winend_inp','mmmddyyyy',true,24,windowUpdateRangeFunction(source_window));">
 
128
                    <img src="images/cal.gif"/>
 
129
                </a>
 
130
            </div></td>
 
131
        </tr><tr>
 
132
            <td><div class="hide_window_custom"><?echo _("Y");?> [<a href='javascript:source_window.ResetY()'><?echo _("Reset");?></a>]</div></td>
 
133
            <td id="source_yrange"><div class="hide_window_custom">
 
134
                <input type="text" id="source_miny_inp" maxlength="8" onchange="javascript:source_window.UpdateRange()"/>
 
135
                -
 
136
                <input type="text" id="source_maxy_inp" maxlength="8" onchange="javascript:source_window.UpdateRange()"/>
 
137
            </div></td>
 
138
        </tr></table>
 
139
</div>
 
140
</td></tr><tr class="source_apply"><td colspan="2">
 
141
    <button id="source_apply_button" type="button" onclick="javascript:source.Apply()"><?echo translate("Apply");?></button>
 
142
</td></tr></table>
 
143
<?}?>
 
 
b'\\ No newline at end of file'