Index: /trunk/jabberit_messenger/index.php
===================================================================
--- /trunk/jabberit_messenger/index.php	(revision 382)
+++ /trunk/jabberit_messenger/index.php	(revision 417)
@@ -10,9 +10,9 @@
 
 	include("../header.inc.php");
-
+	
 	$jabberit_version = $GLOBALS['phpgw_info']['flags']['jabberit_version'];
-
+	
 	$template = CreateObject('phpgwapi.Template', PHPGW_APP_TPL);
-	$template->set_file(Array('jabberit_messenger' => 'index.tpl'));
+	$template->set_file(Array('jabberit_messenger' => 'indexIM.tpl'));
 	$template->set_block('jabberit_messenger','index');
 	$template->pfp('out','index');
Index: unk/jabberit_messenger/templates/default/css/common.css
===================================================================
--- /trunk/jabberit_messenger/templates/default/css/common.css	(revision 382)
+++ 	(revision )
@@ -1,161 +1,0 @@
-/* IM:WINDOW - ADD USER */
-
-div.add_organization_members
-{
-	margin-bottom: 30px;
-}
-
-div.add_organization_members span
-{
-	border-bottom: 1px solid #809aa9;
-	float:left;
-	font-size: 8pt !important;
-	font-family: Arial, Verdana, helvetica, sans-serif !important;
-	font-weight: bold;
-	position:aboslute;
-	width: 200px;
-}
-
-div.add_organization_members div
-{
-	font-weight: normal;
-	margin: 2px;
-	padding: 3px;
-	height: 230px;
-	overflow: auto;
-}
-
-div.add_organization_members div span
-{
-	background: url(../images/photo.png) no-repeat;
-	border-bottom: 1px dashed #809aa9;
-	border-right: 1px dashed #809aa9;
-	clear:both;
-	float:left;
-	font-weight: normal;
-	height: 65px;
-	letter-spacing: 0.2em;
-	padding: 4px 0 4px 80px;
-	margin-bottom: 20px;
-	width: 300px;
-}
-
-div.add_organization_members div#im_ldap_ou
-{
-	float: left;
-	width: 200px;
-}
-
-div.add_member_info
-{
-	margin: 10px 0;
-	display: none;
-}
-
-div.add_member_info span
-{
-	float: left;
-	font: 8pt Verdana, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	margin-right: 3px;
-	text-align: right;
-	width: 80px;
-}
-
-div.add_action
-{
-	padding-bottom: 30px;
-	margin-left: 83px;
-	display: none;
-}
-
-div.add_action span
-{
-	background: #dedede;
-	border: 1px solid;
-	float: left;
-	font: 8pt Verdana, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	letter-spacing: 1px;
-	margin-right: 5px;
-	padding: 0 15px;
-	text-align: center;
-	line-height: 1.5em;
-}
-
-div.search_user 
-{
-	font-size: 8pt !important;
-	font-family: Arial, Verdana, helvetica, sans-serif !important;
-	font-weight: bold;
-	margin: 0 0 0 5px;
-}
-
-.search_user_button
-{
-	border: 1px solid #000 !important;
-}
-
-span.im_button
-{
-	background: #dedede;
-	border: 1px solid;
-	font: 8pt Verdana, Arial, Helvetica, sans-serif;
-	font-weight: bold;
-	letter-spacing: 1px;
-	padding: 0 15px;
-	text-align: center;
-	line-height: 1.5em;
-}
-
-div.loading
-{
-	background: #fdd url(../images/loading.gif) no-repeat 1px 1px;
-	border: 1px dashed #f00;
-	margin:	2px;
-	padding: 3px 3px 3px 20px;
-	text-align: center;
-}
-
-span.message_time
-{
-	color: #aaa;
-	font: 8pt Verdana, Arial, Helvetica, sans-serif;
-}
-
-.font_menu
-{
-	font: 8pt Verdana, Arial, Helvetica, sans-serif;
-}
-
-.layer
-{
-	background: url(../images/photo.png) no-repeat 2px 2px;
-	border:	1px solid #dedede;
-	height: 65px;
-	margin:	2px;
-	padding: 2px 0px 2px 54px;
-}
-
-/* Disconnected */
-
-.disconnected
-{
-	font: 9pt Verdana, Arial, Helvetica, sans-serif;
-	border: 1px solid #dedede;
-	margin: 2px;
-}
-
-/* Vcard */
-
-.vcard_user
-{
-	font: 9pt Verdana, Arial, Helvetica, sans-serif;
-	margin:10px;
-}
-
-.vcard_contact
-{
-	font: 9pt Verdana, Arial, Helvetica, sans-serif;
-	margin:10px;
-}
Index: unk/jabberit_messenger/templates/default/css/window.css
===================================================================
--- /trunk/jabberit_messenger/templates/default/css/window.css	(revision 382)
+++ 	(revision )
@@ -1,108 +1,0 @@
-/***** Cantos Arredondados *****/
-.corner { display: block; }
-.corner * { display: block; height: 1px; overflow: hidden; font-size: 0; }
-.corner1 { padding: 0 1px; margin: 0 3px; }
-.corner2 { padding: 0 1px; margin: 0 1px; }
-.corner3 { margin: 0 1px; }
-.blackcorner *{ background: #dedede; }
-/***** Cantos Arredondados *****/
-
-/***** Window  *****/
-.window
-{
-	font: 10pt Verdana, Arial, Helvetica, sans-serif;
-	margin: 0px;
-	position:fixed;
-}
-
-* html .window
-{
-	position:absolute;
-}
-
-#jabberit_messenger_content .body
-{
-	background: #dedede;
-}
-
-#jabberit_messenger_content .titulo
-{
-	background: #dedede;
-	cursor: pointer;
-	font: 8pt Verdana, Arial, Helvetica, sans-serif;
-	height: 20px;
-	line-height: 1.5em;
-	margin: 0 0;
-	overflow: hidden;
-	padding: 0 0 0 5px;
-}
-
-#jabberit_messenger_content .titulo .icon
-{
-	float:left;
-	height: 15px;
-	width: 15px;
-}
-
-#jabberit_messenger_content .titulo span
-{
-	float:left;
-	margin-left: 2px;
-}
-
-#jabberit_messenger_content .buttons
-{
-	position:absolute !important;
-	right:3px !important;
-	width:50px !important;
-}
-
-#jabberit_messenger_content .titulo .buttons div
-{
-	cursor: pointer;
-	float: right;
-	margin-right: 2px;
-	position: relative;
-	width: 13px;
-	height:13px;
-}
-
-#jabberit_messenger_content .button_minimize
-{
-	background: #dedede url(../images/window_min.gif) no-repeat top center;
-}
-
-#jabberit_messenger_content .button_maximize1
-{
-	background: #dedede url(../images/window_max1.gif) no-repeat top center;
-}
-
-#jabberit_messenger_content .button_maximize
-{
-	background: #dedede url(../images/window_max.gif) no-repeat top center;
-}
-
-#jabberit_messenger_content .button_close
-{
-	background: #dedede url(../images/window_close.gif) no-repeat top center;
-	margin-right: 0px;
-}
-
-#jabberit_messenger_content .content
-{
-	font: 9pt Verdana, Arial, Helvetica, sans-serif;
-	background: #fff;
-	border: 1px solid;
-	border-color: #b3b3b3 #dedede #dedede #b3b3b3;
-	margin: 0px 5px;
-	cursor: default;
-	overflow: auto;
-}
-
-#jabberit_messenger_content .rodape
-{
-	background: #dedede; 
-	height: 15px;
-}
-
-/***** Window - *****/
Index: unk/jabberit_messenger/templates/default/config.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/default/config.tpl	(revision 382)
+++ 	(revision )
@@ -1,89 +1,0 @@
-<!-- BEGIN header -->
-<!--script type="text/javascript" src="instant_messenger/js/connector.js"></script>
-<script type="text/javascript" src="instant_messenger/js/xtools.js"></script>
-<script type="text/javascript" src="instant_messenger/controller.php?act=j.setup"></script>
-<script type="text/javascript">
-	var PostForm = new constructScript;
-</script-->
-<form method="POST" action="{action_url}">
-<table border="0" align="center">
-   <tr bgcolor="{th_bg}">
-    <td colspan="2"><font color="{th_text}">&nbsp;<b>{title} - Jetti Applet</b></font></td>
-   </tr>
-<!-- END header -->
-
-<!-- BEGIN body -->
-   <tr bgcolor="{row_on}">
-    <td colspan="2">&nbsp;</td>
-   </tr>
-
-   <tr bgcolor="{row_off}">
-    <td colspan="2">&nbsp;<b>Configuração do Servidor Jabber com Jeti Applet</b></td>
-   </tr>
-
-   <tr bgcolor="{row_on}">
-    <td>Digite o nome do Servidor Jabber:</td>
-    <td><input type="text" id="JETTI_name_jabberit" name="newsettings[name_jabberit]" value="{value_name_jabberit}"></td>
-   </tr>
-
-   <tr bgcolor="{row_off}">
-    <td>Digite a porta do Servidor Jabber:</td>
-    <td><input type="text" id="JETTI_port_jabberit" name="newsettings[port_jabberit]" value="{value_port_jabberit}"></td>
-   </tr>
-   
-   <tr bgcolor="{row_on}">
-    <td>Digite Nome da Conexão:</td>
-    <td><input type="text" id="JETTI_resource_jabberit" name="newsettings[resource_jabberit]" value="{value_resource_jabberit}"></td>
-   </tr>
-   
-   <tr bgcolor="{row_off}">
-    <td>Digite GroupChatServer :</td>
-    <td><input type="text" id="JETTI_group_chat_server_jabberit" name="newsettings[group_chat_server_jabberit]" value="{value_group_chat_server_jabberit}" size="30"></td>
-   </tr>
-
-   <tr bgcolor="{row_on}">
-    <td>SSL:</td>
-    <td>
-		<select name="newsettings[use_ssl_jabberit]">
-			<option value="false" {selected_use_ssl_jabberit_false}>FALSE</option>
-			<option value="true" {selected_use_ssl_jabberit_true}>TRUE</option>
-		</select>
-	</td>
-   </tr>
-
-   <tr color="{row_off}">
-    <td colspan="2">&nbsp;<b>Configuração do Servidor Ldap</b></td>
-   </tr>
-
-   <tr bgcolor="{row_on}">
-    <td>Servidor Ldap:</td>
-    <td><input type="text" id="JETTI_server_ldap_jabberit" name="newsettings[server_ldap_jabberit]" value="{value_server_ldap_jabberit}"></td>
-   </tr>
-
-   <tr bgcolor="{row_off}">
-    <td>Contexto:</td>
-    <td><input type="text" id="JETTI_context_ldap_jabberit" name="newsettings[context_ldap_jabberit]" value="{value_context_ldap_jabberit}" size="30"></td>
-   </tr>
-
-   <tr bgcolor="{row_on}">
-    <td>Usuário Ldap:</td>
-    <td><input type="text" id="JETTI_user_ldap_jabberit" name="newsettings[user_ldap_jabberit]" value="{value_user_ldap_jabberit}" size="30"></td>
-   </tr>
-
-   <tr bgcolor="{row_off}">
-    <td>Password:</td>
-    <td><input type="password" id="JETTI_password_ldap_jabberit" name="newsettings[password_ldap_jabberit]" value="{value_password_ldap_jabberit}"></td>
-   </tr>
-
-<!-- END body -->
-
-<!-- BEGIN footer -->
-  <tr>
-    <td colspan="2" align="center">
-      <input type="submit" name="submit" value="{lang_submit}"> <!--onclick="javascript:PostForm.sendf(document);return false;"-->
-      <input type="submit" name="cancel" value="{lang_cancel}">
-    </td>
-  </tr>
-</table>
-</form>
-<!-- END footer -->
Index: unk/jabberit_messenger/templates/default/index.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/default/index.tpl	(revision 382)
+++ 	(revision )
@@ -1,135 +1,0 @@
-<!-- BEGIN index -->
-    <h1>Como Utilizar o Jabberit Messenger</h1>
-    <h2><a name="toc">Conteúdo</a></h2>
-    <ol>
-      <li><a href="#intro">Introdução</a>
-      <li><a href="#supported">Browsers Suportados</a>
-	  <li><a href="#prefe">Opções - Troca de Status</a>
-		<ol>
-			<li><a href="#conf_status">Mensagens de Status</a>
-		</ol>
-	  <li><a href="#contact_list">Lista de Contatos</a>
-        <ol>
-          <li><a href="#status">Indicador de Status</a>
-          <li><a href="#useradd">Adicionando um novo contato</a>
-        </ol>
-      <li><a href="#menu_right">Preferências Avançadas</a>
-	  <li><a href="#troca_mens">Troca de Mensagens</a>
-    </ol>
-
-    <h2><a name="intro">1. Introdução</a></h2>
-    
-    O JabberIT Messenger é uma aplicação que permite o envio e recebimento de mensagens instantaneamente. Através da sua lista de contatos, você pode trocar mensagens e arquivos com seus contatos. Através da lista também é possível saber se seus contatos estão Online ou Offline. Para a troca de mensagens basta clicar em cima do nome do seu contato, se o mesmo estiver online ( verifique a sessão <a href="#status">Indicador de Status</a> ) abrirá uma janela onde você poderá enviar/receber as mensagens. O JabberIT Messenger está associado
-    a um serviço de mensagens instantâneas Jabber e este serviço é responsável pelo armazenamento dos seus contatos, preferências e mensagens.
-
-	<br clear="all">
-	<br>
-	( figura 1 )
-    <img src="templates/default/images/tela_inicial.png" style="width:200px; height:297px;" alt="Im Screenshot" title="Im Screenshot" align="left" style="padding-right:4px;"> 
-	
-    <br clear="all">
-
-    <h2><a name="supported">2. Browsers Suportados</a></h2>
-
-    <p>
-      <b>Windows XP/2000/ME/98/95:</b>
-	  <ul>
-	    <!--li>MS Internet Explorer desde a versão 6.0</li-->
-	    <li>Internet Explorer 6.0</li>
-	    <li>Mozilla Firefox desde a versão 2.0</li>
-	    <li>Mozilla Firefox desde a versão 3.0</li>
-	  </ul>
-	  
-    <p>
-      <b>Linux:</b>
-      <ul>
-	    <li>Mozilla Firefox desde a versão 2.0</li>
-	    <li>Mozilla Firefox desde a versão 3.0</li>
-      </ul>
-    </p>
-
-	<h2><a name="prefe">3. Opções - Troca de Status</a></h2>
-	( figura 2 )
-    <img src="templates/default/images/menu_opcoes.png" style="width:135px; height:227px; margin-top:5px;" alt="Menu Opções" title="Menu Opções" align="left"/>
-    <br clear="all">
-    <br>
-
-	Para a troca de status ( conforme figura 2 ), basta dar um clique com o mouse e em cima do botão <img src="templates/default/images/botao_opcoes.png" width="99" height="19" style="margin-left:5px; margin-right:5px;"/> .
-
-
-    <h3><a name="conf_status">1. Mensagens de Status</a></h3>
-	( figura 3 )
-
-	<img src="templates/default/images/conf_status.png" style="width:249px; height:277px; margin-top:5px;" alt="Mensagens de Status" title="Mensagens de Status" align="left"/>
-	<br clear="all">
-	<br>
-
-	É possível configurar as mensagens para cada status escolhido ( conforme figura 3 ) clicando no item Personalizar.
-
-	<br clear="all">
-	<br>
-
-    <h2><a name="contact_list">4. Lista de Contatos</a></h2>
-	( figura 4 )
-    <img src="templates/default/images/lista_contatos.png" width="188" height="255" alt="Lista de Contatos" align="left" style="margin:5px;"/>
-    <br clear="all">
-    <br>
-    
-    Na lista de contato ( conforme figura 4 ), você visualizará seus contatos. 
-    <h3><a name="status">1. Status dos Usuários</a></h3>
-    
-    <img src="templates/default/images/available.png" style="margin:1px;" align="top"> - Disponível<br/>
-    <img src="templates/default/images/away.png" style="margin:1px;" align="top"> - Ausente<br/>
-    <img src="templates/default/images/chat.png" style="margin:1px;" align="top"> - Bate-papo<br/>
-    <img src="templates/default/images/dnd.png" style="margin:1px;" align="top"> - Não Perturbe<br/>
-    <img src="templates/default/images/invisible.png" style="margin:1px;" align="top"> - Invisível<br/>    
-    <img src="templates/default/images/offline.png" style="margin:1px;" align="top"> - Offline / Desconectado<br/>    
-    <img src="templates/default/images/xa.png" style="margin:1px;" align="top"> - Ausência Prolongada<br/>    
-
-    <h3><a name="useradd">2. Adicionando um novo contato </a></h3>
-	( figura 4.1 )
-	<br/>
-    <img src="templates/default/images/adicionar_contato.png" width="237" height="174" alt="Adicionar Contato" title="Adicionar Contato" align="left" style="margin-top:5px;"/>
-    <br clear="all"/>
-    <br>
-
-	Para adicinar um novo contato, clique na imagem <img src="templates/default/images/group_open.gif"/>, no canto superior esquerdo ( conforme figura 4.1 ) e abrirá uma janela para adição dos contatos ( conforme figura 4.2 ) e automaticamente carregará os usuários que tem permissão para usar o Mensageiro Instantâneo Expresso. 
-	Para escolher seu novo contato basta apenas dar um clique em cima do nome desejado. Logo abaixo, dois campos serão necessários para adicionar o novo contato, sendo que o campo "Apelido" e
-	é preenchido no momento da escolha do novo contato e o campo grupo terá que ser definido. Tendo os dois campos preenchidos basta clicar no Botão Adicionar .
-	
-	<br/>
-	<br/>
-	( figura 4.2 )
-	<br/>
-	<img src="templates/default/images/janela_adicionar_contatos.png" width="612" height="237" style="margin-top:5px;" alt="Adicionar Contato" title="Adicionar Contato"/>
-	<br clear="all"/>
-	<br/>
-
-    <h2><a name="menu_right">5. Preferências Avançadas</a></h2>
-	( figura 5 )
-	<br/>
-    <img src="templates/default/images/menu_right.png" width="234" height="145" alt="Preferências Avançadas" align="left" style="margin-top:5px;"/>
-    <br clear="all"/>
-    <br/>
-
-    Clicando com o botão direito do mouse, você tera acesso a um menu ( conforme figura 5 ), com as seguintes funcionalidades :
-
-    <ul>
-      <li>Autorizações : Requisitar e autorizar permissões ( Depois de adicionar um novo contato, é importante solicitar a autorização ).
-      <li>Grupo: Trocar / Adicionar / Remover do grupo.
-      <li>Renomear : Renomeia o contato.
-      <li>Remover: Exclui o contato.
-    </ul>
-
-    <h2><a name="troca_mens">6. Troca de Mensagens</a></h2>
-	( figura 6 )
-    <img src="templates/default/images/troca_de_mensagem.png" width="410" height="309" alt="Troca de Mensagens" title="Troca de Mensagens" align="left" style="margin-top:5px;"/>
-    <br clear="all"/>
-    <br/>
-
-	Clicando com o mouse em cima do nome do contato escolhido, abrirá uma janela ( conforme figura 6 ), para a troca de mensagens. Nessa mesma janela existe um menu, o qual é possível
-	configurar o formato da fonte e enviar smiles.
-
-	<br/>
-	<hr noshade>
-<!-- END index -->
Index: /trunk/jabberit_messenger/templates/celepar/config.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/config.tpl	(revision 402)
+++ /trunk/jabberit_messenger/templates/celepar/config.tpl	(revision 417)
@@ -52,5 +52,5 @@
    </tr>
 
-   <!--tr bgcolor="{row_off}">
+   <tr bgcolor="{row_off}">
    	<td>Usar Proxy do Java:</td>
    	<td>	
@@ -60,5 +60,5 @@
    		</select>
    	</td>
-   </tr-->
+   </tr>
 
    <tr color="{row_off}">
Index: /trunk/jabberit_messenger/templates/celepar/module.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/module.tpl	(revision 417)
+++ /trunk/jabberit_messenger/templates/celepar/module.tpl	(revision 417)
@@ -0,0 +1,40 @@
+<!-- BEGIN module -->
+<form method="POST" action="{action_url}">
+<table align="center" width="60%" cellspacing="2" style="border: 1px solid #000000;">
+	<tr class="th">
+		<td colspan="2">&nbsp;<b>{lang_Settings_Use_Module_Expresso_Messenger}</b></td>
+	</tr>
+	<tr class="row_off">
+		<td colspan="2">
+			<table align="center" cellspacing="0" style="margin-top:15px">
+				<tr>
+					<td class="row_off">	
+						{lang_Applications_List} :
+						<br/>
+						<select id="apps_list" size="10" style="width: 300px" multiple>{apps_list}</select>
+					</td>
+					<td class="row_off">
+						<input type="button" value="Adicionar" onclick="javascript:App.add();" />
+						<br/>
+						<br/>
+						<input type="button" value="Remover" onclick="javascript:App.remove();" />
+					</td>
+					<td class="row_off">
+						{lang_Applications_habilitadas} :
+						<br/>
+						<select id="apps_enabled" size="10" style="width: 300px" multiple name="apps_enabled[]">{apps_enabled}</select>
+					</td>
+				</tr>
+			</table>
+		</td>
+	</tr>
+	<tr>
+		<td colspan="2" align="center">
+		  <input type="submit" name="save" value="{lang_save}" onclick="javascript:App.select_();">
+		  <input type="submit" name="cancel" value="{lang_cancel}">
+		  <br>
+		</td>
+	</tr>
+</table>
+</form>
+<!-- END module -->
Index: /trunk/jabberit_messenger/templates/celepar/css/common.css
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/css/common.css	(revision 382)
+++ /trunk/jabberit_messenger/templates/celepar/css/common.css	(revision 417)
@@ -3,5 +3,5 @@
 div.add_organization_members
 {
-	margin-bottom: 10px;
+	margin-bottom: 30px;
 }
 
@@ -22,5 +22,5 @@
 	margin: 2px;
 	padding: 3px;
-	height: 150px;
+	height: 230px;
 	overflow: auto;
 }
