27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/doleditor.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
33 $langs->loadLangs(array(
'admin',
'fckeditor'));
35 $action =
GETPOST(
'action',
'aZ09');
42 $mode =
GETPOST(
'mode') ?
GETPOST(
'mode',
'alpha') :
'dolibarr_notes';
48 'SOCIETE' =>
'FCKeditorForCompany',
49 'PRODUCTDESC' =>
'FCKeditorForProduct',
50 'DETAILS' =>
'FCKeditorForProductDetails',
51 'USERSIGN' =>
'FCKeditorForUserSignature',
52 'MAILING' =>
'FCKeditorForMailing',
53 'MAIL' =>
'FCKeditorForMail',
54 'TICKET' =>
'FCKeditorForTicket'
59 'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
60 'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
62 'MAILING' => !empty($conf->mailing->enabled),
63 'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
64 'TICKET' => !empty($conf->ticket->enabled)
68 'SOCIETE' =>
'generic',
69 'PRODUCTDESC' =>
'product',
70 'DETAILS' =>
'product',
83 foreach ($modules as $const => $desc)
85 if ($action ==
'activate_'.strtolower($const))
87 dolibarr_set_const($db,
"FCKEDITOR_ENABLE_".$const,
"1",
'chaine', 0,
'', $conf->entity);
89 if ($const ==
'PRODUCTDESC' && !empty($conf->global->PRODUIT_DESC_IN_FORM))
91 dolibarr_set_const($db,
"FCKEDITOR_ENABLE_DETAILS",
"1",
'chaine', 0,
'', $conf->entity);
93 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
96 if ($action ==
'disable_'.strtolower($const))
99 header(
"Location: ".
$_SERVER[
"PHP_SELF"]);
108 $fckeditor_skin =
GETPOST(
'fckeditor_skin',
'alpha');
109 if (!empty($fckeditor_skin)) {
110 if (!
dolibarr_set_const($db,
'FCKEDITOR_SKIN', $fckeditor_skin,
'chaine', 0,
'', $conf->entity)) {
117 $fckeditor_test =
GETPOST(
'formtestfield');
118 if (!empty($fckeditor_test)) {
119 if (!
dolibarr_set_const($db,
'FCKEDITOR_TEST', $fckeditor_test,
'chaine', 0,
'', $conf->entity)) {
140 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
144 if (empty($conf->use_javascript_ajax))
146 setEventMessages(array($langs->trans(
"NotAvailable"), $langs->trans(
"JavascriptDisabled")), null,
'errors');
148 print
'<table class="noborder centpercent">';
149 print
'<tr class="liste_titre">';
150 print
'<td colspan="2">'.$langs->trans(
"ActivateFCKeditor").
'</td>';
151 print
'<td class="center" width="100">'.$langs->trans(
"Action").
'</td>';
155 foreach ($modules as $const => $desc)
158 if (!$conditions[$const])
continue;
160 print
'<tr class="oddeven">';
161 print
'<td width="16">'.img_object(
"", $picto[$const]).
'</td>';
162 print
'<td>'.$langs->trans($desc).
'</td>';
163 print
'<td class="center" width="100">';
164 $constante =
'FCKEDITOR_ENABLE_'.$const;
165 $value = (isset($conf->global->$constante) ? $conf->global->$constante : 0);
168 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=activate_'.strtolower($const).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
169 } elseif ($value == 1)
171 print
'<a href="'.$_SERVER[
'PHP_SELF'].
'?action=disable_'.strtolower($const).
'">'.
img_picto($langs->trans(
"Enabled"),
'switch_on').
'</a>';
178 print
'</table>'.
"\n";
182 print
'<form name="formtest" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
183 print
'<input type="hidden" name="token" value="'.newToken().
'">';
189 $listofmodes = array(
'dolibarr_mailings',
'dolibarr_notes',
'dolibarr_details',
'dolibarr_readonly',
'Full',
'Full_inline');
191 foreach ($listofmodes as $newmode)
193 if ($linkstomode) $linkstomode .=
' - ';
194 $linkstomode .=
'<a href="'.$_SERVER[
"PHP_SELF"].
'?mode='.$newmode.
'">';
195 if ($mode == $newmode) $linkstomode .=
'<strong>';
196 $linkstomode .= $newmode;
197 if ($mode == $newmode) $linkstomode .=
'</strong>';
198 $linkstomode .=
'</a>';
202 print
'<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).
'">';
203 if ($mode !=
'Full_inline')
205 $uselocalbrowser =
true;
206 $readonly = ($mode ==
'dolibarr_readonly' ? 1 : 0);
207 $editor =
new DolEditor(
'formtestfield', isset($conf->global->FCKEDITOR_TEST) ? $conf->global->FCKEDITOR_TEST :
'Test',
'', 200, $mode,
'In',
true, $uselocalbrowser, 1, 120, 8, $readonly);
210 print
'<div style="border: 1px solid #888;" contenteditable="true">';
211 print $conf->global->FCKEDITOR_TEST;
214 print
'<br><div class="center"><input class="button button-save" type="submit" name="save" value="'.$langs->trans(
"Save").
'"></div>'.
"\n";
215 print
'<div id="divforlog"></div>';
216 print
'</form>'.
"\n";
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
show_skin($fuser, $edit=0)
Show list of ckeditor's themes.
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).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
Class to manage a WYSIWYG editor.