From b7f9fc77baeb81d693781657da3accd09f2c8fd1 Mon Sep 17 00:00:00 2001
From: CaMer0n <cameron@e107coders.org>
Date: Thu, 22 Oct 2009 23:43:21 +0000
Subject: [PATCH] Some infopanel cleanup

---
 e107_admin/includes/infopanel.php             | 39 +++++++++++++------
 .../batch/admin_shortcodes_class.php          | 12 +++---
 2 files changed, 35 insertions(+), 16 deletions(-)

diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php
index 5032b7e80..31ea76dbc 100644
--- a/e107_admin/includes/infopanel.php
+++ b/e107_admin/includes/infopanel.php
@@ -11,8 +11,8 @@
  |     GNU General Public License (http://gnu.org).
  |
  |     $Source: /cvs_backup/e107_0.8/e107_admin/includes/infopanel.php,v $
- |     $Revision: 1.12 $
- |     $Date: 2009-09-18 23:14:00 $
+ |     $Revision: 1.13 $
+ |     $Date: 2009-10-22 23:43:15 $
  |     $Author: e107coders $
  +----------------------------------------------------------------------------+
  */
@@ -131,7 +131,8 @@ $text .= "
 			<tr>
 				<th>Timestamp</th>
 				<th>Username</th>
-				<th>Location</th>
+				<th>IP</th>
+				<th>Page</th>
 			</tr>
 		</thead>
 		<tbody>";
@@ -141,9 +142,10 @@ $text .= "
 		foreach ($newsarray as $key=>$val)
 		{
 			$text .= "<tr>
-				<td>".$val['online_timestamp']."</td>
-					<td>".$val['online_user_id']."</td>
-					<td>".$val['online_location']."</td>
+				<td class='nowrap'>".e107::getDateConvert()->convert_date($val['online_timestamp'],'short')."</td>
+					<td>".renderOnlineName($val['online_user_id'])."</td>
+					<td>".($val['online_ip'])."</td>
+					<td class='nowrap'><a href='".$val['online_location']."'>".$tp->text_truncate($val['online_location'],50)."</a></td>
 				</tr>
 				";
 		}
@@ -157,11 +159,13 @@ $text .= "
 
 	if (varset($user_pref['core-infopanel-menus']))
 	{
+
 		foreach ($user_pref['core-infopanel-menus'] as $val)
 		{
+			$id = $frm->name2id('core-infopanel_'.$val);
 			$text .= "
-			<div id='core-infopanel_{$val}' class='f-left' style='width:49%' >
-			<div style='border:1px solid silver;margin:10px'>
+			<div id='".$id."' class='f-left' style='width:24.5%' >
+			<div class='left' style='border:1px solid silver;margin:10px'>
 			";
 			$text .= $tp->parseTemplate("{PLUGIN=$val|TRUE}");
 			$text .= "
@@ -186,6 +190,17 @@ $text .= "</form>";
 $text .= "</div>";
 $ns->tablerender(ADLAN_47." ".ADMINNAME, $emessage->render().$text);
 
+
+
+function renderOnlineName($val)
+{
+	if($val==0)
+	{
+		return "Guest";
+	}
+	return $val;	
+}
+
 function render_info_panel($caption, $text)
 {
 	return "<div class='main_caption bevel left'><b>".$caption."</b></div>
@@ -258,9 +273,11 @@ function render_infopanel_menu_options()
 	{
 		while ($row = e107::getDb()->db_Fetch())
 		{
-			$checked = ($settings && in_array($row['menu_name'], $settings)) ? true : false;
-			$text .= "<div class='left f-left list field-spacer' style='display:block;height:24px;width:200px;'>";
-			$text .= $frm->checkbox_label($row['menu_name'], "e-mymenus[]", $row['menu_name'], $checked);
+			$label = str_replace("_menu","",$row['menu_name']);
+			$path_to_menu = $row['menu_path'].$row['menu_name'];
+			$checked = ($settings && in_array($path_to_menu, $settings)) ? true : false;
+			$text .= "\n<div class='left f-left list field-spacer' style='display:block;height:24px;width:200px;'>";
+			$text .= $frm->checkbox_label($label, "e-mymenus[]",$path_to_menu, $checked);
 			$text .= "</div>";
 		}
 	}
diff --git a/e107_files/shortcode/batch/admin_shortcodes_class.php b/e107_files/shortcode/batch/admin_shortcodes_class.php
index 4946b0c70..cb70f7f35 100644
--- a/e107_files/shortcode/batch/admin_shortcodes_class.php
+++ b/e107_files/shortcode/batch/admin_shortcodes_class.php
@@ -1,7 +1,7 @@
 <?php
 /*
 * Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
-* $Id: admin_shortcodes_class.php,v 1.26 2009-10-21 11:41:15 secretr Exp $
+* $Id: admin_shortcodes_class.php,v 1.27 2009-10-22 23:43:21 e107coders Exp $
 *
 * Admin shortcode batch - class
 */
@@ -275,7 +275,7 @@ class admin_shortcodes
 					$active_uploads = $sql -> db_Count('upload', '(*)', 'WHERE upload_active = 0');
 					$submitted_news = $sql -> db_Count('submitnews', '(*)', 'WHERE submitnews_auth = 0');
 
-					$text = "<div style='padding-bottom: 2px;'>".E_16_NEWS.($submitted_news ? " <a href='".e_ADMIN."newspost.php?sn'>".ADLAN_LAT_2.": $submitted_news</a>" : ' '.ADLAN_LAT_2.': 0').'</div>';
+					$text = "<div class='left'><div style='padding-bottom: 2px;'>".E_16_NEWS.($submitted_news ? " <a href='".e_ADMIN."newspost.php?sn'>".ADLAN_LAT_2.": $submitted_news</a>" : ' '.ADLAN_LAT_2.': 0').'</div>';
 					$text .= "<div style='padding-bottom: 2px;'>".E_16_UPLOADS.($active_uploads ? " <a href='".e_ADMIN."upload.php'>".ADLAN_LAT_7.": $active_uploads</a>" : ' '.ADLAN_LAT_7.': '.$active_uploads).'</div>';
 
 					if(vartrue($pref['e_latest_list']))
@@ -301,7 +301,7 @@ class admin_shortcodes
 					{
 						$text .= "<br /><b><a href='".e_ADMIN."message.php'>".ADLAN_LAT_8." [".$amount."]</a></b>";
 					}
-
+					$text .= "</div>";
 					return $ns -> tablerender(ADLAN_LAT_1, $text, '', TRUE);
 				}
 			}
@@ -814,7 +814,7 @@ class admin_shortcodes
 					$comments = $sql -> db_Count('comments');
 					$unver = ($unverified ? " <a href='".e_ADMIN."users.php?unverified'>".ADLAN_111."</a>" : ADLAN_111);
 
-					$text = "<div style='padding-bottom: 2px;'>".E_16_USER." ".ADLAN_110.": ".$members."</div>";
+					$text = "<div class='left'><div style='padding-bottom: 2px;'>".E_16_USER." ".ADLAN_110.": ".$members."</div>";
 					$text .= "<div style='padding-bottom: 2px;'>".E_16_USER." {$unver}: ".$unverified."</div>";
 					$text .= "<div style='padding-bottom: 2px;'>".E_16_BANLIST." ".ADLAN_112.": ".$banned."</div>";
 					$text .= "<div style='padding-bottom: 2px;'>".E_16_COMMENT." ".ADLAN_114.": ".$comments."</div>";
@@ -834,6 +834,7 @@ class admin_shortcodes
 					{
 						$text .= "<img src='".e_IMAGE."admin_images/failedlogin_16.png' alt='' class='icon S16' /> <a href='".e_ADMIN."fla.php'>".ADLAN_146.": $flo</a>";
 					}
+					$text .= "</div>";
 					return $ns -> tablerender(ADLAN_134, $text, '', TRUE);
 				}
 			}
@@ -947,6 +948,7 @@ class admin_shortcodes
 
 			function adnav_main($cat_title, $cat_link, $cat_img, $cat_id=FALSE, $cat_highlight='')
 			{
+				
 				$exit = "";
 				$text = "<a class='menuItem ".$cat_highlight."' href='".$cat_link."' ";
 				if ($cat_id)
@@ -1094,7 +1096,7 @@ class admin_shortcodes
 
 	function sc_admin_navigation($parm)
 	{
-
+		
 		if (!ADMIN) return '';
 		global $admin_cat, $array_functions, $array_sub_functions, $pref;