forked from glpunzi/nuBuilderPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
156 lines (111 loc) · 3.77 KB
/
index.php
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php require_once('nucommon.php'); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv='Content-type' content='text/html;charset=UTF-8'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>nuBuilder</title>
<link rel="apple-touch-icon" href="apple-touch-icon.png"/>
<link rel="stylesheet" href="jquery/jquery-ui.css" />
<script src="jquery/jquery-1.8.3.js" type='text/javascript'></script>
<script src="jquery/jquery-ui.js" type='text/javascript'></script>
<script src="ace/ace.js" type="text/javascript" charset="utf-8"></script>
<?php
jsinclude('nuformat.js');
jsinclude('nucalendar.js');
jsinclude('nucommon.js');
jsinclude('nueditform.js');
jsinclude('nubrowseform.js');
jsinclude('nuobject.js');
print $GLOBALS['nuSetup']->set_css; //-- html header
$i = "";
$h = "";
$t = "";
$u = isset($_GET['u']) ? $_GET['u'] : '';
$p = isset($_GET['p']) ? $_GET['p'] : '';
$k = isset($_GET['k']) ? $_GET['k'] : '';
if( array_key_exists('i', $_GET) ) {
$i = $_GET['i'];
}
if( array_key_exists('home', $_SESSION) ) {
$h = $_SESSION['home'];
}
if( array_key_exists('title', $_SESSION) ) {
$t = $_SESSION['title'];
}
$l = nuGetLanguage();
$de = $GLOBALS['nuSetup']->set_denied;
print "
<style>
.nuSelected {cursor:move;outline:2px solid red}
</style>
<script>
window.nuDenied = '$de';
window.nuUsername = '$u';
window.nuPassword = '$p';
window.nuPrimaryKey = '$k';
$l
function nuGetID(){
return '$i';
}
function nuGetHome(){
return '$h';
}
function nuGetTitle(){
return '$t';
}
function nuHomeWarning(){
if(nuFORM.edited == '1'){
return nuTranslate('Leave This Form Without Saving?')+' '+nuTranslate('Doing this will return you to the login screen.');
}
return nuTranslate('Doing this will return you to the login screen.');
}
function nuWindowWarning(){
if(nuFORM.edited == '1' && nuFORM.parent_form_id != 'nurunreport' && nuFORM.parent_form_id != 'nurunphp'){
return nuTranslate('Leave This Form Without Saving?');
}
return null;
}
window.onbeforeunload = nuHomeWarning;
</script>
";
?>
<script>
window.nuShiftKey = false;
window.nuControlKey = false;
window.nuTimeout = false;
window.nuMoveable = false;
$(document).ready(function() {
$('title').html(nuGetTitle());
var i = nuGetID();
window.nuSession = new nuBuilderSession();
if(i === ''){ //-- Main Desktop
if(window.nuUsername == '' && window.nuPassword == ''){
toggleModalMode();
}else{
nuLogin(window.nuUsername, window.nuPassword, window.nuPrimaryKey);
}
}else{ //-- iFrame or new window
var pSession = nuGetParentSession();
nuSession.setSessionID(pSession.nuSessionID);
var w = document.defaultView.parent.nuSession.getWindowInfo(i,pSession);
//-- added by sc 2014-01-24
var alreadyDefined = Array();
for (var key in w){
alreadyDefined.push(key);
}
for (var key in document.defaultView.parent.nuFORM){
if(alreadyDefined.indexOf(key) == -1){
w[key] = document.defaultView.parent.nuFORM[key]; //-- add values from parent values (so they can be used as hash variables)
}
}
//-- end added by sc
nuBuildForm(w); //-- Edit or Browse
}
});
</script>
</head>
<body onkeydown="nuKeyPressed(event, true);" onkeyup="nuKeyPressed(event, false);" onload="this.addEventListener('click',function(event){if(event.ctrlKey || event.altKey){window.nuLastCtrlPressedTS = Math.floor(Date.now()/1000);}}, true);">
</body>
</html>