@@ -28,11 +28,15 @@
 div.add_organization_members div span
 {
+	background: url(../images/photo.png) no-repeat;
 	border-bottom: 1px dashed #809aa9;
+	border-right: 1px dashed #809aa9;
 	clear:both;
 	float:left;
 	font-weight: normal;
+	height: 65px;
 	letter-spacing: 0.2em;
-	padding: 4px 0;
-	width: 98%
+	padding: 4px 0 4px 80px;
+	margin-bottom: 20px;
+	width: 300px;
 }
 
@@ -78,4 +82,17 @@
 	text-align: center;
 	line-height: 1.5em;
+}
+
+div.search_user 
+{
+	font-size: 8pt !important;
+	font-family: Arial, Verdana, helvetica, sans-serif !important;
+	font-weight: bold;
+	margin: 0 0 0 5px;
+}
+
+.search_user_button
+{
+	border: 1px solid #000 !important;
 }
 
Index: /trunk/jabberit_messenger/templates/celepar/jabberIM.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/jabberIM.tpl	(revision 417)
+++ /trunk/jabberit_messenger/templates/celepar/jabberIM.tpl	(revision 417)
@@ -0,0 +1,20 @@
+<!-- BEGIN index -->
+<html> 
+	<head></head>
+	<body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
+		<applet name='jeti' archive='{path}applet.jar?{file0},{path}plugins/groupchat.jar?{file1},{path}plugins/sound.jar?{file2},{path}plugins/xhtml.jar?{file3}' code='nu.fw.jeti.applet.Jeti.class' width='100%' height='400px'>
+		<param name='SERVER' value='{value_server}'>
+		<param name='HOST' value='{value_host}'>
+		<param name='PORT' value='{value_port}'>
+		<param name='RESOURCE' value='{value_resource}'>
+		<param name='USER' value='{value_user}'>
+		<param name='PASSWORD'	value='{value_password}'>
+		<param name='SSL' value='{value_ssl}'>
+		<param name='HIDELOGINSTATUS' value='TRUE'>
+		<param name='USEPROXY' value='{value_userproxy}'>
+		<param name='EXPRESSO' value='{value_expresso}'>
+		<param name='EXTIPAGE' value='javascript:window.close();'>
+		</applet>
+	</body>
+</html>
+<!-- END index -->
Index: /trunk/jabberit_messenger/templates/celepar/indexIM.tpl
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/indexIM.tpl	(revision 417)
+++ /trunk/jabberit_messenger/templates/celepar/indexIM.tpl	(revision 417)
@@ -0,0 +1,141 @@
+<!-- BEGIN index -->
+    <h1>Expresso Messenger - Como Utilizar</h1>
+    <ol>
+      <li><a href="#intro">Introdução</a>
+      <li><a href="#supported">Browsers Suportados</a>
+	  <li><a href="#prefe">Opções - Troca de Status</a>
+	  <li><a href="#conf_status">Mensagens de Status</a>
+	  <li><a href="#contact_list">Lista de Contatos</a>
+      <li><a href="#status">Indicador de Status</a>
+      <li><a href="#useradd">Adicionando um novo contato</a>
+      <li><a href="#menu_right">Preferências Avançadas</a>
+	  <li><a href="#troca_mens">Troca de Mensagens</a>
+	  <li><a href="#certi_java">Assinatura de Applet - Java</a>	  
+    </ol>
+
+    <h2><a name="intro">1. Introdução</a></h2>
+    
+    O JabberIT Messenger é uma aplicação que permite o envio e recebimento de mensagens instantaneamente. Através da sua lista de contatos, você pode trocar mensagens e arquivos com seus contatos. Através da lista também é possível saber se seus contatos estão Online ou Offline. Para a troca de mensagens basta clicar em cima do nome do seu contato, se o mesmo estiver online ( verifique a sessão <a href="#status">Indicador de Status</a> ) abrirá uma janela onde você poderá enviar/receber as mensagens. O JabberIT Messenger está associado
+    a um serviço de mensagens instantâneas Jabber e este serviço é responsável pelo armazenamento dos seus contatos, preferências e mensagens.
+	<br>
+	<br>
+	<img src="templates/celepar/images/tela_inicial.png" style="width:228px; height:442px;" alt="Im Screenshot" title="Im Screenshot" align="left" style="padding-right:4px;"> 
+    <br clear="all">
+	( figura 1 )
+    <h2><a name="supported">2. Browsers Suportados</a></h2>
+
+    <p>
+      <b>Windows XP/2000/ME/98/95:</b>
+	  <ul>
+	    <!--li>MS Internet Explorer desde a versão 6.0</li-->
+	    <li>Internet Explorer 6.0</li>
+	    <li>Mozilla Firefox desde a versão 2.0</li>
+	    <li>Mozilla Firefox desde a versão 3.0</li>
+	  </ul>
+	  
+    <p>
+      <b>Linux:</b>
+      <ul>
+	    <li>Mozilla Firefox desde a versão 2.0</li>
+	    <li>Mozilla Firefox desde a versão 3.0</li>
+      </ul>
+    </p>
+	<h2><a name="prefe">3. Opções - Troca de Status</a></h2>
+	<br/>
+	Para a troca de status ( conforme figura 2 ), basta dar um clique com o mouse e em cima do botão <img src="templates/celepar/images/botao_opcoes.png" width="116" height="21" style="margin-left:5px; margin-right:5px;"/> .
+	<br/>
+	<br/>
+    <img src="templates/celepar/images/menu_opcoes.png" style="width:180px; height:213px; margin-top:5px;" alt="Menu Opções" title="Menu Opções" align="left"/>
+    <br clear="all">
+	( figura 2 )    
+    <h2><a name="conf_status">4. Mensagens de Status</a></h2>
+    <br/>
+    É possível configurar as mensagens para cada status escolhido (figura 3) clicando no item Personalizar.<br><br>
+	<img src="templates/celepar/images/conf_status.png" style="width:317px; height:235px; margin-top:5px;" alt="Mensagens de Status" title="Mensagens de Status" align="left"/>
+	<br clear="all"/>
+	( Figura 3 )
+	<br clear="all"/>
+	<h2><a name="contact_list">5. Lista de Contatos</a></h2>
+	<br/>
+    Na lista de contato ( conforme figura 4 ), você visualizará seus contatos.	
+    <br/>
+    <br/>
+    <img src="templates/celepar/images/lista_contatos.png" width="214" height="185" alt="Lista de Contatos" align="left" style="margin:5px;"/>
+    <br clear="all">
+    ( figura 4 )
+    <br/>
+    <h2><a name="status">6. Status dos Usuários</a></h2>
+    <img src="templates/celepar/images/available.png" style="margin:1px;" align="top"> - Disponível<br/>
+    <img src="templates/celepar/images/away.png" style="margin:1px;" align="top"> - Ausente<br/>
+    <img src="templates/celepar/images/chat.png" style="margin:1px;" align="top"> - Bate-papo<br/>
+    <img src="templates/celepar/images/dnd.png" style="margin:1px;" align="top"> - Não Perturbe<br/>
+    <img src="templates/celepar/images/invisible.png" style="margin:1px;" align="top"> - Invisível<br/>    
+    <img src="templates/celepar/images/unavailable.png" style="margin:1px;" align="top"> - Offline / Desconectado<br/>    
+    <img src="templates/celepar/images/xa.png" style="margin:1px;" align="top"> - Ausência Prolongada<br/>    
+    <h2><a name="useradd">7. Adicionando um novo contato </a></h2>
+	<br/>
+	Para adicionar um novo contato, clique na imagem <img src="templates/celepar/images/group_open.gif"/>, no canto superior esquerdo (figura 5) e abrirá uma janela para adição dos contatos (figura 6) e
+	faça uma pesquisa pelo nome. O resultado retornará <u>somente</u> os usuários que <u>tem permissão</u> para usar o Mensageiro Instantâneo do Expresso. 
+	Clique sobre o link "Adicionar Contato" e aparecerá dois campos, sendo que o campo "Apelido" é preenchido no momento da escolha do novo contato e o campo grupo
+	terá que ser definido. Preenchendo estes dois campos basta clicar no "Botão Adicionar", e o contato será adicionado em sua Lista de Contatos.
+	<br/>
+	<br/>
+    <img src="templates/celepar/images/adicionar_contato.png" width="247px" height="191px" alt="Adicionar Contato" title="Adicionar Contato" align="left" style="margin-top:5px;"/>
+    <br clear="all"/>
+	( figura 5 )
+    <br/>
+	<br/>
+	<img src="templates/celepar/images/janela_adicionar_contatos.png" width="454" height="371" style="margin-top:5px;" alt="Adicionar Contato" title="Adicionar Contato"/>
+	<br clear="all"/>
+	( figura 6 )
+	<br/>
+
+    <h2><a name="menu_right">8. Preferências Avançadas</a></h2>
+	<br/>
+	<br/>
+    Clicando com o botão direito do mouse, você tera acesso a um menu ( conforme figura 7 ), com as seguintes funcionalidades :
+
+    <ul>
+      <li>Autorizações : Requisitar e autorizar permissões ( Depois de adicionar um novo contato, é importante solicitar a autorização ).
+      <li>Grupo: Trocar / Adicionar / Remover do grupo.
+      <li>Renomear : Renomeia o contato.
+      <li>Remover: Exclui o contato.
+    </ul>
+	<br/>
+	<br/>
+    <img src="templates/celepar/images/menu_right.png" width="392px" height="110px" alt="Preferências Avançadas" align="left" style="margin-top:5px;"/>
+    <br clear="all"/>
+	( figura 7 )    
+    <br/>
+    <br/>
+    <h2><a name="troca_mens">9. Troca de Mensagens</a></h2>
+	<br/>
+	<br/>
+	Clicando com o mouse em cima do nome do contato escolhido, abrirá uma janela ( conforme figura 8 ), para a troca de mensagens. Nessa mesma janela existe um menu, o qual é possível
+	configurar o formato da fonte e enviar smiles.
+	<br/>
+	<br/>
+    <img src="templates/celepar/images/troca_de_mensagem.png" width="494" height="341" alt="Troca de Mensagens" title="Troca de Mensagens" align="left" style="margin-top:5px;"/>
+    <br clear="all"/>
+    ( figura 8 )
+    <br/>
+	<br/>
+    <h2><a name="certi_java">10. Assinatura de Applet - Java</a></h2>
+	<br/>
+	<br/>
+	O modelo de segurança implementado pela plataforma Java, está sobre o conceito que um código remoto (applet) não é confiável, garantindo assim que um applet malicioso não danifique
+	o computador. Porém existem applets que são de confiança e necessitam de permissões para fornecer determinado tipo de serviço. O Expresso Messenger é desenvolvido em
+	Java e precisa dessas permissões para fornecer o serviço de mensagens instantâneas. Quando carregado pela primeira vez, o Java que está instalado no computador, mostrará uma
+	janela ( figura 9), perguntando se deseja realmente rodar este código remoto e mostra dois botões, "Run" e o "Cancel". É necessário que seja marcada a opção "Run", e caso não queira
+	que esta janela abra, marque a opção "Always trust content from this publisher".
+	<br/>
+	<br/>
+    <img src="templates/celepar/images/cert_java.png" width="520" height="356" alt="Troca de Mensagens" title="Troca de Mensagens" align="bottom" style="margin-top:5px;"/>
+    <br clear="all"/>
+    ( figura 9 )
+    <br/>
+	<br/>
+
+
+	<hr noshade>
+<!-- END index -->
Index: /trunk/jabberit_messenger/templates/celepar/content.html
===================================================================
--- /trunk/jabberit_messenger/templates/celepar/content.html	(revision 382)
+++ /trunk/jabberit_messenger/templates/celepar/content.html	(revision 417)
@@ -18,4 +18,5 @@
       <a href="#menu_right"><font size="2" style="text-decoration:underline" color="DARKBLUE"><li>Preferências Avançadas</li></font></a>
 	  <a href="#troca_mens"><font size="2" style="text-decoration:underline" color="DARKBLUE"><li>Troca de Mensagens</li></font></a>
