From 89af5b8ef3b3842d791c8164f0115f4566569979 Mon Sep 17 00:00:00 2001
From: Evgeny Gryaznov <inspirer@users.sourceforge.net>
Date: Sat, 14 Mar 2009 23:28:35 +0000
Subject: [PATCH] userhistory, localize right menu titles

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@407 c66351dc-e62f-0410-b875-e3a5c0b9693f
---
 src/messenger/webim/default.css               |   1 +
 src/messenger/webim/locales/en/properties     |   3 +
 src/messenger/webim/locales/ru/properties     |   3 +
 .../webim/styles/default/templates/chat.tpl   |   2 +-
 .../webim/styles/original/templates/chat.tpl  |   2 +-
 src/messenger/webim/view/inc_menu.php         |   6 +-
 src/messenger/webim/view/pending_users.php    |   2 +
 src/messenger/webim/view/userhistory.php      | 134 ++++++++----------
 8 files changed, 77 insertions(+), 76 deletions(-)

diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css
index decd00fa..e65f3292 100644
--- a/src/messenger/webim/default.css
+++ b/src/messenger/webim/default.css
@@ -189,6 +189,7 @@ img.left {
 	margin-bottom: 10px;
 	background: url(images/graydot.gif) repeat-x left bottom;
 	font-size: 1.3em;
+	font-weight: bold;
 }
 
 .locales a {
diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties
index 70cd4ef4..c9b0bc51 100644
--- a/src/messenger/webim/locales/en/properties
+++ b/src/messenger/webim/locales/en/properties
@@ -274,6 +274,9 @@ permission.takeover=Take over chat thread
 permission.viewthreads=View another operator's chat thread
 permissions.intro=Here you can control operator's permissions 
 permissions.title=Permissions
+right.administration=Administration
+right.main=Main
+right.other=Other
 settings.chat.title.description=Department of your company for example.
 settings.chat.title=Title in the chat window
 settings.chatstyle.description=Preview for all pages of each style is available <a href="preview.php">here</a>
diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties
index 77843a23..251b4cbf 100644
--- a/src/messenger/webim/locales/ru/properties
+++ b/src/messenger/webim/locales/ru/properties
@@ -272,6 +272,9 @@ permission.takeover=
 permission.viewthreads=������������� ������� ������ ���������� � ������ ��������� �������
 permissions.intro=����� �� ������ ���������� ����������� ���������
 permissions.title=����������� ���������
+right.administration=����������
+right.main=����������
+right.other=���������
 settings.chat.title.description=��������, �������� ������ ����� ��������
 settings.chat.title=��������� � ��� ����
 settings.chatstyle.description=������������ ���� ������� ������� ����� �������� <a href="preview.php">�����</a>
diff --git a/src/messenger/webim/styles/default/templates/chat.tpl b/src/messenger/webim/styles/default/templates/chat.tpl
index df08e62b..1afbd09b 100644
--- a/src/messenger/webim/styles/default/templates/chat.tpl
+++ b/src/messenger/webim/styles/default/templates/chat.tpl
@@ -175,7 +175,7 @@ ${if:canpost}
 				<img class="tplimage isend" src="${webimroot}/images/free.gif" border="0" alt="Redirect&nbsp;" /></a></td>
 ${endif:canpost}
 ${if:historyParams}
-				<td><a href="${page:historyParamsLink}" target="_blank" title="${msg:page.analysis.userhistory.title}" onclick="this.newWindow = window.open('${page:historyParamsLink}', 'UserHistory', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=703,height=380,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img class="tplimage ihistory" src="${webimroot}/images/free.gif" border="0" alt="History&nbsp;"/></a></td>
+				<td><a href="${page:historyParamsLink}" target="_blank" title="${msg:page.analysis.userhistory.title}" onclick="this.newWindow = window.open('${page:historyParamsLink}', 'UserHistory', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=720,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img class="tplimage ihistory" src="${webimroot}/images/free.gif" border="0" alt="History&nbsp;"/></a></td>
 ${endif:historyParams}
 ${endif:agent}
 				<td><a id="togglesound" href="javascript:void(0)" onclick="return false;" title="Turn off sound">
diff --git a/src/messenger/webim/styles/original/templates/chat.tpl b/src/messenger/webim/styles/original/templates/chat.tpl
index 20cffda6..57049dcb 100644
--- a/src/messenger/webim/styles/original/templates/chat.tpl
+++ b/src/messenger/webim/styles/original/templates/chat.tpl
@@ -170,7 +170,7 @@ ${if:canpost}
 				<img class="tplimage isend" src="${webimroot}/images/free.gif" border="0" alt="Redirect&nbsp;" /></a></td>
 ${endif:canpost}
 ${if:historyParams}
-				<td><a href="${page:historyParamsLink}" target="_blank" title="${msg:page.analysis.userhistory.title}" onclick="this.newWindow = window.open('${page:historyParamsLink}', 'UserHistory', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=703,height=380,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img class="tplimage ihistory" src="${webimroot}/images/free.gif" border="0" alt="History&nbsp;"/></a></td>
+				<td><a href="${page:historyParamsLink}" target="_blank" title="${msg:page.analysis.userhistory.title}" onclick="this.newWindow = window.open('${page:historyParamsLink}', 'UserHistory', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,width=720,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><img class="tplimage ihistory" src="${webimroot}/images/free.gif" border="0" alt="History&nbsp;"/></a></td>
 ${endif:historyParams}
 ${endif:agent}
 				<td><a id="togglesound" href="javascript:void(0)" onclick="return false;" title="Turn off sound">
diff --git a/src/messenger/webim/view/inc_menu.php b/src/messenger/webim/view/inc_menu.php
index 3eeb6bc8..9d00756d 100644
--- a/src/messenger/webim/view/inc_menu.php
+++ b/src/messenger/webim/view/inc_menu.php
@@ -10,7 +10,7 @@ function menuli($name) {
 function tpl_menu() { global $page, $webimroot, $errors;
 	if(isset($page) && isset($page['operator'])) { ?>
 			<li>
-				<h2><b>main</b></h2>
+				<h2><?php echo getlocal('right.main') ?></h2>
 				<ul class="submenu">
 					<li<?php menuli("main")?>><a href='<?php echo $webimroot ?>/operator/index.php'><?php echo getlocal('topMenu.main') ?></a></li>
 					<li<?php menuli("users")?>><a href='<?php echo $webimroot ?>/operator/users.php'><?php echo getlocal('topMenu.users') ?></a></li>
@@ -19,7 +19,7 @@ function tpl_menu() { global $page, $webimroot, $errors;
 				</ul>
 			</li>
 			<li>
-				<h2><b>administration</b></h2>
+				<h2><?php echo getlocal('right.administration') ?></h2>
 				<ul class="submenu">
 					<li<?php menuli("operators")?>><a href='<?php echo $webimroot ?>/operator/operators.php'><?php echo getlocal('leftMenu.client_agents') ?></a></li>
 					<li<?php menuli("departments")?>><a href="#">Departments</a></li>
@@ -28,7 +28,7 @@ function tpl_menu() { global $page, $webimroot, $errors;
 				</ul>
 			</li>
 			<li>
-				<h2><b>other</b></h2>
+				<h2><?php echo getlocal('right.other') ?></h2>
 				<ul class="submenu">
 					<li><a href='<?php echo $webimroot ?>/operator/logout.php'><?php echo getlocal('topMenu.logoff') ?></a></li>
 				</ul>
diff --git a/src/messenger/webim/view/pending_users.php b/src/messenger/webim/view/pending_users.php
index 1c74c33c..c55452f9 100644
--- a/src/messenger/webim/view/pending_users.php
+++ b/src/messenger/webim/view/pending_users.php
@@ -14,6 +14,8 @@
 
 require_once("inc_menu.php");
 $page['title'] = getlocal("clients.title");
+$page['menuid'] = "users";
+
 
 function tpl_header() { global $page, $webimroot;
 ?>	
diff --git a/src/messenger/webim/view/userhistory.php b/src/messenger/webim/view/userhistory.php
index b6e7174c..ece6c3bf 100644
--- a/src/messenger/webim/view/userhistory.php
+++ b/src/messenger/webim/view/userhistory.php
@@ -11,82 +11,74 @@
  * Contributors:
  *    Evgeny Gryaznov - initial API and implementation
  */
+
+$page['title'] = getlocal("page.analysis.userhistory.title");
+$page['menuid'] = "history";
+
+function tpl_content() { global $page, $webimroot;
 ?>
-<html>
-<head>
-
-
-
-<link rel="stylesheet" type="text/css" media="all" href="<?php echo $webimroot ?>/styles.css" />
-
-
-<link rel="shortcut icon" href="<?php echo $webimroot ?>/images/favicon.ico" type="image/x-icon"/>
-<title>
-	<?php echo getlocal("page.analysis.userhistory.title") ?> - <?php echo getlocal("app.title") ?>
-</title>
-
-<meta http-equiv="keywords" content="<?php echo getlocal("page.main_layout.meta_keyword") ?>">
-<meta http-equiv="description" content="<?php echo getlocal("page.main_layout.meta_description") ?>">
-</head>
-
-<body bgcolor="#FFFFFF" text="#000000" link="#2971C1" vlink="#2971C1" alink="#2971C1">
-
-<table width="100%" cellpadding="2" cellspacing="0" border="0">
-<tr>
-<td valign="top" class="text">
-
- <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="left" valign="top">
-		<h1><?php echo getlocal("page.analysis.userhistory.title") ?></h1>
- </td><td align="right" class="text" valign="top"><table cellspacing="0" cellpadding="0" border="0"><tr><td class="textform"><?php echo getlocal2("menu.operator",array($page['operator'])) ?></td></tr></table></td></tr></table>
-
-
 
 <?php echo getlocal("page.analysis.userhistory.intro") ?>
+<br />
+<br />
 
-<br/><br/>
+<?php if( $page['pagination'] ) { ?>
 
-<?php if( $page['pagination'] && $page['pagination.items'] ) { ?>
-	<table cellpadding="0" cellspacing="0" border="0" width="100%">
-		<tr>
-			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getlocal("page.analysis.search.head_name") ?></span></td><td width='3'></td>
-			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getlocal("page.analysis.search.head_host") ?></span></td><td width='3'></td>
-			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getlocal("page.analysis.search.head_operator") ?></span></td><td width='3'></td>
-			<td class='table' bgcolor='#276db8' height='30'><span class='header'><?php echo getlocal("page.analysis.search.head_time") ?></span></td>
-		</tr>
-		<?php foreach( $page['pagination.items'] as $chatthread ) { ?>
-			<tr>
-				<td height='30' class='table'>
-					<a href="<?php echo $webimroot ?>/operator/threadprocessor.php?threadid=<?php echo $chatthread['threadid'] ?>" target="_blank" onclick="this.newWindow = window.open('<?php echo $webimroot ?>/operator/threadprocessor.php?threadid=<?php echo $chatthread['threadid'] ?>', '', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,width=640,height=480,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><?php echo htmlspecialchars(topage($chatthread['userName'])) ?></a>
-				</td><td background='<?php echo $webimroot ?>/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $webimroot ?>/images/free.gif'></td>
-				<td height='30' class='table'>
-        			<?php echo get_user_addr(topage($chatthread['remote'])) ?>
-				</td><td background='<?php echo $webimroot ?>/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $webimroot ?>/images/free.gif'></td>
-				<td height='30' class='table'>
-        			<?php if( $chatthread['agentName'] ) { ?><?php echo htmlspecialchars(topage($chatthread['agentName'])) ?><?php } ?>
-				</td><td background='<?php echo $webimroot ?>/images/tablediv3.gif'><img width='3' height='1' border='0' alt='' src='<?php echo $webimroot ?>/images/free.gif'></td>
-				<td height='30' class='table'>
-					<?php echo date_diff($chatthread['modified']-$chatthread['created']) ?>, <?php echo strftime("%B, %d %Y %H:%M:%S", $chatthread['created']) ?>
-				</td>
-			</tr>
-			<tr><td height='2' colspan='7'></td></tr><tr><td bgcolor='#e1e1e1' colspan='7'><img width='1' height='1' border='0' alt='' src='<?php echo $webimroot ?>/images/free.gif'></td></tr><tr><td height='2' colspan='7'></td></tr>
-		<?php } ?>
-	</table>
-	<br />
-	<?php echo generate_pagination($page['pagination']) ?>
-<?php } ?>
-<?php if( $page['pagination'] && !$page['pagination.items'] ) { ?>
-	<br/><br/>
-	<table cellspacing='0' cellpadding='0' border='0'><tr><td background='<?php echo $webimroot ?>/images/loginbg.gif'><table cellspacing='0' cellpadding='0' border='0'><tr><td><img src='<?php echo $webimroot ?>/images/logincrnlt.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $webimroot ?>/images/logincrnrt.gif' width='16' height='16' border='0' alt=''></td></tr><tr><td></td><td align='center'><table border='0' cellspacing='0' cellpadding='0'>
-		<span class="table">
-			<?php echo getlocal("tag.pagination.no_items") ?>
-		</span>
-	</table></td><td></td></tr><tr><td><img src='<?php echo $webimroot ?>/images/logincrnlb.gif' width='16' height='16' border='0' alt=''></td><td></td><td><img src='<?php echo $webimroot ?>/images/logincrnrb.gif' width='16' height='16' border='0' alt=''></td></tr></table></td></tr></table>
-<?php } ?>
-
-</td>
-</tr>
+<table class="list">
+<thead>
+<tr class="header">
+<th>
+	<?php echo getlocal("page.analysis.search.head_name") ?>
+</th><th>
+	<?php echo getlocal("page.analysis.search.head_host") ?>
+</th><th>
+	<?php echo getlocal("page.analysis.search.head_operator") ?>
+</th><th>
+	<?php echo getlocal("page.analysis.search.head_time") ?>
+</th></tr>
+</thead>
+<tbody>
+<?php 
+if( $page['pagination.items'] ) {
+	foreach( $page['pagination.items'] as $chatthread ) { ?>
+	<tr>
+		<td>
+			<a href="<?php echo $webimroot ?>/operator/threadprocessor.php?threadid=<?php echo $chatthread['threadid'] ?>" target="_blank" onclick="this.newWindow = window.open('<?php echo $webimroot ?>/operator/threadprocessor.php?threadid=<?php echo $chatthread['threadid'] ?>', '', 'toolbar=0,scrollbars=1,location=0,status=1,menubar=0,width=720,height=520,resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;"><?php echo topage(htmlspecialchars($chatthread['userName'])) ?></a>
+		</td>
+		<td>
+        	<?php echo get_user_addr(topage($chatthread['remote'])) ?>
+		</td>
+		<td>
+        	<?php if( $chatthread['agentName'] ) { ?><?php echo topage(htmlspecialchars($chatthread['agentName'])) ?><?php } ?>
+		</td>
+		<td>
+			<?php echo date_diff($chatthread['modified']-$chatthread['created']) ?>, <?php echo strftime("%B, %d %Y %H:%M:%S", $chatthread['created']) ?>
+		</td>
+	</tr>
+<?php
+	} 
+} else {
+?>
+	<tr>
+	<td colspan="5">
+		<?php echo getlocal("tag.pagination.no_items.elements") ?>
+	</td>
+	</tr>
+<?php 
+} 
+?>
+</tbody>
 </table>
+<?php
+	if( $page['pagination.items'] ) { 
+		echo "<br/>";
+		echo generate_pagination($page['pagination']);
+	}
+} 
+?>
 
-</body>
-</html>
+<?php 
+} /* content */
 
+require_once('inc_main.php');
+?>
\ No newline at end of file