-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnc-ui-network.php
More file actions
96 lines (83 loc) · 3.37 KB
/
nc-ui-network.php
File metadata and controls
96 lines (83 loc) · 3.37 KB
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
<?php
/*
* Entry point page for an individual network
*
* Assumes some variables are already set by index.php
* $uid, $network, $NCApi
*
*/
// if user does not have at least view permissions, redirect
if (!$upermissions || $upermissions < 1) {
//header("Refresh: 0; ?page=front");
exit();
}
// get network title and description
$nettitle = $NCapi->getNetworkTitle($network);
// start making an object with all the markdown components, and all the comments
$netmd = [];
$netcomments = [];
// For toolbar - get what aspect of the network to view (summary, graph, log, etc)
$view = 'summary';
if (isset($_REQUEST['view'])) {
$view = strtolower($_REQUEST['view']);
}
if (!in_array($view, array('graph', 'log', 'data', 'permissions', 'ontology'))) {
$view = 'summary';
}
// helper object for writing href in toolbar
$coreurl = "?network=$network&view=";
// perhaps page is requesting an object or a history page
if (isset($_REQUEST['object'])) {
$view = 'object';
}
if (isset($_REQUEST['history'])) {
$view = 'history';
}
?>
<nav class="navbar navbar-default nc-navbar navbar-static-top nc-navbar2">
<div class="container">
<div class="navbar-collapse">
<ul class="nav navbar-nav">
<li class='<?php if ($view == 'summary') echo 'active'; ?>'>
<a href='<?php echo $coreurl . 'summary'; ?>'>Summary</a>
</li>
<li class='<?php if ($view == 'ontology') echo 'active'; ?>'>
<a href='<?php echo $coreurl . 'ontology'; ?>'>Ontology</a>
</li>
<li class='<?php if ($view == 'graph') echo 'active'; ?>'>
<a href='<?php echo $coreurl . 'graph'; ?>'>Graph</a>
</li>
<li class='<?php if ($view == 'data') echo 'active'; ?>'>
<a href='<?php echo $coreurl . 'data'; ?>'>Data</a>
</li>
<li class='<?php if ($view == 'log') echo 'active'; ?>'>
<a href='<?php echo $coreurl . 'log'; ?>'>Log</a>
</li>
<li id="nc-permissions-tab" class='nc-curator<?php if ($view == 'permissions') echo ' active'; ?>'
style="display: none">
<a href='<?php echo $coreurl . 'permissions'; ?>'>Permissions</a>
</li>
</ul>
<ul class="nav navbar-nav pull-right nc-nav-icon">
<li class="nc-curator" style="display: none">
<a role="button" id="nc-curation-lock" class="nc-looking">
<span class="glyphicon glyphicon-pencil"></span>
</a>
</li>
<li class="nc-history">
<a role="button" id="nc-history">
<span class="glyphicon glyphicon-film"></span>
</a>
</li>
</ul>
</div>
</div>
</nav>
<?php
// after the menu, include the contents specific to each view
include_once "nc-ui/ui-components/ui-network-$view.php";
// write out the markdown and comments into the page
echo "<script>nc.networktitle='$nettitle';</script>";
echo ncScriptObject("nc.md", $netmd);
echo ncScriptObject("nc.comments", $netcomments);
?>