| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/infrafs/bike/wp-content/themes/colibri-wp/inc/src/Customizer/Controls/ |
Upload File : |
<?php
namespace ColibriWP\Theme\Customizer\Controls;
use ColibriWP\Theme\Core\Utils;
use ColibriWP\Theme\Translations;
class RepeaterControl extends VueControl {
public $type = 'colibri-repeater';
private $fields = array();
public static function sanitize( $value, $control_data, $default = '' ) {
return Utils::sanitizeEscapedJSON( $value );
}
protected function printVueContent() {
?>
<div class="colibri-fullwidth">
<div class="colibri-fullwidth">
<el-collapse v-sortable-el-accordion="onSortEnd">
<el-collapse-item v-for="(item,index) in items" :name="index" :key="item.index">
<template slot="title">
<?php $this->vueEcho( "itemsLabels[index]" ); ?>
</template>
<ul class="field-data">
<li v-for="(field,name) in fields" :key="name">
<label class="field-label"><?php $this->vueEcho( "field.label" ); ?></label>
<div class="component-holder"
:is="getComponentType(field.type)"
:value="item[name]"
v-bind="field.props"
@change="propChanged($event,item,name)"></div>
</li>
</ul>
<el-button class="el-button--danger" type="text" v-show="canRemoveItem"
@click="removeItem(index)"><?php Translations::escHtmlE( 'remove' ); ?></el-button>
</el-collapse-item>
</el-collapse>
</div>
<div class="colibri-fullwidth">
<el-button size="medium" v-show="canAdd"
@click="addItem()"><?php $this->vueEcho( 'item_add_label' ); ?></el-button>
</div>
</div>
<?php
}
}