File modules/cms/action/link/LinkValueAction.class.php
Last commit: Wed Oct 14 01:46:43 2026 +0200 Jan Dankert PHP 8: Fix: Method signature must match the interface.
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(): int 14 { 15 return Permission::ACL_WRITE; 16 } 17 18 19 public function view() { 20 $this->setTemplateVars( $this->link->getProperties() ); 21 22 // Typ der Verknuepfung 23 $this->setTemplateVar('type' ,$this->link->getType() ); 24 25 if ( $this->link->linkedObjectId ) { 26 27 $target = new BaseObject( $this->link->linkedObjectId ); 28 $target->load(); 29 30 $this->setTemplateVar('target' ,$target->getProperties() ); 31 $this->setTemplateVar('targetobjectid' ,$target->objectid ); 32 $this->setTemplateVar('targetobjectname',$target->getName() ); 33 $this->setTemplateVar('targetobjecttype',$target->getType() ); 34 } 35 } 36 37 38 public function post() { 39 40 $this->link->linkedObjectId = $this->request->getText('targetobjectid'); 41 $this->link->save(); 42 43 $this->addNoticeFor( $this->link, Messages::SAVED); 44 } 45 }
Downloadmodules/cms/action/link/LinkValueAction.class.php
History Wed, 14 Oct 2026 01:46:43 +0200 Jan Dankert PHP 8: Fix: Method signature must match the interface. 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'.