diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 725b66c7c67..3e83651261d 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -35,22 +35,28 @@ $langs->load("fckeditor"); if (!$user->admin) accessforbidden(); +// Constante et traduction de la description du module +$modules = array( +'PRODUCTDESC'=>'FCKeditorForProductDescription', +'MAILING'=>'FCKeditorForMailing', +); - -if ($_GET["action"] == 'activate_productdesc') +foreach($modules as $const => $desc) { - dolibarr_set_const($db, "FCKEDITOR_ENABLE_PRODUCTDESC", "1"); + if ($_GET["action"] == 'activate_'.strtolower($const)) + { + dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1"); Header("Location: fckeditor.php"); exit; -} -else if ($_GET["action"] == 'disable_productdesc') -{ - dolibarr_del_const($db, "FCKEDITOR_ENABLE_PRODUCTDESC"); + } + else if ($_GET["action"] == 'disable_'.strtolower($const)) + { + dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const); Header("Location: fckeditor.php"); exit; + } } - /* * Affiche page */ @@ -79,41 +85,45 @@ dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup")); $var=true; -// Module Propale -$var=!$var; -print "
"; print ''; print ''; print ''; print ''; print ''; print "\n"; -print ""; -print ""; -print ''; -print ''; + print ''; + print ''; + print ''; -print '"; -print ''; -print '
'.$langs->trans("ActivateFCKeditor").' '.$langs->trans("Action").'
'.$langs->trans("FCKeditorForProductDescription").''; -if($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC == 1) +// Modules +foreach($modules as $const => $desc) { - print img_tick(); + $var=!$var; + print ""; + print ''; + print '
'.$langs->trans($desc).''; + + if($conf->global->FCKEDITOR_ENABLE_.$const == 1) + { + print img_tick(); + } + + print ''; + + if($conf->global->FCKEDITOR_ENABLE_.$const == 0) + { + print ''.$langs->trans("Activate").''; + } + else if($conf->global->FCKEDITOR_ENABLE_.$cont == 1) + { + print ''.$langs->trans("Disable").''; + } + print ''; } -print ''; - -if($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC == 0) -{ - print ''.$langs->trans("Activate").''; -} -else if($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC == 1) -{ - print ''.$langs->trans("Disable").''; -} - -print "
'; -print ''; + print ""; + print ''; + print ''; $db->close(); diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 2733949335e..ef826a90684 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -244,7 +244,19 @@ if ($_GET["action"] == 'create') print '__LASTNAME__ = '.$langs->trans("Lastname").'
'; print '__FIRSTNAME__ = '.$langs->trans("Firstname").'
'; print ''; - print ''; + print ''; + // éditeur wysiwyg + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) + { + require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php"); + $oFCKeditor = new FCKeditor('body'); + $oFCKeditor->Create() ; + } + else + { + print ''; + } + print ''; print ''; print ''; print ''; @@ -430,8 +442,21 @@ else print '__LASTNAME__ = '.$langs->trans("Lastname").'
'; print '__FIRSTNAME__ = '.$langs->trans("Firstname").'
'; print ''; - print ''; + print ''; + // éditeur wysiwyg + if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) + { + require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php"); + $oFCKeditor = new FCKeditor('body'); + $oFCKeditor->Value = $mil->body; + $oFCKeditor->Create() ; + } + else + { + print ''; + } + print ''; print ''; print '';