+	  <a href="#certi_java"><font size="2" style="text-decoration:underline" color="DARKBLUE"><li>Assinatura de Applet - Java</li></font></a>		  
     </ol>
 
@@ -23,6 +24,9 @@
     <div class='texto'>
     O JabberIT Messenger é uma aplicação que permite o envio e recebimento de mensagens instantaneamente. Através da sua lista de contatos, você pode trocar mensagens e arquivos com seus contatos. Através da lista também é possível saber se seus contatos estão Online ou Offline. Para a troca de mensagens basta clicar em cima do nome do seu contato, se o mesmo estiver online ( verifique a sessão <a href="#status">Indicador de Status</a> ) abrirá uma janela onde você poderá enviar/receber as mensagens. O JabberIT Messenger está associado
-    a um serviço de mensagens instantâneas Jabber e este serviço é responsável pelo armazenamento dos seus contatos, preferências e mensagens.<br><br>
-    <img src="images/tela_inicial.png" style="width:200px; height:297px;" alt="Im Screenshot" title="Im Screenshot" align="bottom" style="padding:4px;"><br>( figura 1 )
+    a um serviço de mensagens instantâneas Jabber e este serviço é responsável pelo armazenamento dos seus contatos, preferências e mensagens.
+    <br><br>
+	<img src="images/tela_inicial.png" style="width:228px; height:442px;" alt="Im Screenshot" title="Im Screenshot" align="bottom" style="padding:4px;">
+	<br clear="all">
+	( Figura 1 )
 	</div>
     <br clear="all">
