Ignore:
Timestamp:
05/28/10 09:36:15 (14 years ago)
Author:
rodsouza
Message:

Ticket #663 - Atualizando o ckeditor do módulo admin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/inc/class.uimainscreen.inc.php

    r2802 r2876  
    2323                { 
    2424 
    25                         $html = createObject('phpgwapi.html'); 
     25                        //$html = createObject('phpgwapi.html'); 
    2626                        $section     = addslashes($_REQUEST['section']); 
    2727                        $select_lang = addslashes($_REQUEST['select_lang']); 
     
    9595                        if (empty($section)) 
    9696                        { 
     97                                $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); 
     98                                //$GLOBALS['phpgw']->common->phpgw_header(); 
     99                                //echo parse_navbar(); 
    97100 
    98                            $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); 
    99                            //$GLOBALS['phpgw']->common->phpgw_header(); 
    100                            //echo parse_navbar(); 
    101                                    
    102                             
    103                            $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); 
     101                                $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); 
    104102                                $GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw_info']['theme']['th_bg']); 
    105103                                $GLOBALS['phpgw']->template->set_var('value',' '); 
     
    140138                                $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); 
    141139                                $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); 
    142                                 $GLOBALS['phpgw']->template->set_var('value','<input type="button" value="' . lang('Edit') 
    143                                         . '" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) 
    144                                         . '\' + \'&section=\' + escape( this.form.section.item( 1 ).value ) + \'&select_lang=\' + escape( this.form.select_lang.item( 1 ).value ) )' 
    145                                         . '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/admin/index.php' ) . '\' )">'); 
     140                                $GLOBALS['phpgw']->template->set_var('value', 
     141                                        '<input type="button" value="' 
     142                                                . lang('Edit') . '" onclick="ExpressoLivre.link( \'' 
     143                                                . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) 
     144                                                . '\' + \'&section=\' + escape( this.form.section.item( 1 ).value )' 
     145                                                . ' + \'&select_lang=\' + escape( this.form.select_lang.item( 1 ).value ) )' 
     146                                                . '">' 
     147                                        . '<input type="button" name="cancel" value="' 
     148                                                . lang('cancel') . '" onclick="ExpressoLivre.link( \'' 
     149                                                . $GLOBALS[ 'phpgw' ] -> link( '/admin/index.php' ) 
     150                                                . '\' )">' 
     151                                ); 
    146152                                $GLOBALS['phpgw']->template->fp('rows','row_2',True); 
    147153                        } 
    148154                        else 
    149155                        { 
    150                            $GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section" 
     156                                $GLOBALS['phpgw']->template->set_block('message','edit','edit'); 
     157                                $GLOBALS['phpgw']->template->set_block('message','edit_script','edit_script'); 
     158 
     159                                $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); 
     160 
     161                                $GLOBALS['phpgw']->db->query("SELECT content FROM phpgw_lang WHERE lang='$select_lang' AND message_id='$section" 
    151162                                . "_message'",__LINE__,__FILE__); 
    152163                                $GLOBALS['phpgw']->db->next_record(); 
    153                                  
    154                                 $current_message = $GLOBALS['phpgw']->db->f('content'); 
    155                                  
    156                                 if($_REQUEST['htmlarea']) 
    157                                 { 
    158                                         //$text_or_htmlarea=$html->htmlarea('message',stripslashes($current_message)); 
    159  
    160                                         include_once("news_admin/inc/fckeditor.php"); 
    161                                         $oFCKeditor = new FCKeditor( 'message' ); 
    162  
    163                                         $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    164                                         $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; 
    165  
    166                                         if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1)) 
    167                                                 $webserver_url .= '/'; 
    168  
    169                                         $oFCKeditor->BasePath = $webserver_url . 'news_admin/templates/default/fckeditor/';  
    170                                         $oFCKeditor->ToolbarSet = 'Basic'; 
    171                                         $oFCKeditor->Value = $current_message; 
    172  
    173                                         $text_or_htmlarea = $oFCKeditor->Create( ); 
    174  
    175                                         $htmlarea_button='<input type="button" name="no-htmlarea" onclick="ExpressoLivre.link( \''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true&section=' . $section ) . '\');" value="'.lang('disable WYSIWYG-editor').'">';         
    176                                 } 
    177                                 else 
    178                                 { 
    179                                         $text_or_htmlarea='<textarea name="message" style="width:100%; min-width:350px; height:300px;" wrap="virtual">' . stripslashes($current_message) . '</textarea>'; 
    180                                         $htmlarea_button='<input type="button" name="htmlarea" onclick="ExpressoLivre.link( \''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true&section=' . $section ) . '\' );" value="'.lang('activate WYSIWYG-editor').'">'; 
    181  
    182                                 }                           
    183  
    184                                 $GLOBALS['phpgw']->js->validate_file('jscode','openwindow','admin'); 
    185                                 //$GLOBALS['phpgw']->common->phpgw_header(); 
    186                                 //echo parse_navbar(); 
    187164 
    188165                                $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); 
    189166                                $GLOBALS['phpgw']->template->set_var('select_lang',$select_lang); 
    190167                                $GLOBALS['phpgw']->template->set_var('section',$section); 
    191                                 $GLOBALS['phpgw']->template->set_var('tr_color',$GLOBALS['phpgw_info']['theme']['th_bg']); 
    192                                 $GLOBALS['phpgw']->template->set_var('value','&nbsp;'); 
    193                                 $GLOBALS['phpgw']->template->fp('rows','row_2',True); 
     168                                $GLOBALS['phpgw']->template->set_var('message', '<textarea name="message"></textarea>'); 
    194169 
    195                                 $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); 
    196                                 $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); 
     170                                $GLOBALS['phpgw']->template->fp('scripts','edit_script',True); 
     171                                $GLOBALS['phpgw']->template->fp('rows','edit',True); 
    197172 
    198                                  
    199                                 $GLOBALS['phpgw']->template->set_var('value',$text_or_htmlarea); 
    200                                  
    201                                  
    202                                  
    203                                 $GLOBALS['phpgw']->template->fp('rows','row_2',True); 
     173                                $GLOBALS['phpgw']->template->set_var( 'value', 
     174                                        '<input type="submit" name="submit" value="' 
     175                                                . lang('Save') . '">' 
     176                                        . '<input type="button" name="cancel" value="'. lang('cancel') 
     177                                                .'" onclick="ExpressoLivre.link( \'' 
     178                                                . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) 
     179                                                . '\' )">' 
     180                                ); 
    204181 
    205                                 $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); 
    206                                 $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); 
    207                                 $GLOBALS['phpgw']->template->set_var('value','<input type="submit" name="submit" value="' . lang('Save') 
    208                                 . '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) . '\' )">'.$htmlarea_button); 
    209182                                $GLOBALS['phpgw']->template->fp('rows','row_2',True); 
    210183                        } 
Note: See TracChangeset for help on using the changeset viewer.