30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/doleditor.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
45$langs->loadLangs(array(
'admin',
'fckeditor',
'errors'));
47$action =
GETPOST(
'action',
'aZ09');
54$mode =
GETPOST(
'mode') ?
GETPOST(
'mode',
'alpha') :
'dolibarr_notes';
62 'NOTE_PUBLIC' =>
'FCKeditorForNotePublic',
63 'NOTE_PRIVATE' =>
'FCKeditorForNotePrivate',
64 'SOCIETE' =>
'FCKeditorForCompany',
65 'DETAILS' =>
'FCKeditorForProductDetails',
66 'USERSIGN' =>
'FCKeditorForUserSignature',
67 'MAILING' =>
'FCKeditorForMailing',
68 'MAIL' =>
'FCKeditorForMail',
69 'TICKET' =>
'FCKeditorForTicket',
77 'PRODUCTDESC' => (isModEnabled(
"product") || isModEnabled(
"service")),
78 'DETAILS' => (isModEnabled(
'invoice') || isModEnabled(
"propal") || isModEnabled(
'order') || isModEnabled(
'supplier_proposal') || isModEnabled(
"supplier_order") || isModEnabled(
"supplier_invoice")),
80 'MAILING' => isModEnabled(
'mailing'),
81 'MAIL' => (isModEnabled(
'invoice') || isModEnabled(
"propal") || isModEnabled(
'order')),
82 'TICKET' => isModEnabled(
'ticket'),
87 'NOTE_PUBLIC' =>
'generic',
88 'NOTE_PRIVATE' =>
'generic',
89 'SOCIETE' =>
'generic',
90 'PRODUCTDESC' =>
'product',
91 'DETAILS' =>
'product',
105foreach ($modules as $const => $desc) {
106 if ($action ==
'enable_'.strtolower($const)) {
110 if ($const ==
'PRODUCTDESC' &&
getDolGlobalInt(
'PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE')) {
114 if ($action ==
'disable_'.strtolower($const)) {
122 $fckeditor_skin =
GETPOST(
'fckeditor_skin',
'alpha');
123 if (!empty($fckeditor_skin)) {
132 $fckeditor_test =
GETPOST(
'formtestfield',
'restricthtml');
133 if (!empty($fckeditor_test)) {
144 } elseif ($error == -1) {
145 setEventMessages($langs->trans(
"EmptyMessageNotAllowedError"),
null,
'warnings');
147 setEventMessages($langs->trans(
"Error").
' '.$db->lasterror(),
null,
'errors');
156llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-fckeditor');
158$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
159print
load_fiche_titre($langs->trans(
"AdvancedEditor"), $linkback,
'title_setup');
162if (empty(
$conf->use_javascript_ajax)) {
163 setEventMessages(
null, array($langs->trans(
"NotAvailable"), $langs->trans(
"JavascriptDisabled")),
'errors');
165 print
'<table class="noborder centpercent">';
166 print
'<tr class="liste_titre">';
167 print
'<td colspan="2">'.$langs->trans(
"ActivateFCKeditor").
'</td>';
168 print
'<td class="center width100"></td>';
172 foreach ($modules as $const => $desc) {
174 if (!$conditions[$const]) {
178 $constante =
'FCKEDITOR_ENABLE_'.$const;
179 print
'<!-- constant = '.$constante.
' -->'.
"\n";
180 print
'<tr class="oddeven">';
181 print
'<td class="width20">'.img_object(
"", $picto[$const]).
'</td>';
183 print $langs->trans($desc);
184 if ($const ==
'DETAILS') {
185 print $form->textwithpicto(
'',
'<span class="warning">'.$langs->trans(
"FCKeditorForProductDetails2").
'</span>');
188 print
'<td class="center centpercent width100">';
191 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=enable_'.strtolower($const).
'&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
192 } elseif ($value == 1) {
193 if ($const ==
'DETAILS') {
194 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=disable_'.strtolower($const).
'&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled").
' - '.$langs->trans(
"FCKeditorForProductDetails2"),
'switch_on',
'', 0, 0, 0,
'',
'warning').
'</a>';
196 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=disable_'.strtolower($const).
'&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'switch_on').
'</a>';
204 print
'</table>'.
"\n";
210 print
'<table class="noborder centpercent">';
211 print
'<tr class="liste_titre">';
212 print
'<td>'.$langs->trans(
"Other").
'</td>';
213 print
'<td class="center"></td>';
216 $constante =
'FCKEDITOR_ENANLE_SPECIALCHAR';
217 print
'<!-- constant = '.$constante.
' -->'.
"\n";
218 print
'<tr class="oddeven">';
220 print $langs->trans(
'SpecialCharActivation');
222 print
'<td class="center width100">';
225 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=enable_'.strtolower($const).
'&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
226 } elseif ($value == 1) {
227 print
'<a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?action=disable_'.strtolower($const).
'&token='.
newToken().
'">'.
img_picto($langs->trans(
"Enabled"),
'switch_on').
'</a>';
233 print
'</table>'.
"\n";
238 print
'<form name="formtest" method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
239 print
'<input type="hidden" name="token" value="'.newToken().
'">';
240 print
'<input type="hidden" name="page_y" value="">';
246 $listofmodes = array(
'dolibarr_readonly',
'dolibarr_details',
'dolibarr_notes',
'dolibarr_mailings',
'Full',
'Full_inline');
248 foreach ($listofmodes as $newmode) {
250 $linkstomode .=
' - ';
252 $linkstomode .=
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?mode='.$newmode.
'">';
253 if ($mode == $newmode) {
254 $linkstomode .=
'<strong>';
256 $linkstomode .= $newmode;
257 if ($mode == $newmode) {
258 $linkstomode .=
'</strong>';
260 $linkstomode .=
'</a>';
264 print
'<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).
'">';
265 if ($mode !=
'Full_inline') {
266 $uselocalbrowser =
true;
267 $readonly = ($mode ==
'dolibarr_readonly' ? 1 : 0);
268 $editor =
new DolEditor(
'formtestfield',
getDolGlobalString(
'FCKEDITOR_TEST',
'Test'),
'', 200, $mode,
'In',
true, $uselocalbrowser, 1, 120,
'8', $readonly);
272 print
'<div style="border: 1px solid #888;" contenteditable="true">';
276 print $form->buttonsSaveCancel(
"Save",
'', array(), 0,
'reposition');
277 print
'<div id="divforlog"></div>';
278 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage a WYSIWYG editor.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.