-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavbar.php
More file actions
53 lines (51 loc) · 2.73 KB
/
navbar.php
File metadata and controls
53 lines (51 loc) · 2.73 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
<?php
namespace Vanderbilt\DataModelBrowserExternalModule;
$style = '';
if(array_key_exists('page',$_REQUEST)){
$style = 'padding-bottom:10px;';
}
?>
<div class="nav-padding-left">
<div class="nav nav-pills" style="margin-top: 100px;<?=$style?>">
<?PHP
$active = "";
$path = "";
if( !array_key_exists('option', $_REQUEST)) {
$active = "class='wiki_active'";
}
?>
<?php if( array_key_exists('option', $_REQUEST)){
echo '<a href="'.$module->getUrl($page."&pid=".$_GET['pid']).'" '.$active.' style="padding-top: 40px;">Home</a>';
}
if( array_key_exists('option', $_REQUEST) && ($_REQUEST['option'] === 'variables' || $_REQUEST['option'] === 'variableInfo')){
$tid = (int)$_REQUEST['tid'];
$vid = isset($_REQUEST['vid']) ? (int)$_REQUEST['vid']:"";
$dataTable = generateTableArray($module, $pidsArray['DATAMODEL'],$tid);
$active = "";
foreach( $dataTable as $data ) {
if (!empty($data['record_id']) && !empty($data['variable_name'])) {
#rearrange the array to start at 1 to match the variables
$data['variable_name'] = array_combine(range(1, count($data['variable_name'])), $data['variable_name']);
if ($_REQUEST['option'] === 'variables' || $_REQUEST['option'] === 'variableInfo') {
if($_REQUEST['option'] === 'variables') {
$active = "class='wiki_active'";
}
$url = $module->getUrl($page).'&NOAUTH&tid=' . $data['record_id'] . '&option=variables';
?>
<span> > </span>
<a href="<?=$url?>" <?=$active?>><?= htmlentities($data['table_name'],ENT_QUOTES) ?></a>
<?php }
if ($_REQUEST['option'] === 'variableInfo') {
$active = "class='wiki_active'";
$url = $module->getUrl($page).'&NOAUTH&tid=' . $data['record_id'] . '&vid=' . $vid . '&option=variableInfo';
?>
<span> > </span>
<a href="<?=$url?>" <?=$active?>><?= htmlentities($data['variable_name'][$vid],ENT_QUOTES) ?></a>
<?php }
}
}
}else if($_REQUEST['option'] == 'search'){
echo "<span> > </span><a href=".$page."'&pid=".$pidsArray['DATAMODEL']."&option=search' class='wiki_active'>Variable search</a>";
}?>
</div>
</div>