1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00
This commit is contained in:
Ryan Cramer
2022-04-15 11:02:40 -04:00
parent 2a8899dcd9
commit f2b27cca75

View File

@@ -88,6 +88,9 @@ class FieldtypeRepeaterConfigHelper extends Wire {
// -------------------------------------------------
/** @var ProcessTemplate $processTemplate */
$processTemplate = $modules->getModule('ProcessTemplate', array('noInit' => true));
/** @var InputfieldAsmSelect $select */
$select = $modules->get('InputfieldAsmSelect');
$select->label = $this->_x('Repeater fields', 'field-label');
@@ -104,15 +107,8 @@ class FieldtypeRepeaterConfigHelper extends Wire {
foreach($template->fieldgroup as $f) {
/** @var Field $f */
$f = $template->fieldgroup->getField($f->id, true); // get in context
$columnWidth = (int) $f->get('columnWidth');
$attrs = array(
'selected' => 'selected',
'data-status' => str_replace('Fieldtype', '', $f->type) . ' ' . ($columnWidth > 0 ? $columnWidth . '%': '100%'),
'data-desc' => $f->getLabel(),
);
$icon = $f->getIcon();
if($icon) $attrs['data-handle'] = "<i class='fa fa-fw fa-$icon'></i>";
$attrs = $processTemplate->getAsmListAttrs($f);
$attrs['selected'] = 'selected';
$select->addOption($f->id, $f->name, $attrs);
}
@@ -122,13 +118,7 @@ class FieldtypeRepeaterConfigHelper extends Wire {
if(($f->flags & Field::flagPermanent) && !$this->wire('config')->advanced) continue;
$name = $f->name;
if($f->flags & Field::flagSystem) $name .= "*";
$columnWidth = (int) $f->get('columnWidth');
$attrs = array(
'data-desc' => $f->getLabel(),
'data-status' => str_replace('Fieldtype', '', $f->type) . ' ' . ($columnWidth > 0 ? $columnWidth . '%': '100%'),
);
$icon = $f->getIcon();
if($icon) $attrs['data-handle'] = "<i class='fa fa-fw fa-$icon'></i>";
$attrs = $processTemplate->getAsmListAttrs($f);
$select->addOption($f->id, $name, $attrs);
}