diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 08fcdd82a58be..9dc1b2c3863e5 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -39,7 +39,7 @@ function dolWebsiteReplacementOfLinks($website, $content, $removephppart=0) if ($removephppart) $replacewith=''; $content = preg_replace('/value="<\?php((?!\?>).)*\?>\n*/ims', 'value="'.$replacewith.'"', $content); - $replacewith='...php...'; + $replacewith='...php...'; if ($removephppart) $replacewith=''; $content = preg_replace('/<\?php((?!\?>).)*\?>\n*/ims', $replacewith, $content); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c275927dabab1..596d8624232f4 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3468,6 +3468,10 @@ /* Module website */ /* ============================================================================== */ +.phptag { + background: #ddd; border: 1px solid #ccc; border-radius: 4px; +} + .nobordertransp { border: 0px; background-color: transparent; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a1cc57896632a..2773be6f3e52b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3533,6 +3533,10 @@ /* Module website */ /* ============================================================================== */ +.phptag { + background: #ddd; border: 1px solid #ccc; border-radius: 4px; +} + .nobordertransp { border: 0px; background-color: transparent; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index d84c8fec11b31..37e87c6367ff1 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -110,6 +110,15 @@ if (($pageid > 0 || $pageref) && $action != 'addcontainer') { $res = $objectpage->fetch($pageid, ($object->id > 0 ? $object->id : null), $pageref); + // Check if pageid is inside the new website, if not we reset param pageid + if ($object->id > 0 && ($objectpage->fk_website != $object->id)) + { + $res = $objectpage->fetch(0, $object->id, '');; + if ($res == 0) // Page was not found, we reset it + { + $objectpage=new WebsitePage($db); + } + } $pageid = $objectpage->id; } @@ -1202,6 +1211,7 @@ '/includes/ace/ext-statusbar.js', '/includes/ace/ext-language_tools.js', //'/includes/ace/ext-chromevox.js' + //'/includes/jquery/plugins/jqueryscoped/jquery.scoped.js', ); $arrayofcss = array(); @@ -2016,11 +2026,30 @@ // REPLACEMENT OF LINKS When page called by website editor - $out.=')', $objectpage->htmlheader); + $tmpstyleinheader =''; + $i=0; + foreach($tmp as $valtmp) + { + $i++; + if ($i % 2 == 0) $tmpstyleinheader.=$valtmp."\n"; + } + //$tmpstyleinheader.=''; + //$pos=strpos($tmpstyleinheader, ']*>)+/ims','aaa', $tmpstyleinheader); + //$tmpstyleinheader = preg_replace('/().*$/ims','$1', $tmpstyleinheader); + //$tmpstyleinheader = preg_replace('/.*]*>/ims','', $tmpstyleinheader); + $tmpout.= $tmpstyleinheader."\n"; + // Clean style that may affect global style of Dolibarr + $tmpout=preg_replace('/}[\s\n]*body\s*{[^}]+}/ims','}',$tmpout); + $out.=$tmpout; $out.=''."\n"; // Do not enable the contenteditable when page was grabbed, ckeditor is removing span and adding borders, @@ -2032,10 +2061,13 @@ $out.=''; - $out.=''; + $out.=' '; $out.= "\n".''."\n\n"; + // For jqueryscoped (does not work as expected) + //$out.=""; + print $out; /*file_put_contents($filetpl, $out);