@@ -40,12 +44,14 @@
 	<p class='item'><a name="prefe">3. Opções - Troca de Status</a></p>
     <div class='texto'>
-	Para a troca de status ( conforme figura 2 ), basta dar um clique com o mouse e em cima do botão <img src="images/botao_opcoes.png" width="99" height="19" style="margin-left:5px; margin-right:5px;"/> .
+	Para a troca de status ( conforme figura 2 ), basta dar um clique com o mouse e em cima do botão <img src="images/botao_opcoes.png" width="116" height="21" style="margin-left:5px; margin-right:5px;"/> .
 	<br><br>
-    <img src="images/menu_opcoes.png" style="width:135px; height:227px;" alt="Menu Opções" title="Menu Opções" align="bottom"/><br>( figura 2 )
+    <img src="images/menu_opcoes.png" style="width:180px; height:213px;" alt="Menu Opções" title="Menu Opções" align="bottom"/><br>( figura 2 )
 	</div>
     <p class='item'><a name="conf_status">4. Mensagens de Status</a></p>
 	<div class='texto'>
 	É possível configurar as mensagens para cada status escolhido (figura 3) clicando no item Personalizar.<br><br>
-	<img src="images/conf_status.png" style="width:249px; height:277px; margin-top:5px;" alt="Mensagens de Status" title="Mensagens de Status" align="bottom"/><br>( figura 3 )
+	<img src="images/conf_status.png" style="width:317px; height:235px; margin-top:5px;" alt="Mensagens de Status" title="Mensagens de Status" align="bottom"/>
+	<br>
+	( figura 3 )
 	</div>
 	<p class='back'><a href="#indice">Voltar</a></p>
@@ -53,5 +59,7 @@
 	<div class='texto'> 
 	Na lista de contato (figura 4), você visualizará seus contatos.<br><br>
-    <img src="images/lista_contatos.png" width="188" height="255" alt="Lista de Contatos" align="bottom" style="border:1px solid black;margin:5px;"/><br>( figura 4 )
+    <img src="images/lista_contatos.png" width="214px" height="185px" alt="Lista de Contatos" align="bottom" style="border:1px solid black;margin:5px;"/>
+    <br>
+    ( figura 4 )
 	</div>
     <p class='item'><a name="status">6. Status dos Usuários</a></p>    
@@ -62,23 +70,24 @@
     <img src="images/dnd.png" style="margin:1px;" align="top"> - Não Perturbe<br/>
     <img src="images/invisible.png" style="margin:1px;" align="top"> - Invisível<br/>    
-    <img src="images/offline.png" style="margin:1px;" align="top"> - Offline / Desconectado<br/>    
+    <img src="images/unavailable.png" style="margin:1px;" align="top"> - Offline / Desconectado<br/>    
     <img src="images/xa.png" style="margin:1px;" align="top"> - Ausência Prolongada<br/>    
 	</div>
     <p class='item'><a name="useradd">7. Adicionando um novo contato </a></p>
 	<div class='texto'>
-	Para adicionar um novo contato, clique na imagem <img src="images/group_open.gif"/>, no canto superior esquerdo (figura 6) e abrirá uma janela para adição dos contatos (figura 7) e
+	Para adicionar um novo contato, clique na imagem <img src="images/group_open.gif"/>, no canto superior esquerdo (figura 5) e abrirá uma janela para adição dos contatos (figura 6) e
 	faça uma pesquisa pelo nome. O resultado retornará <u>somente</u> os usuários que <u>tem permissão</u> para usar o Mensageiro Instantâneo do Expresso. 
-	Clique sobre o link "Adicionar Contato". Logo abaixo, dois campos serão necessários para adicionar o novo contato, sendo que o campo "Apelido" e
-	é preenchido no momento da escolha do novo contato e o campo grupo terá que ser definido. Tendo os dois campos preenchidos basta clicar no Botão Adicionar .
+	Clique sobre o link "Adicionar Contato" e aparecerá dois campos, sendo que o campo "Apelido" é preenchido no momento da escolha do novo contato e o campo grupo
+	terá que ser definido. Preenchendo estes dois campos basta clicar no "Botão Adicionar", e o contato será adicionado em sua Lista de Contatos.
 	<br/>
     <img src="images/adicionar_contato.png" alt="Adicionar Contato" title="Adicionar Contato" align="bottom" style="margin-top:5px;"/>
-   	<br>( figura 6 )
+   	<br>( figura 5 )
 	<br><br>
-	<img align="bottom" src="images/janela_adicionar_contatos.png" style="margin-top:5px;" alt="Adicionar Contato" title="Adicionar Contato"/><br>( figura 7 )
+	<img align="bottom" src="images/janela_adicionar_contatos.png" style="margin-top:5px;" alt="Adicionar Contato" title="Adicionar Contato"/>
+	<br>( figura 6 )
 	</div>
 	<p class='back'><a href="#indice">Voltar</a></p>
     <p class='item'><a name="menu_right">8. Preferências Avançadas</a></p>
 	<div class='texto'>
-    Clicando com o botão direito do mouse, você terá acesso a um menu (figura 8), com as seguintes funcionalidades:
+    Clicando com o botão direito do mouse, você terá acesso a um menu (figura 7), com as seguintes funcionalidades:
     <blockquote><br>
       - Autorizações: Requisitar e autorizar permissões.<br>
@@ -88,14 +97,27 @@
      </blockquote>
     <br>
-    <img src="images/menu_right.png" width="234" height="145" alt="Preferências Avançadas" align="bottom" style="margin-top:5px;"/><br>( figura 8 )
+    <img src="images/menu_right.png" width="392" height="110" alt="Preferências Avançadas" align="bottom" style="margin-top:5px;"/>
+    <br>( figura 7 )
 	</div>
 	<p class='back'><a href="#indice">Voltar</a></p>
 	<p class='item'><a name="troca_mens">9. Troca de Mensagens</a></p>
 	<div class='texto'>
-	Clicando duas vezes com o botão esquerdo sobre o nome do contato escolhido, abrirá uma janela (figura 9), para a troca de mensagens. Nessa mesma janela existe um menu, o qual é possível
+	Clicando duas vezes com o botão esquerdo sobre o nome do contato escolhido, abrirá uma janela (figura 8), para a troca de mensagens. Nessa mesma janela existe um menu, o qual é possível
 	configurar o formato da fonte e enviar smiles.<br><br>
-    <img src="images/troca_de_mensagem.png" width="410" height="309" alt="Troca de Mensagens" title="Troca de Mensagens" align="bottom" style="margin-top:5px;"/><br>( figura 9 )
+    <img src="images/troca_de_mensagem.png" width="494" height="341" alt="Troca de Mensagens" title="Troca de Mensagens" align="bottom" style="margin-top:5px;"/><br>( figura 8 )
 	</div>	
 	<br/>
+	<p class='back'><a href="#indice">Voltar</a></p>
+	<p class='item'><a name="certi_java">10. Assinatura de Applet - Java</a></p>
+	<div class='texto'>
+	O modelo de segurança implementado pela plataforma Java, está sobre o conceito que um código remoto (applet) não é confiável, garantindo assim que um applet malicioso não danifique
+	o computador. Porém existem applets que são de confiança e necessitam de permissões para fornecer determinado tipo de serviço. O Expresso Messenger é desenvolvido em
+	Java e precisa dessas permissões para fornecer o serviço de mensagens instantâneas. Quando carregado pela primeira vez, o Java que está instalado no computador, mostrará uma
+	janela ( figura 9), perguntando se deseja realmente rodar este código remoto e mostra dois botões, "Run" e o "Cancel". É necessário que seja marcada a opção "Run", e caso não queira
+	que esta janela abra, marque a opção "Always trust content from this publisher".
+	<br><br>
+    <img src="images/cert_java.png" width="520" height="356" alt="Troca de Mensagens" title="Troca de Mensagens" align="bottom" style="margin-top:5px;"/><br>( figura 9 )
+	</div>	
+	<br/>	
 	<p class='back'><a href="#indice">Voltar</a></p>
 	<hr noshade>
Index: /trunk/jabberit_messenger/setup/phpgw_pt-br.lang
===================================================================
--- /trunk/jabberit_messenger/setup/phpgw_pt-br.lang	(revision 382)
+++ /trunk/jabberit_messenger/setup/phpgw_pt-br.lang	(revision 417)
@@ -15,4 +15,5 @@
 busy	jabberit_messenger	pt-br	Ocupado
 change your Status	jabberit_messenger	pt-br	Mude seu estado
