Changed behavior of the Cancel buttons
This commit is contained in:
parent
5f30afa2a1
commit
64a309f558
4 changed files with 16 additions and 24 deletions
|
@ -142,17 +142,14 @@ class Categories extends Admin
|
|||
$v = $this->c->Validator->reset()
|
||||
->addRules([
|
||||
'token' => 'token:AdminCategoriesDelete',
|
||||
'confirm' => 'integer',
|
||||
'confirm' => 'integer', // ????
|
||||
'delete' => 'string',
|
||||
'cancel' => 'string',
|
||||
])->addAliases([
|
||||
])->addArguments([
|
||||
'token' => $args,
|
||||
]);
|
||||
|
||||
if (! $v->validation($_POST) || null === $v->delete) {
|
||||
return $this->c->Redirect->page('AdminCategories')->message('Cancel redirect');
|
||||
} elseif ($v->confirm !== 1) {
|
||||
if (! $v->validation($_POST) || $v->confirm !== 1) {
|
||||
return $this->c->Redirect->page('AdminCategories')->message('No confirm redirect');
|
||||
}
|
||||
|
||||
|
@ -180,8 +177,9 @@ class Categories extends Admin
|
|||
'accesskey' => 'd',
|
||||
],
|
||||
'cancel' => [
|
||||
'type' => 'submit',
|
||||
'type' => 'btn',
|
||||
'value' => \ForkBB\__('Cancel'),
|
||||
'link' => $this->c->Router->link('AdminCategories'),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -221,17 +221,14 @@ class Forums extends Admin
|
|||
$v = $this->c->Validator->reset()
|
||||
->addRules([
|
||||
'token' => 'token:AdminForumsDelete',
|
||||
'confirm' => 'integer',
|
||||
'confirm' => 'integer', // ????
|
||||
'delete' => 'string',
|
||||
'cancel' => 'string',
|
||||
])->addAliases([
|
||||
])->addArguments([
|
||||
'token' => $args,
|
||||
]);
|
||||
|
||||
if (! $v->validation($_POST) || null === $v->delete) {
|
||||
return $this->c->Redirect->page('AdminForums')->message('Cancel redirect');
|
||||
} elseif ($v->confirm !== 1) {
|
||||
if (! $v->validation($_POST) || $v->confirm !== 1) {
|
||||
return $this->c->Redirect->page('AdminForums')->message('No confirm redirect');
|
||||
}
|
||||
|
||||
|
@ -259,8 +256,9 @@ class Forums extends Admin
|
|||
'accesskey' => 'd',
|
||||
],
|
||||
'cancel' => [
|
||||
'type' => 'submit',
|
||||
'type' => 'btn',
|
||||
'value' => \ForkBB\__('Cancel'),
|
||||
'link' => $this->c->Router->link('AdminForums'),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -641,17 +641,14 @@ class Groups extends Admin
|
|||
->addRules([
|
||||
'token' => 'token:AdminGroupsDelete',
|
||||
'movegroup' => $move,
|
||||
'confirm' => 'integer',
|
||||
'confirm' => 'integer', // ????
|
||||
'delete' => 'string',
|
||||
'cancel' => 'string',
|
||||
])->addAliases([
|
||||
])->addArguments([
|
||||
'token' => $args,
|
||||
]);
|
||||
|
||||
if (! $v->validation($_POST) || null === $v->delete) {
|
||||
return $this->c->Redirect->page('AdminGroups')->message('Cancel redirect');
|
||||
} elseif ($v->confirm !== 1) {
|
||||
if (! $v->validation($_POST) || $v->confirm !== 1) {
|
||||
return $this->c->Redirect->page('AdminGroups')->message('No confirm redirect');
|
||||
}
|
||||
|
||||
|
@ -681,8 +678,9 @@ class Groups extends Admin
|
|||
'accesskey' => 'd',
|
||||
],
|
||||
'cancel' => [
|
||||
'type' => 'submit',
|
||||
'type' => 'btn',
|
||||
'value' => \ForkBB\__('Cancel'),
|
||||
'link' => $this->c->Router->link('AdminGroups'),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -31,17 +31,14 @@ class Delete extends Page
|
|||
$v = $this->c->Validator->reset()
|
||||
->addRules([
|
||||
'token' => 'token:DeletePost',
|
||||
'confirm' => 'integer',
|
||||
'confirm' => 'integer', // ????
|
||||
'delete' => 'string',
|
||||
'cancel' => 'string',
|
||||
])->addAliases([
|
||||
])->addArguments([
|
||||
'token' => $args,
|
||||
]);
|
||||
|
||||
if (! $v->validation($_POST) || null === $v->delete) {
|
||||
return $this->c->Redirect->page('ViewPost', $args)->message('Cancel redirect');
|
||||
} elseif ($v->confirm !== 1) {
|
||||
if (! $v->validation($_POST) || $v->confirm !== 1) {
|
||||
return $this->c->Redirect->page('ViewPost', $args)->message('No confirm redirect');
|
||||
}
|
||||
|
||||
|
@ -105,8 +102,9 @@ class Delete extends Page
|
|||
'accesskey' => 'd',
|
||||
],
|
||||
'cancel' => [
|
||||
'type' => 'submit',
|
||||
'type' => 'btn',
|
||||
'value' => \ForkBB\__('Cancel'),
|
||||
'link' => $this->c->Router->link('ViewPost', $args),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
Loading…
Add table
Reference in a new issue