ElementAction.class.php (917B)
1 <?php 2 3 namespace cms\action; 4 5 6 use cms\base\Configuration; 7 use cms\model\BaseObject; 8 use cms\model\Element; 9 use cms\model\Folder; 10 use cms\model\Project; 11 use cms\model\Template; 12 use ReflectionClass; 13 use ReflectionProperty; 14 use util\Text; 15 16 17 /** 18 * Action-Klasse fuer die Bearbeitung eines Template-Elementes. 19 * 20 * @author Jan Dankert 21 */ 22 class ElementAction extends BaseAction 23 { 24 public $security = Action::SECURITY_USER; 25 26 /** 27 * @var Element 28 */ 29 protected $element; 30 31 private $template; 32 33 /** 34 * Konstruktor 35 */ 36 function __construct() 37 { 38 parent::__construct(); 39 40 } 41 42 43 public function init() 44 { 45 if ( $this->request->getId() == 0 ) 46 throw new \util\exception\ValidationException('no element-id available'); 47 48 $this->element = new Element( $this->request->getId() ); 49 $this->element->load(); 50 51 $this->setTemplateVar( 'elementid' ,$this->element->elementid ); 52 } 53 } 54