'admin', 'enable_nextmatchs_class' => True);
include('../header.inc.php');
$p = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$p->set_file(array('message' => 'mainscreen_message.tpl'));
$p->set_block('message','form','form');
$p->set_block('message','row','row');
$p->set_block('message','row_2','row_2');
if ($submit)
{
$phpgw->db->query("delete from lang where message_id='$section" . "_message' and app_name='"
. "$section' and lang='$select_lang'",__LINE__,__FILE__);
$phpgw->db->query("insert into lang values ('$section" . "_message','$section','$select_lang','"
. addslashes($message) . "')",__LINE__,__FILE__);
$message = "
".lang("message has been updated")."";
}
if (! isset($select_lang))
{
$p->set_var("header_lang",lang("Main screen message"));
$p->set_var("form_action",$phpgw->link("/admin/mainscreen_message.php"));
$p->set_var("tr_color",$phpgw_info["theme"]["th_bg"]);
$p->set_var("value"," ");
$p->parse("rows","row_2",True);
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$p->set_var("tr_color",$tr_color);
$select_lang = '';
$p->set_var("label",lang("Language"));
$p->set_var("value",$select_lang);
$p->parse("rows","row",True);
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$p->set_var("tr_color",$tr_color);
$select_section = '';
$p->set_var("label",lang("Section"));
$p->set_var("value",$select_section);
$p->parse("rows","row",True);
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$p->set_var("tr_color",$tr_color);
$p->set_var("value",'');
$p->parse("rows","row_2",True);
}
else
{
$phpgw->db->query("select content from lang where lang='$select_lang' and message_id='$section"
. "_message'");
$phpgw->db->next_record();
$current_message = $phpgw->db->f("content");
if ($section == "mainscreen")
{
$p->set_var("header_lang",lang("Edit main screen message"));
}
else
{
$p->set_var("header_lang",lang("Edit login screen message"));
}
$p->set_var("form_action",$phpgw->link("/admin/mainscreen_message.php","select_lang=$select_lang§ion=$section"));
$p->set_var("tr_color",$phpgw_info["theme"]["th_bg"]);
$p->set_var("value"," ");
$p->parse("rows","row_2",True);
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$p->set_var("tr_color",$tr_color);
$p->set_var("value",'');
$p->parse("rows","row_2",True);
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$p->set_var("tr_color",$tr_color);
$p->set_var("value",'');
$p->parse("rows","row_2",True);
}
$p->set_var("error_message",$message);
$p->pparse("out","form");
$phpgw->common->phpgw_footer();
?>