From 5fa1bb109b10653697aa5f33a69c79d830aa5c9d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 19 Nov 2005 20:10:23 +0000 Subject: [PATCH] fixed not working update of start and login-page message: eliminated direct access to the lang & languages table by using (new) functions from the translation class --- admin/inc/class.uimainscreen.inc.php | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/admin/inc/class.uimainscreen.inc.php b/admin/inc/class.uimainscreen.inc.php index 5121534429..ed64d3d043 100644 --- a/admin/inc/class.uimainscreen.inc.php +++ b/admin/inc/class.uimainscreen.inc.php @@ -50,11 +50,8 @@ if ($_POST['submit']) { - $GLOBALS['egw']->db->query("DELETE FROM phpgw_lang WHERE message_id='$section" . "_message' AND app_name='" - . "$section' AND lang='$select_lang'",__LINE__,__FILE__); - $GLOBALS['egw']->db->query("INSERT INTO phpgw_lang (message_id,app_name,lang,content)VALUES ('$section" . "_message','$section','$select_lang','" - . $message . "')",__LINE__,__FILE__); - $feedback_message = '
'.lang('message has been updated').'
'; + $GLOBALS['egw']->translation->write($select_lang,$section,$section.'_message',$message); + $feedback_message = '
'.lang('message has been updated').'
'; $section = ''; } @@ -78,10 +75,6 @@ { $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); } - - - - if (empty($section)) { @@ -99,16 +92,13 @@ $GLOBALS['egw']->template->set_var('tr_color',$tr_color); $lang_select = ''; + $GLOBALS['egw']->template->set_var('label',lang('Language')); $GLOBALS['egw']->template->set_var('value',$lang_select); $GLOBALS['egw']->template->fp('rows','row',True); @@ -135,11 +125,7 @@ } else { - $GLOBALS['egw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section" - . "_message'",__LINE__,__FILE__); - $GLOBALS['egw']->db->next_record(); - - $current_message = $GLOBALS['egw']->db->f('content'); + $current_message = $GLOBALS['egw']->translation->read($select_lang,$section,$section.'_message'); if($_POST['htmlarea']) {