File modules/cms/action/template/TemplatePropAction.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\template; 3 use cms\action\Method; 4 use cms\action\TemplateAction; 5 use language\Messages; 6 7 8 class TemplatePropAction extends TemplateAction implements Method { 9 10 11 public function view() { 12 13 $this->setTemplateVar('name' , $this->template->name ); 14 $this->setTemplateVar('publish' , $this->template->publish ); 15 } 16 17 18 public function post() { 19 20 $this->request->handleText('name',function($value) { 21 $this->template->name = $value; 22 }); 23 24 $this->template->publish = $this->request->isTrue('publish'); 25 $this->template->save(); 26 27 $this->addNoticeFor($this->template,Messages::SAVED); 28 } 29 }
Download modules/cms/action/template/TemplatePropAction.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()' Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Sat, 20 Feb 2021 01:34:41 +0100 Jan Dankert New: Publish-switch for templates. Sat, 20 Feb 2021 00:49:37 +0100 Jan Dankert Cleanup of templates. Thu, 19 Nov 2020 14:49:58 +0100 Jan Dankert Fix: Action::addNotice() is replaced by Action::addNoticeFor() Thu, 19 Nov 2020 12:36:44 +0100 Jan Dankert Fix: nextSubAction() is depracated and should not be used. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.