mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-21 02:18:28 +02:00
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
This commit is contained in:
parent
fa96e4a576
commit
5fa1bb109b
@ -50,10 +50,7 @@
|
|||||||
|
|
||||||
if ($_POST['submit'])
|
if ($_POST['submit'])
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->db->query("DELETE FROM phpgw_lang WHERE message_id='$section" . "_message' AND app_name='"
|
$GLOBALS['egw']->translation->write($select_lang,$section,$section.'_message',$message);
|
||||||
. "$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 = '<center>'.lang('message has been updated').'</center>';
|
$feedback_message = '<center>'.lang('message has been updated').'</center>';
|
||||||
|
|
||||||
$section = '';
|
$section = '';
|
||||||
@ -78,10 +75,6 @@
|
|||||||
{
|
{
|
||||||
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
|
$GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (empty($section))
|
if (empty($section))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -99,16 +92,13 @@
|
|||||||
$GLOBALS['egw']->template->set_var('tr_color',$tr_color);
|
$GLOBALS['egw']->template->set_var('tr_color',$tr_color);
|
||||||
|
|
||||||
$lang_select = '<select name="select_lang">';
|
$lang_select = '<select name="select_lang">';
|
||||||
$GLOBALS['egw']->db->query("SELECT lang,phpgw_languages.lang_name,phpgw_languages.lang_id FROM phpgw_lang,phpgw_languages WHERE "
|
foreach($GLOBALS['egw']->translation->get_installed_langs() as $lang => $lang_name)
|
||||||
. "phpgw_lang.lang=phpgw_languages.lang_id GROUP BY lang,phpgw_languages.lang_name,"
|
|
||||||
. "phpgw_languages.lang_id ORDER BY lang",__LINE__,__FILE__);
|
|
||||||
while ($GLOBALS['egw']->db->next_record())
|
|
||||||
{
|
{
|
||||||
$lang = $GLOBALS['egw']->db->f('lang');
|
$lang_select .= '<option value="' . $lang . '"'.($lang == $select_lang ? ' selected="selected"' : '').'>' .
|
||||||
$lang_select .= '<option value="' . $lang . '"'.($lang == $select_lang ? ' selected' : '').'>' .
|
$lang . ' - ' . $lang_name . "</option>\n";
|
||||||
$lang . ' - ' . $GLOBALS['egw']->db->f('lang_name') . "</option>\n";
|
|
||||||
}
|
}
|
||||||
$lang_select .= '</select>';
|
$lang_select .= '</select>';
|
||||||
|
|
||||||
$GLOBALS['egw']->template->set_var('label',lang('Language'));
|
$GLOBALS['egw']->template->set_var('label',lang('Language'));
|
||||||
$GLOBALS['egw']->template->set_var('value',$lang_select);
|
$GLOBALS['egw']->template->set_var('value',$lang_select);
|
||||||
$GLOBALS['egw']->template->fp('rows','row',True);
|
$GLOBALS['egw']->template->fp('rows','row',True);
|
||||||
@ -135,11 +125,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section"
|
$current_message = $GLOBALS['egw']->translation->read($select_lang,$section,$section.'_message');
|
||||||
. "_message'",__LINE__,__FILE__);
|
|
||||||
$GLOBALS['egw']->db->next_record();
|
|
||||||
|
|
||||||
$current_message = $GLOBALS['egw']->db->f('content');
|
|
||||||
|
|
||||||
if($_POST['htmlarea'])
|
if($_POST['htmlarea'])
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user