28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/doleditor.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
34$langs->loadLangs(array(
'admin',
'fckeditor'));
36$action =
GETPOST(
'action',
'aZ09');
43$mode =
GETPOST(
'mode') ?
GETPOST(
'mode',
'alpha') :
'dolibarr_notes';
51 'NOTE_PUBLIC' =>
'FCKeditorForNotePublic',
52 'NOTE_PRIVATE' =>
'FCKeditorForNotePrivate',
53 'SOCIETE' =>
'FCKeditorForCompany',
55 'DETAILS' =>
'FCKeditorForProductDetails',
56 'USERSIGN' =>
'FCKeditorForUserSignature',
57 'MAILING' =>
'FCKeditorForMailing',
58 'MAIL' =>
'FCKeditorForMail',
59 'TICKET' =>
'FCKeditorForTicket',
60 'SPECIALCHAR' =>
'SpecialCharActivation',
67 'PRODUCTDESC' => (isModEnabled(
"product") || isModEnabled(
"service")),
68 'DETAILS' => (isModEnabled(
'facture') || isModEnabled(
"propal") || isModEnabled(
'commande') || isModEnabled(
'supplier_proposal') || isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")),
70 'MAILING' => isModEnabled(
'mailing'),
71 'MAIL' => (isModEnabled(
'facture') || isModEnabled(
"propal") || isModEnabled(
'commande')),
72 'TICKET' => isModEnabled(
'ticket'),
77 'NOTE_PUBLIC' =>
'generic',
78 'NOTE_PRIVATE' =>
'generic',
79 'SOCIETE' =>
'generic',
80 'PRODUCTDESC' =>
'product',
81 'DETAILS' =>
'product',
86 'SPECIALCHAR' =>
'generic'
95foreach ($modules as $const => $desc) {
96 if ($action ==
'enable_'.strtolower($const)) {
97 dolibarr_set_const($db,
"FCKEDITOR_ENABLE_".$const,
"1",
'chaine', 0,
'', $conf->entity);
100 if ($const ==
'PRODUCTDESC' &&
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
101 dolibarr_set_const($db,
"FCKEDITOR_ENABLE_DETAILS",
"1",
'chaine', 0,
'', $conf->entity);
104 if ($action ==
'disable_'.strtolower($const)) {
105 dolibarr_set_const($db,
"FCKEDITOR_ENABLE_".$const,
"0",
'chaine', 0,
'', $conf->entity);
112 $fckeditor_skin =
GETPOST(
'fckeditor_skin',
'alpha');
113 if (!empty($fckeditor_skin)) {
114 $result =
dolibarr_set_const($db,
'FCKEDITOR_SKIN', $fckeditor_skin,
'chaine', 0,
'', $conf->entity);
122 $fckeditor_test =
GETPOST(
'formtestfield',
'restricthtml');
123 if (!empty($fckeditor_test)) {
124 $result =
dolibarr_set_const($db,
'FCKEDITOR_TEST', $fckeditor_test,
'chaine', 0,
'', $conf->entity);
135 setEventMessages($langs->trans(
"Error").
' '.$db->lasterror(),
null,
'errors');
145$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
146print
load_fiche_titre($langs->trans(
"AdvancedEditor"), $linkback,
'title_setup');
149if (empty($conf->use_javascript_ajax)) {
150 setEventMessages(array($langs->trans(
"NotAvailable"), $langs->trans(
"JavascriptDisabled")),
null,
'errors');
152 print
'<table class="noborder centpercent">';
153 print
'<tr class="liste_titre">';
154 print
'<td colspan="2">'.$langs->trans(
"ActivateFCKeditor").
'</td>';
155 print
'<td class="center" width="100">'.$langs->trans(
"Action").
'</td>';
159 foreach ($modules as $const => $desc) {
161 if (!$conditions[$const]) {
165 $constante =
'FCKEDITOR_ENABLE_'.$const;
166 print
'<!-- constant = '.$constante.
' -->'.
"\n";
167 print
'<tr class="oddeven">';
168 print
'<td class="width20">'.img_object(
"", $picto[$const]).
'</td>';
170 print $langs->trans($desc);
171 if ($const ==
'DETAILS') {
172 print
'<br><span class="warning">'.$langs->trans(
"FCKeditorForProductDetails2").
'</span>';
175 print
'<td class="center centpercent width100">';
178 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=enable_'.strtolower($const).
'&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
179 } elseif ($value == 1) {
180 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=disable_'.strtolower($const).
'&token='.newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'switch_on').
'</a>';
187 print
'</table>'.
"\n";
191 print
'<form name="formtest" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
192 print
'<input type="hidden" name="token" value="'.newToken().
'">';
193 print
'<input type="hidden" name="page_y" value="">';
199 $listofmodes = array(
'dolibarr_mailings',
'dolibarr_notes',
'dolibarr_details',
'dolibarr_readonly',
'Full',
'Full_inline');
201 foreach ($listofmodes as $newmode) {
203 $linkstomode .=
' - ';
205 $linkstomode .=
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?mode='.$newmode.
'">';
206 if ($mode == $newmode) {
207 $linkstomode .=
'<strong>';
209 $linkstomode .= $newmode;
210 if ($mode == $newmode) {
211 $linkstomode .=
'</strong>';
213 $linkstomode .=
'</a>';
217 print
'<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).
'">';
218 if ($mode !=
'Full_inline') {
219 $uselocalbrowser =
true;
220 $readonly = ($mode ==
'dolibarr_readonly' ? 1 : 0);
221 $editor =
new DolEditor(
'formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST :
'Test',
'', 200, $mode,
'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
225 print
'<div style="border: 1px solid #888;" contenteditable="true">';
226 print $conf->global->FCKEDITOR_TEST;
229 print $form->buttonsSaveCancel(
"Save",
'',
null, 0,
'reposition');
230 print
'<div id="divforlog"></div>';
231 print
'</form>'.
"\n";
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.
Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='', $moreparam='', $morecss='')
Output edit area inside the HTML stream.
show_skin($fuser, $edit=0)
Show list of ckeditor's themes.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.