Component-Builder/admin/layouts/repeatablejcbjfive.php
Robot c7bd2952a8
Release of v4.0.1
Fix auto build from SQL in Joomla 4. Fix permission issue for admin views. Add in JCB gitea push feature to help maintain JCB core features. Add extending options to interfaces. Change the extendsinterfaces field to allow null, #1139. Update the Schema class to also update null mismatching if needed. Add repositories for better integration with gitea. Refactored the Data classes. Add new Data classes. Add new subform classes. Fix registry class methods return type. Update all list and custom fields to use the new layouts. Add push options to Joomla Power. Complete the Joomla Power Init and Reset features. Fix Gitea Contents class functions. Fix subform set methods. Improved the Joomla Power Push path. Fix the metadata, metadesc, metakey database issue. Fix function mismatch call in the compiler power class. Fix init feature to only add missing powers. Fix controller postSaveHook function, for correct model class in Joomla 4 and 5. Fix app instances (mismatch) in the install script and schema class when installing from CLI. Add option to use placeholders in Joomla Power namespaces. Fix subform layout of uikit in JCB.
2024-07-20 22:39:22 +02:00

83 lines
3.2 KiB
PHP

<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper;
// No direct access to this file
defined('JPATH_BASE') or die;
use Joomla\CMS\Form\Form;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $tmpl The Empty form for template
* @var array $forms Array of JForm instances for render the rows
* @var bool $multiple The multiple state for the form field
* @var int $min Count of minimum repeating in multiple mode
* @var int $max Count of maximum repeating in multiple mode
* @var string $name Name of the input field.
* @var string $fieldname The field name
* @var string $fieldId The field ID
* @var string $control The forms control
* @var string $label The field label
* @var string $description The field description
* @var string $class Classes for the container
* @var array $buttons Array of the buttons that will be rendered
* @var bool $groupByFieldset Whether group the subform fields by it`s fieldset
*/
if ($multiple) {
// Add script
Factory::getApplication()
->getDocument()
->getWebAssetManager()
->useScript('webcomponent.field-subform');
}
$class = $class ? ' ' . $class : '';
$sublayout = 'sectionjcbjfive';
?>
<div class="subform-repeatable-wrapper subform-layout">
<joomla-field-subform class="subform-repeatable<?php echo $class; ?>" name="<?php echo $name; ?>"
button-add=".group-add" button-remove=".group-remove" button-move="<?php echo empty($buttons['move']) ? '' : '.group-move' ?>"
repeatable-element=".subform-repeatable-group" minimum="<?php echo $min; ?>" maximum="<?php echo $max; ?>">
<?php if (!empty($buttons['add'])) : ?>
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="group-add btn btn-sm button btn-success" aria-label="<?php echo Text::_('COM_COMPONENTBUILDER_ADD'); ?>">
<span class="icon-plus icon-white" aria-hidden="true"></span>
</button>
</div>
</div>
<?php endif; ?>
<?php
foreach ($forms as $k => $form) :
echo LayoutHelper::render($sublayout, ['form' => $form, 'basegroup' => $fieldname, 'group' => $fieldname . $k, 'buttons' => $buttons]);
endforeach;
?>
<?php if ($multiple) : ?>
<template class="subform-repeatable-template-section hidden"><?php
echo trim(LayoutHelper::render($sublayout, ['form' => $tmpl, 'basegroup' => $fieldname, 'group' => $fieldname . 'X', 'buttons' => $buttons]));
?></template>
<?php endif; ?>
</joomla-field-subform>
</div>