Index: /trunk/expressoMail1_2/inc/class.db_functions.inc.php
===================================================================
--- /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 1059)
+++ /trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 1186)
@@ -215,71 +215,4 @@
 		return $stringDropDownContacts;	
 	}
-	/*
-	function update_preferences($params){
-		
-		$aux = explode("##",$params['prefe_string']);
-		$new_prefe = array();
-		
-		foreach($aux as $key=>$tmp){
-			if($key == 0){
-				$new_prefe['max_email_per_page'] = $tmp;
-			}
-			if($key == 1){
-				$new_prefe['save_deleted_msg'] = $tmp;
-			}
-			if($key == 2){
-				$new_prefe['delete_trash_messages_after_n_days'] = $tmp;
-			}
-			if($key == 3){
-				$new_prefe['delete_and_show_previous_message'] = $tmp;
-			}
-			if($key == 4){
-				$new_prefe['alert_new_msg'] = $tmp;
-			}
-			if($key == 5){
-				$new_prefe['mainscreen_showmail'] = $tmp;
-			}
-			if($key == 10){
-				$new_prefe['signature'] = $tmp;
-			}
-			if($key == 7){
-				$new_prefe['hide_folders'] = $tmp;
-			}
-			if($key == 6){
-				$new_prefe['save_in_folder'] = $tmp;
-			}
-			if($key == 8){
-				$new_prefe['line_height'] = $tmp;
-			}
-			if($key == 9){
-				$new_prefe['font_size'] = $tmp;
-			}
-			if($key == 11){
-				$new_prefe['use_shortcuts'] = $tmp;
-			}
-		}
-		
-		$string_serial =  serialize($new_prefe);
-		$string_serial = get_magic_quotes_gpc() ? $string_serial : addslashes($string_serial);
-		$query = "update phpgw_preferences set preference_value = '".$string_serial."' where preference_app = 'expressoMail'".
-				 " and preference_owner = '".$this->user_id."'";
-		
-		if (!$this->db->query($query))
-        	return "Failed!";
-		else
-			return "OK!";
-	}
-	*/
-	function update_preferences($params){
-		$string_serial = urldecode($params['prefe_string']);				
-		$string_serial = get_magic_quotes_gpc() ? $string_serial : addslashes($string_serial);
-		$query = "update phpgw_preferences set preference_value = '".$string_serial."' where preference_app = 'expressoMail'".
-				 " and preference_owner = '".$this->user_id."'";
-		
-		if (!$this->db->query($query))
-        	return $this->db->error;
-		else
-			return array("success" => true);
-	}
 	function getUserByEmail($params){	
 		// Follow the referral
Index: /trunk/expressoMail1_2/js/common_functions.js
===================================================================
--- /trunk/expressoMail1_2/js/common_functions.js	(revision 1162)
+++ /trunk/expressoMail1_2/js/common_functions.js	(revision 1186)
@@ -558,11 +558,5 @@
 
 function preferences_mail(){
-	if(preferences.type_signature && preferences.type_signature == 'html') {
-		location.href="../preferences/preferences.php?appname=expressoMail1_2";
-	}
-	else {
-		connector.loadScript("preferences");
-		prefe.showList();
-	}
+	location.href="../preferences/preferences.php?appname=expressoMail1_2";
 }
 
Index: unk/expressoMail1_2/js/preferences.js
===================================================================
--- /trunk/expressoMail1_2/js/preferences.js	(revision 485)
+++ 	(revision )
@@ -1,296 +1,0 @@
-/**************************************************************************\
- Início 
-\**************************************************************************/
-	function Preferences(){
-		this.prefeW 		= new Array;
-	}
-	// Cria as divs;
-	Preferences.prototype.showList = function(){
-	
-		id = '1';
-		_this = this;
-		
-		form_pref = document.createElement("DIV");
-		form_pref.style.visibility = "hidden";
-		form_pref.style.position = "absolute";
-		form_pref.id = "window_confexp";
-		document.body.appendChild(form_pref);
-		prefe.showWindow(form_pref);
-		var form = Element("form_preferences");
-		
-		if(!form) {
-			form = document.createElement("FORM");
-			form.id  = "form_preferences";
-			form.innerHTML = 	"<table border='0' cellpading='0' cellspacing='0'>"+
-				"<tr><td colspan='2'><center>" + get_lang('Config for expressoMail') + "</center></td></tr>"+
-				"<tr><td nowrap> - " + get_lang('What is the maximum number of messages per page?') + "</td>"+
-				"<td>&nbsp;<select id='sel_num_max' name='sel_num_max'>"+
-				"<option value='25'>25</option>"+
-				"<option value='50'>50</option>"+
-				"<option value='75'>75</option>"+
-				"<option value='100'>100</option>"+														
-				"</select></td>"+
-				"</tr>"+
-				"<tr><td nowrap> - " + get_lang('Save deleted messages in trash folder?') + "</td>"+
-				"<td><input type='checkBox' id='check_save_men' name='check_save_men'></td>"+
-				"</tr>"+
-				"<tr><td nowrap> - " + get_lang('Delete trash messages after how many days?') + "</td>"+
-				"<td>&nbsp;<select id='sel_del_men' name='sel_del_men'>"+
-				"<option value='0'>" + get_lang('None') + "</option>"+
-				"<option value='1'>"+get_lang("1 day")+"</option>"+
-				"<option value='2'>"+get_lang("2 days")+"</option>"+												
-				"<option value='3'>"+get_lang("3 days")+"</option>"+							
-				"<option value='4'>"+get_lang("4 days")+"</option>"+							
-				"<option value='5'>"+get_lang("5 days")+"</option>"+							
-				"</select></td>"+
-				"</tr>"+
-				"<tr><td nowrap> - " + get_lang('Show previous message, after delete actual message?') + "</td>"+
-				"<td><input type='checkBox' id='check_show_previous' name='check_show_previous'></td>"+
-				"</tr>"+
-				"<tr><td nowrap> - " + get_lang('Do you wanna receive an alert for new messages?') + "</td>"+
-				"<td><input type='checkBox' id='check_alert' name='check_alert'></td>"+
-				"</tr>"+
-				"<tr><td nowrap> - " + get_lang('Show default view on main screen?') + "</td>"+
-				"<td><input type='checkBox' id='check_view' name='check_view'></td>"+
-				"</tr>"+
-				"<tr><td nowrap> - " + get_lang('Save sent messages in folder') + "</td>"+				
-				"<td>&nbsp;<select style='width:125px' id='sel_name_box' name='sel_name_box'></select></td>"+
-				"</tr>"+
-				"<tr><td> - " + get_lang('Hide menu folders?') + "</td>"+
-				"<td><input type='checkBox' id='check_menu' name='check_menu'></td>"+
-				"</tr>"+
-				"<tr><td> - " + get_lang('What is the height of the lines in the list of messages?') + "</td>"+
-				"<td>&nbsp;<select id='sel_height_line' name='sel_height_line'>"+
-				"<option value='20'>"+get_lang("Normal")+"</option>"+
-				"<option value='30'>"+get_lang("Medium")+"</option>"+
-				"<option value='40'>"+get_lang("Big")+"</option>"+														
-				"</select></td>"+
-				"</tr>"+
-				"<tr><td> - " + get_lang('What the font size in the list of messages?') + "</td>"+
-				"<td>&nbsp;<select id='sel_size_font' name='sel_size_font'>"+
-				"<option value='10'>"+get_lang("Small")+"</option>"+
-				"<option value='11'>"+get_lang("Normal")+"</option>"+							
-				"<option value='15'>"+get_lang("Big")+"</option>"+
-				"</select></td></tr>"+
-				"<tr><td> - " + get_lang("Use dynamic contacts?") + "</td>"+
-				"<td><input type='checkBox' id='use_dynamic_contacts' name='use_dynamic_contacts'></td></tr>"+
-				"<tr><td> - " + get_lang("Auto save draft") + "?</td>"+
-				"<td><input type='checkBox' id='auto_save_draft' name='auto_save_draft'></td></tr>"+
-				"<tr><td> - " + get_lang("Use shortcuts?") + "</td>"+
-				"<td><input type='checkBox' id='use_shortcuts' name='use_shortcuts'></td></tr>"+
-				"<tr><td nowrap> - " + get_lang('Insert signature automatically in new messages?') + "</td>"+
-				"<td><input type='checkBox' id='use_signature' name='use_signature'></td>"+
-				"</tr>"+
-				"<tr><td colspan='2'> - " + get_lang('Signature') + "<br>"+
-				"<textarea id='txt_signature' name='txt_signature' rows='3' cols='59'></textarea></td>"+
-				"</tr>"+
-				"<tr><td><input type='button' value='"+get_lang("Cancel")+"' onclick='prefe.close_win();'>"+
-				"<td align='left'><input type='button' value='"+get_lang("Save")+"' onclick='prefe.save_form()'>"+
-				"</tr>"+
-				"</table>";
-			form_pref.appendChild(form);
-			var sel_nm = Element("sel_name_box");
-			var opt = new Option(get_lang("Select the user"),"-1",true,true);
-			sel_nm.options[sel_nm.length] = opt;
-			var reg = /user(\.|\/)(.*)$/;
-			for(var i=0; i < folders.length; i++){
-				if(reg.test(folders[i].folder_id))
-					continue;
-				var level =  parseInt(folders[i].folder_id.split(cyrus_delimiter).length);
-				var	ident = '';
-				for(var j = 2;level > 2 && j < level; j++)
-					ident += ' - ';
-				var opt = new Option(ident+lang_folder(folders[i].folder_name),folders[i].folder_id,false,true);
-				sel_nm.options[sel_nm.length] = opt;
-			}
-			sel_nm.options[0].selected = true;
-			_this.clean_all();
-		}
-		_this.load_form();
-	}
-	
-	// Preenche os campos no form;
-	Preferences.prototype.load_form = function(){
-		var sel_num_max = Element("sel_num_max");
-			for(var i=0; i < sel_num_max.options.length; i++){
-				if(sel_num_max.options[i].value == preferences.max_email_per_page){sel_num_max.options[i].selected = true;}
-			}
-		var check_save_men = Element("check_save_men");
-			if( preferences.save_deleted_msg == 1){check_save_men.checked = true;}
-		var sel_del_men = Element("sel_del_men");
-			for(var i=0; i < sel_del_men.options.length; i++){
-				if(sel_del_men.options[i].value == preferences.delete_trash_messages_after_n_days){sel_del_men.options[i].selected = true;}
-			}
-		var check_show_previous = Element("check_show_previous");
-			if( preferences.delete_and_show_previous_message == 1){check_show_previous.checked = true;} 
-		var check_alert = Element("check_alert");
-			if( preferences.alert_new_msg == 1){check_alert.checked = true;}
-		var check_view = Element("check_view");
-			if( preferences.mainscreen_showmail == 1){check_view.checked = true;}
-		var sel_name_box = Element("sel_name_box");
-			for(var i=0; i < sel_name_box.options.length; i++){
-				if(sel_name_box.options[i].value == preferences.save_in_folder){sel_name_box.options[i].selected = true;}
-			}
-		var check_menu = Element("check_menu");
-			if( preferences.hide_folders == 1){check_menu.checked = true;}
-		var sel_height_line = Element("sel_height_line");
-			for(var i=0; i < sel_height_line.options.length; i++){
-				if( sel_height_line.options[i].value == preferences.line_height){sel_height_line.options[i].selected = true;}
-			}
-		var sel_size_font = Element("sel_size_font");
-			for(var i=0; i < sel_size_font.options.length; i++){
-				if(sel_size_font.options[i].value == preferences.font_size){sel_size_font.options[i].selected = true;}
-			}
-		var use_dynamic_contacts = Element("use_dynamic_contacts");
-			if (preferences.use_dynamic_contacts == 1) {
-				use_dynamic_contacts.checked = true;
-			}
-		var use_signature = Element("use_signature");
-			if( preferences.use_signature == 1){
-				use_signature.checked = true;
-			}
-		var txt_signature = Element("txt_signature");
-			txt_signature.value = preferences.signature;
-		
-		if ((preferences.number_of_contacts < 1) || isNaN(preferences.number_of_contacts)){
-			Element("use_dynamic_contacts").checked = false;
-			Element("use_dynamic_contacts").disabled = 'disabled';
-		}
-		if( preferences.use_shortcuts == 1) Element("use_shortcuts").checked = true;
-		if( preferences.auto_save_draft == 1) Element("auto_save_draft").checked = true;
-	}
-	
-
-	// Salva as opções do form;
-	Preferences.prototype.save_form = function(){
-		
-		var _this = this;	
-	    //var prefe_string;			
-		var reload_page = false;
-
-		if(preferences.max_email_per_page != Element("sel_num_max").value)
-			reload_page = true;
-		else if(preferences.delete_trash_messages_after_n_days != Element("sel_del_men").value)
-		   	reload_page = true;
-		else if(preferences.hide_folders != Element("check_menu").checked)
-			reload_page = true;
-		else if(preferences.line_height != Element("sel_height_line").value)
-	    	reload_page = true;
-	    else if(preferences.font_size != Element("sel_size_font").value)
-			reload_page = true;
-	    else if(preferences.use_shortcuts != Element("use_shortcuts").checked)
-			reload_page = true;
-	    else if(preferences.auto_save_draft != Element("auto_save_draft").checked)
-			reload_page = true;
-		else if(preferences.use_dynamic_contacts != Element("use_dynamic_contacts").checked) {
-			reload_page = true;
-			_this.delete_dynamic_contacts();
-		}
-				
-		preferences.max_email_per_page = Element("sel_num_max").value; 
-	 	preferences.save_deleted_msg = Element("check_save_men").checked ? 1 : 0;
-		preferences.delete_trash_messages_after_n_days = Element("sel_del_men").value;
-		preferences.delete_and_show_previous_message = Element("check_show_previous").checked ? 1 : 0;
-		preferences.alert_new_msg = Element("check_alert").checked ? 1 : 0;
-		preferences.mainscreen_showmail = Element("check_view").checked ? 1 : 0;
-	   	preferences.save_in_folder = Element("sel_name_box").value;
-		preferences.hide_folders = Element("check_menu").checked ? 1 : 0;
-	    preferences.line_height = Element("sel_height_line").value;
-		preferences.font_size = Element("sel_size_font").value;
-		preferences.use_signature = Element("use_signature").checked ? 1 : 0;
-		preferences.signature = Element("txt_signature").value;
-		preferences.use_dynamic_contacts = Element("use_dynamic_contacts").checked ? 1 : 0;
-		preferences.use_shortcuts = Element("use_shortcuts").checked ? 1 : 0;
-		preferences.auto_save_draft = Element("auto_save_draft").checked ? 1 : 0;
-
-
-	   	var handler_preferences = function(data){
-	   		if(data && data.success){
-	   			if(reload_page)
-			   		window.location.reload(true);
-			   	else
-				   	_this.close_win();
-	   		}else{
-	   			alert(data);
-	   		}
-	   	}
-	   	var args   = "$this.db_functions.update_preferences";
-		var params = "prefe_string="+url_encode(connector.serialize(preferences));
-	   	cExecute(args,handler_preferences,params);
-	}	
-	//Fecha a janela
-	Preferences.prototype.close_win = function(){
-		this.prefeW['window_confexp'].close();
-	}
-	
-	// Salva uma unica preferencia
-	Preferences.prototype.save = function(key, value){
-		var _this = this;		
-	   	var handler_preferences = function(data){
-	   		if(data && data.success)
-	   			return;	   		
-	   		else
-	   			alert(data);
-	   	}
-	   	preferences[key] = value;
-	   	var args   = "$this.db_functions.update_preferences";
-		var params = "prefe_string="+url_encode(connector.serialize(preferences));
-	   	cExecute(args,handler_preferences,params);
-	}	
-
-	//Limpa os campos
-	Preferences.prototype.clean_all = function(){
-		document.getElementById('check_save_men').checked = false;
-		document.getElementById('check_show_previous').value = false;
-		document.getElementById('check_alert').checked = false;
-		document.getElementById('check_view').checked = false;
-		document.getElementById('check_menu').checked = false;
-		document.getElementById("sel_name_box").options[0].selected = true;
-		document.getElementById("use_signature").checked = false;		
-		document.getElementById('txt_signature').value = "";
-		document.getElementById("use_dynamic_contacts").checked = false;
-	}
-
-	//Monta a janela principal da aplicação;
-	Preferences.prototype.showWindow = function(div){
-		
-		if(! this.prefeW[div.id]) {
-			div.style.height = is_ie ? "385px" : "370px";
-			div.style.width = "515px";
-			div.style.visibility = "hidden";
-			div.style.position = "absolute";
-			div.style.paddingLeft = "10px";			
-			var title = get_lang("ExpressoMail 1.2 Configuration");
-			var wHeight = "480px";
-			var wWidth =  "530px";
-
-			win = new dJSWin({			
-				id: 'cc_'+div.id,
-				content_id: div.id,
-				width: wWidth,
-				height: wHeight,
-				title_color: '#3978d6',
-				bg_color: '#eee',
-				title: title,						
-				title_text_color: 'white',
-				button_x_img: '../phpgwapi/images/winclose.gif',
-				border: true });
-			
-			this.prefeW[div.id] = win;
-			win.draw();
-		}
-		else {
-			win = this.prefeW[div.id];
-
-		}
-		win.open();
-	}	
-	Preferences.prototype.delete_dynamic_contacts = function(){
-		var handler = function(data){}
-		var args   = "$this.dynamic_contacts.delete_dynamic_contacts";
-		var params = "";
-		cExecute(args,handler,params);
-	}
-// Cria o objeto	
-	var prefe;
-	prefe = new Preferences();
