openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs | README

Selector.class.php (1334B)


      1 <?php
      2 
      3 namespace template_engine\components;
      4 
      5 use template_engine\components\html\Component;
      6 use template_engine\element\CMSElement;
      7 use template_engine\element\HtmlElement;
      8 use template_engine\element\Value;
      9 use template_engine\element\ValueExpression;
     10 
     11 class SelectorComponent extends Component
     12 {
     13 
     14 	public $types;
     15 
     16 	public $name;
     17 
     18 	public $id;
     19 
     20 	public $folderid;
     21 
     22 	public $param;
     23 
     24 	public function createElement()
     25 	{
     26 		return (new HtmlElement('div'))->addStyleClass('selector')->addChild(
     27 			(new HtmlElement('input'))->addAttribute('type','hidden')->addStyleClass('selector-link-value')->addAttribute('name',$this->param)->addAttribute('value',Value::createExpression(ValueExpression::TYPE_DATA_VAR,$this->param))
     28 		)->addChild(
     29 			(new HtmlElement('input'))->addAttribute('type','text')->addStyleClass('selector-link-name')->addAttribute('name',$this->param.'_text')->addAttribute('placeholder',$this->name)->addAttribute('value',$this->name)
     30 		)->addChild(
     31 			(new HtmlElement('div'))->addStyleClass('dropdown')->addStyleClass('act-selector-search-results')
     32 		)->addChild(
     33 			(new HtmlElement('div'))->addAttribute('type','hidden')->addStyleClass(['navtree','act-load-selector-tree'])->addAttribute('data-types',$this->types)->addAttribute('data-init-id',$this->id)->addAttribute('data-init-folderid',$this->folderid)
     34 		);
     35 	}
     36 
     37 }