Index: /branches/2.2/mobile/login.php
===================================================================
--- /branches/2.2/mobile/login.php	(revision 3492)
+++ /branches/2.2/mobile/login.php	(revision 3553)
@@ -19,12 +19,12 @@
 	if(isset($GLOBALS['sessionid']) && $_GET['cd'] != 10 && $_GET['cd'] != 1)
 		start_prefered_app();
-		if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)	{
-		if ($_SERVER['HTTPS'] != 'on')
-                    {
-                        $proxies=explode(',',$_SERVER['HTTP_X_FORWARDED_HOST']);
-                        $fwConstruct = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $proxies[0] : $_SERVER['HTTP_HOST'];
+		
+	if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)	{
+		if ($_SERVER['HTTPS'] != 'on') {
+			$proxies=explode(',',$_SERVER['HTTP_X_FORWARDED_HOST']);
+            $fwConstruct = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $proxies[0] : $_SERVER['HTTP_HOST'];
    			Header('Location: https://' . $fwConstruct . '/' . $_SERVER['REQUEST_URI']);
 			exit;
-                    }
+		}
 	}
 
@@ -34,7 +34,16 @@
 	$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'] = $GLOBALS['phpgw_info']['login_template_set'];
 	$tmpl->set_file(array('login_form' => 'login.tpl'));
-	$tmpl->set_var('cd',check_logoutcode($_GET['cd']));
+	$tmpl->set_block('login_form','page');
+	$tmpl->set_block('login_form','success_message');
+	$tmpl->set_block('login_form','error_message');
+	
+	//verificando a mensagem erro ou sucesso
+	$cd = check_logoutcode($_GET['cd']);
+	$tmpl->set_var('cd', $cd);
+	
+	if(trim($cd) != "")
+		$tmpl->parse('message_box', (($_GET['cd'] == 1) ? 'success_message' : 'error_message') ,True);
+	
 	$tmpl->set_var('css',CreateObject("mobile.mobiletemplate")->get_mobile_css());
-
 
 	function check_logoutcode($code) {
@@ -43,23 +52,16 @@
 				logout();
 				return lang('You have been successfully logged out');
-
 			case 2:
 				return lang('Sorry, your login has expired');
-
 			case 4:
 				return lang('Cookies are required to login to this site.');
-
 			case 5:
-				return '<font color="FF0000">' . lang('Bad login or password') . '</font>';
-
+				return lang('Bad login or password');
 			case 6:
-				return '<font color="FF0000">' . lang('Your password has expired, and you do not have access to change it') . '</font>';
-
+				return lang('Your password has expired, and you do not have access to change it');
 			case 98:
-				return '<font color="FF0000">' . lang('Account is expired') . '</font>';
-
+				return lang('Account is expired');
 			case 99:
-				return '<font color="FF0000">' . lang('Blocked, too many attempts') . '</font>';
-
+				return lang('Blocked, too many attempts');
 			case 10:
 				$GLOBALS['phpgw']->session->phpgw_setcookie('sessionid');
@@ -69,8 +71,7 @@
 					$GLOBALS['phpgw']->session->phpgw_setcookie(PHPGW_PHPSESSID);
 				}
-				return '<font color="#FF0000">' . lang('Your session could not be verified.') . '</font>';
-
+				return lang('Your session could not be verified.');
 			default:
-				return '&nbsp;';
+				return '';
 		}
 	}
@@ -115,7 +116,8 @@
 	$tmpl->set_var('charset',$GLOBALS['phpgw']->translation->charset());
 	$tmpl->set_var('cookie',$last_loginid);
