/openshift/adei

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

« back to all changes in this revision

Viewing changes to index.php

  • Committer: Suren A. Chilingaryan
  • Date: 2011-01-26 02:48:39 UTC
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: csa@dside.dyndns.org-20110126024839-nv6qp2ie9stmd2dn
Support of Appled devices by Toni Pirhonen

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
require("config.php");
4
4
require("tools.php");
5
 
require("module.php");
6
5
 
7
6
header("Content-Type: application/xhtml+xml; charset=UTF-8");
8
7
header("Content-Type: text/html; charset=UTF-8");
9
8
header("Cache-Control: no-cache, must-revalidate");
10
9
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
11
10
 
 
11
if (!isset($_GET["minimal"])) {
 
12
        if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone") || strpos($_SERVER['HTTP_USER_AGENT'],"iPod") || strpos($_SERVER['HTTP_USER_AGENT'],"iPad") || ereg('iPhone',$_SERVER['HTTP_USER_AGENT']) || ereg('iPod',$_SERVER['HTTP_USER_AGENT'])) {
 
13
                $host  = $_SERVER['HTTP_HOST'];
 
14
                $uri   = rtrim(dirname($_SERVER['PHP_SELF']), "/\\");
 
15
                $extra = 'index.php?minimal=iAdei';
 
16
                header("Location: http://$host$uri/$extra");    
 
17
        }       
 
18
}
 
19
 
12
20
if (isset($_GET["minimal"])) {
13
21
    if ($_GET["minimal"]) $minimal = $_GET["minimal"];
14
22
    else $minimal = true;
15
23
    unset($_GET["minimal"]);
16
24
} else $minimal = false;
17
25
 
 
26
$ADEI_MODE = $minimal;
18
27
 
19
28
if ($minimal) {
20
29
    switch ($minimal) {
35
44
        $no_search = true;
36
45
        $no_menu = true;
37
46
     break;
38
 
 
39
47
     case "search":
40
48
        $config_module = "graph";
41
49
        $allowed_modules = array("graph");
55
63
        $no_header = false;
56
64
        $no_search = true;
57
65
     break;
 
66
     case "iAdei":
 
67
        if (!in_array("settings", $MODULES)) array_push($MODULES, "settings");
 
68
        $config_module = "wiki";
 
69
        $allowed_modules = array("slowcontrol", "alarms", "graph", "wiki", "settings");
 
70
        $allowed_popups = array("source", "export");
 
71
        $displayed_popups = array();        
 
72
        $no_header = true;
 
73
        $iHeader = true;
 
74
     break;
58
75
     default:
59
76
        $config_module = "graph";
60
77
        $allowed_modules = array($config_module);
79
96
 
80
97
}
81
98
 
82
 
 
83
99
$config_options = &$_GET;
84
100
if (sizeof($config_options)) $config_options["apply"] = 1;
85
101
 
92
108
} else {
93
109
    $_SESSION['setup'] = $ADEI_SETUP;
94
110
}
 
111
 
 
112
 
 
113
require("module.php");
 
114
 
 
115
 
95
116
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
96
117
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
97
118
<head>
98
119
    <title>ADEI (Advanced Data Extraction Infrastructure) </title>
99
 
    <meta name = "viewport" content = "user-scalable=no, initial-scale = 1.0, maximum-scale = 1.0, minimum-scale = 1.0" />
100
 
    <meta name = "apple-mobile-web-app-capable" content = "yes" />
101
 
    <link rel="stylesheet" type="text/css" href="adei.css"/> <?/* Should be first, otherwise cssSetProperty would not work */?>
102
 
