1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-28 18:30:53 +02:00

Added InfoPanel admin layout and Tabbed category Layout.

This commit is contained in:
CaMer0n
2009-07-04 03:08:03 +00:00
parent 4fb7a7c189
commit d884cd5f6d
4 changed files with 423 additions and 21 deletions

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/admin.php,v $
| $Revision: 1.9 $
| $Date: 2008-12-30 15:56:12 $
| $Author: secretr $
| $Revision: 1.10 $
| $Date: 2009-07-04 03:08:03 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
require_once('../class2.php');
@@ -167,14 +167,18 @@ function render_links($link, $title, $description, $perms, $icon = FALSE, $mode
}
else
{
if ($td == (ADLINK_COLS+1))
if($mode != "div")
{
$text .= '</tr>';
$td = 1;
}
if ($td == 1)
{
$text .= '<tr>';
if ($td == (ADLINK_COLS+1))
{
$text .= '</tr>';
$td = 1;
}
if ($td == 1)
{
$text .= '<tr>';
}
}
if ($mode == 'default')
{
@@ -183,14 +187,20 @@ function render_links($link, $title, $description, $perms, $icon = FALSE, $mode
}
elseif ($mode == 'classis')
{
$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title='{$description}'>".$icon."</a><br />
<a href='".$link."' title='{$description}'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a><br /><br /></td>";
$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>";
}
elseif ($mode == 'beginner')
{
$text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a href='".$link."' >".$icon."</a>
$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 href='".$link."' title='".$description."' style='text-decoration:none'><b>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</b></a></div><br /><br /><br /></td>";
<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>";
}
elseif($mode == "div")
{
$text .= "<div class='core-mainpanel-block'><a class='core-mainpanel-link-icon' href='".$link."' title='{$description}'>".$icon."</a><br />
<a class='core-mainpanel-link-text' href='".$link."' title='{$description}'>".$tp->toHTML($title,FALSE,"defs, emotes_off")."</a>
</div>";
}
$td++;
}
@@ -249,7 +259,7 @@ function admin_info()
function status_request()
{
global $pref;
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner' || $pref['adminstyle'] == 'tabbed') {
return TRUE;
} else {
return FALSE;
@@ -260,7 +270,7 @@ function status_request()
function latest_request()
{
global $pref;
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner' || $pref['adminstyle'] == 'tabbed') {
return TRUE;
} else {
return FALSE;
@@ -270,7 +280,7 @@ function latest_request()
function log_request()
{
global $pref;
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade'|| $pref['adminstyle'] == 'beginner') {
if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade'|| $pref['adminstyle'] == 'beginner' || $pref['adminstyle'] == 'tabbed') {
return TRUE;
} else {
return FALSE;
@@ -327,19 +337,25 @@ function getPluginLinks($iconSize = E_16_PLUGMANAGER, $linkStyle = 'adminb')
$eplug_name = $tp->toHTML($eplug_name,FALSE,"defs, emotes_off");
if ($iconSize == E_16_PLUGMANAGER)
{
$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
$plugin_icon = $eplug_icon_small ? "<img class='icon S16' src='".e_PLUGIN.$eplug_icon_small."' alt='' />" : E_16_PLUGIN;
}
else
{
$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; vertical-align:bottom; width: 32px; height: 32px' />" : E_32_PLUGIN;
$plugin_icon = $eplug_icon ? "<img class='icon S32' src='".e_PLUGIN.$eplug_icon."' alt='' />" : E_32_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);
$plugin_array[$plugin_path] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
}
unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
}
}
ksort($plugin_array, SORT_STRING);
if($linkStyle == "array")
{
return $plugin_array;
}
foreach ($plugin_array as $plug_key => $plug_value)
{
$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], $linkStyle);

View File