-	$tmpl->set_var('lang_username',lang('username'));
-	$tmpl->set_var('lang_password',lang('password'));
-	$tmpl->set_var('lang_login',lang('login'));
+	$tmpl->set_var('lang_username', lang('username'));
+	$tmpl->set_var('lang_password', lang('password'));
+	$tmpl->set_var('lang_login', lang('login'));
+	$tmpl->set_var('lang_notices', lang('notices'));
 	$tmpl->set_var('website_title', $GLOBALS['phpgw_info']['server']['site_title']);
 	$tmpl->set_var('template_set',$GLOBALS['phpgw_info']['login_template_set']);
@@ -123,5 +125,5 @@
 	$tmpl->set_var($var);
 	$tmpl->set_block('login_form','language_select');
-	$tmpl->pfp('loginout','login_form');
+	$tmpl->pfp('loginout','page');
 
 	function logout(){
Index: /branches/2.2/mobile/templates/default/login.tpl
===================================================================
--- /branches/2.2/mobile/templates/default/login.tpl	(revision 3484)
+++ /branches/2.2/mobile/templates/default/login.tpl	(revision 3553)
@@ -1,46 +1,59 @@
-<html>
-<head>
-	<title>{website_title} - {lang_login}</title>
-	{css}
-</head>
-<body scroll="no"  style="overflow:hidden" bgcolor="#ffffff">
-	<table border="0" height="100%" width="100%">
-		<tr>
-			<td align="center" valign="top">
-				<div align="center" class="msgInicial">{cd}<br>{lang_message}<br>{website_title}<br><br></div>
-		        	<table border="0" bordercolor="#cfcfcf" cellpadding="0" cellspacing="0" width="auto">
-			        	<tbody>
-						<form name="form_login" method="post" action="./login.php" autocomplete=off>
-						<tr>
-							<td align="center" bgcolor="#f7f7f7" style="border:1px solid black">
-								<table border="0" cellpadding="1" cellspacing="0" class="tableLogin">
-									<tr><td width="96" colspan="3">&nbsp;</td></tr>												
-								    <tr><td width="120" class="loginLabel" align="right">{lang_username}:&nbsp;</td>
-										<td width="120"><input name="login" size="15">
-										<script>document.form_login.login.focus();</script></td>
-										<td width="43" rowspan="3" colspan=2>&nbsp;</td>
-									</tr>
-									<tr>
-										<td width="120" class="loginLabel"  align="right">{lang_password}:&nbsp;</td>
-										<td width="35"><input name="passwd" type="password" size="15"></td>
-									</tr>
-									<tr>
-										<td width="120">&nbsp;</td>
-										<td width="135">
-										  <input type="submit" value="{lang_login}" name="submitit" class="button">
-										</td>
-									</tr>
-								</table>              
-							</td>
-						</tr>
-						<input type="hidden" name="passwd_type" value="text">
-						<input type="hidden" name="account type" value="u">
-		              	</form>		          
-						</tbody>
-					</table>      
-				</div>
-			</td>		
-		</tr>
-	</table>
-</body>
+<!-- BEGIN page -->
+<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> 
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>   
+	    <title>{website_title} - {lang_login}</title>
+		<meta content="text/html;width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0; charset=utf-8;" http-equiv="Content-Type" name="viewport" /> 
+		<meta name="format-detection" content="telephone=no" />
+		{css}
+	</head>
+	
+    <body>    	
+		<div class="topo">
+        	<h1>{website_title} - {lang_login}</h1>
+		</div>
+
+		{message_box}
+		
+		<div class="campos-entrada">
+			<div class="posiciona-esquerda">
+				<form name="form_login" method="post" action="./login.php" autocomplete=off>
+					<input type="hidden" name="passwd_type" value="text">
+					<input type="hidden" name="account type" value="u">
+					<p><strong>{lang_username}:&nbsp</strong></p> 
+					<p><input name="login"></p>
+					<script>document.form_login.login.focus();</script>
+					<p><strong>{lang_password}:&nbsp</strong></p> 
+					<p><input name="passwd" type="password"></p>
+					<p><button name="submitit" class="btn-contexto">{lang_login}</button></p>
+				</form>
+			</div>
+		</div>
+			
+		<div id="corpo_mensagem" class="login">
+			<p><strong>{lang_notices}</strong></p>
+			<div class="avisos">
+				<p><strong>Bem vindo ao novo Expresso Mini!</strong></p>
+				<p>Navegue, aprecie e opnie!</p> 
+			</div>
+		</div>
+	
+		<div class="rodape">Projeto ExpressoLivre 2004 - 2010 :: Licen&ccedil;a de Software</div>
+    </body>
 </html>
+<!-- END page -->
+<!-- BEGIN success_message -->
+<div class="bg-neutro">
+	<div class="aviso-positivo">
+		<strong>{cd}{lang_message}</strong>
+	</div>
+</div>
+<!-- END success_message -->
+<!-- BEGIN error_message -->
+<div class="bg-neutro">
+	<div class="aviso-negativo">
+		<strong>{cd}{lang_message}</strong>
+	</div>
+</div>
+<!-- END error_message -->
Index: /branches/2.2/mobile/templates/css/mobile.css
===================================================================
--- /branches/2.2/mobile/templates/css/mobile.css	(revision 3466)
+++ /branches/2.2/mobile/templates/css/mobile.css	(revision 3553)
@@ -1,444 +1,86 @@
-body
-{
-	font-size: 13px !important;
-	font-family: Verdana, Arial, Helvetica, sans-serif !important;
-	left: 0px;
-	padding: 0px;
-	margin: 0px;
-}
+/**********GLOBAL RESET*************/
 
-img
-{
-	border-width:0px !important;
-	border-style:none !important;
-}
-
-a:link,a:visited
-{
-	cursor:pointer !important;
-	color: #000000 !important;
-	text-decoration: none !important;
-}
-
-a:hover,a:active
-{
-	cursor:pointer !important;
-	color: #ff9933 !important;
-	text-decoration: none !important;
-}
-
-input, button
-{
-	font-size: 11px !important;
-	color: #006699 !important;
-	font-family: Arial, Helvetica, sans-serif !important;
-	border: 1px #000066 solid !important;
-}
-
-input[type=submit],input[type=button],button
-{
-	margin:1px !important;
-	padding:0px 6px 0px 6px !important;
-	cursor: pointer !important;
-	cursor: hand !important;
-}
-
-input[type=image]
-{
-	cursor: pointer !important;
-	cursor: hand !important;
-	border: 1px #bbbbbb none !important;
-}
-
-select
-{
-	font-size: 11px !important;
-	color: #000066 !important;
-	font-family: Arial, Helvetica, sans-serif !important;
-	border: 1px #bbbbbb solid !important;
-	z-index: -1 !important;
-}
-
-td
-{
-	font-size: 11px !important;
-}
-
-h1, h4
-{
-	font-size:16px;
-	margin:10 0 10 20;
-}
-p{
-	margin:10 0 10 20;
-}
-
-.divLoginbox
-{
-	position:relative;
-	width: 300px;
-	border-right: #9c9c9c 0px solid;
-	border-top: #9c9c9c 1px solid;
-	border-left: #9c9c9c 0px solid;
-	border-bottom: #9c9c9c 1px solid
-}
-
-.divLoginboxHeader
-{
-	text-align:center;
-	background-color:#dddddd;
-	padding-top:2px;
-	font-size:10px;
-	color:#666666;
-}
-.divSidebox
-{
-	position:relative;
-	width: 147px;
-	border-right: #9c9c9c 1px solid;
-	border-top: #9c9c9c 1px solid;
-	border-left: #9c9c9c 1px solid;
-	border-bottom: #9c9c9c 1px solid
-}
-
-.tblHeadApp {
-
-	border-right: #9c9c9c 1px solid;
-	border-top: #9c9c9c 1px solid;
-	border-left: #9c9c9c 1px solid;
-	border-bottom: #9c9c9c 1px solid
-}
-
-.divSideboxHeader
-{
-	text-align:center;
-	background-color:#000066;
-	padding-top:2px;
-	height: 15px;
-	color: #FFFFFF;
-
-}
-
-a.divSideboxEntry, .divSideboxEntry
-{
-	text-align:left;
-	height:16px;
-	background-color:#eeeeee;
-}
-
-a.appTitles,.appTitles
-{
-	font-size: 10px;
-	height:18px;
-	padding-top:2px;
-	padding-bottom:2px;
-
-}
-
-a.textSidebox
-{
-	font-size: 10px;
-	border-top: #aaaaaa 0px none;
-}
-
-.textSidebox
-{
-	font-size: 10px;
-	height:18px;
-	padding-top:2px;
-	padding-bottom:2px;
-	border-top: #aaaaaa 1px solid;
-
-}
-
-.sideboxSpace
-{
-	height:9px;
-}
-
-.greyLine
-{
-	margin:1px;
-	border-top-color:#7e7e7e;
-	border-top-width:1px;
-	border-top-style:solid;
-	height:1px;
-}
-
-.prefSection
-{
-	font-weight:bold;
-	font-size:16px;
-	line-height:40px;
-}
-
-#extraIcons
-{
-	background-color:#eeeeee;
-	border-width:1px;
-	border-color:#7e7e7e;
-	border-style:solid;
-}
-
-.extraIconsRow
-{
-	border-top-color:#dddddd;
-	border-top-width:1px;
-	border-top-style:solid;
-	padding:2px;
-}
-
-#divMain
-{
-	background-color:white;
-	margin-top: 0px;
-	padding:9px;
-	border-color:#7e7e7e;
-	border-width:1px;
-	border-style:solid;
-}
-
-#divLogo
-{
-	position:absolute;
-	left:20px;
-	top:5px;
-	z-index:51;
-}
-
-#divAppIconBar
-{
-	background-color:white;
-	border-top-color:#9c9c9c;
-	border-top-width:1px;
-	border-top-style:solid;
-	background-image: url(../images/background-icon-bar.png);
-	background-repeat: repeat-x
-}
-
-#divAppTextBar
-{
-	background-color:white;
-}
-
-#divStatusBar
-{
-	background-color:#f7f8fa;
-	height:15px;
-	padding-left:10px;
-	padding-top:0px;
-}
-
-#tdSidebox
-{
-	width:170px;
-	background-color:white;
-	overflow:visible;
-}
+html, body, div, span, iframe, h1, h2, h3, h4, h5, h6, p,
+blockquote, pre, a, abbr, acronym, address, code, del, 
+dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, 
+label, legend, table, caption, tbody, tfoot, thead, tr, th, 
+td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:Arial, Helvetica, sans-serif;}
+body { -webkit-text-size-adjust: none; }
+table {border-collapse:separate;border-spacing:0;}
+caption, th, td {text-align:left;font-weight:normal;}
+table, td, th {vertical-align:middle;}
+blockquote:before, blockquote:after, q:before, q:after {content:"";}
+blockquote, q {quotes:"" "";}
+a img {border:none;}			
+a:link, a:visited {text-decoration: none}
+li {list-style:none;}
+body {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:Arial, Helvetica, sans-serif;vertical-align:baseline;}
 
 
-#tdAppbox
-{
-	background-color:white;
-	width: 100%;
-}
+/***************Elementos******************/X
 
