diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index c6a6826251f..ed4b56be831 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -231,6 +231,8 @@ class FormWebsite */ public function selectContainer($website, $htmlname = 'pageid', $pageid = 0, $showempty = 0, $action = '', $morecss = 'minwidth200', $excludeids = null) { + global $conf, $langs; + $this->num = 0; $atleastonepage = (is_array($website->lines) && count($website->lines) > 0); @@ -239,13 +241,18 @@ class FormWebsite if ($atleastonepage && $action != 'editsource') { $out .= ''; } else { - $out .= ''; + $out .= ''; } if ($showempty || !$atleastonepage) { - $out .= ' '; + $out .= ''.(is_numeric($showempty) ? ' ' : $showempty).''; } + /*if (!empty($conf->use_javascript_ajax)) { + $valueoption = ''.img_picto('', 'add', 'class="paddingrightonly"').$langs->trans("AddPage").''; + $out .= ''.$valueoption.''; + }*/ + if ($atleastonepage) { if (empty($pageid) && $action != 'createcontainer') { // Page id is not defined, we try to take one $firstpageid = 0; diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 379eadef08f..298f7c6ab51 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -150,4 +150,5 @@ ErrorFaviconSize=Favicon must be sized 16x16, 32x32 or 64x64 FaviconTooltip=Upload an image which needs to be a png (16x16, 32x32 or 64x64) NextContainer=Next page/container PreviousContainer=Previous page/container -WebsiteMustBeDisabled=The website must have the status "Disabled" +WebsiteMustBeDisabled=The website must have the status "%s" +WebpageMustBeDisabled=The web page must have the status "%s" diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 717638fcbcb..da006de3616 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -285,7 +285,7 @@ section.setupsection { div.tabBar textarea:focus { border: 1px solid #aaa !important; } -input:focus:not(.button):not(.select2-search__field):not(#top-bookmark-search-input):not(.search_component_input):not(.input-search-takepos), +input:focus:not(.button):not(.buttonwebsite):not(.select2-search__field):not(#top-bookmark-search-input):not(.search_component_input):not(.input-search-takepos), select:focus, .select2-container--open [aria-expanded="false"].select2-selection--single { /* div.tabBar input:focus, div.tabBar select:focus { */ border-bottom: 1px solid #666 !important; @@ -620,11 +620,12 @@ table.tableforfield .buttonDelete:not(.bordertransp):not(.buttonpayment) { -webkit-box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } -.button:disabled, .buttonDelete:disabled, .button.disabled { +.button:disabled, .buttonDelete:disabled, .button.disabled, .buttonDelete.disabled { opacity: 0.4; box-shadow: none; -webkit-box-shadow: none; cursor: auto; + text-decoration: none; } .buttonRefused { pointer-events: none; @@ -5141,7 +5142,7 @@ tr.visible { .websiteformtoolbar { position: sticky; top: ; - z-index: 1000; + z-index: 1002; /* Dolibarr menu is 1001, Website menu is 1002 */ } .exampleapachesetup { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 9141a0d3f3c..874e77985a2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4996,7 +4996,7 @@ tr.visible { .websiteformtoolbar { position: sticky; top: ; - z-index: 1000; + z-index: 1002; /* Dolibarr menu is 1001, Website menu is 1002 */ } .exampleapachesetup { diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index bddb8b43c24..a8a85423da3 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -875,10 +875,10 @@ class Website extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online'); } $statusType = 'status5'; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 51ea6998d59..d04608387cb 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -838,10 +838,10 @@ class WebsitePage extends CommonObject if (empty($this->labelStatus) || empty($this->labelStatusShort)) { global $langs; //$langs->load("mymodule"); - $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); - $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); - $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled'); - $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled'); + $this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline'); + $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online'); + $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Offline'); + $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Online'); } $statusType = 'status5'; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 16985c511e1..7cf58a81971 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2760,28 +2760,32 @@ if (!GETPOST('hide_websitemenu')) { print ''; if ($action != 'file_manager') { - print ''; + print ''; print $langs->trans("Website").': '; - print ''; + print ''; $urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite'; - if (empty($conf->use_javascript_ajax)) { - print ''; - print ''; + //if (empty($conf->use_javascript_ajax)) { + print ''; + print ''; print ''; - } + //} // List of website print ''; + $out = ''; $out .= ''; if (empty($object->records)) { $out .= ' '; } + + /* if (!empty($conf->use_javascript_ajax)) { $valueoption = ''.img_picto('', 'add', 'class="paddingrightonly"').$langs->trans("AddWebsite").''; $out .= ''.$valueoption.''; - } + }*/ + // Loop on each sites $i = 0; foreach ($object->records as $key => $valwebsite) { @@ -2826,6 +2830,10 @@ if (!GETPOST('hide_websitemenu')) { print ''; } + print ''; + + print ''; + if ($websitekey && $websitekey != '-1' && ($action == 'preview' || $action == 'createfromclone' || $action == 'createpagefromclone' || $action == 'deletesite')) { print ' '; @@ -2852,10 +2860,15 @@ if (!GETPOST('hide_websitemenu')) { // Delete website if ($website->status == $website::STATUS_VALIDATED) { - print ''; + $disabled = ' disabled="disabled"'; + $title = $langs->trans("WebsiteMustBeDisabled", $langs->transnoentitiesnoconv($website->LibStatut(0, 0))); + $url = '#'; } else { - print ''; + $disabled = ''; + $title = $langs->trans("Delete"); + $url = $_SERVER["PHP_SELF"].'?action=deletesite&token='.newToken().'&website='.urlencode($website->ref); } + print ''.img_picto('', 'delete', 'class=""').''.$langs->trans("Delete").''; // Regenerate all pages print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'">'; @@ -2863,6 +2876,7 @@ if (!GETPOST('hide_websitemenu')) { // Generate site map print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'">'; + // Find / replace tool print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'">'; } @@ -2970,53 +2984,53 @@ if (!GETPOST('hide_websitemenu')) { print ''; print ''; - print ''; + print ''; print $langs->trans("PageContainer").': '; - print ''; + print ''; - print ''; - print 'ref).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; + print ''; + print 'ref).'" class=""'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'">'; print ''; //print ''; - if ($action != 'addcontainer') { + //if ($action != 'addcontainer') { $out = ''; - $s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'maxwidth200onsmartphone'); + $s = $formwebsite->selectContainer($website, 'pageid', $pageid, 0, $action, 'minwidth100 maxwidth200onsmartphone'); - if ($formwebsite->num > 0) { - $out .= ''; - $out .= $s; - $out .= ''; + if ($formwebsite->num >= 0) { + $out .= ''; + $out .= $s; + $out .= ''; - $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref); + $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&token='.newToken().'&website='.urlencode($website->ref); - if (!empty($conf->use_javascript_ajax)) { - $out .= ''; - } + if (!empty($conf->use_javascript_ajax)) { + $out .= ''; } + } print $out; - } else { + /*} else { print $langs->trans("New"); - } + }*/ print ''; - print ''; + print ''; // Print nav arrows $pagepreviousid = 0; @@ -3240,7 +3254,19 @@ if (!GETPOST('hide_websitemenu')) { print 'ref).'&pageid='.((int) $pageid).'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("SetAsHomePage")).'">'; } print ''; - print ''; + + // Delete + //print ''; + if ($websitepage->status == $websitepage::STATUS_DRAFT || !$atleastonepage) { + $disabled = ' disabled="disabled"'; + $title = $langs->trans("WebpageMustBeDisabled", $langs->transnoentitiesnoconv($websitepage->LibStatut(0, 0))); + $url = '#'; + } else { + $disabled = ''; + $title = ''; + $url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&website='.urlencode($website->ref); + } + print ''.img_picto('', 'delete', 'class=""').''.$langs->trans("Delete").''; } } @@ -3881,7 +3907,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties $pageusermodifid = $objectpage->fk_user_modif; $pageauthoralias = $objectpage->author_alias; $pagestatus = $objectpage->status; - } else { + } else { // $action = 'createcontainer' $type_container = 'page'; $pageurl = ''; $pagealiasalt = ''; @@ -4179,6 +4205,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print ''; print ''; + if ($action == 'createcontainer') { print ''; @@ -4207,7 +4234,10 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties $arraygrabimagesinto = array('root'=>$langs->trans("WebsiteRootOfImages"), 'subpage'=>$langs->trans("SubdirOfPage")); print $form->selectarray('grabimagesinto', $arraygrabimagesinto, GETPOSTISSET('grabimagesinto') ? GETPOST('grabimagesinto') : 'root', 0, 0, 0, '', 0, 0, 0, '', '', 1); print ''; - print ''; + + print ''; + print ''; + print ''; print ''; }