+Cancel	jabberit_messenger	pt-br	Cancelar
 Choice Contact	jabberit_messenger	pt-br	Escolha Contato
 Close	jabberit_messenger	pt-br	Fechar
@@ -27,4 +28,5 @@
 deny	jabberit_messenger	pt-br	Negar
 Error in the message!	jabberit_messenger	pt-br	Erro na mensagem!
+Error saving your preferences!	jabberit_messenger	pt-br	Erro salvando suas preferências! 
 E-mail	jabberit_messenger	pt-br	E-mail
 Ficar ausente depois de	jabberit_messenger	pt-br	Ficar ausente depois de
@@ -38,5 +40,5 @@
 It requisition permission	jabberit_messenger	pt-br	Requisitar Permissão
 Jid Contact	jabberit_messenger	pt-br	Email Expresso
-jabberit_messenger	common	pt-br	Jabberit Messenger
+jabberit_messenger	common	pt-br	Expresso JMessenger
 List of Contacts	jabberit_messenger	pt-br	Lista de Contatos
 Loading...	jabberit_messenger	pt-br	Carregando...
@@ -65,4 +67,5 @@
 Problems in its register \n	jabberit_messenger	pt-br	Problemas em seu registro
 Preferences	jabberit_messenger	pt-br	Preferências
+Preferences saved with success!	jabberit_messenger	pt-br	Preferências salvas com sucesso!
 Quick Contacts	jabberit_messenger	pt-br	Contatos Rápidos
 Re-connect Expresso Messenger ?	jabberit_messenger	pt-br	Reconectar Expresso Messenger ?
@@ -95,4 +98,5 @@
 Vcard	jabberit_messenger	pt-br	Vcard
 You desire to register in service IM?	jabberit_messenger	pt-br	Você deseja registrar no serviço IM?
+Your Preferences	jabberit_messenger	pt-br	Suas Preferências
 Your search argument must be longer than 4 characters.	jabbertit_messenger	pt-br	Seus argumentos para a pesquisa precisam ter mais que 4 dígitos.
 your status	jabberit_messenger	pt-br	Seu status
Index: /trunk/jabberit_messenger/setup/setup.inc.php
===================================================================
--- /trunk/jabberit_messenger/setup/setup.inc.php	(revision 382)
+++ /trunk/jabberit_messenger/setup/setup.inc.php	(revision 417)
@@ -8,5 +8,5 @@
 	$setup_info['jabberit_messenger']['name']      	= 'jabberit_messenger';
 	$setup_info['jabberit_messenger']['title']     	= 'Jeti Applet';
-	$setup_info['jabberit_messenger']['version']   	= '0.7.7';
+	$setup_info['jabberit_messenger']['version']   	= '0.7.8';
 	$setup_info['jabberit_messenger']['app_order'] 	= 9;
 	$setup_info['jabberit_messenger']['enable']    	= 1;
Index: /trunk/jabberit_messenger/xsl/preferences_jabberit.xsl
===================================================================
--- /trunk/jabberit_messenger/xsl/preferences_jabberit.xsl	(revision 417)
+++ /trunk/jabberit_messenger/xsl/preferences_jabberit.xsl	(revision 417)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:output method="html" omit-xml-declaration="yes"/>
+
+	<xsl:param name="path" />
+	<xsl:param name="lang1" />
+	<xsl:param name="lang2" />
+	<xsl:param name="lang3" />
+	<xsl:param name="lang4" />	
+	
+	<xsl:template match="preferences_jabberit">
+		<fieldset style="height:70px; padding:5px;">
+			<legend><xsl:value-of select="$lang1"/></legend>
+			<br/>
+			<label><xsl:value-of select="$lang2"/> .: </label>
+			<select id="openWindowJabberit">
+				<option value="true">Sim</option>
+				<option value="false">Não</option>					
+			</select>
+		</fieldset>
+		<div style="padding: 5px; cellpadding:5px;">
+			<input type="button" value="{$lang3}" onclick="javascript:loadscript.setPrefe();"/>
+			<input type="button" value="{$lang4}" />
+		</div>
+	</xsl:template>
+
+</xsl:stylesheet>
Index: /trunk/jabberit_messenger/languages/jeti_pt_BR.properties
===================================================================
--- /trunk/jabberit_messenger/languages/jeti_pt_BR.properties	(revision 382)
+++ /trunk/jabberit_messenger/languages/jeti_pt_BR.properties	(revision 417)
@@ -370,4 +370,5 @@
 main.main.jetimenu.Please_enter_your_password_to_delete_your_account=Por favor, informe sua senha para deletar essa conta.
 main.main.jetimenu.Show_Log=Mostrar Jeti &Log
+main.main.List_Contacts=Lista de Contatos
 main.main.Offline=Desconectado
 main.main.Online=Conectado
@@ -407,5 +408,5 @@
 main.main.statusmenu.Change_message=&Mensagem
 main.main.statusmenu.Manage_messages=&Personalizar
-main.main.statusmenu.Status_message=Status\:
+main.main.statusmenu.Status_message=Mensagem de Status\:
 main.manageservices.Change_Server=&Trocar servidor
 main.manageservices.Manage_Services=&Gerenciar servi\u00E7os
Index: /trunk/jabberit_messenger/inc/getphoto.php
===================================================================
--- /trunk/jabberit_messenger/inc/getphoto.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/getphoto.php	(revision 417)
@@ -1,5 +1,114 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
-	function getPhotoSession($pUid)
+class ldapPhoto
+{
+	private $host;
+	private $dn;
+	private $passwd;
+	private $refer;
+	private $user_referral;
+	private $password_referral;
+	private $conn;
+	private $context;
+	private $photo_user = array();
+
+	function __construct()
+	{
+		$this->host		= "localhost";
+		$this->dn		= "uid=expresso-admin,ou=celepar,dc=ecelepar10612,dc=pr,dc=gov,dc=br";
+		$this->passwd	= "senha";
+		$this->context	= "dc=ecelepar10612,dc=pr,dc=gov,dc=br";
+		
+		$this->refer  	= true;
+		$this->version3 = true;
+	}
+
+	private final function ldap_rebind($ldap_connection, $ldap_url)
+	{
+		@ldap_bind($ldap_connection, $this->user_referral, $this->password_referral);
+	}
+
+	private final function ldapConnect()
+	{
+		if(!function_exists('ldap_connect'))
+		{
+			printf("<b>Erro : Ldap Não suportado %s</b><br>" , $this->host);
+			return False;
+		}
+		
+		if(!$this->conn = ldap_connect($this->host))
+		{
+			printf("<b>Erro: não pode conectar no servidor ldap %s!</b><br>", $this->host);
+			return False;
+		}
+		if( $this->version3 )
+		{
+			if( !ldap_set_option($this->conn,LDAP_OPT_PROTOCOL_VERSION,3) )
+				$this->version = false;
+		}
+		ldap_set_option($this->conn, LDAP_OPT_REFERRALS, $this->refer);
+		// verifica refer
+		if( $this->refer )
+		{
+			$this->user_referral = $this->dn;
+			$this->password_referral = $this->passwd;
+			@ldap_set_rebind_proc($this->conn, $this->ldap_rebind);
+		}
+		
+		// bind as admin
+		if($this->dn && $this->passwd && !ldap_bind($this->conn, $this->dn, $this->passwd)){
+			echo "<center><b>ExpressoLivre indisponível no momento</b></center>";
+			return False;
+		}
+		// bind as anonymous
+		if(!$this->dn && !$this->passwd && !@ldap_bind($this->conn))
+		{
+			echo "<center><b>ExpressoLivre indisponível no momento</b></center>";
+			return False;
+		}						
+	}
+	
+	public final function getPhotoLdap($uid)
+	{
+		$this->ldapConnect();
+		if( $this->conn )
+		{
+			$filter = "(&(phpgwaccounttype=u)(uid=".$uid."))";
+			$justthese = array("uid","phpgwAccountVisible","jpegPhoto");
+			$search = ldap_search($this->conn,$this->context,$filter,$justthese);
+			$entry1 = ldap_get_entries($this->conn,$search);
+			$entry = ldap_first_entry( $this->conn, $search );
+
+			if( $entry1['count'] > 0 )
+			{
+				$i = 0;
+				$photo = "";
+				$return_photo = "";
+	
+				
+				if ( $entry1[$i]['phpgwaccountvisible'][0] != '-1' )
+				{
+					$photo = @ldap_get_values_len($this->conn, $entry, 'jpegphoto');
+	
+					if ( $photo )
+						$return_photo = $photo[0];
+				}				
+				return $return_photo;
+			}
+		}
+		return false;
+	}
+	
+	public final function getPhotoSession($pUid)
 	{
 		if(isset($_SESSION['phpgw_info']['jabberit_messenger']['photo'][$pUid]))
@@ -20,10 +129,41 @@
 		}
 	}
+}
 
-	if(trim($_REQUEST['uid']) != "")
+if(trim($_REQUEST['uid']) != "")
+{
+	$uid = trim($_REQUEST['uid']);
+	$a = new ldapPhoto();
+	
+	if( strpos($uid,"@"))
 	{
-		getPhotoSession(trim($_REQUEST['uid']));
+		$uid = substr($uid, 0, strpos($uid,"@"));	
+		$photo = $a->getPhotoLdap($uid);
+		$photoWidth = 70;
+		$photoHeight = 90;
+		$newImage = imagecreatetruecolor($photoWidth,$photoHeight);		
+		
+		if($photo)
+		{
+			$photo = imagecreatefromstring($photo);
+			$trans = imagecolortransparent($photo);
+			imagecopyresized($newImage,$photo,0,0,0,0,$photoWidth,$photoHeight,imagesx($photo),imagesy($photo));
+			imagepng($newImage);
+			imagedestroy($newImage);
+		}
+		else
+		{
+			$photo = @imagecreatefrompng("../templates/celepar/images/photo.png");
+			$trans = imagecolortransparent($photo);
+			imagecopyresized($newImage,$photo,0,0,0,0,$photoWidth,$photoHeight,imagesx($photo),imagesy($photo));
+			imagepng($newImage);
+			imagedestroy($newImage);
+		}
 	}
-
+	else
+	{
+		$a->getPhotoSession($uid);
+	}
+}
 ?>
 
Index: /trunk/jabberit_messenger/inc/jabberit_acl.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/jabberit_acl.inc.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/jabberit_acl.inc.php	(revision 417)
@@ -1,3 +1,13 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
 $size_of_acl = sizeof($GLOBALS['phpgw_info']['user']['acl']);
@@ -5,7 +15,18 @@
 for( $i = 0; $i < $size_of_acl && $GLOBALS['phpgw_info']['user']['acl'] != "jabberit_messenger"; $i++ )
 {
-	if ( $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'jabberit_messenger' && ( $GLOBALS['phpgw_info']['flags']['currentapp'] == 'expressoMail1_2' || $GLOBALS['phpgw_info']['flags']['currentapp'] == 'jabberit_messenger' ))
+	$apps = unserialize($GLOBALS['phpgw_info']['server']['apps_jabberit']);
+	$flag = false;
+	
+	foreach($apps as $tmp)
 	{
-		
+		$app_enabled = substr($tmp,0,strpos($tmp,";"));
+ 
+		if( $GLOBALS['phpgw_info']['flags']['currentapp'] == $app_enabled )
+			$flag = true;
+	}	
+	
+	if ( $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'jabberit_messenger' && ( $flag || $GLOBALS['phpgw_info']['flags']['currentapp'] == 'jabberit_messenger' ))
+	{
+
 		$webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
 		$webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
@@ -48,9 +69,10 @@
 		printf("<script type=\"text/javascript\">%s</script>", $script);
 		
-		print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/window.css">';
-		print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/common.css">';
+		print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/celepar/css/window.css">';
+		print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/celepar/css/common.css">';
 
 		break;
 	}
+	
 }
 ?>
