1
0
mirror of https://github.com/e107inc/e107.git synced 2025-02-15 12:05:23 +01:00

62 lines
1.4 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
2009-07-18 10:17:56 +00:00
* e107 website system
*
2012-12-03 04:48:56 -08:00
* Copyright (C) 2008-2013 e107 Inc (e107.org)
2009-07-18 10:17:56 +00:00
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* Administration menu
*
2006-12-02 04:36:16 +00:00
*/
2009-07-18 10:17:56 +00:00
//@TODO make it 0.8 compatible
2006-12-02 04:36:16 +00:00
if (!defined('e107_INIT')) { exit; }
2012-12-03 04:48:56 -08:00
2009-07-18 10:17:56 +00:00
if (ADMIN == TRUE)
{
// We're not in admin - load generic admin phrases
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php');
2012-12-03 04:48:56 -08:00
$tp = e107::getParser();
$pref = e107::getPref();
$ns = e107::getRender();
$nav = e107::getNav();
2013-02-26 18:57:33 -08:00
// $admin = $nav->adminLinks('assoc');
// $plugins = $nav->pluginLinks('assoc');
2006-12-02 04:36:16 +00:00
2013-02-26 18:57:33 -08:00
// $array_functions = array_merge($admin, $plugins);
$array_functions = $nav->adminLinks();
2006-12-02 04:36:16 +00:00
2012-12-03 04:48:56 -08:00
// print_a($array_functions);
2006-12-02 04:36:16 +00:00
2012-12-03 04:48:56 -08:00
// asort($array_functions);
2013-04-26 21:50:01 -07:00
// ksort($array_functions, 'title'); //FIXME Improve ordering.
2012-12-03 04:48:56 -08:00
//$array_functions = asortbyindex($array_functions, 1);
2006-12-02 04:36:16 +00:00
$amtext = "<div style='text-align:center'>
<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>
<option>".LAN_SELECT."</option>\n";
2009-07-18 10:17:56 +00:00
foreach ($array_functions as $link_value)
{
2012-12-03 04:48:56 -08:00
$amtext .= render_admin_links($link_value['link'], $link_value['title'], $link_value['perms']);
2006-12-02 04:36:16 +00:00
}
$amtext .= "</select>
</div>";
2012-12-03 04:48:56 -08:00
2006-12-02 04:36:16 +00:00
$ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu');
}
2009-07-18 10:17:56 +00:00
function render_admin_links($link, $title, $perms)
{
if (getperms($perms))
{
2006-12-02 04:36:16 +00:00
return "<option value='".$link."'>".$title."</option>";
}
}