From d884cd5f6dea51c6bedd3efec3cb9ea4bd46ae2c Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Sat, 4 Jul 2009 03:08:03 +0000 Subject: [PATCH] Added InfoPanel admin layout and Tabbed category Layout. --- e107_admin/admin.php | 56 +++--- e107_admin/includes/infopanel.php | 286 ++++++++++++++++++++++++++++++ e107_admin/includes/tabbed.php | 90 ++++++++++ e107_themes/jayya/style.css | 12 +- 4 files changed, 423 insertions(+), 21 deletions(-) create mode 100644 e107_admin/includes/infopanel.php create mode 100644 e107_admin/includes/tabbed.php diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 367883ce7..b9bab6e35 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -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 .= ''; - $td = 1; - } - if ($td == 1) - { - $text .= ''; + if ($td == (ADLINK_COLS+1)) + { + $text .= ''; + $td = 1; + } + if ($td == 1) + { + $text .= ''; + } } if ($mode == 'default') { @@ -183,14 +187,20 @@ function render_links($link, $title, $description, $perms, $icon = FALSE, $mode } elseif ($mode == 'classis') { - $text .= "".$icon."
- ".$tp->toHTML($title,FALSE,"defs, emotes_off")."

"; + $text .= "".$icon."
+ ".$tp->toHTML($title,FALSE,"defs, emotes_off")."

"; } elseif ($mode == 'beginner') { - $text .= "".$icon." + $text .= "".$icon."
- ".$tp->toHTML($title,FALSE,"defs, emotes_off")."



"; + ".$tp->toHTML($title,FALSE,"defs, emotes_off")."


"; + } + elseif($mode == "div") + { + $text .= "
".$icon."
+ ".$tp->toHTML($title,FALSE,"defs, emotes_off")." +
"; } $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 ? "" : E_16_PLUGIN; + $plugin_icon = $eplug_icon_small ? "" : E_16_PLUGIN; } else { - $plugin_icon = $eplug_icon ? "" : E_32_PLUGIN; + $plugin_icon = $eplug_icon ? "" : 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); diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php new file mode 100644 index 000000000..c385881e3 --- /dev/null +++ b/e107_admin/includes/infopanel.php @@ -0,0 +1,286 @@ + +
+ "; + + +// 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 .= " + +
+
+
Welcome to your e107 Content Management System
+ +
+

".ucwords(USERNAME)."'s Admin Panel

+ Welcome to your Website Content Manager +
+ +
+ +
"; + + $text .= getPluginLinks(E_32_PLUGMANAGER, "div"); + + $text .="
 
+
+ +
+ To customize the icons that appear in this panel, please click here. +
+ + +
+
+ "; + +// e107 News + +$text .= " +
+
+
e107 News
+
+ RSS News feed from e107.org goes here. +
+
+
+ "; + + +// e107 latest + +$text .= " +
+
+ + +
+"; + +require_once(e_FILE."shortcode/batch/admin_shortcodes.php"); +$text .= $tp->parseTemplate("{ADMIN_LATEST}"); +$text .= ""; +$text .= $tp->parseTemplate("{ADMIN_STATUS}"); + + $text .= "
+ + +
+
+ "; + + +// Who's Online --------------------------------- + +$text .= " +
+
+
Who's Online
+
+
+ + + + + + + + + + + + + + + "; + + if($e107->sql->db_Select('online', '*')) + { + $newsarray = $e107->sql->db_getList(); + foreach($newsarray as $key=>$val) + { + $text .= " + + + + + "; + } + + } + + + + + $text .= "
TimestampUsernameLocation
".$val['online_timestamp']."".$val['online_user_id']."".$val['online_location']."
+
+
+ "; + + +// Customizer ------------------------------------------ + +$text .= " +
+
+
+
Customize your Admin Panel
+
"; + foreach($iconlist as $key=>$icon) + { + $checked = (in_array($key,$columnsDefault)) ? TRUE : FALSE; + $text .= "
+ ".$icon['icon'].$frm->checkbox('e-columns[]', $key, $checked). $icon['title']."
"; + } + + foreach($pluglist as $key=>$icon) + { + $checked = (in_array($key,$columnsDefault)) ? TRUE : FALSE; + $text .= "
+ ".$icon['icon'].$frm->checkbox('e-columns[]', $key, $checked). $icon['title']."
"; + + } + + + $text .= "
+
 
+
"; + $text .= "
"; // has issues with the checkboxes. + $text .= $frm->admin_button('submit-mye107','Save','Save'); + $text .= " (TO-DO)
+ +
+
+ "; + +// e107 News + +$text .= " +
+
+
Add
+
+ Here we configure additional tabs. A list is shown of plugins that have their own 'infopanel' tab. e_infopanel.php ? ;-) +
+
+
+ "; + + + /* + +foreach ($admin_cat['id'] as $cat_key => $cat_id) +{ + $text_check = FALSE; + + $text_cat = "
+
+
".$admin_cat['title'][$cat_key]."
+ "; + + + 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 .= "
+
"; + + if ($text_check) + { + $text .= $text_cat; + } +}*/ + + + +$text .= "
"; + +$ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text); + + + +?> diff --git a/e107_admin/includes/tabbed.php b/e107_admin/includes/tabbed.php new file mode 100644 index 000000000..d338c43a9 --- /dev/null +++ b/e107_admin/includes/tabbed.php @@ -0,0 +1,90 @@ + +
+ "; + + + +foreach ($admin_cat['id'] as $cat_key => $cat_id) +{ + $text_check = FALSE; + + $text_cat = "
+
+
".$admin_cat['title'][$cat_key]."
+ "; + + + 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 .= "
+
"; + + if ($text_check) + { + $text .= $text_cat; + } +} + + + +$text .= "
"; + +$ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text); + + + +?> diff --git a/e107_themes/jayya/style.css b/e107_themes/jayya/style.css index aaf53e0ff..0d4aeb766 100644 --- a/e107_themes/jayya/style.css +++ b/e107_themes/jayya/style.css @@ -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; }