/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk
1 by Suren A. Chilingaryan
Initial import
1
<?php
2
3
foreach (array_merge($POPUPS, $MODULES) as $module) {
171 by Suren A. Chilingaryan
KATRIN code by Sebastian and few fixes to integrate it
4
    if (file_exists("setups/$ADEI_SETUP/modules/$module.php")) require("setups/$ADEI_SETUP/modules/$module.php");
5
    else $inc = require("modules/$module.php");
1 by Suren A. Chilingaryan
Initial import
6
}
7
130 by Suren A. Chilingaryan
Minimized interface version
8
function moduleLinkModules($list = false) {
1 by Suren A. Chilingaryan
Initial import
9
    global $MODULES;
10
    global $config_module;
11
12
    $separator_flag = 0;
13
130 by Suren A. Chilingaryan
Minimized interface version
14
    foreach (($list===false)?$MODULES:$list as $module) {
210.1.1 by Suren A. Chilingaryan
Support of Appled devices by Toni Pirhonen
15
	if ($separator_flag) echo " | ";
16
	else $separator_flag = 1;
1 by Suren A. Chilingaryan
Initial import
17
18
	if (strcmp($config_module, $module)) $css = "module_link";
19
	else $css = "module_link_current";
210.1.1 by Suren A. Chilingaryan
Support of Appled devices by Toni Pirhonen
20
		
21
	echo "<a class=\"$css\" id=\"module_link_$module\" href=\"javascript:adei.OpenModule('$module')\">";
22
		
1 by Suren A. Chilingaryan
Initial import
23
	if (isset($GLOBALS[$module . "_title"])) echo $GLOBALS[$module . "_title"];
24
	else echo $module;
25
	echo "</a>";
26
    }
27
}
28
130 by Suren A. Chilingaryan
Minimized interface version
29
function moduleLinkPopups($list = false) {
1 by Suren A. Chilingaryan
Initial import
30
    global $POPUPS;
31
    
130 by Suren A. Chilingaryan
Minimized interface version
32
    foreach (($list===false)?$POPUPS:$list as $module) {
1 by Suren A. Chilingaryan
Initial import
33
	$text = implode("<br/>",str_split((isset($GLOBALS[$module . "_title"]))?$GLOBALS[$module . "_title"]:$module));
312 by Suren A. Chilingaryan
Resizing of sidebar popups
34
	?><div id="main_sidebar_<?echo $module;?>" class="sidebar"><table><tr style="height: 100%;">
35
	    <td class="holder" style="height: 100%;"><div class="popup" id="popup_<?echo $module;?>" style="display: none; height: 100%;">
1 by Suren A. Chilingaryan
Initial import
36
		<?if (function_exists($module . "Page")) call_user_func($module . "Page");?>
37
	    </div></td>
38
	    <td class="switch" id="popup_switch_<?echo $module;?>">
39
		<button onclick="javascript:adei.SwitchPopup('<?echo $module;?>')"><table width="100%" height="100%"><tr><td><?echo $text;?></td></tr></table></button>
40
	    </td>
41
	</tr></table></div><?
42
    }
43
}
44
130 by Suren A. Chilingaryan
Minimized interface version
45
function modulePlacePages($list = false) {
1 by Suren A. Chilingaryan
Initial import
46
    global $MODULES;
47
    global $POPUPS;
48
    global $config_module;
49
    
130 by Suren A. Chilingaryan
Minimized interface version
50
    foreach (($list===false)?$MODULES:$list as $module) {
1 by Suren A. Chilingaryan
Initial import
51
	if (strcmp($config_module, $module)) $tmp_attr = " style=\"display: none;\"";
52
	else $tmp_attr = "";
53
    
54
	echo "<div class=\"module\" id=\"module_" . $module . "\"" . $tmp_attr . ">";
55
	if (function_exists($module . "Page")) call_user_func($module . "Page");
56
	echo "</div>";
57
    }
58
}
59
60
130 by Suren A. Chilingaryan
Minimized interface version
61
function modulePlaceJS($popup_list = false, $module_list = false) {
1 by Suren A. Chilingaryan
Initial import
62
    global $MODULES;
63
    global $POPUPS;
64
130 by Suren A. Chilingaryan
Minimized interface version
65
    foreach (($popup_list===false)?$POPUPS:$popup_list as $module) {
1 by Suren A. Chilingaryan
Initial import
66
	if (function_exists($module . "JS")) call_user_func($module . "JS");
67
    }
68
130 by Suren A. Chilingaryan
Minimized interface version
69
    foreach (($module_list===false)?$MODULES:$module_list as $module) {
1 by Suren A. Chilingaryan
Initial import
70
	if (function_exists($module . "JS")) {
71
	    $module_class = call_user_func($module . "JS");
72
?>
73
	    adei.RegisterModule("<?echo $module;?>", <?echo $module_class?$module_class:"null";?>);
312 by Suren A. Chilingaryan
Resizing of sidebar popups
74
    <?
1 by Suren A. Chilingaryan
Initial import
75
	}
76
    }
77
}
78
79
80
function moduleAdjustGeometry($width_var, $height_var) {
81
    global $MODULES;
82
    foreach ($MODULES as $module) {
83
?>
84
    adei.UpdateModuleGeometry("<?echo $module;?>", <?echo $width_var;?>, <?echo $height_var;?>);
85
<?
86
    }
87
}
88
312 by Suren A. Chilingaryan
Resizing of sidebar popups
89
function moduleSetupDragger() {
90
    global $POPUPS;
91
92
    foreach ($POPUPS as $module) {
93
?>
94
        {
95
            var node = document.getElementById("popup_<?echo $module;?>");
96
            var dragger = new DIALOG_DRAGGER(node);
97
            dragger.ControlMinimumSize(adei.popup.popups_width, 0);     // It is actually not scalled to real size
98
            dragger.RegisterCallbacks(null, null, UpdatePopupGeometry, "<?echo $module;?>");
99
            dragger.Disable(true, "nsw");
100
            dragger.Setup();
101
        }
102
<?
103
    }
104
}
105
106
1 by Suren A. Chilingaryan
Initial import
107
?>