File modules/cms/action/element/ElementRemoveAction.class.php
Last commit: Wed Mar 9 13:28:52 2022 +0100 dankert Refactoring: Checkbox values are always sent to the server. In the actions we must test the value with 'isTrue()'
1 <?php 2 namespace cms\action\element; 3 use cms\action\Action; 4 use cms\action\ElementAction; 5 use cms\action\Method; 6 use language\Messages; 7 8 9 class ElementRemoveAction extends ElementAction implements Method { 10 public function view() { 11 $this->setTemplateVar( 'name' ,$this->element->name ); 12 } 13 14 public function post() { 15 $type = $this->request->getAlphanum('type'); 16 17 if ( $type == 'value' ) 18 { 19 // Nur Inhalte löschen 20 $this->element->deleteValues(); 21 $this->addNoticeFor( $this->element, Messages::DELETED); 22 } 23 elseif ( $type == 'all' ) 24 { 25 // Element löschen 26 $this->element->delete(); 27 $this->addNoticeFor( $this->element, Messages::DELETED); 28 } 29 } 30 }
Downloadmodules/cms/action/element/ElementRemoveAction.class.php
History Wed, 9 Mar 2022 13:28:52 +0100 dankert Refactoring: Checkbox values are always sent to the server. In the actions we must test the value with 'isTrue()' Wed, 10 Mar 2021 23:51:22 +0100 Jan Dankert Refactoring: Cleaned the Request params. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Thu, 19 Nov 2020 14:49:58 +0100 Jan Dankert Fix: Action::addNotice() is replaced by Action::addNoticeFor() Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.