-#divSideboxContainer
-{
-	position:relative;
-	width:150px;
-	top:0px;
-	left:0px;
-	background-color:white;
-	border-width:1px;
-	border-style:solid;
-	z-index:40;
-}
+*{font-family:Arial; font-size: 10px;}
+h1{ padding-top: 5px; height:20px; font-size: 80%; padding-left:5px; color:#FFFFFF;}
+dt{ padding:2px 0px 0px 5px; height:20px; font-weight:bold; font-size: 80%; color:#3E3E3D; background-color:#CEE5EF;}
+dd{ min-width:200px; padding-top:3px; padding-left:25px; vertical-align:middle; min-height:20px; font-size:70%;}
+input{ height: 15px; }
+dt select, div.menu-contexto select{font-size:80%; border:none; color:#ffffff; background-color:#2B84AF;}
+div.menu-contexto select{font-size:90%; border:none; color:#ffffff; background-color:#2B84AF;}
+div.menu-contexto a{color:#FFFFFF; text-decoration:underline;}
+#operacao_lista{ padding-left: 5px; padding-top:5px; height:25px; font-size:70%; background-color:#C9C9C9; }
+#menu_rodape{background-color:#F2F2F2;}
+#menu_rodape a{ padding-left:10px; color:#2B84AF; font-size:9px;}
+#corpo_mensagem{ padding:10px;font-size:11px; min-width:200px;}
+#corpo_mensagem p{min-height:25px;}
+#corpo_mensagem input {height:10px;}
 
-#divAppboxHeader
-{
-	margin-top:2px;
-	margin-left:2px;
-	margin-right:2px;
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 14px;
-	font-weight: bold;
-	color: #000066;
-	text-align: center;
-	padding: 0px;
-	background-image:url(../images/appbox-header-background21.png);
-	background-repeat: repeat-x;
-	height:24px;
-	line-height:24px;
-	border-top-color:#9c9c9c;
-	border-top-width:1px;
-	border-top-style:solid;
-	border-left-color:#9c9c9c;
-	border-left-width:1px;
-	border-left-style:solid;
-	border-right-color:#9c9c9c;
-	border-right-width:1px;
-	border-right-style:solid;
-}
+/***************Classes******************/
 
-#divAppbox
-{
-	background-color:#f7f7f7;
-	padding-right:1px;
-	padding-top:1px;
-	padding-bottom:1px;
-	padding-left:15px;
-	border-bottom-color:#9c9c9c;
-	border-bottom-width:1px;
-	border-bottom-style:solid;
-	border-left-color:#9c9c9c;
-	border-left-width:1px;
-	border-left-style:solid;
-	border-right-color:#9c9c9c;
-	border-right-width:1px;
-	border-right-style:solid;
-	margin-top:0px;
-	margin-bottom:0px;
-	margin-left:2px;
-	margin-right:2px;
 
-}
+.busca{ padding-left: 5px; padding-top:5px; height:25px;; background-color:#E4E4E4}
+.busca input{height:10px;}
+.par{background-color:#EEF7FA}
+.topo{background-color:#3E3E3D;}
+.rodape{ padding-top:4px; height:16px; text-align:center; font-size:50%; background-color:#F6F6F6; color:#333333;}
+.btn-generico{color:#FFFFFF; background-color:#434343; border:none;}
+.contagem{ text-align:right;}
+.nome-item{ float:left; width:160px;}
+.menu-contexto{ padding-top:3px; padding-left:5px; height:20px; font-size:60%; background-color:#3399CC; color:#FFFFFF;}
+.btn-contexto{ font-size:90%; border:none; background-color:#2B84AF; color:#FFFFFF;}
+.titulo_mensagem{ font-size:75%; font-weight:bold;}
+.titulo-sdt{ padding:2px 0px 0px 5px; height:20px; font-weight:bold; font-size: 80%; color:#3E3E3D; background-color:#CEE5EF;}
 
-#fmStatusBar
-{
-	margin-left:4px;
-	margin-bottom:3px;
-	font-size: 10px;
-}
+.menu-diverso{ height:35px;}
+.menu-diverso a{ margin-right:3px; padding:5px; font-size:110%; background-color:#EEF7FA; color:#434343;}
+.menu-diverso a:hover{color:#FFFFFF;background-color:#3399CC;}
+dt.menu-diverso div{margin-top:8px;}
 
-.fmButton
-{
-	background-image:url(../images/buttonbackground.png);
-	width:28px;
-	height:28px;
-	background-repeat: no-repeat;
-}
+.reset-dt{background-color:#ffffff;}
+.dd-mensagem{height:30px;}
+.btn-anexo{ padding:2px; font-size: 80%; background-color:#FAD364;}
+a.btn-anexo{ padding:2px; font-size: 80%; color:#3E3E3D; background-color:#FAD364;}
+.sobre-mensagem{ min-width:140px; float:left;}
 
-#fmLocation
-{
-	position:relative;
-	margin-bottom:3px;
-	height:27px;
+.alerta{ font-style:italic; color:#FF3300;}
+.sinal-alerta{padding:1px 5px 1px 5px; background-color:#FF3300; color:#ffffff;}
+.titulo-secao{padding:0px 10px 0px 10px; font-size:120%; color:#ffffff; font-weight:bold;}
 
-}
+.label-normal{font-style:italic;}
 
-#fmMenu
-{
-	position:relative;
-}
+.campos-entrada{ height:110px; font-size:70%; background-color:#CEE5EF;}
+.campos-correspondencia{ height:65px; font-size:70%; background-color:#CEE5EF;}
+.campos-correspondencia input, .campos-entrada input{height:9px;}
+.posiciona-esquerda{padding:5px 0px 0px 10px; float:left;}
+.posiciona-esquerda p{height:20px;}
 
-#fmFileWindow
-{
-	background-color:#ffffff;
-	margin-left:4px;
-	padding:5px;
-	position:relative;
-	border-right: #cccccc 1px solid;
-	border-top: #9c9c9c 2px solid;
-	border-left: #9c9c9c 2px solid;
-	border-bottom: #cccccc 1px solid
-}
+.login{ background-color:#EEF7FA;}
+.login p{padding:3px;}
+.avisos{background-color:#FAE1E1;}
+.aviso-positivo{ padding:5px; font-size:70%; color:#333333; background-color:#CEE5EF; }
+.aviso-negativo{ padding:5px; font-size:70%; color:#333333; background-color:#FAE1E1; }
+.aviso-positivo a,.aviso-negativo a{text-decoration:underline; color:#333333;}
 
-#user_info
-{
-padding-left:17px;
 
-}
+.bg-neutro{padding:5px; background-color:#EEF7FA;} 
 
-#admin_info
-{
-	position:relative;
-	text-align:center;
-	margin-right:10px;
-}
-
-#divGenTime
-{
-	bottom:14px;
-	font-size: 9px;
-	color: #ff0000;
-	text-align:center;
-	width:99%;
-}
-
-#divPoweredBy
-{
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 10px;
-	color: #999999;
-	text-decoration: none;
-	padding: 7px;
-	text-align: center;
-	background-color:white;
-}
-
-A.minicalhol
-{
-	padding-left:3px;
-	padding-right:3px;
-	background: #dab0b0;
-	color: #000000;
-	font-size: 10px;
-}
-
-.loginLabel
-{
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 10px;
-	color: #000066;
-	padding-left: 0px;
-}
-
-.tableLogin
-{
-	padding: 0px;
-}
-
-.login
-{
-	text-align:center;
-	background-color: #F7F7F7;
-	border: 1px solid #CCCCCC;
-	margin: 5px 5px 50px;
-	padding: 5px;
-	height: 116px;
-	width: 300px;
-}
-
-.button
-{
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 10px;
-	color: 006699;
-	background-color: #D4D0C8;
-	border: 1px solid #666666;
-}
-
-.msgInicial
-{
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: 12px;
-	color: #000066;
-	font-weight: bold;
-	padding-top: 1px;
-}
-
-.grid_email_class
-{
-	border-bottom:1px solid #cfcfcf;
-}
-
-.unseen_bkg
-{
-	background-color: #e0ecff;
-}
-
-.seen_bkg
-{
-	background-color: #ffffff;
-}
+.rotulo-complementar{font-size:9px; text-decoration:underline; font-weight:normal;}
Index: /branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 3527)
+++ /branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 3553)
@@ -1676,4 +1676,7 @@
      * Se usar $params['noSharedFolders'] = true, ira retornar todas as pastas do usuário logado,
      * excluindo as compartilhadas para ele.
+     * Se usar $params['folderType'] = "default" irá retornar somente as pastas defaults
+     * Se usar $params['folderType'] = "personal" irá retornar somente as pastas pessoais
+     * Se usar $params['folderType'] = null irá retornar todas as pastas
      * @return Retorna um array contendo as seguintes informacoes de cada pasta: folder_unseen,
      * folder_id, folder_name, folder_parent e folder_hasChildren.
@@ -1700,4 +1703,5 @@
 		if ( $params && $params['noSharedFolders'] )
 			$folders_list = imap_getmailboxes($mbox_stream, $serverString, 'INBOX' ) + $folders_list;
+			
 		$folders_list = array_slice($folders_list,0,$this->foldersLimit); 
 
@@ -1716,11 +1720,11 @@
   				//$tmp_folder_id = explode("}", imap_utf7_decode($val->name));
   				$tmp_folder_id = explode("}", mb_convert_encoding($val->name, "ISO_8859-1", "UTF7-IMAP" ));
-    			        if($tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') {
-		        	        //error_log('passou', 3,'/tmp/imap_get_list.log');
-                			//imap_deletemailbox($mbox_stream,imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas'));
-		                	continue;
-		                }
-		                $result[$i]['folder_unseen'] = $status->unseen;
-  				$folder_id = $tmp_folder_id[1];
+    	        if($tmp_folder_id[1]=='INBOX'.$this->imap_delimiter.'decifradas') {
+        	        //error_log('passou', 3,'/tmp/imap_get_list.log');
+                	//imap_deletemailbox($mbox_stream,imap_utf7_encode("{".$this->imap_server."}".'INBOX/decifradas'));
+                	continue;
+                }
+                $result[$i]['folder_unseen'] = $status->unseen;
+	  			$folder_id = $tmp_folder_id[1];
 				$result[$i]['folder_id'] = $folder_id;
 
@@ -1750,4 +1754,5 @@
 					case $trash:
                 		   		$resultDefault[]=$result[$i];
+                		   		break;
 					default:
                 				$resultMine[]=$result[$i];
@@ -1758,4 +1763,11 @@
 		}
 
+		//Get quota info of current folder
+		$current_folder = "INBOX";
+		if($params && $params['folder'])
+			$current_folder = $params['folder'];
+			
+		$arr_quota_info = $this->get_quota(array('folder_id' => $current_folder));		
+		
 		// Sorting resultMine
 		foreach ($resultMine as $folder_info)
@@ -1771,9 +1783,7 @@
 		}
 		
-		$resultDefault2=$resultDefault;
 		// Sorting resultDefault
 		foreach ($resultDefault as $key => $folder_id)
 		{
-
 			switch ($resultDefault[$key]['folder_id']) {
 				case $inbox: 
@@ -1794,12 +1804,15 @@
 			}
 		}
-
-		// Merge default folders and mines
+		
+		if ( $params && $params['folderType'] && $params['folderType'] == 'default' )
+			return array_merge($resultDefault2, $arr_quota_info);		
+
+		if ( $params && $params['folderType'] && $params['folderType'] == 'personal' )
+			return array_merge($result2, $arr_quota_info);	
+			
+		// Merge default folders and personal
 		$result2 = array_merge($resultDefault2, $result2);
 		
-		$current_folder = "INBOX";
-		if($params && $params['folder'])
-			$current_folder = $params['folder'];
-		return array_merge($result2, $this->get_quota(array('folder_id' => $current_folder)));
+		return array_merge($result2, $arr_quota_info);
 	}
 
