Fixed gh-565 by removing the old PHPExcel_IOFactory and adding the new. Updated the subform layout for verious subforms in JCB for beter display. Change the helper category naming conventions for better integration with Joomla fields. gh-561
This commit is contained in:
95
admin/layouts/repeatablejcb.php
Normal file
95
admin/layouts/repeatablejcb.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_BASE') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Make thing clear
|
||||
*
|
||||
* @var JForm $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 $fieldname The field name
|
||||
* @var string $control The forms control
|
||||
* @var string $label The field label
|
||||
* @var string $description The field description
|
||||
* @var array $buttons Array of the buttons that will be rendered
|
||||
* @var bool $groupByFieldset Whether group the subform fields by it`s fieldset
|
||||
*/
|
||||
extract($displayData);
|
||||
|
||||
// Add script
|
||||
JHtml::_('jquery.ui', array('core', 'sortable'));
|
||||
JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true));
|
||||
|
||||
$sublayout = 'sectionjcb';
|
||||
|
||||
?>
|
||||
<div class="row-fluid">
|
||||
<div class="subform-repeatable-wrapper subform-layout">
|
||||
<div class="subform-repeatable"
|
||||
data-bt-add="a.group-add-<?php echo $unique_subform_id; ?>"
|
||||
data-bt-remove="a.group-remove-<?php echo $unique_subform_id; ?>"
|
||||
data-bt-move="a.group-move-<?php echo $unique_subform_id; ?>"
|
||||
data-repeatable-element="div.subform-repeatable-jcb-group-<?php echo $unique_subform_id; ?>"
|
||||
data-minimum="<?php echo $min; ?>" data-maximum="<?php echo $max; ?>"
|
||||
>
|
||||
|
||||
<?php if (!empty($buttons['add'])) : ?>
|
||||
<div class="btn-toolbar">
|
||||
<div class="btn-group">
|
||||
<a class="btn btn-mini button btn-success group-add group-add-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_ADD'); ?>">
|
||||
<span class="icon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
foreach ($forms as $k => $form) :
|
||||
echo JLayoutHelper::render(
|
||||
$sublayout,
|
||||
array(
|
||||
'form' => $form,
|
||||
'basegroup' => $fieldname,
|
||||
'group' => $fieldname . $k,
|
||||
'buttons' => $buttons,
|
||||
'unique_subform_id' => $unique_subform_id
|
||||
)
|
||||
);
|
||||
endforeach;
|
||||
?>
|
||||
<?php if ($multiple) : ?>
|
||||
<template class="subform-repeatable-template-section" style="display: none;"><?php
|
||||
// Use str_replace to escape HTML in a simple way, it need for IE compatibility, and should be removed later
|
||||
echo str_replace(
|
||||
array('<', '>'),
|
||||
array('SUBFORMLT', 'SUBFORMGT'),
|
||||
trim(
|
||||
JLayoutHelper::render(
|
||||
$sublayout,
|
||||
array(
|
||||
'form' => $tmpl,
|
||||
'basegroup' => $fieldname,
|
||||
'group' => $fieldname . 'X',
|
||||
'buttons' => $buttons,
|
||||
'unique_subform_id' => $unique_subform_id
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
?></template>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
62
admin/layouts/sectionjcb.php
Normal file
62
admin/layouts/sectionjcb.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('JPATH_BASE') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Make thing clear
|
||||
*
|
||||
* @var JForm $form The form instance for render the section
|
||||
* @var string $basegroup The base group name
|
||||
* @var string $group Current group name
|
||||
* @var array $buttons Array of the buttons that will be rendered
|
||||
*/
|
||||
extract($displayData);
|
||||
|
||||
?>
|
||||
<div
|
||||
class="subform-repeatable-group subform-repeatable-jcb-group-<?php echo $unique_subform_id; ?>"
|
||||
data-base-name="<?php echo $basegroup; ?>"
|
||||
data-group="<?php echo $group; ?>"
|
||||
>
|
||||
<?php if (!empty($buttons)) : ?>
|
||||
<div class="btn-toolbar text-right">
|
||||
<div class="btn-group">
|
||||
<?php if (!empty($buttons['add'])) : ?>
|
||||
<a class="btn btn-mini button btn-success group-add group-add-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_ADD'); ?>">
|
||||
<span class="icon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($buttons['remove'])) : ?>
|
||||
<a class="btn btn-mini button btn-danger group-remove group-remove-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_REMOVE'); ?>">
|
||||
<span class="icon-minus" aria-hidden="true"></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($buttons['move'])) : ?>
|
||||
<a class="btn btn-mini button btn-primary group-move group-move-<?php echo $unique_subform_id; ?>" aria-label="<?php echo JText::_('COM_COMPONENTBUILDER_MOVE'); ?>">
|
||||
<span class="icon-move" aria-hidden="true"></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div data-uk-grid-margin="" class="uk-grid">
|
||||
<?php foreach ($form->getGroup('') as $field) : ?>
|
||||
<div class="uk-width-medium-1-4 uk-width-large-1-5">
|
||||
<div class="uk-panel">
|
||||
<?php echo $field->renderField(); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user