Inheritance: extends AbstractMultiValueFieldViewHelper
 /**
  * @param string $type
  * @return RelationFieldInterface
  */
 protected function getPreparedComponent($type)
 {
     /** @var RelationFieldInterface $component */
     $component = parent::getPreparedComponent($type);
     $component->setCollapseAll($this->arguments['collapseAll']);
     $component->setExpandSingle($this->arguments['expandSingle']);
     $component->setNewRecordLinkAddTitle($this->arguments['newRecordLinkAddTitle']);
     $component->setNewRecordLinkPosition($this->arguments['newRecordLinkPosition']);
     $component->setUseCombination($this->arguments['useCombination']);
     $component->setUseSortable($this->arguments['useSortable']);
     $component->setShowPossibleLocalizationRecords($this->arguments['showPossibleLocalizationRecords']);
     $component->setShowRemovedLocalizationRecords($this->arguments['showRemovedLocalizationRecords']);
     $component->setShowAllLocalizationLink($this->arguments['showAllLocalizationLink']);
     $component->setShowSynchronizationLink($this->arguments['showSynchronizationLink']);
     if (TRUE === is_array($this->arguments['enabledControls'])) {
         $component->setEnabledControls($this->arguments['enabledControls']);
     }
     if (TRUE === is_array($this->arguments['headerThumbnail'])) {
         $component->setHeaderThumbnail($this->arguments['headerThumbnail']);
     }
     if (TRUE === is_array($this->arguments['foreignMatchFields'])) {
         $component->setForeignMatchFields($this->arguments['foreignMatchFields']);
     }
     $component->setLevelLinksPosition($this->arguments['levelLinksPosition']);
     return $component;
 }
Exemplo n.º 2
0
 /**
  * Initialize
  * @return void
  */
 public function initializeArguments()
 {
     parent::initializeArguments();
     $this->registerArgument('parentField', 'string', 'Field containing UID of parent record', TRUE);
     $this->registerArgument('allowRecursiveMode', 'boolean', 'If TRUE, the selection of a node will trigger the selection of all child nodes too (recursively)', FALSE, Tree::DEFAULT_ALLOW_RECURSIVE_MODE);
     $this->registerArgument('expandAll', 'boolean', 'If TRUE, expands all branches', FALSE, Tree::DEFAULT_EXPAND_ALL);
     $this->registerArgument('nonSelectableLevels', 'string', 'Comma-separated list of levels that will not be selectable, by default the root node (which is "0") cannot be selected', FALSE, Tree::DEFAULT_NON_SELECTABLE_LEVELS);
     $this->registerArgument('maxLevels', 'integer', ' The maximal amount of levels to be rendered (can be used to stop possible recursions)', FALSE, Tree::DEFAULT_MAX_LEVELS);
     $this->registerArgument('showHeader', 'boolean', 'If TRUE, displays tree header', FALSE, Tree::DEFAULT_SHOW_HEADER);
     $this->registerArgument('width', 'integer', 'Width of TreeView component', FALSE, Tree::DEFAULT_WIDTH);
 }