<?  if (file_exists($SETUP_CSS)) {?>
103
 
    <link rel="stylesheet" type="text/css" href="<?echo $SETUP_CSS;?>"/>
 
120
<?  if($iHeader){?>
 
121
        <meta name = "viewport" content = "user-scalable=no, initial-scale = 1.0, maximum-scale = 1.0, minimum-scale = 1.0" />
 
122
        <meta name="apple-touch-fullscreen" content="YES" />
 
123
        <meta name="apple-mobile-web-app-capable" content="yes" />
 
124
        <meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
 
125
        <link rel="stylesheet" type="text/css" href="iadei.css"/> <?/* Should be first, otherwise cssSetProperty would not work */?>
 
126
        <link rel="stylesheet" type="text/css" href="includes/sw/spinningwheel.css"/>
 
127
<?  } else {?>    
 
128
        <link rel="stylesheet" type="text/css" href="adei.css"/> <?/* Should be first, otherwise cssSetProperty would not work */?>
 
129
<?  }  
 
130
 
 
131
    if (file_exists($SETUP_CSS)) {?>
 
132
        <link rel="stylesheet" type="text/css" href="<?echo $SETUP_CSS;?>"/>
104
133
<?  }?>
105
134
    <link rel="stylesheet" type="text/css" href="includes/dhtmlx/skins/dhtmlxmenu_<?=$DHTMLX_SKIN;?>.css"/>
106
135
    <link rel="stylesheet" type="text/css" href="includes/dhtmlx/dhtmlxtree.css"/>
112
141
    <script type="text/javascript" src="includes/prototype.js"></script>
113
142
    <script type="text/javascript" src="includes/scriptaculous/scriptaculous.js?load=builder,effects,dragdrop"></script>
114
143
    <script type="text/javascript" src="includes/cropper/cropper.js"></script>
115
 
 
 
144
        
116
145
<?/*
117
146
    This causes Ajax.Request (prototype) to return on 'onSuccess' handler
118
147
    status=0 (should be 200) and undefined responseText. 
172
201
            }
173
202
        }
174
203
    }
 
204
 
175
205
?>    
176
206
    <script type="text/javascript" ev:event="onload">
177
207
//<![CDATA[
178
208
        function Geometry() {
 
209
            /* DS: Do we need this? */
179
210
            if (typeof adei == "undefined") return;
180
 
            
 
211
 
181
212
            var new_width = windowGetWidth();
182
213
            var new_height = windowGetHeight();
183
214
            <?moduleAdjustGeometry("new_width", "new_height");?>
223
254
 
224
255
            adei.Start('<?echo $config_module;?>', <?echo $AJAX_UPDATE_RATE;?>);
225
256
        }
 
257
        
 
258
        function Navigate(btn) {
 
259
            if(btn != "settings") {
 
260
                adei.OpenModule(btn);
 
261
            } else {
 
262
                adei.SetConfiguration("p_id=main");
 
263
                adei.OpenModule(btn);
 
264
                adei.updater.Update();
 
265
            } 
 
266
        }
226
267
//]]>
227
268
    </script>
228
269
</head>
229
270
 
230
 
<body onload="javascript:Startup()" onresize="Geometry()">
 
271
<body onload="javascript:Startup()" onresize="Geometry()" onorientationchange="Geometry()">
231
272
<div class="all ales">
232
273
<?if (!$no_menu) {?>
233
274
    <div class="menu_button"><div id="menu_zone"></div></div>
234
275
<?}?>
 
276
 
235
277
<?if (!$no_header) {?>
236
278
    <div id="header_div" class="header">
237
279
        <table width="100%" cellspacing="0" cellpadding="0"><tr>
248
290
        </tr></table>
249
291
    </div>
250
292
<?}?>
 
293
 
 
294
<?if ($iHeader){?>
 
295
    <div id="header_div" class="iheader">
 
296
        <table><tr><td><button class="settingsbtn" id="settingsbutton" onclick="javascript:Navigate('settings');"></button></td><td><h1 class="ADEIhead">ADEI</h1></td></tr></table>
 
297
        <select class="moduleSelector" onChange='javascript:Navigate(this.options[this.selectedIndex].value);' name="modsel" id="modsel">
 
298
<? 
 
299
     if($allowed_modules){
 
300
        for($i = 0; $i<sizeof($allowed_modules);$i++){
 
301
                        echo"<option value='$allowed_modules[$i]'>";
 
302
                if (isset($GLOBALS[$allowed_modules[$i] . "_title"])) echo  $GLOBALS[$allowed_modules[$i] . "_title"];
 
303
                        else echo"$allowed_modules[$i]";
 
304
                        echo"</option>";
 
305
                
 
306
        }
 
307
     }
 
308
 ?>
 
309
        </select>     
 
310
    </div>
 
311
<?}?>
 
312
 
251
313
    <div><table align="center" cellspacing="0" cellpadding="0">
252
314
        <?/*<tr><td colspan="2"></td></tr>*/?>
253
315
        <tr><td id="main_sidebar"><div>
265
327
                <?modulePlacePages($allowed_modules);?>
266
328
        </div></td></tr>
267
329
    </table></div>
 
330
 
268
331
    <div id="main_statusbar" class="statusbar">
269
332
        <div>I'm a status bar</div>
270
333
    </div>
 
334
  </div>
271
335
</div>
272
336
</body>
273
337
</html>