Index: /trunk/jabberit_messenger/inc/controller.xml
===================================================================
--- /trunk/jabberit_messenger/inc/controller.xml	(revision 382)
+++ /trunk/jabberit_messenger/inc/controller.xml	(revision 417)
@@ -29,11 +29,9 @@
 		<php path="/var/www/expresso/jabberit_messenger/inc" suffix=".class.php">
 			<item ref="contacts_im" alias="list_contacts" class="contacts_im" method="list_contacts" prefix="class." suffix=".inc.php"/>
-			<item ref="db_im" alias="get_preferences" class="db_im" method="get_preferences" prefix="class." suffix=".inc.php"/>
-			<item ref="db_im" alias="set_preferences" class="db_im" method="set_preferences" prefix="class." suffix=".inc.php"/>
+			<item ref="db_im" alias="getPreferences" class="db_im" method="getPreferences" prefix="class." suffix=".inc.php"/>
+			<item ref="db_im" alias="setPreferences" class="db_im" method="setPreferences" prefix="class." suffix=".inc.php"/>
 			<item ref="ldap_im" alias="list_organizations_ldap" class="ldap_im" method="list_organizations_ldap" prefix="class." suffix=".inc.php"/>
 			<item ref="ldap_im" alias="photo_ldap" class="ldap_im" method="photo_ldap" prefix="class." suffix=".inc.php"/>
 			<item ref="ujabber" alias="AddNewContact" class="ujabber" method="AddNewContact" prefix="class." suffix=".inc.php"/>
-			<item ref="ujabber" alias="statusWindow" class="ujabber" method="statusWindow" prefix="class." suffix=".inc.php"/>
-			<item ref="ujabber" alias="setWindow" class="ujabber" method="setWindow" prefix="class." suffix=".inc.php"/>
 		</php>
 		<xml></xml>
Index: /trunk/jabberit_messenger/inc/class.contacts_im.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.contacts_im.inc.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/class.contacts_im.inc.php	(revision 417)
@@ -1,3 +1,14 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
+
 
 require_once "class.ldap_im.inc.php";
Index: /trunk/jabberit_messenger/inc/class.uimodule.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.uimodule.inc.php	(revision 417)
+++ /trunk/jabberit_messenger/inc/class.uimodule.inc.php	(revision 417)
@@ -0,0 +1,105 @@
+<?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
+
+require_once "class.bomodule.inc.php"; 
+
+class uimodule
+{
+	public $public_functions = array(
+		'add'      => True,
+		'edit_conf' => True,
+	);
+
+	private $bo;
+	
+	final function __construct()
+	{
+		$this->bo = new bomodule();	
+	}	
+	
+	public final function edit_conf()
+	{
+		if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
+		{
+			$GLOBALS['phpgw']->redirect_link('/index.php');
+		}		
+		
+		$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') .' - ' . 'Configurar o Uso do Módulo';	
+		
+		if(!@is_object($GLOBALS['phpgw']->js))
+		{
+			$GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript');
+		}
+			
+		$webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
+		$webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
+		
+		$js = array('functions');
+		
+		foreach( $js as $tmp )
+			$GLOBALS['phpgw']->js->validate_file('',$tmp,'jabberit_messenger');
+		
+		$GLOBALS['phpgw']->common->phpgw_header();
+		echo parse_navbar();
+		
+		if( $apps_list = $this->bo->getApplicationsEnabled())
+		{
+			$apps_list = unserialize($apps_list);
+			foreach($apps_list as $tmp)
+				$apps_en .= "<option value='".$tmp."'>".substr($tmp,strpos($tmp, ";")+1)."</option>";
+		}
+
+		if( $apps_enabled = $this->bo->getApplicationsList() )
+		{
+			foreach($apps_enabled as $tmp )
+				$apps .= "<option value='".$tmp['name'].";".$tmp['title']."'>".$tmp['title']."</option>";
+		}
+
+		
+		$GLOBALS['phpgw']->template->set_file(array('jabberit_messenger'=>'module.tpl'));
+		$GLOBALS['phpgw']->template->set_block('jabberit_messenger','module');	
+		$GLOBALS['phpgw']->template->set_var(array(
+										'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=jabberit_messenger.uimodule.add'),
+										'apps_enabled' => $apps_en,
+										'apps_list' => $apps,
+										'lang_Settings_Use_Module_Expresso_Messenger' => 'Configurar o uso do módulo Expresso Messenger',
+										'lang_Applications_List' => 'Lista de Aplicativos',
+										'lang_Applications_habilitadas' => 'Aplicativos Habilitados',
+										'lang_save' => lang('Save'),
+										'lang_cancel' => lang('Cancel')
+										));
+	
+		$GLOBALS['phpgw']->template->pparse('out','module');
+	}
+	
+	public final function add()
+	{
+		if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
+		{
+			$GLOBALS['phpgw']->redirect_link('/index.php');
+		}		
+		
+		if ($_POST['cancel'])
+		{
+			$GLOBALS['phpgw']->redirect_link('/admin/index.php');
+		}
+
+		if ( $_POST['save'] )
+		{
+			if(is_array($_POST['apps_enabled']))
+				$this->bo->setApplications($_POST['apps_enabled']);
+		}
+
+		$GLOBALS['phpgw']->redirect_link('/admin/index.php');
+	}
+}
+
+?>
Index: /trunk/jabberit_messenger/inc/hook_admin.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/hook_admin.inc.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/hook_admin.inc.php	(revision 417)
@@ -1,17 +1,19 @@
 <?php
-	/**************************************************************************\
-	* eGroupWare                                                               *
-	* http://www.egroupware.org                                                *
-	* --------------------------------------------                             *
-	*  This program is free software; you can redistribute it and/or modify it *
-	*  under the terms of the GNU General Public License as published by the   *
-	*  Free Software Foundation; either version 2 of the License, or (at your  *
-	*  option) any later version.                                              *
-	\**************************************************************************/
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
 // Only Modify the $file and $title variables.....
 	$title = 'jabberit_messenger';
 	$file = array(
-		'Site Configuration'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname)
+		'Site Configuration'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname),
+		'Configurar o Uso do Módulo' => $GLOBALS['phpgw']->link('/index.php','menuaction=jabberit_messenger.uimodule.edit_conf')
 	);
 	
Index: /trunk/jabberit_messenger/inc/jabberit_sessions.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/jabberit_sessions.inc.php	(revision 402)
+++ /trunk/jabberit_messenger/inc/jabberit_sessions.inc.php	(revision 417)
@@ -1,5 +1,17 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
+		//User
 		$_SESSION['phpgw_info']['jabberit_messenger']['user']       = $GLOBALS['phpgw_info']['user']['account_lid'];
+		$_SESSION['phpgw_info']['jabberit_messenger']['user_id']    = $GLOBALS['phpgw_info']['user']['account_id'];		
         $_SESSION['phpgw_info']['jabberit_messenger']['passwd']		= $GLOBALS['phpgw_info']['user']['passwd'];
 
@@ -9,5 +21,5 @@
         $_SESSION['phpgw_info']['jabberit_messenger']['user_ldap_jabberit']     = $GLOBALS['phpgw_info']['server']['user_ldap_jabberit'];
         $_SESSION['phpgw_info']['jabberit_messenger']['password_ldap_jabberit'] = $GLOBALS['phpgw_info']['server']['password_ldap_jabberit'];
-
+        
         //DB
         $_SESSION['phpgw_info']['jabberit_messenger']['server']['db_name']	 = $GLOBALS['phpgw_info']['server']['db_name'];
@@ -24,5 +36,5 @@
         $_SESSION['phpgw_info']['jabberit_messenger']['group_chat_jabberit']	= $GLOBALS['phpgw_info']['server']['group_chat_server_jabberit'];
 		$_SESSION['phpgw_info']['jabberit_messenger']['use_ssl_jabberit']		= $GLOBALS['phpgw_info']['server']['use_ssl_jabberit'];
-		//$_SESSION['phpgw_info']['jabberit_messenger']['use_proxy_java']			= $GLOBALS['phpgw_info']['server']['use_proxy_java'];
+		$_SESSION['phpgw_info']['jabberit_messenger']['use_proxy_java']			= $GLOBALS['phpgw_info']['server']['use_proxy_java'];
 
 ?>
Index: /trunk/jabberit_messenger/inc/load_lang.php
===================================================================
--- /trunk/jabberit_messenger/inc/load_lang.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/load_lang.php	(revision 417)
@@ -1,3 +1,3 @@
-<?
+<?php
 
 if ( file_exists(($fn = dirname(__FILE__) . '/../setup/phpgw_pt-br.lang')) )
Index: /trunk/jabberit_messenger/inc/class.ldap_im.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.ldap_im.inc.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/class.ldap_im.inc.php	(revision 417)
@@ -1,3 +1,13 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
 define('PHPGW_INCLUDE_ROOT', '../');
@@ -18,5 +28,4 @@
 	public final function __construct()
 	{
-		
 		$this->ldap_host 	= $_SESSION['phpgw_info']['jabberit_messenger']['server_ldap_jabberit'];
 		$this->ldap_context	= $_SESSION['phpgw_info']['jabberit_messenger']['context_ldap_jabberit'];
@@ -37,5 +46,6 @@
 		$this->common = new common();
 		
-		if( !$this->ldap ){
+		if( !$this->ldap )
+		{
 			$GLOBALS['phpgw_info']['server']['ldap_version3'] = true;
 			$this->ldap = $this->common->ldapConnect( $this->ldap_host,$this->ldap_dn,$this->ldap_pass );
@@ -89,11 +99,8 @@
 							$_SESSION['phpgw_info']['jabberit_messenger']['photo'][trim($result_user[$i]['uid'])] = $photo[0];
 						}
-						
 						$i++;
 					}				
-					
 					$entry = ldap_next_entry($this->ldap,$entry);	
 				}
-
 				return $result_user;
 			}
@@ -102,7 +109,11 @@
 				return "Many Results";
 			}
-
 		}
 		return 0;
+	}
+	
+	public final function teste()
+	{
+		 return 'dentro da classe do php';
 	}
 }
