File modules/template_engine/components/html/component_selector/SelectorComponent.class.php

Last commit: Mon Jun 27 02:22:50 2022 +0200	Jan Dankert	Fix: Saving links in PageallAction and PageelementAllAction.
1 <?php 2 3 namespace template_engine\components\html\component_selector; 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 /** 12 * A selector for selecting a node object. 13 * 14 * @package template_engine\components\html\component_selector 15 */ 16 class SelectorComponent extends Component 17 { 18 19 public $types; 20 21 public $name; 22 23 public $id; 24 25 public $folderid; 26 27 public $default; 28 29 public $param; 30 31 public function createElement() { 32 return (new HtmlElement('div'))->addStyleClass(['selector','droppable-selector'])->addChild( 33 (new HtmlElement('input'))->addAttribute('type','hidden')->addStyleClass('selector-link-value')->addAttribute('name',$this->param)->addAttribute('value',$this->default?:Value::createExpression(ValueExpression::TYPE_DATA_VAR,$this->param)) 34 )->addChild( 35 (new HtmlElement('input'))->addAttribute('type','text')->addStyleClass(['input','selector-link-name','act-selector-search'])->addAttribute('name',$this->param.'_text')->addAttribute('placeholder',$this->name)->addAttribute('value',$this->name) 36 )->addChild( 37 (new HtmlElement('i'))->addStyleClass( ['image-icon','image-icon--menu-tree','act-selector-tree-button' ]) 38 )->addChild( 39 (new HtmlElement('div'))->addStyleClass('dropdown')->addStyleClass('act-selector-search-results') 40 )->addChild( 41 (new HtmlElement('div'))->addAttribute('type','hidden')->addStyleClass(['navtree','selector-tree','act-load-selector-tree'])->addAttribute('data-types',$this->types)->addAttribute('data-init-id',$this->id)->addAttribute('data-init-folderid',$this->folderid) 42 ); 43 } 44 45 }
Download modules/template_engine/components/html/component_selector/SelectorComponent.class.php
History Mon, 27 Jun 2022 02:22:50 +0200 Jan Dankert Fix: Saving links in PageallAction and PageelementAllAction. Wed, 17 Feb 2021 00:37:45 +0100 Jan Dankert Refactoring: Extract Notices into a separate js class Mon, 15 Feb 2021 02:27:54 +0100 Jan Dankert Fix: Drag and drop from the navigation tree to a selector input. Mon, 15 Feb 2021 01:33:55 +0100 Jan Dankert New: Show the navigation tree only after click. Sat, 13 Feb 2021 22:23:06 +0100 Jan Dankert Refactoring: Moving editing of links into the subaction 'value'. Wed, 14 Oct 2020 22:36:29 +0200 Jan Dankert Refactoring: Fixed the namespace in component classes, now the are able to be load by the standard autoloader. Wed, 14 Oct 2020 22:20:22 +0200 Jan Dankert Refactoring: Renamed component folders, because 'if' is no valid namespace fragment.