File modules/cms/action/link/LinkValueAction.class.php

Last commit: Sat Mar 6 03:42:38 2021 +0100	Jan Dankert	New: Better permission checks.
1 <?php 2 namespace cms\action\link; 3 use cms\action\Action; 4 use cms\action\LinkAction; 5 use cms\action\Method; 6 use cms\model\BaseObject; 7 use cms\model\Permission; 8 use language\Messages; 9 10 11 class LinkValueAction extends LinkAction implements Method { 12 13 public function getRequiredPermission() { 14 return Permission::ACL_WRITE; 15 } 16 17 18 public function view() { 19 $this->setTemplateVars( $this->link->getProperties() ); 20 21 // Typ der Verknuepfung 22 $this->setTemplateVar('type' ,$this->link->getType() ); 23 24 if ( $this->link->linkedObjectId ) { 25 26 $target = new BaseObject( $this->link->linkedObjectId ); 27 $target->load(); 28 29 $this->setTemplateVar('target' ,$target->getProperties() ); 30 $this->setTemplateVar('targetobjectid' ,$target->objectid ); 31 $this->setTemplateVar('targetobjectname',$target->getName() ); 32 $this->setTemplateVar('targetobjecttype',$target->getType() ); 33 } 34 } 35 36 37 public function post() { 38 39 $this->link->linkedObjectId = $this->request->getText('targetobjectid'); 40 $this->link->save(); 41 42 $this->addNoticeFor( $this->link, Messages::SAVED); 43 } 44 }
Download modules/cms/action/link/LinkValueAction.class.php
History Sat, 6 Mar 2021 03:42:38 +0100 Jan Dankert New: Better permission checks. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Sat, 13 Feb 2021 22:23:06 +0100 Jan Dankert Refactoring: Moving editing of links into the subaction 'value'.