openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 36d1be40e0273a5b4912e6350fc0a8345a92fbe3
parent c88f16de7703f5de28d24a774ae11b43c346ed1b
Author: dankert <devnull@localhost>
Date:   Sun, 25 Oct 2009 11:35:51 +0100

Beim Löschen von Elementen eine Bestätigungsabfrage. Außerdem nun eine Option-Liste verwenden.

Diffstat:
actionClasses/ElementAction.class.php | 16++++++++++------
themes/default/templates/element/remove.tpl.src.php | 16+++++++++++-----
2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/actionClasses/ElementAction.class.php b/actionClasses/ElementAction.class.php @@ -76,20 +76,24 @@ class ElementAction extends Action */ function delete() { - if ( $this->hasRequestVar('deletevalues') ) + if ( !$this->hasRequestVar('confirm') ) + { + $this->addValidationError('confirm'); + return; + } + + $type = $this->getRequestVar('type','abc'); + + if ( $type == 'value' ) { $this->element->deleteValues(); $this->addNotice('element',$this->template->name,'DELETED',OR_NOTICE_OK); } - elseif ( $this->hasRequestVar('delete') ) + elseif ( $type == 'all' ) { $this->element->delete(); $this->addNotice('element',$this->template->name,'DELETED',OR_NOTICE_OK); } - else - { - $this->addNotice('element',$this->template->name,'CANCELED',OR_NOTICE_WARN); - } } diff --git a/themes/default/templates/element/remove.tpl.src.php b/themes/default/templates/element/remove.tpl.src.php @@ -12,14 +12,20 @@ page fieldset title:message:options row cell colspan:2 - checkbox name:delete - label for:delete - text text:GLOBAL_DELETE + checkbox name:confirm + label for:confirm + text text:CONFIRM_DELETE row cell colspan:2 - checkbox name:deletevalues - label for:deletevalues + label for:type_value + text raw:_____ + radio name:type value:value default:value text text:ELEMENT_DELETE_VALUES + newline + label for:type_all + text raw:_____ + radio name:type value:all + text text:DELETE row cell colspan:2 class:act