@@ -0,0 +1,286 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $
| $Revision: 1.1 $
| $Date: 2009-07-04 03:08:03 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER."message_handler.php");
$emessage = &eMessage::getInstance();
require_once(e_HANDLER."form_handler.php");
$frm = new e_form(true); //enable inner tabindex counter
$text = "<div style='text-align:center'>
<div class='admintabs' id='tab-container'>
<ul class='e-tabs e-hideme' id='core-emote-tabs'>
<li id='tab-infopanel_mye107'><a href='#core-infopanel_mye107'>My Admin Panel</a></li>
<li id='tab-infopanel_news'><a href='#core-infopanel_news'>e107 News</a></li>
<li id='tab-infopanel_latest'><a href='#core-infopanel_latest'>Info</a></li>
<li id='tab-infopanel_online'><a href='#core-infopanel_online'>Who's Online</a></li>
<li id='tab-infopanel_customize'><a href='#core-infopanel_customize'>Customize</a></li>
<li id='tab-infopanel_add'><a href='#core-infopanel_add'>+</a></li>
</ul>";
// My E107
// Info about attributes
/*
attribute 1 = link
attribute 2 = title
attribute 3 = description
attribute 4 = perms
attribute 5 = category
1 - settings
2 - users
3 - content
4 - tools
5 - plugins
6 - about
attribute 6 = 16 x 16 image
attribute 7 = 32 x 32 image
*/
$buts = "";
while (list($key, $funcinfo) = each($newarray))
{
$iconlist[] = array("title"=>$funcinfo[1],"icon"=>$funcinfo[5]); // , $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
$buts .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
}
$pluglist = getPluginLinks(E_16_PLUGMANAGER, "array");
$text .= "
<div id='core-infopanel_mye107' class='adminedit' >
<div style='border:1px solid silver;margin:10px'>
<div class='main_caption bevel left'><b>Welcome to your e107 Content Management System</b></div>
<div class='left block-text' >
<h1>".ucwords(USERNAME)."'s Admin Panel</h1>
Welcome to your Website Content Manager
<br />
</div>
<div class='left' style='padding:25px'>";
$text .= getPluginLinks(E_32_PLUGMANAGER, "div");
$text .="<div class='clear'>&nbsp;</div>
</div>
<div class='left block-text' >
To customize the icons that appear in this panel, please <a href='#core-infopanel_customize&amp;etabTabContainer=core-infopanel_customize'>click here</a>.
</div>
</div>
</div>
";
// e107 News
$text .= "
<div id='core-infopanel_news' class='adminedit' >
<div style='border:1px solid silver;margin:10px'>
<div class='main_caption bevel left'><b>e107 News</b></div>
<div class='left block-text'>
RSS News feed from e107.org goes here.
</div>
</div>
</div>
";
// e107 latest
$text .= "
<div id='core-infopanel_latest' class='adminedit' >
<div style='border:1px solid silver;margin:10px'>
<table cellspacing='0' cellpadding='0'>
<tr>
<td style='padding:0px'>
";
require_once(e_FILE."shortcode/batch/admin_shortcodes.php");
$text .= $tp->parseTemplate("{ADMIN_LATEST}");
$text .= "</td><td style='padding:0px'>";
$text .= $tp->parseTemplate("{ADMIN_STATUS}");
$text .= "</td></tr></table>
</div>
</div>
";
// Who's Online ---------------------------------
$text .= "
<div id='core-infopanel_online' class='adminedit' >
<div style='border:1px solid silver;margin:10px'>
<div class='main_caption bevel left'><b>Who's Online</b></div>
<div class='left block-text'>
<form action='".e_SELF."' id='onlineform' method='post'>
<table cellpadding='0' cellspacing='0' class='adminlist'>
<colgroup span='3'>
<col style='width: 5%'></col>
<col style='width: 35%'></col>
<col style='width: 45%'></col>
</colgroup>
<thead>
<tr>
<th>Timestamp</th>
<th>Username</th>
<th>Location</th>
</tr>
</thead>
<tbody>";
if($e107->sql->db_Select('online', '*'))
{
$newsarray = $e107->sql->db_getList();
foreach($newsarray as $key=>$val)
{
$text .= "<tr>
<td>".$val['online_timestamp']."</td>
<td>".$val['online_user_id']."</td>
<td>".$val['online_location']."</td>
</tr>
";
}
}
$text .= "</tbody></table></form></div>
</div>
</div>
";
// Customizer ------------------------------------------
$text .= "
<form method='post' action='".e_SELF."'>
<div id='core-infopanel_customize' class='adminedit' >
<div style='border:1px solid silver;margin:10px'>
<div class='main_caption bevel left'><b>Customize your Admin Panel</b></div>
<div class='block-text'>";
foreach($iconlist as $key=>$icon)
{
$checked = (in_array($key,$columnsDefault)) ? TRUE : FALSE;
$text .= "<div class='left f-left list field-spacer' style='display:block;height:24px;width:200px;'>
".$icon['icon'].$frm->checkbox('e-columns[]', $key, $checked). $icon['title']."</div>";
}
foreach($pluglist as $key=>$icon)
{
$checked = (in_array($key,$columnsDefault)) ? TRUE : FALSE;
$text .= "<div class='left f-left list field-spacer' style='display:block;height:24px;width:200px;'>
".$icon['icon'].$frm->checkbox('e-columns[]', $key, $checked). $icon['title']."</div>";
}
$text .= " </div>
<div class='clear'>&nbsp;</div>
</div>";
$text .= "<div id='button' class='buttons-bar center'>"; // has issues with the checkboxes.
$text .= $frm->admin_button('submit-mye107','Save','Save');
$text .= " (TO-DO)</div>
</div>
</form>
";
// e107 News
$text .= "
<div id='core-infopanel_add' class='adminedit' >
<div style='border:1px solid silver;margin:10px'>
<div class='main_caption bevel left'><b>Add</b></div>
<div class='left block-text'>
Here we configure additional tabs. A list is shown of plugins that have their own 'infopanel' tab. e_infopanel.php ? ;-)
</div>
</div>
</div>
";
/*
foreach ($admin_cat['id'] as $cat_key => $cat_id)
{
$text_check = FALSE;
$text_cat = "<div class='adminedit' id='core-main_".$cat_key."'>
<div style='border:1px solid silver;margin:10px'>
<div class='main_caption bevel'><b>".$admin_cat['title'][$cat_key]."</b></div>
<table style='width:100%'>";
if ($cat_key != 5) // Note the Plugin category.
{
foreach ($newarray as $key => $funcinfo)
{
if ($funcinfo[4] == $cat_key)
{
$text_rend = render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], 'classis');
if ($text_rend)
{
$text_check = TRUE;
}
$text_cat .= $text_rend;
}
}
}
else // Plugin category.
{
$text_rend = getPluginLinks(E_32_PLUGMANAGER, "classis");
if ($text_rend)
{
$text_check = TRUE;
}
$text_cat .= $text_rend;
}
$text_cat .= render_clean();
$text_cat .= "</table></div>
</div>";
if ($text_check)
{
$text .= $text_cat;
}
}*/
$text .= "</div></div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text);
?>

