diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index bca9555f379106748265820b723fbb1d0953a92c..5ad8b3aa646adf905f170ab3b6b6891b880666f3 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -195,6 +195,7 @@ class DolEditor
readOnly : '.($this->readonly?'true':'false').',
htmlEncodeOutput :'.$htmlencode_force.',
allowedContent :'.($disallowAnyContent?'false':'true').',
+ extraAllowedContent : \'\',
fullPage : '.($fullpage?'true':'false').',
toolbar: \''.$this->toolbarname.'\',
toolbarStartupExpanded: '.($this->toolbarstartexpanded ? 'true' : 'false').',
diff --git a/htdocs/public/websites/index.php b/htdocs/public/websites/index.php
index 8c83a1daebc457700306dbd41f8be241acc8c86f..44789409058cffe4f78a12eef20fa3251622af14 100644
--- a/htdocs/public/websites/index.php
+++ b/htdocs/public/websites/index.php
@@ -144,6 +144,7 @@ if (! file_exists($original_file_osencoded))
// Output page content
+define('USEDOLIBARRSERVER', 1);
print "\n".'<!-- Page content '.$original_file.' : Html with CSS link + Body was saved into tpl -->'."\n";
include_once $original_file_osencoded;
diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js
index f01fde4dabb242d916b086c72990a381de62742f..eb88af48a049d3dd04549562a3565be2e855abfa 100644
--- a/htdocs/theme/eldy/ckeditor/config.js
+++ b/htdocs/theme/eldy/ckeditor/config.js
@@ -39,17 +39,17 @@ CKEDITOR.editorConfig = function( config )
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
- ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
+ ['Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
- ['Maximize', 'ShowBlocks','-','About']
+ ['Maximize', 'ShowBlocks']
];
// Used for mailing fields
config.toolbar_dolibarr_mailings =
[
['Source','Maximize','Preview'],
- ['Cut','Copy','Paste','-','SpellChecker'],
+ ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
@@ -62,7 +62,7 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_notes =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker'],
+ ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
@@ -75,7 +75,7 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_details =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker'],
+ ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'],
diff --git a/htdocs/theme/md/ckeditor/config.js b/htdocs/theme/md/ckeditor/config.js
index f01fde4dabb242d916b086c72990a381de62742f..eb88af48a049d3dd04549562a3565be2e855abfa 100644
--- a/htdocs/theme/md/ckeditor/config.js
+++ b/htdocs/theme/md/ckeditor/config.js
@@ -39,17 +39,17 @@ CKEDITOR.editorConfig = function( config )
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl'],
['Link','Unlink','Anchor'],
- ['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
+ ['Image','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
- ['Maximize', 'ShowBlocks','-','About']
+ ['Maximize', 'ShowBlocks']
];
// Used for mailing fields
config.toolbar_dolibarr_mailings =
[
['Source','Maximize','Preview'],
- ['Cut','Copy','Paste','-','SpellChecker'],
+ ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
@@ -62,7 +62,7 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_notes =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker'],
+ ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
['Undo','Redo','-','Find','Replace'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
@@ -75,7 +75,7 @@ CKEDITOR.editorConfig = function( config )
config.toolbar_dolibarr_details =
[
['Source','Maximize'],
- ['Cut','Copy','Paste','-','SpellChecker'],
+ ['Cut','Copy','Paste','-','SpellChecker', 'Scayt'],
['Format','Font','FontSize'],
['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'],
['NumberedList','BulletedList','Outdent','Indent'],
diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php
index fce7a96bc30a09518da97fe5f9191f6412b676de..5b7ae2a3b258c6bd7a95fa4572ef2d405ffb2bcf 100644
--- a/htdocs/websites/index.php
+++ b/htdocs/websites/index.php
@@ -325,35 +325,54 @@ if ($action == 'updatemeta')
{
$db->commit();
+ $filemaster=$pathofwebsite.'/master.inc.php';
$fileoldalias=$pathofwebsite.'/'.$objectpage->old_object->pageurl.'.php';
$filealias=$pathofwebsite.'/'.$objectpage->pageurl.'.php';
+
+ dol_mkdir($pathofwebsite);
+
- // Generate the alias.php page
- //-----------------------------
- dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias);
+ // Now generate the master.inc.php page
+ dol_syslog("We regenerate the master file");
+ dol_delete_file($filemaster);
- dol_mkdir($pathofwebsite);
- dol_delete_file($fileoldalias);
+ $mastercontent = '<?php'."\n";
+ $mastercontent.= '// File generated to link to the master file'."\n";
+ $mastercontent.= "if (! defined('USEDOLIBARRSERVER')) require '".DOL_DOCUMENT_ROOT."/master.inc.php';\n";
+ $mastercontent.= '?>'."\n";
+ $result = file_put_contents($filemaster, $mastercontent);
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($filemaster, octdec($conf->global->MAIN_UMASK));
+
+ if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors');
+
+
+ // Now generate the alias.php page
+ if (! empty($fileoldalias))
+ {
+ dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias);
+ dol_delete_file($fileoldalias);
+ }
$aliascontent = '<?php'."\n";
$aliascontent.= '// File generated to wrap the alias page'."\n";
- $aliascontent.= "include_once './page".$objectpage->id.".tpl.php'\n";
+ $aliascontent.= "include_once './page".$objectpage->id.".tpl.php';\n";
$aliascontent.= '?>'."\n";
$result = file_put_contents($filealias, $aliascontent);
if (! empty($conf->global->MAIN_UMASK))
@chmod($filealias, octdec($conf->global->MAIN_UMASK));
- if ($result) setEventMessages($langs->trans("Saved"), null, 'mesgs');
- else setEventMessages('Failed to write file '.$filealias, null, 'errors');
+ if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors');
// Now create the .tpl file (duplicate code with actions updatecontent but we need this to save new header)
dol_syslog("We regenerate the tpl page filetpl=".$filetpl);
- dol_mkdir($pathofwebsite);
dol_delete_file($filetpl);
- $tplcontent = '<html>'."\n";
+ $tplcontent ='';
+ $tplcontent.= '<?php require "./master.inc.php"; ?>'."\n";
+ $tplcontent.= '<html>'."\n";
$tplcontent.= '<header>'."\n";
$tplcontent.= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'."\n";
$tplcontent.= '<meta name="robots" content="index, follow" />'."\n";
@@ -376,7 +395,7 @@ if ($action == 'updatemeta')
if ($result)
{
- //setEventMessages($langs->trans("Saved"), null, 'mesgs');
+ setEventMessages($langs->trans("Saved"), null, 'mesgs');
//header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website.'&pageid='.$pageid);
//exit;
}
@@ -423,12 +442,53 @@ if ($action == 'updatecontent')
{
$db->commit();
+ $filemaster=$pathofwebsite.'/master.inc.php';
+ //$fileoldalias=$pathofwebsite.'/'.$objectpage->old_object->pageurl.'.php';
+ $filealias=$pathofwebsite.'/'.$objectpage->pageurl.'.php';
+
+ dol_mkdir($pathofwebsite);
+
+
+ // Now generate the master.inc.php page
+ dol_syslog("We regenerate the master file");
+ dol_delete_file($filemaster);
+
+ $mastercontent = '<?php'."\n";
+ $mastercontent.= '// File generated to link to the master file'."\n";
+ $mastercontent.= "if (! defined('USEDOLIBARRSERVER')) require '".DOL_DOCUMENT_ROOT."/master.inc.php';\n";
+ $mastercontent.= '?>'."\n";
+ $result = file_put_contents($filemaster, $mastercontent);
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($filemaster, octdec($conf->global->MAIN_UMASK));
+
+ if (! $result) setEventMessages('Failed to write file '.$filemaster, null, 'errors');
+
+
+ // Now generate the alias.php page
+ if (! empty($fileoldalias))
+ {
+ dol_syslog("We regenerate alias page new name=".$filealias.", old name=".$fileoldalias);
+ dol_delete_file($fileoldalias);
+ }
+
+ $aliascontent = '<?php'."\n";
+ $aliascontent.= '// File generated to wrap the alias page'."\n";
+ $aliascontent.= "include_once './page".$objectpage->id.".tpl.php';\n";
+ $aliascontent.= '?>'."\n";
+ $result = file_put_contents($filealias, $aliascontent);
+ if (! empty($conf->global->MAIN_UMASK))
+ @chmod($filealias, octdec($conf->global->MAIN_UMASK));
+
+ if (! $result) setEventMessages('Failed to write file '.$filealias, null, 'errors');
+
+
// Now create the .tpl file
// TODO Keep a one time generate file or include a dynamicaly generated content ?
- dol_mkdir($pathofwebsite);
dol_delete_file($filetpl);
- $tplcontent = '<html>'."\n";
+ $tplcontent ='';
+ $tplcontent.= '<?php require "./master.inc.php"; ?>'."\n";
+ $tplcontent.= '<html>'."\n";
$tplcontent.= '<header>'."\n";
$tplcontent.= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'."\n";
$tplcontent.= '<meta name="robots" content="index, follow" />'."\n";