-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
418 lines (372 loc) · 15.4 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
<?php
/**
* Main entry page.
*
* This file contains the site's main entry page.
*
* @package Test
* @subpackage Site
*
* @author Milko A. Škofič <[email protected]>
* @version 1.00 20/07/2012
*/
/*=======================================================================================
* *
* index.php *
* *
*======================================================================================*/
//
// Global includes.
//
require_once( '/Library/WebServer/Library/wrapper/includes.inc.php' );
//
// Server includes.
//
require_once( '/Library/WebServer/Library/wrapper/local/server.inc.php' );
//
// Sites includes.
//
// When moving the site:
// - Perform a global replace of the below path with the new path.
// - Open the .../assets/site/CSessionLocal.inc.php file and update the paths.
//
require_once( '/Library/WebServer/Sites/development/OntologyNav/assets/site/CSessionLocal.php' );
/*=======================================================================================
* LOAD SESSION *
*======================================================================================*/
//
// TRY BLOCK.
//
try
{
//
// Start session.
//
session_start();
//
// Initialise session.
//
CSessionLocal::Init_Session();
//
// Ensure guest user.
// We only include this for debugging purposes,
// code is test and pass is pass.
// Omit this in production.
//
$_SESSION[ kDEFAULT_SESSION ]->Init_Guest();
//
// Handle login/logout.
//
$_SESSION[ kDEFAULT_SESSION ]->Handle_Login();
}
//
// CATCH BLOCK.
catch( Exception $error )
{
exit( CException::AsHTML( $error ) );
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Home page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<link href="http://resources.grinfo.net/Library/bootstrap/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
</style>
<link href="http://resources.grinfo.net/Library/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<!-- My styles -->
<link href="<?= kDEFAULT_HOME.'assets/style/MyStyles.css' ?>" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="<?= kDEFAULT_HOME.'assets/icon/favicon.ico' ?>">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?= kDEFAULT_HOME.'assets/icon/apple-touch-icon-144-precomposed.png' ?>">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?= kDEFAULT_HOME.'assets/icon/apple-touch-icon-72-precomposed.png' ?>">
<link rel="apple-touch-icon-precomposed" href="<?= kDEFAULT_HOME.'assets/icon/apple-touch-icon-57-precomposed.png' ?>">
<!-- ------------------------------------------------------------------------- --
-- VIEW MODEL --
-- ------------------------------------------------------------------------- -->
<script type="text/javascript">
function viewModel() <?php echo( (string) $_SESSION[ kDEFAULT_SESSION ]."\n" ); ?>
</script>
</head>
<body>
<!-- ------------------------------------------------------------------------- --
-- MODAL LOGIN --
-- ------------------------------------------------------------------------- -->
<div class="modal hide fade" id="LoginModal">
<form class="well form-inline" action="<?= kDEFAULT_HOME.'index.php' ?>" method="post">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Login</h3>
</div>
<div class="modal-body">
<div class="input-prepend">
<span class="add-on"><i class="icon-envelope"></i></span><input name="<?= kSESSION_PARAM_USER_CODE ?>" class="span2" type="text" placeholder="User" \>
</div>
<br />
<div class="input-prepend">
<span class="add-on"><i class="icon-lock"></i></span><input name="<?= kSESSION_PARAM_USER_PASS ?>" class="span2" type="password" placeholder="Password">
</div>
<br />
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<button class="btn-small btn-primary" type="submit">
<i class="icon-user icon-white"></i>Sign in
</button>
</div>
</form>
</div><!--/.LoginModal -->
<!-- ------------------------------------------------------------------------- --
-- MODAL PROFILE --
-- ------------------------------------------------------------------------- -->
<div class="modal hide fade" id="ProfileModal">
<form class="form-horizontal" data-bind="submit: userProfileSubmit" action="<?= kDEFAULT_HOME.'index.php' ?>" method="post">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>User Profile</h3>
</div>
<div class="modal-body">
<div class="control-group">
<label class="control-label" for="userName">Full name</label>
<div class="controls">
<input class="input-xlarge"
type="text"
id="userName"
name="<?= kSESSION_PARAM_USER_NAME ?>"
data-bind="value: <?= kSESSION_USER_NAME ?>" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="userEmail">E-mail</label>
<div class="controls">
<input class="input-xlarge"
type="text"
id="userEmail"
name="<?= kSESSION_PARAM_USER_EMAIL ?>"
data-bind="value: <?= kSESSION_USER_EMAIL ?>" />
</div>
</div>
<!--
<div class="control-group">
<label class="control-label" for="userKinds">Kinds</label>
<div class="controls">
<select size='4' id="userKinds" data-bind="options: <?= kSESSION_USER_KIND ?>"></select>
</div>
</div>
<div class="control-group">
<label class="control-label" for="userRoles">Roles</label>
<div class="controls">
<select size='4' id="userRoles" data-bind="options: <?= kSESSION_USER_ROLE ?>"></select>
</div>
</div>
-->
<div class="control-group">
<label class="control-label" for="userPass">Password</label>
<div class="controls">
<input type="password"
id="userPass"
name="<?= kSESSION_PARAM_USER_PASS ?>" />
<br />
<small><em>Leave blank to keep old password.</em></small>
</div>
</div>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Cancel</a>
<button class="btn-small btn-primary" type="submit">
<i class="icon-user icon-white"></i>Submit
</button>
</div>
<div class="alert alert-error fade in hide" id="userProfile_MissingName">
<strong>You must provide your full name.</strong>
</div>
<div class="alert alert-error fade in hide" id="userProfile_MissingEmail">
<strong>You must provide an e-mail.</strong>
</div>
</form>
</div><!--/.ProfileModal -->
<!-- ------------------------------------------------------------------------- --
-- NAVIGATION BAR --
-- ------------------------------------------------------------------------- -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<!-- --------------------------------------------------------------------- --
-- PROJECT TITLE --
-- --------------------------------------------------------------------- -->
<a data-bind="if: <?= kSESSION_NAV_FLAG_BRAND ?>"
class="brand MyBrandColor" href="#">
EURISCO Data Warehouse
</a>
<!-- --------------------------------------------------------------------- --
-- LOGIN BUTTON --
-- --------------------------------------------------------------------- -->
<div data-bind="ifnot: <?= kSESSION_USER_LOGGED ?>"
class="btn-group pull-right">
<a class="btn" data-toggle="modal" href="#LoginModal">
<span data-bind="text: <?php echo( kSESSION_USER_NAME ); ?>"></span>
</a>
</div><!--/.btn-group -->
<!-- --------------------------------------------------------------------- --
-- LOGGED BUTTON --
-- --------------------------------------------------------------------- -->
<div data-bind="if: <?= kSESSION_USER_LOGGED ?>"
class="btn-group pull-right">
<a class="btn btn-info" data-toggle="modal" href="#ProfileModal"><i class="icon-user"></i> <span data-bind="text: <?php echo( kSESSION_USER_NAME ); ?>"></span></a>
<button class="btn btn-info dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" style="width: 240px">
<li><a href="<?= kDEFAULT_HOME.'index.php?'.kSESSION_PARAM_USER_LOGOUT ?>">Sign Out</a></li>
</ul>
</div><!--/.btn-group -->
<div class="nav-collapse">
<ul class="nav">
<!-- --------------------------------------------------------------------- --
-- SEARCH FIELD --
-- --------------------------------------------------------------------- -->
<form data-bind="if: <?= kSESSION_NAV_FLAG_SEARCH ?>"
class="navbar-search pull-left">
<input type="text" class="search-query" placeholder="Search">
</form>
<!-- --------------------------------------------------------------------- --
-- DATASET TAB --
-- --------------------------------------------------------------------- -->
<li data-bind="if: <?= kSESSION_NAV_FLAG_DATASET ?>"
class="dropdown" id="menu1">
<a class="dropdown-toggle" data-toggle="dropdown" href="#ontology_menu">
Dataset
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="<?= kDEFAULT_HOME.'Dataset/upload.php' ?>">Upload</a></li>
<li class="divider"></li>
<li><a href="<?= kDEFAULT_HOME.'Dataset/manage.php' ?>">Manage</a></li>
</ul>
</li>
<!-- --------------------------------------------------------------------- --
-- ONTOLOGY TAB --
-- --------------------------------------------------------------------- -->
<li data-bind="if: <?= kSESSION_NAV_FLAG_ONTOLOGY ?>"
class="dropdown" id="menu1">
<a class="dropdown-toggle" data-toggle="dropdown" href="#ontology_menu">
Ontology
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li><a href="<?= kDEFAULT_HOME.'Ontology/ontology.php' ?>">Ontologies</a></li>
<li class="divider"></li>
<li><a href="<?= kDEFAULT_HOME.'Ontology/term.php' ?>">Terms</a></li>
<li><a href="<?= kDEFAULT_HOME.'Ontology/node.php' ?>">Nodes</a></li>
<li><a href="<?= kDEFAULT_HOME.'Ontology/tag.php' ?>">Tags</a></li>
<li class="divider"></li>
<li><a href="<?= kDEFAULT_HOME.'Ontology/graph.php' ?>">Graphs</a></li>
</ul>
</li>
<!-- --------------------------------------------------------------------- --
-- DIVIDER TAB --
-- --------------------------------------------------------------------- -->
<li class="divider-vertical"></li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</div><!--/.navbar-inner -->
</div><!--/.navbar -->
<!-- ------------------------------------------------------------------------- --
-- CONTENT --
-- ------------------------------------------------------------------------- -->
<div class="container-fluid">
<!-- --------------------------------------------------------------------- --
-- MAIN CONTENT --
-- --------------------------------------------------------------------- -->
<h1>Load your data in EURISCO</h1>
<p>The goal of agrobiodiversity conservation, unlike other forms of
conservation, is not only the conservation of species and intra-specific
genetic diversity related to agriculture, but also to promote its sustainable
use in facilitating agricultural production. Although significant progress
has been made in the conservation and management of plant genetic resources
for food and agriculture (PGRFA) globally and in Europe, there remain two
critical areas where progress has been limited: (a) the use of conserved
agrobiodiversity by breeders and (b) the systematic conservation of crop wild
relative (CWR) and landrace (LR) diversity.
<br />
Specifically for breeders and CWR / LR diversity conservationists, the status
quo is no longer an option as human-induced climate change is threatening the
maintenance of the very diversity breeders require to mitigate the adverse
impact of climate change.
<br />
Conventionally, breeders have used their own lines and stocks to generate
novel crop varieties, but these materials are relatively genetically
uniform and it is now increasingly recognized that CWR and LR offer the
breadth of genetic diversity required by breeders to meet the novel
challenges of climate change and rapidly changing consumer demands.
</p>
<!-- --------------------------------------------------------------------- --
-- DEBUG CONTENT --
-- --------------------------------------------------------------------- -->
<div data-bind="if: <?= kSESSION_DEBUG ?>">
<hr>
<pre>
<p><?php print_r( $_SERVER ); ?></p>
<p><?php print_r( $_REQUEST ); ?></p>
<p><?php print_r( $_SESSION ); ?></p>
</pre>
<hr>
</div>
<!-- ------------------------------------------------------------------------- --
-- COPYRIGHT --
-- ------------------------------------------------------------------------- -->
<hr>
<footer>
<p>© Bioversity International 2012</p>
</footer>
</div><!--/.fluid-container-->
<!-- Javascript libraries
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://resources.grinfo.net/Library/jquery.js"></script>
<script src="http://resources.grinfo.net/Library/knockout.js"></script>
<script src="http://resources.grinfo.net/Library/knockout.mapping.js"></script>
<script src="http://resources.grinfo.net/Library/bootstrap/js/bootstrap.min.js"></script>
<!-- Local Javascript libraries
================================================== -->
<script src="<?= kDEFAULT_HOME.'assets/site/site.js' ?>"></script>
<!-- Apply view model bindings
================================================== -->
<script type="text/javascript">
<!-- Login popover (not used currently). -->
$(function(){
$('#login-prompt').popover({
placement: 'bottom'
})
});
<!-- Instantiate view model. -->
var vm = new viewModel();
<!-- Add functions to view model. -->
addFunctionsToViewModel( vm );
<!-- Apply bindings. -->
ko.applyBindings( vm );
</script>
</body>
</html>