diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 668ec7b3c07527bebc1529e6adbe4e0ea1b0e0db..3a09f226eb0a5f724accfd5105751378282b8398 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -15,4 +15,5 @@ EditPageContent=Edit Content Website=Web site AddPage=Add page Page=Page -PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page. \ No newline at end of file +PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page. +PageDeleted=Page %s of website %s deleted \ No newline at end of file diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index c33489e46fe925074cb7d76a58428fbd40d13018..162310f4697f2d2b8fd3847468f5a852abfbbd3f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -350,7 +350,7 @@ legend { margin-bottom: 8px; } fieldset { border: 1px solid #AAAAAA !important; } -.button, input[name="sbmtConnexion"] { +.button, .buttonDelete, input[name="sbmtConnexion"] { font-family: <?php print $fontlist ?>; border-color: #c5c5c5; border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25); @@ -383,17 +383,17 @@ fieldset { border: 1px solid #AAAAAA !important; } -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); } -.button:focus { +.button:focus, .buttonDelete:focus { -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(0, 0, 60, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } -.button:hover { +.button:hover, .buttonDelete:hover { -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } -.button:disabled { +.button:disabled, .buttonDelete:disabled { opacity: 0.4; filter: alpha(opacity=40); /* For IE8 and earlier */ box-shadow: none; @@ -1907,31 +1907,16 @@ span.butAction, span.butActionDelete { } .butAction:hover { -/* for bootstrap look - color: #fff; - background-color: #286090; - border-color: #204d74; -*/ -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); } -.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active { -/* for bootstrap look - color: #fff; - background-color: #d9534f; - border-color: #d43f3a; -*/ - color: #800; +.butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active, .buttonDelete { + color: #800 !important; } .butActionDelete:hover { -/* for bootstrap look - color: #fff; - background-color: #c9302c; - border-color: #ac2925; -*/ -moz-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); -webkit-box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.2), 0px 0px 0px rgba(60,60,60,0.1); @@ -3128,6 +3113,12 @@ td.hidden { border-bottom: 1px solid #888; background: #eee; } +.websitebar .button, .websitebar .buttonDelete +{ + padding: 2px 5px 3px 5px !important; + margin: 2px 4px 2px 4px !important; + line-height: normal; +} .websiteselection { display: inline-block; padding-left: 10px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 58629477e761039a290cc492750bd8b238035002..3de39efb50fbc1aa147a6160fca966eb1945f32b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1913,7 +1913,7 @@ span.butAction, span.butActionDelete { background-repeat: repeat-x } -.butActionDelete { +.butActionDelete, .buttonDelete { color: #ffffff !important; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); background-color: #cc6d00; @@ -2990,6 +2990,12 @@ td.hidden { border-bottom: 1px solid #888; background: #eee; } +.websitebar .button, .websitebar .buttonDelete +{ + padding: 2px 4px 2px 4px !important; + margin: 2px 4px 2px 4px !important; + line-height: normal; +} .websiteselection { display: inline-block; padding-left: 10px; diff --git a/htdocs/websites/index.php b/htdocs/websites/index.php index ea03c9fd7b77d347b5f9f406b5fe264bde205400..0696c28c86db66c64524418b848183a80b88909f 100644 --- a/htdocs/websites/index.php +++ b/htdocs/websites/index.php @@ -81,6 +81,7 @@ $page=GETPOST('page', 'alpha'); $pageid=GETPOST('pageid', 'alpha'); $action=GETPOST('action','alpha'); +if (GETPOST('delete')) { $action='delete'; } if (GETPOST('preview')) $action='preview'; if (GETPOST('create')) { $action='create'; } if (GETPOST('editmedia')) { $action='editmedia'; } @@ -110,7 +111,7 @@ if ($website) { $res = $object->fetch(0, $website); } -if ($pageid) +if ($pageid && $action != 'add') { $res = $objectpage->fetch($pageid); } @@ -207,6 +208,43 @@ if ($action == 'update') } } +// Update page +if ($action == 'delete') +{ + $db->begin(); + + $res = $object->fetch(0, $website); + + $res = $objectpage->fetch($pageid, $object->fk_website); + + if ($res > 0) + { + $res = $objectpage->delete($user); + if (! $res > 0) + { + $error++; + setEventMessages($objectpage->error, $objectpage->errors, 'errors'); + } + + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("PageDeleted", $objectpage->pageurl, $website), null, 'mesgs'); + + header("Location: ".$_SERVER["PHP_SELF"].'?website='.$website); + exit; + } + else + { + $db->rollback(); + } + } + else + { + dol_print_error($db); + } +} + // Update css if ($action == 'updatecss') { @@ -442,6 +480,7 @@ if (count($object->records) > 0) $out.='</select>'; print $out; print '<input type="submit" class="button" name="refresh" value="'.$langs->trans("Refresh").'">'; + print '<input type="submit" class="buttonDelete" name="delete" value="'.$langs->trans("Delete").'">'; //print $form->selectarray('page', $array); print '</div>'; print '<div class="websiteselection">';