diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index a0a1da26b3c..2257203d25b 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -51,11 +51,14 @@ function dolStripPhpCode($str, $replacewith = '') $partlings = explode('?>', $part); if (!empty($partlings)) { - $phppart = $partlings[0]; + //$phppart = $partlings[0]; //remove content before closing tag if (count($partlings) > 1) $partlings[0] = ''; // Todo why a count > 1 and not >= 1 ? //append to out string - $newstr .= ''.$replacewith.''.implode('', $partlings); + //$newstr .= ''.$replacewith.''.implode('', $partlings); + //$newstr .= ''.$replacewith.''.implode('', $partlings); + $newstr .= ''.$replacewith.''.implode('', $partlings); + //$newstr .= $replacewith.implode('', $partlings); } } } diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index ee46c9f4954..02e283babea 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -42,7 +42,8 @@ ViewPageInNewTab=View page in new tab SetAsHomePage=Set as Home page RealURL=Real URL ViewWebsiteInProduction=View web site using home URLs -SetHereVirtualHost=Use with Apache/NGinx/...
If you can create, on your web server (Apache, Nginx, ...), a dedicated Virtual Host with PHP enabled and a Root directory on
%s
then set the name of the virtual host you have created in the properties of web site, so the preview can be done also using this dedicated web server access instead of the internal Dolibarr server. +SetHereVirtualHost=Use with Apache/NGinx/...
Create on your web server (Apache, Nginx, ...) a dedicated Virtual Host with PHP enabled and a Root directory on
%s +ExampleToUseInApacheVirtualHostConfig=Example to use in Apache virtual host setup: YouCanAlsoTestWithPHPS=Use with PHP embedded server
On develop environment, you may prefer to test the site with the PHP embedded web server (PHP 5.5 required) by running
php -S 0.0.0.0:8080 -t %s YouCanAlsoDeployToAnotherWHP=Run your web site with another Dolibarr Hosting provider
If you don't have a web server like Apache or NGinx available on internet, you can export and import your web site onto another Dolibarr instance provided by another Dolibarr hosting provider that provide full integration with the Website module. You can find a list of some Dolibarr hosting providers on https://saas.dolibarr.org CheckVirtualHostPerms=Check also that virtual host has permission %s on files into
%s diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index d1e79773558..c8cdf0a951a 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -4112,7 +4112,14 @@ tr.visible { /* Module website */ /* ============================================================================== */ -.phptag { +.exampleapachesetup { + overflow-y: auto; + height: 100px; + font-size: 0.8em; + border: 1px solid #aaa; +} + +span[phptag] { background: #ddd; border: 1px solid #ccc; border-radius: 4px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9026b8111c9..8f61c785f14 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4115,7 +4115,14 @@ tr.visible { /* Module website */ /* ============================================================================== */ -.phptag { +.exampleapachesetup { + overflow-y: auto; + max-height: 100px; + font-size: 0.8em; + border: 1px solid #aaa; +} + +span[phptag] { background: #ddd; border: 1px solid #ccc; border-radius: 4px; } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 03587b97d32..afee89e0d1f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2195,7 +2195,26 @@ if (!GETPOST('hide_websitemenu')) $htmltext .= '
'; $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("ReadPerm"), DOL_DOCUMENT_ROOT); $htmltext .= '
'.$langs->trans("CheckVirtualHostPerms", $langs->transnoentitiesnoconv("WritePerm"), DOL_DATA_ROOT.'/website
'.DOL_DATA_ROOT.'/medias'); - $htmltext .= '
'; + + $examplewithapache = ''."\n"; + $examplewithapache .= 'AllowOverride FileInfo Options + Options -Indexes -MultiViews -FollowSymLinks -ExecCGI + Require all granted + + + AllowOverride FileInfo Options + Options -Indexes -MultiViews +FollowSymLinks -ExecCGI + Require all granted + + + AllowOverride FileInfo Options + Options -Indexes -MultiViews -FollowSymLinks -ExecCGI + Require all granted + '; + + $htmltext .= '
'.$langs->trans("ExampleToUseInApacheVirtualHostConfig").':
'; + $htmltext .= '
'.dol_nl2br(dol_escape_htmltag($examplewithapache, 1, 1)).'
'; + $htmltext .= '
'; $htmltext .= $langs->trans("YouCanAlsoTestWithPHPS", $dataroot); $htmltext .= '
'; @@ -2371,12 +2390,12 @@ if (!GETPOST('hide_websitemenu')) if (! isEditingEnabled || forceenable) { console.log("Enable inline edit"); - jQuery(\'section[contenteditable="true"]\').each(function(idx){ + jQuery(\'section[contenteditable="true"],div[contenteditable="true"]\').each(function(idx){ var idtouse = $(this).attr(\'id\'); console.log("Enable inline edit for "+idtouse); CKEDITOR.inline(idtouse, { // Allow some non-standard markup that we used in the introduction. - extraAllowedContent: \'span(*);cite(*);q(*);dl(*);dt(*);dd(*);ul(*);li(*);header(*);button(*);h1(*);h2(*);\', + extraAllowedContent: \'span(*);cite(*);q(*);dl(*);dt(*);dd(*);ul(*);li(*);header(*);button(*);h1(*);h2(*);title(*);\', //extraPlugins: \'sourcedialog\', removePlugins: \'flash,stylescombo\', // Show toolbar on startup (optional). @@ -2400,7 +2419,9 @@ if (!GETPOST('hide_websitemenu')) print $langs->trans("EditInLine"); print ''; - if ($websitepage->grabbed_from) + //$disableeditinline = $websitepage->grabbed_from; + $disableeditinline = 0; + if ($disableeditinline) { //print ''; print ''.img_picto($langs->trans("OnlyEditionOfSourceForGrabbedContent"), 'switch_off', '', false, 0, 0, '', 'nomarginleft').''; @@ -2421,12 +2442,6 @@ if (!GETPOST('hide_websitemenu')) print ''; print '
'; print $langs->trans("ShowSubcontainers"); - /*if ($websitepage->grabbed_from) - { - print ''.img_picto($langs->trans("OnlyEditionOfSourceForGrabbedContent"),'switch_off','',false,0,0,'','nomarginleft').''; - } - else - {*/ if (empty($conf->global->WEBSITE_SUBCONTAINERSINLINE)) { print ''.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', false, 0, 0, '', 'nomarginleft').'';