View File

@@ -0,0 +1,90 @@
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| <20>Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/includes/tabbed.php,v $
| $Revision: 1.1 $
| $Date: 2009-07-04 03:08:03 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
require_once(e_HANDLER."message_handler.php");
$emessage = &eMessage::getInstance();
$text = "<div style='text-align:center'>
<div class='admintabs' id='tab-container'>
<ul class='e-tabs e-hideme' id='core-emote-tabs'>";
foreach ($admin_cat['id'] as $cat_key => $cat_id)
{
$text .= "<li id='tab-main_".$cat_key."'><img class='icon S16' src='".$admin_cat['img'][$cat_key]."' alt='' style='margin-right:3px' /><a href='#core-main_".$cat_key."'>".$admin_cat['title'][$cat_key]."</a></li>";
}
$text .= "</ul>";
foreach ($admin_cat['id'] as $cat_key => $cat_id)
{
$text_check = FALSE;
$text_cat = "<div class='adminedit' id='core-main_".$cat_key."'>
<div style='border:1px solid silver;margin:10px'>
<div class='main_caption bevel'><b>".$admin_cat['title'][$cat_key]."</b></div>
<table style='width:100%'>";
if ($cat_key != 5) // Note the Plugin category.
{
foreach ($newarray as $key => $funcinfo)
{
if ($funcinfo[4] == $cat_key)
{
$text_rend = render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], 'classis');
if ($text_rend)
{
$text_check = TRUE;
}
$text_cat .= $text_rend;
}
}
}
else // Plugin category.
{
$text_rend = getPluginLinks(E_32_PLUGMANAGER, "classis");
if ($text_rend)
{
$text_check = TRUE;
}
$text_cat .= $text_rend;
}
$text_cat .= render_clean();
$text_cat .= "</table></div>
</div>";
if ($text_check)
{
$text .= $text_cat;
}
}
$text .= "</div></div>";
$ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text);
?>

View File

@@ -391,7 +391,7 @@ ul,ol { list-style:none; }
.nowrap { white-space:nowrap; }
/* Core Icons */
img.icon { border: 0 }
img.icon { border: 0px }
img.icon.list { margin: 0px 5px 5px 0px }
img.icon.action { vertical-align: middle }
img.S16 { width: 16px; height: 16px }
@@ -526,6 +526,9 @@ label { cursor: pointer; }
.admintabs fieldset { clear: both ; border: 1px solid #DDDDDD; padding: 10px; border-top: 0px none; }
.admintabs fieldset legend { border: 1px solid #DDDDDD; }
.admintabs ul.e-tabs li.active { border-bottom: 1px solid #FFFFFF; background-color: #FFFFFF}
a.e-tabs {
text-decoration: none;
}
/******** SyS Messages / Message text formatting */
/* message boxes */
@@ -726,6 +729,13 @@ ul.plugin-navigation ul.plugin-navigation-sub a.link-active {font-weight: bold;}
.page-info { border: 1px solid #DDDDDD; margin-bottom: 10px; }
.page-info p { padding: 10px; }
/***** Admin Main Panel Buttons **/
.core-mainpanel-block { text-align:center; width:100px; float:left; height:48px; display:block }
.core-mainpanel-link-text { font-weight:bold; text-decoration: none; padding:3px }
#core-banlist-times .textarea { width: 98%; }
#core-emoticon-configure input.input-text { width: 300px; }