Index: /trunk/jabberit_messenger/inc/class.bomodule.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.bomodule.inc.php	(revision 417)
+++ /trunk/jabberit_messenger/inc/class.bomodule.inc.php	(revision 417)
@@ -0,0 +1,40 @@
+<?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
+
+require_once "class.db_im.inc.php";
+require_once "jabberit_sessions.inc.php";
+
+class bomodule
+{
+	private $db;
+	
+	function __construct()
+	{
+		$this->db = new db_im();
+	}
+	
+	public final function getApplicationsEnabled()
+	{
+		return $this->db->getApplicationsEnabled();
+	}
+	
+	public final function getApplicationsList()
+	{
+		return $this->db->getApplicationsList();
+	}
+	
+	public final function setApplications($Applications)
+	{
+		return $this->db->setApplications($Applications);
+	}
+}
+
+?>
Index: /trunk/jabberit_messenger/inc/class.db_im.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.db_im.inc.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/class.db_im.inc.php	(revision 417)
@@ -1,3 +1,13 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
 define('PHPGW_INCLUDE_ROOT','../');	
@@ -7,5 +17,4 @@
 class db_im
 {	
-	
 	private $db;
 	private $db_name;
@@ -28,9 +37,53 @@
 	}
 
+	private final function connectDB()
+	{
+		$this->db = new db();
+		$this->db->connect($this->db_name,$this->db_host,$this->db_port,$this->db_user,$this->db_pass,$this->db_type);		
+	}	
+
+	public final function getApplicationsEnabled()
+	{
+		$this->connectDB();
+		$this->db->query("SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' and config_name ='apps_jabberit'");
+		if($this->db->num_rows())
+		{
+			$tmp = "";
+			while($this->db->next_record())
+			{
+				$tmp[]= $this->db->row();
+			}
+			return $tmp[0]['config_value'];
+		}
+		return false;
+	}
+	
+	public final function getApplicationsList()
+	{
+		$this->connectDB();
+		$this->db->query("SELECT * FROM phpgw_applications WHERE app_enabled = '1' order by app_name");
+		if($this->db->num_rows())
+		{
+			while ($this->db->next_record())
+			{
+				$app = $this->db->f('app_name');
+				$title = @$GLOBALS['phpgw_info']['apps'][$app]['title'];
+				if (empty($title))
+				{
+					$title = lang($app) == $app.'*' ? $app : lang($app);
+				}
+				$apps[$app] = array(
+					'title'  => $title,
+					'name'   => $app,
+					'status' => $this->db->f('app_enabled')
+				);
+			}
+		}
+		return $apps;
+	}
+
 	public final function get_accounts_acl()
 	{
-			
-		$this->db = new db();
-		$this->db->connect($this->db_name,$this->db_host,$this->db_port,$this->db_user,$this->db_pass,$this->db_type);		
+		$this->connectDB();			
 		
 		$query  = "select acl_account from phpgw_acl where acl_location in (select acl_account from phpgw_acl where acl_appname = 'jabberit_messenger') ";
@@ -54,12 +107,72 @@
 	}
 	
-	private final function query_db($pQuery)
+	public final function getPreferences()
 	{
-		if (!$this->db->query($pQuery))
-        	return false;
+		$this->connectDB();
+		
+		$result = array();
+		$query = "select * from phpgw_preferences where preference_owner = '".$this->user_id."' and preference_app = 'jabberit_messenger'";
+		
+ 		if ( $this->db->query($query) )
+		{	
+			while($this->db->next_record())
+				$result[] = $this->db->row();
+	
+			if(count($result) > 0)
+				return unserialize($result[0]['preference_value']);
+		}
+
+		return "openWindowJabberit:true";
+	}
+
+	public final function setPreferences($pParam)
+	{
+		$this->connectDB();
+		$preferences = $pParam['preferences'];
+		$user_id  = $this->user_id;
+		
+		$query = "insert into phpgw_preferences values('".$user_id."','jabberit_messenger','".serialize($preferences)."')";
+				
+		if($this->db->query($query))
+		{ 
+			return "true";
+		}
 		else
-			return true;
+		{
+			$query = "update phpgw_preferences set preference_value = '".serialize($preferences)."' where preference_app='jabberit_messenger' and preference_owner='".$user_id."'";
+
+			if($this->db->query($query))
+				return "true";
+			else
+				return "false";			
+		}		
+	}
+	
+	public final function setApplications($pApplications)
+	{
+		$this->connectDB();
+		$apps = serialize($pApplications);
+		
+		if( $this->db )
+		{
+			$query = "SELECT * FROM phpgw_config WHERE config_app = 'phpgwapi' and config_name ='apps_jabberit'";
+				
+			$this->db->query($query);
+					
+			if(!$this->db->next_record())
+			{
+				$query = "INSERT INTO phpgw_config(config_app,config_name,config_value) VALUES('phpgwapi','apps_jabberit','".$apps."')";
+				$this->db->query($query);
+				return true;
+			}
+			else
+			{
+				$query = "UPDATE phpgw_config SET config_value = '".$apps."' WHERE config_app = 'phpgwapi' AND config_name = 'apps_jabberit'";
+				$this->db->query($query);
+				return true;
+			}
+		}
+		return false;	
 	}
 }
-
 ?>
Index: /trunk/jabberit_messenger/inc/class.ujabber.inc.php
===================================================================
--- /trunk/jabberit_messenger/inc/class.ujabber.inc.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/class.ujabber.inc.php	(revision 417)
@@ -1,3 +1,13 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
 require_once "class.jabber.inc.php";
@@ -60,17 +70,4 @@
 		$this->disconnect();
 	}
-
-	function statusWindow()
-	{
-		if(!isset($_SESSION['phpgw_info']['jabberit_messenger']['status']))
-			return 'closed';
-		else
-			return $_SESSION['phpgw_info']['jabberit_messenger']['status'];
-	}
-
-	function setWindow($pStatus)
-	{
-		$_SESSION['phpgw_info']['jabberit_messenger']['status'] = $pStatus['window'];
-	}
 }
 ?>	
Index: /trunk/jabberit_messenger/inc/Controller.class.php
===================================================================
--- /trunk/jabberit_messenger/inc/Controller.class.php	(revision 382)
+++ /trunk/jabberit_messenger/inc/Controller.class.php	(revision 417)
@@ -1,3 +1,12 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
 
 class Controller
Index: /trunk/jabberit_messenger/inc/login.php
===================================================================
--- /trunk/jabberit_messenger/inc/login.php	(revision 402)
+++ /trunk/jabberit_messenger/inc/login.php	(revision 417)
@@ -1,35 +1,42 @@
 <?php
