Work on website module. Can delete a page.
This commit is contained in:
parent
f59f3032c6
commit
3045449dbb
@ -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.
|
||||
PreviewOfSiteNotYetAvailable=Preview of your website <strong>%s</strong> not yet available. You must first add a page.
|
||||
PageDeleted=Page %s of website %s deleted
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user