Add the test for ckeditor with mode "inline" in setup page of ckeditor

This commit is contained in:
Laurent Destailleur 2019-04-12 17:44:22 +02:00
parent 4703444fbe
commit d728af9ced
2 changed files with 20 additions and 10 deletions

View File

@ -186,7 +186,7 @@ else
show_skin(null, 1); show_skin(null, 1);
print '<br>'."\n"; print '<br>'."\n";
$listofmodes=array('dolibarr_mailings','dolibarr_notes','dolibarr_details','dolibarr_readonly','Full'); $listofmodes=array('dolibarr_mailings', 'dolibarr_notes', 'dolibarr_details', 'dolibarr_readonly', 'Full', 'Full_inline');
$linkstomode=''; $linkstomode='';
foreach($listofmodes as $newmode) foreach($listofmodes as $newmode)
{ {
@ -200,10 +200,19 @@ else
$linkstomode.=''; $linkstomode.='';
print load_fiche_titre($langs->trans("TestSubmitForm"), $linkstomode, ''); print load_fiche_titre($langs->trans("TestSubmitForm"), $linkstomode, '');
print '<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).'">'; print '<input type="hidden" name="mode" value="'.dol_escape_htmltag($mode).'">';
$uselocalbrowser=true; if ($mode != 'Full_inline')
$readonly=($mode=='dolibarr_readonly'?1:0); {
$editor=new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly); $uselocalbrowser=true;
$editor->Create(); $readonly=($mode=='dolibarr_readonly'?1:0);
$editor=new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly);
$editor->Create();
}
else
{
print '<div style="border: 1px solid #888;" contenteditable="true">';
print $conf->global->FCKEDITOR_TEST;
print '</div>';
}
print '<br><div class="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></div>'."\n"; print '<br><div class="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"></div>'."\n";
print '<div id="divforlog"></div>'; print '<div id="divforlog"></div>';
print '</form>'."\n"; print '</form>'."\n";

View File

@ -2922,11 +2922,12 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa
// Change the contenteditable to "true" or "false" when mode Edit Inline is on or off // Change the contenteditable to "true" or "false" when mode Edit Inline is on or off
if (empty($conf->global->WEBSITE_EDITINLINE)) if (empty($conf->global->WEBSITE_EDITINLINE))
{ {
// Remove the contenteditable="true"
$newcontent = preg_replace('/(div|section)(\s[^\>]*)contenteditable="true"/', '\1\2', $newcontent); $newcontent = preg_replace('/(div|section)(\s[^\>]*)contenteditable="true"/', '\1\2', $newcontent);
} }
else else
{ {
// TODO Add the contenteditable="true" when mode Edit Inline is on // Keep the contenteditable="true" when mode Edit Inline is on
} }
$out.=dolWebsiteReplacementOfLinks($object, $newcontent)."\n"; $out.=dolWebsiteReplacementOfLinks($object, $newcontent)."\n";
//$out.=$newcontent; //$out.=$newcontent;