+  /***************************************************************************\
+  *  Expresso - Expresso Messenger                                            *
+  *  	- Alexandre Correia / Rodrigo Souza							          *
+  *  	- JETI - http://jeti-im.org/										  *
+  * ------------------------------------------------------------------------- *
+  *  This program is free software; you can redistribute it and/or modify it  *
+  *  under the terms of the GNU General Public License as published by the    *
+  *  Free Software Foundation; either version 2 of the License, or (at your   *
+  *  option) any later version.                                               *
+  \***************************************************************************/
+
+	define('PHPGW_API_INC','../../phpgwapi/inc');
+	require_once(PHPGW_API_INC . '/class.Template.inc.php');
 
 	if(isset($_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit']))
     {
 		$path = $_SESSION['phpgw_info']['jabberit_messenger']['webserver_url'];
+		$SERVER_EXPRESSO = gethostbyaddr($_SERVER['SERVER_ADDR']) . $path;
 
-		$newWindow = "<script type='text/javascript'>";
-		$newWindow .= "document.write('<HTML>');"; 
-		$newWindow .= "document.write('<HEAD>');";
-		$newWindow .= "document.write('</HEAD>');";
-		$newWindow .= "document.write('<BODY leftmargin=\'0\' topmargin=\'0\' marginwidth=\'0\' marginheight=\'0\'>');";
-		$newWindow .= "document.write('<APPLET name=\'jeti\' ";
-		$newWindow .= "archive=\'".$path."applet.jar,";
-		$newWindow .= $path."plugins/groupchat.jar,";
-		$newWindow .= $path."plugins/sound.jar,";
-		$newWindow .= $path."plugins/xhtml.jar\' CODE=\'nu.fw.jeti.applet.Jeti.class\' WIDTH=\'100%\' HEIGHT=\'400px\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"SERVER\" VALUE=\'".$_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit']."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"HOST\" VALUE=\'".$_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit']."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"PORT\" VALUE=\'".$_SESSION['phpgw_info']['jabberit_messenger']['port_jabberit']."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"RESOURCE\" VALUE=\'".$_SESSION['phpgw_info']['jabberit_messenger']['resource_jabberit']."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"USER\" VALUE=\'".$_SESSION['phpgw_info']['jabberit_messenger']['user']."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"PASSWORD\" VALUE=\'".$_SESSION['phpgw_info']['jabberit_messenger']['passwd']."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"SSL\" VALUE=\'".$_SESSION['phpgw_info']['jabberit_messenger']['use_ssl_jabberit']."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"HIDELOGINSTATUS\" VALUE=\"TRUE\">');";
-		//$newWindow .= "document.write('<PARAM NAME=\"USEPROXY\" VALUE=\'".strtoupper($_SESSION['phpgw_info']['jabberit_messenger']['use_proxy_java'])."\'>');";
-		$newWindow .= "document.write('<PARAM NAME=\"EXTIPAGE\" VALUE=\"javascript:window.close();\">');";
-		$newWindow .= "document.write('</APPLET>');";
-		$newWindow .= "document.write('</BODY>');";
-		$newWindow .= "document.write('</HTML>');";
-		$newWindow .= "document.close();";
-		$newWindow .= "</script>";
+		$template = new Template('templates/celepar');
+		$template->set_var("path", $path);
+		$template->set_var("file0", filemtime("applet.jar"));
+		$template->set_var("file1", filemtime("plugins/groupchat.jar"));
+		$template->set_var("file2", filemtime("plugins/sound.jar"));
+		$template->set_var("file3", filemtime("plugins/xhtml.jar"));		
+		$template->set_var("value_server",$_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit']);
+		$template->set_var("value_host",$_SESSION['phpgw_info']['jabberit_messenger']['name_jabberit']);			
+		$template->set_var("value_port",$_SESSION['phpgw_info']['jabberit_messenger']['port_jabberit']);
+		$template->set_var("value_resource",$_SESSION['phpgw_info']['jabberit_messenger']['resource_jabberit']);
+		$template->set_var("value_user",$_SESSION['phpgw_info']['jabberit_messenger']['user']);
+		$template->set_var("value_password",$_SESSION['phpgw_info']['jabberit_messenger']['passwd']);
+		$template->set_var("value_ssl",$_SESSION['phpgw_info']['jabberit_messenger']['use_ssl_jabberit']);
+		$template->set_var("value_hideloginstatus","TRUE");
+		$template->set_var("value_userproxy",$_SESSION['phpgw_info']['jabberit_messenger']['use_proxy_java']);
+		$template->set_var("value_expresso",$SERVER_EXPRESSO);
+		$template->set_file(Array('jabberit_messenger' => 'jabberIM.tpl'));
+		$template->set_block('jabberit_messenger','index');
+		$template->pfp('out','index');
+    }
 
-		printf("%s",$newWindow);
-	}
 ?>
Index: /trunk/jabberit_messenger/js/images.js
===================================================================
--- /trunk/jabberit_messenger/js/images.js	(revision 382)
+++ /trunk/jabberit_messenger/js/images.js	(revision 417)
@@ -2,9 +2,9 @@
 	
 	var jabberit_add_user = new Image();
-	jabberit_add_user.src = path_jabberit + 'templates/default/images/adduser_azul.png';
+	jabberit_add_user.src = path_jabberit + 'templates/celepar/images/adduser_azul.png';
 
 	var jabberit_group_close = new Image();
-	jabberit_group_close.src = path_jabberit + 'templates/default/images/group_close.gif';
+	jabberit_group_close.src = path_jabberit + 'templates/celepar/images/group_close.gif';
 
 	var jabberit_group_open = new Image();
-	jabberit_group_open.src = path_jabberit + 'templates/default/images/group_open.gif';
+	jabberit_group_open.src = path_jabberit + 'templates/celepar/images/group_open.gif';
Index: /trunk/jabberit_messenger/js/functions.js
===================================================================
--- /trunk/jabberit_messenger/js/functions.js	(revision 417)
+++ /trunk/jabberit_messenger/js/functions.js	(revision 417)
@@ -0,0 +1,49 @@
+(function()
+{
+	
+	function addApplication()
+	{
+		var select_appList = document.getElementById('apps_list');
+		for(var i = 0; i < select_appList.options.length ; i++)
+			if( select_appList.options[i].selected )
+			{
+				var select_appEnabled =  document.getElementById('apps_enabled');
+				var flag = false;
+				for(var j = 0; j < select_appEnabled.options.length ; j++ )
+				{
+					if( select_appEnabled.options[j].value === select_appList.options[i].value )
+						flag = true;
+				}
+				
+				if ( !flag )
+					select_appEnabled.options[select_appEnabled.length] = new Option(select_appList.options[i].text, select_appList.options[i].value, false, true);
+			}
+	}
+	
+	function removeApplication()
+	{
+		var select_appEnabled = document.getElementById('apps_enabled');
+		
+		for(var i = 0 ; i < select_appEnabled.options.length; i++ )
+			if( select_appEnabled.options[i].selected )
+			{
+				select_appEnabled.options[i].parentNode.removeChild(select_appEnabled.options[i]);
+				i--;
+			}
+	}
+	
+	function Selected()
+	{
+		var select_appEnabled = document.getElementById('apps_enabled');
+		for(var i = 0 ; i < select_appEnabled.options.length; i++ )
+			select_appEnabled.options[i].selected = true;
+	}
+	
+	function AppJabberit(){}
+
+	AppJabberit.prototype.add = addApplication;
+	AppJabberit.prototype.remove = removeApplication;
+	AppJabberit.prototype.select_ = Selected; 
+	window.App = new AppJabberit;
+	
+})();
Index: /trunk/jabberit_messenger/js/load.js
===================================================================
--- /trunk/jabberit_messenger/js/load.js	(revision 382)
+++ /trunk/jabberit_messenger/js/load.js	(revision 417)
@@ -6,6 +6,7 @@
 	var myWindow	  = '';
 	var flagMouseOver = '';
+	var flagOpenIM	  = '';
     
-	//Sniffer Browser
+	// Sniffer Browser
 	var agt=navigator.userAgent.toLowerCase();
     var is_major = parseInt(navigator.appVersion);
@@ -40,5 +41,4 @@
 	function addIcon()
 	{
-		
 		var StatusBar = '';
 		if((StatusBar = document.getElementById('divStatusBar')))
@@ -99,5 +99,6 @@
 					var _options = [
 						['Add Contacts',addContacts],
-						['Help',helpJabberit]
+						['Help',helpJabberit],
+						['Preferences', preferences]
 					];
 
@@ -166,5 +167,4 @@
 	function closeWindow()
 	{
-		_conn.go('$this.ujabber.setWindow','window=closed'); 
 		myWindow = '';
 	}
@@ -200,20 +200,20 @@
 	function openPopup()
 	{
-		_conn.go('$this.ujabber.statusWindow',
-				function(data)
-				{
-					if( !(data.indexOf('closed') < 0 ))
-					{
-						if( !myWindow )
-						{	
-							myWindow = window.open( path_jabberit + 'client.php', 'JabberIM', 'width=215,height=400,top=50,left=50,toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no');
-							myWindow.blur();
-							configEvents(myWindow,'onbeforeunload', closeWindow );
-							_conn.go('$this.ujabber.setWindow','window=open');
-						}
-					}
-					else
-						alert('O Mensageiro já está aberto!');
-				});
+		try{
+			if( ! myWindow )
+			{	
+				myWindow = window.open( path_jabberit + 'client.php', 'JabberIM', 'width=215,height=400,top=50,left=50,toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no');
+				myWindow.blur();
+				configEvents(myWindow,'onbeforeunload', closeWindow );
+			}else
+				myWindow.focus();
+		}
+		catch(e)
+		{
+			delete myWindow;
+			myWindow = window.open( path_jabberit + 'client.php', 'JabberIM', 'width=215,height=400,top=50,left=50,toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no');
+			myWindow.blur();
+			configEvents(myWindow,'onbeforeunload', closeWindow );
+		}
 	}
 
@@ -221,14 +221,18 @@
 	{
 		var _win_contacts = _window.load('jabberit_contacts');
-			_win_contacts.size(1,1);
-			_win_contacts.position(50,50);
-
-			_win_contacts.bc.style.display = "none";
-			_win_contacts.bx.style.display = "none";
-
-			if( _win_contacts.bz.removeEventListener )
-				_win_contacts.bz.removeEventListener('click',_win_contacts.button, false);
-			else
-				_win_contacts.bz.detachEvent('onclick',_win_contacts.button);
+		if( flagOpenIM == 'openWindowJabberit:false' )
+		{
+			_win_contacts.size(215,400);
+		}					
+		else _win_contacts.size(1,1);
+
+		_win_contacts.position(50,50);
+		_win_contacts.bc.style.display = "none";
+		_win_contacts.bx.style.display = "none";
+
+		if( _win_contacts.bz.removeEventListener )
+			_win_contacts.bz.removeEventListener('click',_win_contacts.button, false);
+		else
+			_win_contacts.bz.detachEvent('onclick',_win_contacts.button);
 
 		configEvents(
@@ -245,7 +249,85 @@
 
 		var _params = {'path' : path_jabberit};
+		_win_contacts.content(_xtools.parse(_xtools.xml('contacts_jabberit'), 'contacts_jabberit.xsl', _params));
+
+		if( flagOpenIM == 'openWindowJabberit:false' )
+		{
+			_win_contacts.wm.style.visibility = "visible";
+			_win_contacts.title('.:: Expresso - JMessenger ::.');
+		}
+		else _win_contacts.wm.style.visibility = "hidden";
+	}
+
+	function getPreferences()
+	{
+		if( flagOpenIM == '' )
+		{
+			_conn.go("$this.db_im.getPreferences",
+					 function(data)
+					 {
+							flagOpenIM = data;
+							if(flagOpenIM == 'openWindowJabberit:true')
+							{
+								setTimeout('loadscript.showW();', 2000);
+							}
+					 });
+		}
+	}
+
+	function preferences()
+	{
+		if( !(_window.get('jabberit_preferences')) )
+		{
+			var _win_preferences = _window.load('jabberit_preferences');
+				_win_preferences.size(300,250);
+				_win_preferences.position(150,100);
+				_win_preferences.title('.:: Expresso - JMessenger '+jabberitGetLang('Preferences')+'::.');
+				_win_preferences.bc.style.display = "none";
+				_win_preferences.bx.style.display = "none";
+				_win_preferences.wc.style.padding = "5px";								
+
+			if( _win_preferences.bz.removeEventListener )
+				_win_preferences.bz.removeEventListener('click',_win_preferences.button, false);
+			else
+				_win_preferences.bz.detachEvent('onclick',_win_preferences.button);
+				
+			configEvents(
+				_win_preferences.bz,
+				"onclick",
+				function()
+				{
+					_win_preferences.size(1,1);
+					_win_preferences.wm.style.visibility = 'hidden';
+					_win_preferences.position(50,50);
+					_win_preferences.title('');
+				});
+
+			var _params = {'path'  : path_jabberit,
+						   'lang1' : jabberitGetLang('Your Preferences'), 	
+						   'lang2' : 'Conectar o IM Automaticamente',
+						   'lang3' : jabberitGetLang('Save'),
+						   'lang4' : jabberitGetLang('Cancel')										   
+						  };
+			_win_preferences.content(_xtools.parse(_xtools.xml('preferences_jabberit'), 'preferences_jabberit.xsl', _params));
+ 			_win_preferences.wc.lastChild.lastChild.onclick = _win_preferences.close;
+		}
+		else
+		{
+			var _win_preferences = _window.get('jabberit_preferences');
+			_win_preferences.wm.style.visibility = "visible";
+			_win_preferences.position(150,100);							
+			_win_preferences.title('.:: Expresso - JMessenger '+jabberitGetLang('Preferences')+'::.');
+			_win_preferences.size(300,250);
+		}
 		
-		_win_contacts.content(_xtools.parse(_xtools.xml('contacts_jabberit'), 'contacts_jabberit.xsl', _params));
-		_win_contacts.wm.style.visibility = "hidden";
+		var value = flagOpenIM.split(':');
+		var elementSelect = document.getElementById(value[0]);
+		var valueSelect = value[1];
+
+
+		// Preenchendo a Select
+		for(var i = 0; i < elementSelect.options.length; i++)
+			if( elementSelect.options[i].value == valueSelect )
+				elementSelect.options[i].selected = true;
 	}
 
@@ -259,5 +341,31 @@
 			alert(jabberitGetLang('Your search argument must be longer than 4 characters.'));
 	}
-
+	
+	function setPreferences()
+	{
+		var element = document.getElementById('openWindowJabberit');
+		
+		for(var i = 0 ; i < element.options.length; i++)
+			if( element.options[i].selected == true)
+				var value = element.options[i].value;
+				
+		_conn.go('$this.db_im.setPreferences',
+				 function(data)
+				 {
+					if(data == 'true')
+					{
+						flagOpenIM = 'openWindowJabberit:' + value;
+						alert(jabberitGetLang('Preferences saved with success!'));
+					}
+					else
+						alert(jabberitGetLang('Error saving your preferences!'));
+										
+					var _win_preferences = _window.get('jabberit_preferences');
+						_win_preferences.close();
+											
+				 },
+				'preferences=openWindowJabberit:' + value);
+	}
+	
 	function showDiv()
 	{
@@ -276,5 +384,5 @@
 				_win_contacts.wm.style.visibility = "visible";
 				_win_contacts.title('.:: Expresso - JMessenger ::.');
-				_win_contacts.size(205,400);
+				_win_contacts.size(215,400);
 			}
 			else
@@ -288,5 +396,5 @@
 	{
 		addIcon();
-		setTimeout('loadscript.showW();', 2000);
+		getPreferences();
 	}
 
@@ -295,4 +403,5 @@
 	Load.prototype.show = showDiv;
 	Load.prototype.showW = showWindow;
+	Load.prototype.setPrefe = setPreferences;
 	Load.prototype.closeW = closeWindow;
 	window.loadscript = new Load;
