diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
index a0c74af9482..ef7189a3fa0 100644
--- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
+++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql
@@ -95,6 +95,7 @@ create table llx_product_lot_extrafields
ALTER TABLE llx_product_lot_extrafields ADD INDEX idx_product_lot_extrafields (fk_object);
+ALTER TABLE llx_website_page MODIFY content MEDIUMTEXT;
diff --git a/htdocs/install/mysql/tables/llx_website_pages.sql b/htdocs/install/mysql/tables/llx_website_pages.sql
index 28f0c870dea..f1ea66bb56a 100644
--- a/htdocs/install/mysql/tables/llx_website_pages.sql
+++ b/htdocs/install/mysql/tables/llx_website_pages.sql
@@ -25,7 +25,7 @@ CREATE TABLE llx_website_page
title varchar(255),
description varchar(255),
keywords varchar(255),
- content text,
+ content mediumtext, -- text is not enough in size
status integer,
date_creation datetime,
date_modification datetime,
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index fa6d056c587..b014776e15f 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -1780,7 +1780,7 @@ img.toolbarbutton {
}
/* hide the toggler-button when the pane is 'slid open' */
-.ui-layout-resizer-sliding .ui-layout-toggler {
+.ui-layout-resizer-sliding .ui-layout-toggler {
display: none;
}
@@ -2007,7 +2007,9 @@ span.tabspan {
/* Boutons actions */
/* ============================================================================== */
-div.divButAction { margin-bottom: 1.4em; }
+div.divButAction {
+ margin-bottom: 1.4em;
+}
span.butAction, span.butActionDelete {
cursor: pointer;
@@ -3321,6 +3323,7 @@ td.hidden {
}
.websitetools {
float: right;
+ height: 28px;
}
.websiteinputurl {
display: inline-block;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index d4d24172bbf..5591edd7a80 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -32,7 +32,7 @@ if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be accessed by logon page so without login
-//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
+//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
@@ -580,7 +580,7 @@ div.myavailability {
margin-top: 25px !important;
}
-/* for future usage (when left menu has been removed) */
+/* DOL_XXX for future usage (when left menu has been removed). If we do not use datatable */
.table-responsive {
width: calc(100% - 330px);
margin-bottom: 15px;
@@ -615,7 +615,7 @@ div.myavailability {
.maxwidth500 { max-width: 500px; }
.minheight20 { min-height: 20px; }
.minheight40 { min-height: 40px; }
-.titlefield { width: 30%; }
+.titlefield { width: 25%; }
.titlefieldcreate { width: 20%; }
/* Force values for small screen */
@@ -849,7 +849,7 @@ div.ficheaddleft {
browser->layout != 'phone') { print "padding-".$left.": 16px;\n"; }
else print "margin-top: 10px;\n"; ?>
}
-/* Force values for small screen */
+/* Force values on one colum for small screen */
@media only screen and (max-width: 900px)
{
div.fiche {
@@ -1167,7 +1167,7 @@ div.mainmenu {
div.mainmenu.home{
background-image: url();
- background-position-x: middle;
+ background-position-x: center;
}
div.mainmenu.accountancy {
@@ -1281,7 +1281,7 @@ foreach($mainmenuusedarray as $val)
$url=dol_buildpath($path.'/theme/'.$theme.'/img/menus/generic'.$generic.".png",1);
$found=1;
if ($generic < 4) $generic++;
- print "/* A mainmenu entry but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
+ print "/* A mainmenu entry was found but img file ".$val.".png not found (check /".$val."/img/".$val.".png), so we use a generic one */\n";
}
if ($found)
{
@@ -1777,7 +1777,7 @@ img.toolbarbutton {
}
/* hide the toggler-button when the pane is 'slid open' */
-.ui-layout-resizer-sliding ui-layout-toggler {
+.ui-layout-resizer-sliding .ui-layout-toggler {
display: none;
}
@@ -2016,8 +2016,8 @@ span.tabspan {
/* Boutons actions */
/* ============================================================================== */
-div.divButAction {
- margin-bottom: 1.4em;
+div.divButAction {
+ margin-bottom: 1.4em;
vertical-align: top;
}
@@ -3216,7 +3216,18 @@ td.hidden {
}
.websitetools {
float: right;
- padding-top: 2px;
+ height: 28px;
+}
+.websiteinputurl {
+ display: inline-block;
+ vertical-align: top;
+}
+.websiteiframenoborder {
+ border: 0px;
+}
+a.websitebuttonsitepreview img {
+ width: 26px;
+ display: inline-block;
}
.websiteiframenoborder {
border: 0px;
diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php
index 11bcc12e7af..d0aa6424787 100644
--- a/htdocs/websites/index.php
+++ b/htdocs/websites/index.php
@@ -222,35 +222,48 @@ if ($action == 'delete')
// Update css
if ($action == 'updatecss')
{
- $db->begin();
+ //$db->begin();
$res = $object->fetch(0, $website);
+
/*
$res = $object->update($user);
if ($res > 0)
{
$db->commit();
- setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
$action='';
}
else
{
+ $error++;
$db->rollback();
}*/
- $csscontent =''."\n";
+ $csscontent.= '"."\n";
+ $csscontent.= ''."\n";
$csscontent.= GETPOST('WEBSITE_CSS_INLINE');
+ dol_syslog("Save file css into ".$filecss);
+
dol_mkdir($pathofwebsite);
$result = file_put_contents($filecss, $csscontent);
if (! empty($conf->global->MAIN_UMASK))
@chmod($filecss, octdec($conf->global->MAIN_UMASK));
-
- if ($result) setEventMessages($langs->trans("Saved"), null, 'mesgs');
- else setEventMessages('Failed to write file '.$fileindex, null, 'errors');
+ if (! $result)
+ {
+ $error++;
+ setEventMessages('Failed to write file '.$filecss, null, 'errors');
+ }
+
+ if (! $error)
+ {
+ setEventMessages($langs->trans("Saved"), null, 'mesgs');
+ }
+
$action='preview';
}
@@ -432,7 +445,7 @@ if ($action == 'updatecontent')
/* $objectpage->content = preg_replace('//s', '', $objectpage->content); */
$res = $objectpage->update($user);
- if (! $res > 0)
+ if ($res < 0)
{
$error++;
setEventMessages($objectpage->error, $objectpage->errors, 'errors');
@@ -487,7 +500,7 @@ if ($action == 'updatecontent')
dol_delete_file($filetpl);
$tplcontent ='';
- $tplcontent.= ''."\n";
+ $tplcontent.= ""."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
$tplcontent.= ''."\n";
@@ -840,7 +853,9 @@ if ($action == 'editcss')
print '
';
$csscontent = @file_get_contents($filecss);
-
+ // Clean php css file to get only css part
+ $csscontent = preg_replace('//s', '', $csscontent);
+
dol_fiche_head();
print ''."\n";
@@ -967,7 +982,7 @@ if ($action == 'editcontent')
$doleditor->Create(0, '', false);
}
-print '';
+print "\n\n";