From 94822be83a092227b4100df1c5a2b4e14242d251 Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Thu, 22 Apr 2004 00:19:50 +0000 Subject: [PATCH] implement htmlarea with plugins for testing and real use --- admin/inc/class.uimainscreen.inc.php | 51 ++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/admin/inc/class.uimainscreen.inc.php b/admin/inc/class.uimainscreen.inc.php index 93ac0390b1..f537e03a8a 100644 --- a/admin/inc/class.uimainscreen.inc.php +++ b/admin/inc/class.uimainscreen.inc.php @@ -22,7 +22,9 @@ function index() { - $section = addslashes($_POST['section']); + + $html = createObject('phpgwapi.html'); + $section = addslashes($_POST['section']); $select_lang = addslashes($_POST['select_lang']); $message = addslashes($_POST['message']); @@ -52,7 +54,7 @@ . "$section' AND lang='$select_lang'",__LINE__,__FILE__); $GLOBALS['phpgw']->db->query("INSERT INTO phpgw_lang VALUES ('$section" . "_message','$section','$select_lang','" . $message . "')",__LINE__,__FILE__); - $message = '
'.lang('message has been updated').'
'; + $feedback_message = '
'.lang('message has been updated').'
'; $section = ''; } @@ -76,13 +78,19 @@ { $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); } - $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); - $GLOBALS['phpgw']->common->phpgw_header(); - echo parse_navbar(); + + + if (empty($section)) { - $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); + + $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + + + $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); $GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw_info']['theme']['th_bg']); $GLOBALS['phpgw']->template->set_var('value',' '); $GLOBALS['phpgw']->template->fp('rows','row_2',True); @@ -127,11 +135,28 @@ } else { - $GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section" + $GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section" . "_message'",__LINE__,__FILE__); $GLOBALS['phpgw']->db->next_record(); + $current_message = $GLOBALS['phpgw']->db->f('content'); + + if($_POST[htmlarea]) + { + $text_or_htmlarea=$html->htmlarea('message',stripslashes($current_message),'','','TableOperations,ContextMenu,SpellChecker'); + $htmlarea_button=''; + } + else + { + $text_or_htmlarea=''; + $htmlarea_button=''; + } + + $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); + $GLOBALS['phpgw']->common->phpgw_header(); + echo parse_navbar(); + $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); $GLOBALS['phpgw']->template->set_var('select_lang',$select_lang); $GLOBALS['phpgw']->template->set_var('section',$section); @@ -141,19 +166,23 @@ $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); - $GLOBALS['phpgw']->template->set_var('value',''); + + + $GLOBALS['phpgw']->template->set_var('value',$text_or_htmlarea); + + + $GLOBALS['phpgw']->template->fp('rows','row_2',True); $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); $GLOBALS['phpgw']->template->set_var('value','' - ); + . '">'.$htmlarea_button); $GLOBALS['phpgw']->template->fp('rows','row_2',True); } $GLOBALS['phpgw']->template->set_var('lang_cancel',lang('Cancel')); - $GLOBALS['phpgw']->template->set_var('error_message',$message); + $GLOBALS['phpgw']->template->set_var('error_message',$feedback_message); $GLOBALS['phpgw']->template->pfp('out','form'); } }