Ignore:
Timestamp:
08/14/08 11:15:07 (16 years ago)
Author:
niltonneto
Message:

Ver Tickets no Trac #286 e #287.
Inclusão de template de assinatura padrão.
Assinatura também disponível em formato de texto rico.
Inclusão da biblioteca FCKEditor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/preferences.php

    r385 r389  
    99        ); 
    1010 
     11         
    1112        include('../header.inc.php'); 
    12         include('inc/class.imap_functions.inc.php'); 
     13        include('inc/class.imap_functions.inc.php');     
     14        include_once("inc/fckeditor.php"); 
    1315         
    1416        if (!$_POST['try_saved']) 
     
    6971                else 
    7072                        $GLOBALS['phpgw']->template->set_var('text_signature',''); 
    71  
     73                 
     74                if($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature']){ 
     75                        $GLOBALS['phpgw']->template->set_var('type_signature_option_'.$GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature'].'_selected','selected'); 
     76                        $GLOBALS['phpgw']->template->set_var('type_signature_td_'.($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature'] == 'html' ? 'text' : 'html'),'display:none'); 
     77                } 
     78                else{ 
     79                        $GLOBALS['phpgw']->template->set_var('type_signature_option_text_selected','selected'); 
     80                        $GLOBALS['phpgw']->template->set_var('type_signature_td_html','display:none'); 
     81                } 
     82 
     83                // BEGIN FCKEDITOR 
     84                $oFCKeditor = new FCKeditor('html_signature') ; 
     85                $oFCKeditor->BasePath   = 'js/fckeditor/'; 
     86                $oFCKeditor->ToolbarSet = 'ExpressoLivre'; 
     87                if(is_array($GLOBALS['phpgw_info']['user']['preferences']['expressoMail'])) { 
     88                        $oFCKeditor->Value      = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['signature']; 
     89                } 
     90                // First Time: The user has no preferences. If the template file exists, then it loads a default signature. 
     91                // See signature_example.tpl 
     92                elseif(file_exists($GLOBALS['phpgw']->template->root.'/signature.tpl')){ 
     93                        $filein = fopen($GLOBALS['phpgw']->template->root.'/signature.tpl',"r"); 
     94                        while (!feof ($filein)) 
     95                                $oFCKeditor->Value .= fgets($filein, 1024);  
     96                } 
     97                $oFCKeditor->Value = str_replace("{full_name}",$phpgw_info['user']['fullname'],$oFCKeditor->Value); 
     98                $oFCKeditor->Value = str_replace("{first_name}",$phpgw_info['user']['firstname'],$oFCKeditor->Value); 
     99                 
     100                $GLOBALS['phpgw']->template->set_var('rtf_signature',$oFCKeditor->Create()); 
     101                $GLOBALS['phpgw']->template->set_var('text_signature',strip_tags($oFCKeditor->Value)); 
     102                // END FCKEDITOR 
    72103                if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['hide_folders']) 
    73104                        $GLOBALS['phpgw']->template->set_var('checked_menu','checked'); 
     
    138169                else 
    139170                        $GLOBALS['phpgw']->preferences->add('expressoMail','signature',$_POST['signature']); 
     171 
     172                if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['type_signature']) 
     173                        $GLOBALS['phpgw']->preferences->change('expressoMail','type_signature',$_POST['type_signature']); 
     174                else 
     175                        $GLOBALS['phpgw']->preferences->add('expressoMail','type_signature',$_POST['type_signature']); 
    140176 
    141177                if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['hide_folders']) 
     
    196232        $GLOBALS['phpgw']->template->set_var('medium',lang('Medium')); 
    197233        $GLOBALS['phpgw']->template->set_var('normal',lang('Normal')); 
     234        $GLOBALS['phpgw']->template->set_var('simple_text',lang('Simple Text')); 
     235        $GLOBALS['phpgw']->template->set_var('html_text',lang('Rich Text')); 
     236        $GLOBALS['phpgw']->template->set_var('lang_config_signature',lang('Signature Configuration')); 
     237        $GLOBALS['phpgw']->template->set_var('lang_type_signature',lang('Signature type')); 
    198238        $GLOBALS['phpgw']->template->set_var('big',lang('Big')); 
    199239        $GLOBALS['phpgw']->template->set_var('lang_use_signature',lang('Insert signature automatically in new messages?')); 
    200         $GLOBALS['phpgw']->template->set_var('lang_signature',lang('Signature')); 
    201240 
    202241        $boemailadmin   = CreateObject('emailadmin.bo'); 
Note: See TracChangeset for help on using the changeset viewer.