From eff1d1c89e2bfe9b565371896053b1025c12c971 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Sep 2018 16:35:59 +0200 Subject: [PATCH] Work on website module --- htdocs/core/lib/website.lib.php | 3 ++- htdocs/core/website.inc.php | 7 ++++--- htdocs/website/index.php | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 092ded57111..50b284e49c4 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -107,7 +107,8 @@ function dolWebsiteOutput($content) { // We remove the part of content $content = preg_replace('/.*<\/head>/ims', '', $content); - + $content = preg_replace('/^.*]*)*>/ims', '', $content); + $content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $content); } elseif (defined('USEDOLIBARRSERVER')) // REPLACEMENT OF LINKS When page called from Dolibarr server { diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 46b1f955177..3ed3a92cb50 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2018 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,10 +19,11 @@ /** * \file htdocs/core/website.inc.php * \brief Common file loaded used by all website pages (after master.inc.php) - * The global variable $website must be defined. + * The global variable $websitekey must be defined. */ - include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; $website=new Website($db); $website->fetch(0,$websitekey); + +include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f7b592e8992..ec4846e08b5 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2618,7 +2618,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa $objectpage->fetch($pageid); $jscontent = @file_get_contents($filejs); - $out = ''."\n"; + $out = ''."\n"; // Include a html so we can benefit of the header of page. // Note: We can't use iframe as it can be used to include another external html file @@ -2666,7 +2666,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa // Do not enable the contenteditable when page was grabbed, ckeditor is removing span and adding borders, // so editable will be available only from container created from scratch - //$out.='
grabbed_from ? ' contenteditable="true"' : '').'>'."\n"; + //$out.='
grabbed_from ? ' contenteditable="true"' : '').'>'."\n"; $out.='
'."\n"; $newcontent = $objectpage->content;