Work on website module

This commit is contained in:
Laurent Destailleur 2018-09-25 16:35:59 +02:00
parent e6be047178
commit eff1d1c89e
3 changed files with 8 additions and 6 deletions

View File

@ -107,7 +107,8 @@ function dolWebsiteOutput($content)
{
// We remove the <head> part of content
$content = preg_replace('/<head>.*<\/head>/ims', '', $content);
$content = preg_replace('/^.*<body(\s[^>]*)*>/ims', '', $content);
$content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $content);
}
elseif (defined('USEDOLIBARRSERVER')) // REPLACEMENT OF LINKS When page called from Dolibarr server
{

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2017-2018 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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';

View File

@ -2618,7 +2618,7 @@ if ($action == 'preview' || $action == 'createfromclone' || $action == 'createpa
$objectpage->fetch($pageid);
$jscontent = @file_get_contents($filejs);
$out = '<!-- Page content '.$filetpl.' : Div with (CSS Of website from file + Style/htmlheader of page from database + Page content from database) -->'."\n";
$out = '<!-- Page content '.$filetpl.' : Div with (CSS Of website from file + Style/htmlheader of page from database + Page content from database or by include if WEBSITE_SUBCONTAINERSINLINE is on) -->'."\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.='<div id="divbodywebsite" class="bodywebsite"'.($objectpage->grabbed_from ? ' contenteditable="true"' : '').'>'."\n";
//$out.='<div id="bodywebsite" class="bodywebsite"'.($objectpage->grabbed_from ? ' contenteditable="true"' : '').'>'."\n";
$out.='<div id="divbodywebsite" class="bodywebsite">'."\n";
$newcontent = $objectpage->content;