1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Review and cleanup of all admin layouts

This commit is contained in:
Cameron
2013-02-26 21:27:36 -08:00
parent bb020c6ae2
commit b8b8a3e726
8 changed files with 33 additions and 231 deletions

View File

@@ -28,6 +28,11 @@ if(vartrue($_GET['iframe']) == 1)
$e_sub_cat = 'main';
if (varset($pref['adminstyle'])=='cascade' || varset($pref['adminstyle'])=='beginner') // Deprecated Admin-include.
{
$pref['adminstyle'] = 'infopanel';
}
if(strpos($pref['adminstyle'], 'infopanel') === 0)
{
require_once(e_ADMIN.'includes/'.$pref['adminstyle'].'.php');
@@ -43,10 +48,10 @@ if(strpos($pref['adminstyle'], 'infopanel') === 0)
require_once(e_ADMIN.'boot.php');
require_once(e_ADMIN.'auth.php');
require_once(e_HANDLER.'upload_handler.php');
// require_once (e_HANDLER."message_handler.php");
$mes = e107::getMessage();
if (!isset($pref['adminstyle'])) $pref['adminstyle'] = 'classis'; // Shouldn't be needed - but just in case
if (!isset($pref['adminstyle'])) $pref['adminstyle'] = 'infopanel'; // Shouldn't be needed - but just in case
// --- check for htmlarea.
@@ -175,79 +180,7 @@ $td = 1;
// DEPRECATED
function render_links($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE)
{
return e107::getNav()->renderAdminButton($link, $title, $description, $perms, $icon, $mode);
/*
global $td,$tp;
$text = '';
if (getperms($perms))
{
$description = strip_tags($description);
if ($mode == 'adminb')
{
$text = "<tr><td class='forumheader3'>
<div class='td' style='text-align:left; vertical-align:top; width:100%'
onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">
".$icon." <b>".$title."</b> ".($description ? "[ <span class='field-help'>".$description."</span> ]" : "")."</div></td></tr>";
}
else
{
if($mode != "div" && $mode != 'div-icon-only')
{
if ($td == (ADLINK_COLS+1))
{
$text .= '</tr>';
$td = 1;
}
if ($td == 1)
{
$text .= '<tr>';
}
}
switch ($mode)
{
case 'default':
$text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap'
onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$tp->toHTML($title,FALSE,"defs, emotes_off")."</td>";
break;
case 'classis':
$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a class='core-mainpanel-link-icon' href='".$link."' title='{$description}'>".$icon."</a><br />
<a class='core-mainpanel-link-text' href='".$link."' title='{$description}'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a><br /><br /></td>";
break;
case 'beginner':
$text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a class='core-mainpanel-link-icon' href='".$link."' >".$icon."</a>
<div style='padding:5px'>
<a class='core-mainpanel-link-text' href='".$link."' title='".$description."'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a></div><br /><br /><br /></td>";
break;
case 'div':
$text .= "<div class='core-mainpanel-block'><a class='core-mainpanel-link-icon e-tip' href='".$link."' title='{$description}'>".$icon."</a><br />
<a class='core-mainpanel-link-text e-tip' href='".$link."' title='{$description}'>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</a>
</div>";
break;
case 'div-icon-only':
$text .= "<div class='core-mainpanel-block'><a class='core-mainpanel-link-icon e-tip' href='".$link."' title='{$description}'>".$icon."</a></div>";
break;
default:
break;
}
$td++;
}
}
return $text;
*/
}

View File

@@ -1,63 +0,0 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* $URL$
* $Id$
*/
if (!defined('e107_INIT')) { exit; }
$mes = e107::getMessage();
if($_GET['mode'] == "e_advanced"){
$pref['adminstyle'] = "classis";
save_prefs();
Header("Location:". e_ADMIN."admin.php");
}
$buts = "";
$text = "<div style='text-align:center;vertical-align:middle'><br /><br />
<table style='".ADMIN_WIDTH.";margin-top:auto;margin-bottom:auto' >";
// $newarray[28] = array(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", 2, E_16_PLUGMANAGER, E_32_PLUGMANAGER);
$selection = array(22,12,17,25,5,19,7,23,28,26);
// $selection = array(21,11,17,24,5,19,7,27,28,25);
foreach($selection as $id)
{
$buts .= e107::getNav()->renderAdminButton($newarray[$id][0],$newarray[$id][1],$newarray[$id][2],$newarray[$id][3],$newarray[$id][6],'beginner');
}
$text .= $buts;
$text .= render_clean();
$text .= "\n</table><br /></div>";
$text .= "<div class='smalltext' style='text-align:center'>".ADLAN_144." <a href='".e_SELF."?mode=e_advanced' >".ADLAN_145."</a>&nbsp;&nbsp;</div>";
if($buts != '')
{
$ns->tablerender(ADLAN_47." ".ADMINNAME, $mes->render().$text);
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
$text .= e107::getNav()->pluginLinks(E_32_PLUGMANAGER, "classis");
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
?>

View File

@@ -1,40 +0,0 @@
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* $URL$
* $Id$
*/
if (!defined('e107_INIT')) { exit; }
$mes = e107::getMessage();
$text = "<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>";
while (list($key, $funcinfo) = each($newarray))
{
$text .= e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'adminb');
}
$text .= "<tr>
<td class='fcaption' colspan='5'>
".ADLAN_CL_7."
</td>
</tr>";
$text .= e107::getNav()->pluginLinks( E_16_PLUGMANAGER, 'adminb');
$text .= "</table></div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $mes->render().$text);
?>

View File

@@ -15,10 +15,13 @@ if (!defined('e107_INIT')) { exit; }
$mes = e107::getMessage();
$text = "<div style='text-align:center'>
<table class='fborder' style='".ADMIN_WIDTH."'>";
<table class='table'>";
$admin_cat = e107::getNav()->adminCats();
$newarray = e107::getNav()->adminLinks('core');
$plugin_array = e107::getNav()->adminLinks('plugin');
foreach ($admin_cat['id'] as $cat_key => $cat_id)
{
$text_check = FALSE;
@@ -44,49 +47,12 @@ foreach ($admin_cat['id'] as $cat_key => $cat_id)
{
$text_rend = e107::getNav()->renderAdminButton(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default');
$xml = e107::getXml();
$xml->filter = array('@attributes' => FALSE,'administration' => FALSE); // .. and they're all going to need the same filter
if ($text_rend)
{
$text_check = TRUE;
}
$text_cat .= $text_rend;
if ($sql->db_Select("plugin", "*", "plugin_installflag=1"))
{
while ($row = $sql->db_Fetch())
{
extract($row); // plugin_id int(10) unsigned NOT NULL auto_increment,
// plugin_name varchar(100) NOT NULL default '',
// plugin_version varchar(10) NOT NULL default '',
// plugin_path varchar(100) NOT NULL default '',
// plugin_installflag tinyint(1) unsigned NOT NULL default '0',
// plugin_addons text NOT NULL,
if (is_readable(e_PLUGIN.$plugin_path."/plugin.xml"))
{
$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
$eplug_name = $tp->toHTML($readFile['name'],FALSE,"defs, emotes_off");
$eplug_conffile = $readFile['administration']['configFile'];
$eplug_icon_small = $plugin_path.'/'.$readFile['administration']['iconSmall'];
$eplug_icon = $plugin_path.'/'.$readFile['administration']['icon'];
$eplug_caption = $readFile['administration']['caption'];
}
elseif (is_readable(e_PLUGIN.$plugin_path."/plugin.php"))
{
include(e_PLUGIN.$plugin_path."/plugin.php");
}
if ($eplug_conffile)
{
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs, emotes_off");
$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='".$eplug_caption."' class='icon S16' />" : E_16_PLUGIN;
$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
$text_check = TRUE;
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
}
}
ksort($plugin_array, SORT_STRING);
foreach ($plugin_array as $plug_key => $plug_value)
{
$text_cat .= e107::getNav()->renderAdminButton($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default');

View File

@@ -15,6 +15,8 @@ if (!defined('e107_INIT')) { exit; }
$mes = e107::getMessage();
$buts = "";
$newarray = e107::getNav()->adminLinks('core');
while (list($key, $funcinfo) = each($newarray))
{
$buts .= e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
@@ -22,14 +24,14 @@ while (list($key, $funcinfo) = each($newarray))
if($buts != "")
{
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
<table class='table'>";
$text .= $buts;
$text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $mes->render().$text);
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
<table class='table'>";
$text .= e107::getNav()->pluginLinks(E_32_PLUGMANAGER, "classis");
@@ -37,6 +39,6 @@ $text .= render_clean();
$text .= "</table></div>";
$ns->tablerender(ADLAN_CL_7, $text);
$ns->tablerender(ADLAN_CL_7, $text,'infopanel');
?>

View File

@@ -12,11 +12,12 @@
if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER."message_handler.php");
$mes = e107::getMessage();
$newarray = e107::getNav()->adminLinks('core');
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
<table class='table'>";
$buts = "";
while (list($key, $funcinfo) = each($newarray)) {
$buts .= e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
@@ -33,7 +34,7 @@ if($buts != ""){
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
<table class='table'>";
$text .= e107::getNav()->pluginLinks(E_32_PLUGMANAGER, "classis");

View File

@@ -20,15 +20,17 @@ $newarray = e107::getNav()->adminLinks('core');
$buts = "";
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
<table class='table'>";
while (list($key, $funcinfo) = each($newarray)) {
while (list($key, $funcinfo) = each($newarray))
{
$buts .= e107::getNav()->renderAdminButton($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
}
$text .= $buts;
$text_cat = '';
while ($td <= 5) {
while ($td <= 5)
{
$text_cat .= "<td class='td' style='width:20%;' ></td>";
$td++;
}
@@ -36,12 +38,13 @@ $td = 1;
$text .= "</tr></table></div>";
if($buts !=""){
if($buts !="")
{
$ns->tablerender(ADLAN_47." ".ADMINNAME, $mes->render().$text);
}
$text = "<div style='text-align:center'>
<table style='".ADMIN_WIDTH."'>";
<table class='table'>";
$text .= e107::getNav()->pluginLinks( E_16_PLUGMANAGER, 'default');

View File

@@ -1187,7 +1187,7 @@ class e_navigation
global $td;
$tp = e107::getParser();
$mes = e107::getMessage();
$cols = defset('ADLINK_COLS',3);
$cols = defset('ADLINK_COLS',5);
$text = '';
@@ -1221,13 +1221,13 @@ class e_navigation
switch ($mode)
{
case 'default':
$text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap'
onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$tp->toHTML($title,FALSE,"defs, emotes_off")."</td>";
$text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap'>
<a class='core-mainpanel-link-icon e-tip' href='".$link."' title='{$description}'>".$icon." ".$tp->toHTML($title,FALSE,"defs, emotes_off")."</a></td>";
break;
case 'classis':
$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a class='core-mainpanel-link-icon' href='".$link."' title='{$description}'>".$icon."</a><br />
<a class='core-mainpanel-link-text' href='".$link."' title='{$description}'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a><br /><br /></td>";
<a class='core-mainpanel-link-text' href='".$link."' title='{$description}'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a></td>";
break;
case 'beginner':