diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php
index dce4b158c54..08fcdd82a58 100644
--- a/htdocs/core/lib/website.lib.php
+++ b/htdocs/core/lib/website.lib.php
@@ -160,17 +160,20 @@ function dolWebsiteSaveContent($content)
* Clean an HTML page to report only content, so we can include it into another page.
* It outputs content of file sanitized from html and body part.
*
- * @param string $contentfile Path to file to include (must include website root. Example: 'mywebsite/mypage.php')
+ * @param string $containeralias Path to file to include (must be a page from website root. Example: 'mypage.php' means 'mywebsite/mypage.php')
* @return void
*/
-function dolIncludeHtmlContent($contentfile)
+function includeContainer($containeralias)
{
global $conf, $db, $langs, $mysoc, $user, $website;
global $includehtmlcontentopened;
+ global $websitekey;
$MAXLEVEL=20;
- $fullpathfile=DOL_DATA_ROOT.'/website/'.$contentfile;
+ if (! preg_match('/\.php$/i', $containeralias)) $containeralias.='.php';
+
+ $fullpathfile=DOL_DATA_ROOT.'/website/'.$websitekey.'/'.$containeralias;
if (empty($includehtmlcontentopened)) $includehtmlcontentopened=0;
$includehtmlcontentopened++;
@@ -193,7 +196,7 @@ function dolIncludeHtmlContent($contentfile)
if (! $res)
{
- print 'ERROR: FAILED TO INCLUDE PAGE '.$contentfile.".\n";
+ print 'ERROR: FAILED TO INCLUDE PAGE '.$containeralias.".\n";
}
$includehtmlcontentopened--;
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index 739bfd3cf9b..326228b7e45 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -40,7 +40,7 @@ VirtualHostUrlNotDefined=URL of the virtual host served by external web server n
NoPageYet=No pages yet
SyntaxHelp=Help on specific syntax tips
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
-YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.
You can also include content of another Page/Container with the following syntax:
<?php dolIncludeHtmlContent($websitekey.'/alias_of_container_to_include.php'); ?>
To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
+YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.
You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>
To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">
To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
ClonePage=Clone page/container
CloneSite=Clone site
SiteAdded=Web site added
diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang
index b15a604aac0..daa54f635ce 100644
--- a/htdocs/langs/fr_FR/website.lang
+++ b/htdocs/langs/fr_FR/website.lang
@@ -39,7 +39,7 @@ VirtualHostUrlNotDefined=URL du virtual host servit par le serveur web externe n
NoPageYet=Pas de page pour l'instant
SyntaxHelp=Help on specific syntax tips
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
-YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.
You can also include content of another Page/Container with the following syntax:
<?php dolIncludeHtmlContent($websitekey.'/alias_of_container_to_include.php'); ?>
To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
+YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.
You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include.php'); ?>
To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
To include an image stored into the documents directory, use the viewimage.php wrapper:
Example, for an image into documents/medias (open access), syntax is:
<a href="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
ClonePage=Cloner la page/contenair
CloneSite=Cloner le site
SiteAdded=Web site added
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index b1ebdda2981..370b34bf4ae 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -3798,10 +3798,6 @@ A.none, A.none:active, A.none:visited, A.none:hover {
.cke_dialog {
border: 1px #bbb solid ! important;
}
-.cke_editable
-{
- margin: 5px !important;
-}
/*.cke_editor table, .cke_editor tr, .cke_editor td
{
border: 0px solid #FF0000 !important;
@@ -3823,11 +3819,13 @@ a.cke_dialog_ui_button
{
vertical-align: bottom ! important;
}
+/*
.cke_editable
{
line-height: 1.4 !important;
margin: 6px !important;
}
+*/
a.cke_dialog_ui_button_ok span {
text-shadow: none !important;
color: #333 !important;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 44195d88e74..f62048bdb5c 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -3873,10 +3873,6 @@ A.none, A.none:active, A.none:visited, A.none:hover {
.cke_dialog {
border: 1px #bbb solid ! important;
}
-.cke_editable
-{
- margin: 5px !important;
-}
/*.cke_editor table, .cke_editor tr, .cke_editor td
{
border: 0px solid #FF0000 !important;
@@ -3898,11 +3894,13 @@ a.cke_dialog_ui_button
{
vertical-align: bottom ! important;
}
+/*
.cke_editable
{
line-height: 1.4 !important;
margin: 6px !important;
}
+*/
a.cke_dialog_ui_button_ok span {
text-shadow: none !important;
color: #333 !important;
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 360578f7da0..ff9ff6fcc62 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -62,7 +62,7 @@ $file_manager = GETPOST('file_manager', 'alpha');
if (GETPOST('delete')) { $action='delete'; }
if (GETPOST('preview')) $action='preview';
if (GETPOST('createsite')) { $action='createsite'; }
-if (GETPOST('create')) { $action='create'; }
+if (GETPOST('createcontainer')) { $action='createcontainer'; }
if (GETPOST('editcss')) { $action='editcss'; }
if (GETPOST('editmenu')) { $action='editmenu'; }
if (GETPOST('setashome')) { $action='setashome'; }
@@ -107,7 +107,7 @@ if ($website)
}
if ($pageid < 0) $pageid = 0;
-if (($pageid > 0 || $pageref) && $action != 'add')
+if (($pageid > 0 || $pageref) && $action != 'addcontainer')
{
$res = $objectpage->fetch($pageid, ($object->id > 0 ? $object->id : null), $pageref);
$pageid = $objectpage->id;
@@ -162,7 +162,7 @@ if ($action == 'adddir' && $permtouploadfile)
else
{
setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors');
- $action = "create";
+ $action = "createcontainer";
}
clearstatcache();
@@ -240,8 +240,8 @@ if ($action == 'addsite')
}
}
-// Add page
-if ($action == 'add')
+// Add page/container
+if ($action == 'addcontainer')
{
dol_mkdir($pathofwebsite);
@@ -276,13 +276,13 @@ if ($action == 'add')
{
$error++;
setEventMessages('Error getting '.$urltograb.': '.$tmp['curl_error_msg'], null, 'errors');
- $action='create';
+ $action='createcontainer';
}
elseif ($tmp['http_code'] != '200')
{
$error++;
setEventMessages('Error getting '.$urltograb.': '.$tmp['http_code'], null, 'errors');
- $action='create';
+ $action='createcontainer';
}
else
{
@@ -383,13 +383,13 @@ if ($action == 'add')
{
$error++;
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg'], null, 'errors');
- $action='create';
+ $action='createcontainer';
}
elseif ($tmpgeturl['http_code'] != '200')
{
$error++;
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors');
- $action='create';
+ $action='createcontainer';
}
else
{
@@ -448,13 +448,13 @@ if ($action == 'add')
{
$error++;
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg'], null, 'errors');
- $action='create';
+ $action='createcontainer';
}
elseif ($tmpgeturl['http_code'] != '200')
{
$error++;
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors');
- $action='create';
+ $action='createcontainer';
}
else
{
@@ -504,6 +504,8 @@ if ($action == 'add')
$objectpage->keywords = GETPOST('WEBSITE_KEYWORDS','alpha');
$objectpage->lang = GETPOST('WEBSITE_LANG','aZ09');
$objectpage->htmlheader = GETPOST('htmlheader','none');
+
+ $objectpage->content = '