1<?php
2/*
3 * e107 website system
4 *
5 * Copyright (C) 2008-2014 e107 Inc (e107.org)
6 * Released under the terms and conditions of the
7 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
8 *
9 * Administration menu
10 *
11*/
12
13
14if (!defined('e107_INIT')) { exit; }
15
16
17if (ADMIN == TRUE)
18{
19
20	e107::lan('core','admin', true); // We're not in admin - load generic admin phrases
21
22	$tp 	= e107::getParser();
23	$pref 	= e107::getPref();
24	$ns 	= e107::getRender();
25	$nav 	= e107::getNav();
26
27
28    $array_functions = $nav->adminLinks();
29
30	$amtext = "<div class='text-center' style='text-align:center'>
31	<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox form-control'>
32	<option>".LAN_SELECT."...</option>\n";
33	foreach ($array_functions as $link_value)
34	{
35		$amtext .= render_admin_links($link_value['link'], $link_value['title'], $link_value['perms']);
36	}
37
38	$amtext .= "</select>
39	</div>";
40
41	$ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu');
42}
43
44function render_admin_links($link, $title, $perms)
45{
46	if (getperms($perms))
47	{
48		return "<option value='".$link."'>".$title."</option>";
49	}
50}
51