2020-04-21 06:47:26 +12:00
<?php
$key = $this->getParam('key', '');
2020-04-26 08:33:35 +12:00
$type = $this->getParam('type', '');
2020-04-21 06:47:26 +12:00
$required = $this->getParam('required', '');
$comp = $this->getParam('comp', '');
$namespace = $this->getParam('namespace', '');
2020-04-26 08:33:35 +12:00
$list = $this->getParam('list', []);
2020-04-28 06:37:42 +12:00
$collections = $this->getParam('collections', []);
2020-04-21 06:47:26 +12:00
2020-04-26 08:33:35 +12:00
$comp->setParam('namespace', 'node');
if($type === 'document') {
$comp->setParam('key', null);
}
2020-04-21 06:47:26 +12:00
?>
< input type = "hidden" name = " <?php echo $this -> escape ( $key ); ?> " <?php if ( $required ) : ?> required <?php endif ; ?> data-cast-to = "array-empty" >
2020-04-28 06:37:42 +12:00
< hr / >
2020-04-29 20:36:55 +12:00
< ul data-ls-loop = " <?php echo $this -> escape ( $namespace ); ?> " data-ls-as = "node" class = "sortable numbers" >
2020-04-28 06:37:42 +12:00
< li data-forms-move-up data-forms-move-down >
2020-06-13 23:13:53 +12:00
< div class = "drop-list bottom end settings" data-ls-ui-open = "" data-button-text = "" data-button-icon = "icon-cog" data-button-aria = "Options" data-button-selector = "[data-toggler]" data-button-class = "round dark small margin-bottom-small margin-top-tiny pull-end" data-blur = "1" >
2020-05-01 04:34:51 +12:00
< ul class = "arrow-end margin-top margin-end-negative-small" >
< li data-move-up >
< button type = "button" class = "link" > < i class = "icon-up-dir" > < / i > Move Up< / button >
< / li >
< li data-move-down >
< button type = "button" class = "link" > < i class = "icon-down-dir" > < / i > Move Down< / button >
< / li >
< li >
2020-08-14 00:55:09 +12:00
< button type = "button" data-ls-ui-trigger = "splice- <?php echo $this -> escape ( $namespace ); ?> -{{$index}}" class = "link" >< i class = "icon-cancel" ></ i > Remove</ button >
2020-05-01 04:34:51 +12:00
< / li >
< / ul >
2020-04-21 06:47:26 +12:00
< / div >
2020-05-01 04:34:51 +12:00
<?php echo $comp -> render (); ?>
2020-05-01 18:28:39 +12:00
< hr / >
2020-04-21 06:47:26 +12:00
< / li >
2020-04-26 08:33:35 +12:00
< / ul >
2020-04-28 06:37:42 +12:00
<?php if ( ! empty ( $list ) && $type === 'document' ) : ?>
2020-06-13 23:13:53 +12:00
< div class = "drop-list" data-ls-ui-open = "" data-button-text = "Add" data-button-aria = "Add" data-button-icon = "" data-button-selector = "[data-toggler]" data-button-class = "reverse margin-bottom-small" data-blur = "1" >
2020-04-28 06:37:42 +12:00
< ul >
<?php foreach ( $list as $item ) :
2020-05-03 21:49:22 +12:00
$name = (isset($collections[$item])) ? $collections[$item]->getAttribute('name', '') : '';
2020-04-28 06:37:42 +12:00
?>
< li >
< button type = "button" class = "link" data-ls-ui-trigger = "collection-child- <?php echo $this -> escape ( $namespace ); ?> - <?php echo $this -> escape ( $item ); ?> " >< i class = "icon-edit" ></ i > Add <?php echo $this -> escape ( $name ); ?> </ button >
< / li >
<?php endforeach ; ?>
< / ul >
< / div >
2020-04-29 20:36:55 +12:00
<?php else : ?>
2020-05-03 09:16:34 +12:00
< button type = "button" data-ls-ui-trigger = "collection-child- <?php echo $this -> escape ( $namespace ); ?> " class = "reverse margin-bottom-small" > Add</ button >
2020-04-29 20:36:55 +12:00
<?php endif ; ?>