From eb058409e89e9a44990ee2192e9e9c11b1160d12 Mon Sep 17 00:00:00 2001
From: Evgeny Gryaznov <inspirer@users.sourceforge.net>
Date: Mon, 16 Mar 2009 00:43:24 +0000
Subject: [PATCH] hiding items in main menu, proper title for login

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@410 c66351dc-e62f-0410-b875-e3a5c0b9693f
---
 src/messenger/webim/locales/en/properties |  1 +
 src/messenger/webim/locales/ru/properties |  4 +++-
 src/messenger/webim/view/inc_main.php     |  2 +-
 src/messenger/webim/view/inc_menu.php     |  2 +-
 src/messenger/webim/view/login.php        |  3 ++-
 src/messenger/webim/view/menu.php         | 28 ++++++++++++++++-------
 6 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties
index 68925be7..86347c8d 100644
--- a/src/messenger/webim/locales/en/properties
+++ b/src/messenger/webim/locales/en/properties
@@ -168,6 +168,7 @@ mailthread.perform=Send
 mailthread.title=Send chat history<br>by mail
 menu.agents=Agents list
 menu.blocked=Blocked visitors
+menu.departments=Departments
 menu.locale=Language
 menu.locale.content=Change locale.
 menu.main=Main
diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties
index 3f0db2ca..e49a7ee2 100644
--- a/src/messenger/webim/locales/ru/properties
+++ b/src/messenger/webim/locales/ru/properties
@@ -167,6 +167,7 @@ mailthread.perform=
 mailthread.title=��������� ������� ���������<br>�� �������� ����
 menu.agents=������ �������
 menu.blocked=������������� ����������
+menu.departments=������
 menu.locale=����
 menu.locale.content=������� ����.
 menu.main=�������
@@ -215,7 +216,7 @@ page.preview.userchat=Chat window (user-mode)
 page.translate.descr=���� ��� �� �������� �������, �������� ��� ��� �������.   
 page.translate.done=��� ������� ��������.
 page.translate.one=������� ��� ������� ��������.
-page.translate.title=������ �����������
+page.translate.title=�����������
 page_agent.clear_avatar=������� ��������
 page_agent.create_new=�������� ������ ���������
 page_agent.error.duplicate_login=�������� ������ �����, �.�. ����� � ��������� ������� ��� ��������������� � �������.
@@ -314,6 +315,7 @@ thread.chat_log=
 thread.intro=�� ������ �������� �� ������ ����������� ������.
 topMenu.admin=������������ ����
 topMenu.logoff=�����
+topMenu.main=�������
 topMenu.users=����������
 translate.direction=����������� ��������:
 translate.show.all=��� ������
diff --git a/src/messenger/webim/view/inc_main.php b/src/messenger/webim/view/inc_main.php
index 06dad88f..977175c2 100644
--- a/src/messenger/webim/view/inc_main.php
+++ b/src/messenger/webim/view/inc_main.php
@@ -18,7 +18,7 @@
 	<div id="header">
 		<div id="title">
 			<h1><img src="<?php echo $webimroot ?>/images/logo.gif" alt="" width="32" height="32" class="left" />
-				<a href="#"><?php echo $page['title'] ?></a></h1>
+				<a href="#"><?php echo isset($page['headertitle']) ? $page['headertitle'] : $page['title'] ?></a></h1>
 		</div>
 <?php if(isset($page) && isset($page['operator'])) { ?>
 		<div id="path"><p><?php echo getlocal2("menu.operator",array($page['operator'])) ?></p></div>
diff --git a/src/messenger/webim/view/inc_menu.php b/src/messenger/webim/view/inc_menu.php
index 9272fae4..9064db29 100644
--- a/src/messenger/webim/view/inc_menu.php
+++ b/src/messenger/webim/view/inc_menu.php
@@ -22,7 +22,7 @@ function tpl_menu() { global $page, $webimroot, $errors;
 				<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>
+					<li<?php menuli("departments")?>><a href="#"><?php echo getlocal('menu.departments') ?></a></li>
 					<li<?php menuli("getcode")?>><a href='<?php echo $webimroot ?>/operator/getcode.php'><?php echo getlocal('leftMenu.client_gen_button') ?></a></li>
 					<li<?php menuli("settings")?>><a href='<?php echo $webimroot ?>/operator/settings.php'><?php echo getlocal('leftMenu.client_settings') ?></a></li>
 					<li<?php menuli("translate")?>><a href='<?php echo $webimroot ?>/operator/translate.php'><?php echo getlocal('menu.translate') ?></a></li>
diff --git a/src/messenger/webim/view/login.php b/src/messenger/webim/view/login.php
index c5741d82..4a54dbc1 100644
--- a/src/messenger/webim/view/login.php
+++ b/src/messenger/webim/view/login.php
@@ -13,7 +13,8 @@
  */
 
 require_once('inc_locales.php');
-$page['title'] = getlocal("app.title");
+$page['title'] = getlocal("page_login.title");
+$page['headertitle'] = getlocal("app.title");
 $page['show_small_login'] = true;
 $page['fixedwrap'] = true;
 
diff --git a/src/messenger/webim/view/menu.php b/src/messenger/webim/view/menu.php
index 90256243..feb5ecbc 100644
--- a/src/messenger/webim/view/menu.php
+++ b/src/messenger/webim/view/menu.php
@@ -23,7 +23,13 @@ function tpl_header() { global $page, $webimroot;
 <?php
 }
 
-function tpl_content() { global $page, $webimroot, $current_locale;
+function menuseparator() {
+	global $menuItemsCount;
+	$menuItemsCount++;
+	if(($menuItemsCount%3) == 0) { echo "</tr><tr>"; }
+}
+
+function tpl_content() { global $page, $webimroot, $current_locale, $menuItemsCount;
 ?>
 
 <br/>   
@@ -47,7 +53,10 @@ function tpl_content() { global $page, $webimroot, $current_locale;
 			<?php echo getlocal('page_analysis.search.title') ?></a>
 		<?php echo getlocal('content.history') ?>
 	</td>
-<?php if( $page['showban'] ) { ?>
+<?php 
+$menuItemsCount = 2;
+if( $page['showban'] ) {
+?>
 	
 	<td class="dashitem">
 		<img src="/webim/images/dash/blocked.gif" alt=""/>
@@ -55,16 +64,18 @@ function tpl_content() { global $page, $webimroot, $current_locale;
 			<?php echo getlocal('menu.blocked') ?></a>
 		<?php echo getlocal('content.blocked') ?>
 	</td>
-<?php } ?>
-</tr>
-<?php if( $page['showadmin'] ) { ?>
-<tr>	
+	<?php menuseparator(); ?>
+<?php 
+}
+if( $page['showadmin'] ) { ?>
+	
 	<td class="dashitem">
 		<img src="/webim/images/dash/operators.gif" alt=""/>
 		<a href='<?php echo $webimroot ?>/operator/operators.php'>
 			<?php echo getlocal('leftMenu.client_agents') ?></a>
 		<?php echo getlocal('admin.content.client_agents') ?>
 	</td>
+	<?php menuseparator(); ?>
 	
 	<td class="dashitem">
 		<img src="/webim/images/dash/getcode.gif" alt=""/>
@@ -72,6 +83,7 @@ function tpl_content() { global $page, $webimroot, $current_locale;
 			<?php echo getlocal('leftMenu.client_gen_button') ?></a>
 		<?php echo getlocal('admin.content.client_gen_button') ?>
 	</td>
+	<?php menuseparator(); ?>
 
 	<td class="dashitem">
 		<img src="/webim/images/dash/settings.gif" alt=""/>
@@ -79,16 +91,16 @@ function tpl_content() { global $page, $webimroot, $current_locale;
 			<?php echo getlocal('leftMenu.client_settings') ?></a>
 		<?php echo getlocal('admin.content.client_settings') ?>
 	</td>
-</tr>
+	<?php menuseparator(); ?>
 <?php } ?>
 
-<tr>
 	<td class="dashitem">
 		<img src="/webim/images/dash/locale.gif"  alt=""/>
 		<a href='#' id="changelang">
 			<?php echo getlocal('menu.locale') ?></a>
 		<?php echo getlocal('menu.locale.content') ?>
 	</td>
+	<?php menuseparator(); ?>
 
 	<td class="dashitem">
 		<img src="/webim/images/dash/exit.gif" alt=""/>