Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
975 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Make thing clear | ||
* | ||
* @var JForm $tmpl - Empry form for template | ||
* @var array $forms - array of ZForm for render | ||
* @var bool $multiple | ||
* @var int $max - maximum repeatin for multiple | ||
* @var string $fieldname - the field name | ||
* @var string $control - the forms control | ||
* @var string $label | ||
* @var string $description | ||
*/ | ||
extract($displayData); | ||
|
||
$form = $forms[0]; | ||
?> | ||
|
||
<!-- Render fields for subform "<?php echo $fieldname; ?>" --> | ||
<div class="subform-wrapper"> | ||
<label class="hasTooltip" title="<?php echo JHtml::tooltipText($label, $description); ?>" > | ||
<?php echo $label; ?> | ||
</label> | ||
<?php foreach($form->getGroup(false) as $field): ?> | ||
<?php echo $field->renderField(); ?> | ||
<?php endforeach; ?> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Make thing clear | ||
* | ||
* @var JForm $tmpl - Empty form for template | ||
* @var array $forms - array of ZForm for render | ||
* @var bool $multiple | ||
* @var int $min - minimum repeatin for multiple | ||
* @var int $max - maximum repeatin for multiple | ||
* @var string $fieldname - the field name | ||
* @var string $control - the forms control | ||
* @var string $label | ||
* @var string $description | ||
* @var array $buttons Buttons that will be displied | ||
* @var bool $groupByFieldset Whether group subform fields by its fieldset | ||
*/ | ||
extract($displayData); | ||
|
||
// Add script | ||
JHtml::_('jquery.ui', array('core', 'sortable')); | ||
JHtml::_('script', 'system/subform-repeatable.js', false, true); | ||
|
||
// Build heading | ||
$table_head = ''; | ||
if(!empty($groupByFieldset)) | ||
{ | ||
foreach($tmpl->getFieldsets() as $fieldset) { | ||
$table_head .= '<th>' . JText::_($fieldset->label); | ||
if(!empty($fieldset->description)) | ||
{ | ||
$table_head .= '<br /><small style="font-weight:normal">' . JText::_($fieldset->description) . '</small>'; | ||
} | ||
$table_head .= '</th>'; | ||
} | ||
$sublayout = 'section-byfieldsets'; | ||
} | ||
else | ||
{ | ||
foreach($tmpl->getGroup(false) as $field) { | ||
$table_head .= '<th>' . strip_tags($field->label); | ||
$table_head .= '<br /><small style="font-weight:normal">' . JText::_($field->description) . '</small>'; | ||
$table_head .= '</th>'; | ||
} | ||
$sublayout = 'section'; | ||
} | ||
|
||
?> | ||
|
||
<div class="row-fluid"> | ||
<!-- Render fields for repeatable subform "<?php echo $fieldname; ?>" --> | ||
<div class="subform-repeatable-wrapper subform-table-layout"> | ||
<div class="subform-repeatable" | ||
data-bt-add="a.group-add" data-bt-remove="a.group-remove" data-bt-move="a.group-move" | ||
data-repeatable-element="tr.subform-repeatable-group" | ||
data-rows-container="tbody" data-minimum="<?php echo $min; ?>" data-maximum="<?php echo $max; ?>"> | ||
|
||
<table class="adminlist table table-striped table-bordered"> | ||
<thead> | ||
<tr> | ||
<?php echo $table_head; ?> | ||
<th style="width:8%;"> | ||
<?php if(!empty($buttons['add'])):?> | ||
<div class="btn-group"> | ||
<a class="group-add btn btn-mini button btn-success"><span class="icon-plus"></span> </a> | ||
</div> | ||
<?php endif;?> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php | ||
foreach($forms as $k => $form): | ||
echo $this->sublayout($sublayout, array('form' => $form, 'basegroup' => $fieldname, 'group' => $fieldname . $k, 'buttons' => $buttons)); | ||
endforeach; | ||
?> | ||
</tbody> | ||
</table> | ||
<?php if($multiple):?> | ||
<!-- Template subform "<?php echo $fieldname; ?>" --> | ||
<script type="text/subform-repeatable-template-section" class="subform-repeatable-template-section"> | ||
<?php echo $this->sublayout($sublayout, array('form' => $tmpl, 'basegroup' => $fieldname, 'group' => $fieldname . 0, 'buttons' => $buttons));?> | ||
</script> | ||
<!-- End template subform "<?php echo $fieldname; ?>" --> | ||
<?php endif;?> | ||
</div> | ||
</div> | ||
<!-- End render fields for repeatable subform "<?php echo $fieldname; ?>" --> | ||
</div> |
39 changes: 39 additions & 0 deletions
39
layouts/joomla/form/field/subform/repeatable-table/section-byfieldsets.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Make thing clear | ||
* | ||
* @var JForm $form - Form for render section | ||
* @var string $basegroup - base group name | ||
* @var string $group - current group name | ||
* @var array $buttons Buttons that will be enabled | ||
*/ | ||
extract($displayData); | ||
|
||
?> | ||
|
||
<tr class="subform-repeatable-group" data-base-name="<?php echo $basegroup; ?>" data-group="<?php echo $group; ?>"> | ||
<?php foreach($form->getFieldsets() as $fieldset): ?> | ||
<td class="<?php if(!empty($fieldset->class)){ echo $fieldset->class; } ?>"> | ||
<?php foreach($form->getFieldset($fieldset->name) as $field): ?> | ||
<?php echo $field->renderField(); ?> | ||
<?php endforeach; ?> | ||
</td> | ||
<?php endforeach; ?> | ||
<td> | ||
<div class="btn-group"> | ||
<?php if(!empty($buttons['add'])):?><a class="group-add btn btn-mini button btn-success"><span class="icon-plus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['remove'])):?><a class="group-remove btn btn-mini button btn-danger"><span class="icon-minus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['move'])):?><a class="group-move btn btn-mini button btn-primary"><span class="icon-move"></span> </a><?php endif;?> | ||
</div> | ||
</td> | ||
</tr> |
37 changes: 37 additions & 0 deletions
37
layouts/joomla/form/field/subform/repeatable-table/section.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Make thing clear | ||
* | ||
* @var JForm $form - Form for render section | ||
* @var string $basegroup - base group name | ||
* @var string $group - current group name | ||
* @var array $buttons Buttons that will be enabled | ||
*/ | ||
extract($displayData); | ||
|
||
?> | ||
|
||
<tr class="subform-repeatable-group" data-base-name="<?php echo $basegroup; ?>" data-group="<?php echo $group; ?>"> | ||
<?php foreach($form->getGroup(false) as $field): ?> | ||
<td> | ||
<?php echo $field->renderField(); ?> | ||
</td> | ||
<?php endforeach; ?> | ||
<td> | ||
<div class="btn-group"> | ||
<?php if(!empty($buttons['add'])):?><a class="group-add btn btn-mini button btn-success"><span class="icon-plus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['remove'])):?><a class="group-remove btn btn-mini button btn-danger"><span class="icon-minus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['move'])):?><a class="group-move btn btn-mini button btn-primary"><span class="icon-move"></span> </a><?php endif;?> | ||
</div> | ||
</td> | ||
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Make thing clear | ||
* | ||
* @var JForm $tmpl - Empry form for template | ||
* @var array $forms - array of ZForm for render | ||
* @var bool $multiple | ||
* @var int $min - minimum repeatin for multiple | ||
* @var int $max - maximum repeatin for multiple | ||
* @var string $fieldname - the field name | ||
* @var string $control - the forms control | ||
* @var string $label | ||
* @var string $description | ||
* @var array $buttons Buttons that will be enabled | ||
* @var bool $groupByFieldset Whether group subform fields by its fieldset | ||
*/ | ||
extract($displayData); | ||
|
||
// Add script | ||
JHtml::_('jquery.ui', array('core', 'sortable')); | ||
JHtml::_('script', 'system/subform-repeatable.js', false, true); | ||
|
||
$sublayout = empty($groupByFieldset) ? 'section' : 'section-byfieldsets'; | ||
?> | ||
|
||
<div class="row-fluid"> | ||
<!-- Render fields for repeatable subform "<?php echo $fieldname; ?>" --> | ||
<div class="subform-repeatable-wrapper subform-layout"> | ||
<legend class="hasTooltip" title="<?php echo JHtml::tooltipText($label, $description); ?>" > | ||
<?php echo $label; ?> | ||
</legend> | ||
<div class="subform-repeatable" | ||
data-bt-add="a.group-add" data-bt-remove="a.group-remove" data-bt-move="a.group-move" | ||
data-repeatable-element="div.subform-repeatable-group" data-minimum="<?php echo $min; ?>" data-maximum="<?php echo $max; ?>"> | ||
<div class="btn-toolbar text-right"> | ||
<div class="btn-group"> | ||
<?php if(!empty($buttons['add'])):?> | ||
<a class="group-add btn btn-mini button btn-success"><span class="icon-plus"></span> </a> | ||
<?php endif; ?> | ||
</div> | ||
</div> | ||
<?php | ||
foreach($forms as $k => $form): | ||
echo $this->sublayout($sublayout, array('form' => $form, 'basegroup' => $fieldname, 'group' => $fieldname . $k, 'buttons' => $buttons)); | ||
endforeach; | ||
?> | ||
<?php if($multiple):?> | ||
<!-- Template subform "<?php echo $fieldname; ?>" --> | ||
<script type="text/subform-repeatable-template-section" class="subform-repeatable-template-section"> | ||
<?php echo $this->sublayout($sublayout, array('form' => $tmpl, 'basegroup' => $fieldname, 'group' => $fieldname . 0, 'buttons' => $buttons))?> | ||
</script> | ||
<!-- End template subform "<?php echo $fieldname; ?>" --> | ||
<?php endif;?> | ||
</div> | ||
</div> | ||
<!-- End render fields for repeatable subform "<?php echo $fieldname; ?>" --> | ||
</div> |
43 changes: 43 additions & 0 deletions
43
layouts/joomla/form/field/subform/repeatable/section-byfieldsets.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Make thing clear | ||
* | ||
* @var JForm $form - Form for render section | ||
* @var string $basegroup - base group name | ||
* @var string $group - current group name | ||
* @var array $buttons Buttons that will be enabled | ||
*/ | ||
extract($displayData); | ||
?> | ||
|
||
<div class="subform-repeatable-group" data-base-name="<?php echo $basegroup; ?>" data-group="<?php echo $group; ?>"> | ||
<div class="btn-toolbar text-right"> | ||
<div class="btn-group"> | ||
<?php if(!empty($buttons['add'])):?><a class="group-add btn btn-mini button btn-success"><span class="icon-plus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['remove'])):?><a class="group-remove btn btn-mini button btn-danger"><span class="icon-minus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['move'])):?><a class="group-move btn btn-mini button btn-primary"><span class="icon-move"></span> </a><?php endif;?> | ||
</div> | ||
</div> | ||
<div class="row-fluid"> | ||
<?php foreach($form->getFieldsets() as $fieldset): ?> | ||
<fieldset class="<?php if(!empty($fieldset->class)){ echo $fieldset->class; } ?>"> | ||
<?php if(!empty($fieldset->label)):?> | ||
<legend><?php echo JText::_($fieldset->label); ?></legend> | ||
<?php endif; ?> | ||
<?php foreach($form->getFieldset($fieldset->name) as $field): ?> | ||
<?php echo $field->renderField(); ?> | ||
<?php endforeach; ?> | ||
</fieldset> | ||
<?php endforeach; ?> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage Layout | ||
* | ||
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
/** | ||
* Make thing clear | ||
* | ||
* @var JForm $form - Form for render section | ||
* @var string $basegroup - base group name | ||
* @var string $group - current group name | ||
* @var array $buttons Buttons that will be enabled | ||
*/ | ||
extract($displayData); | ||
|
||
?> | ||
|
||
<div class="subform-repeatable-group" data-base-name="<?php echo $basegroup; ?>" data-group="<?php echo $group; ?>"> | ||
<div class="btn-toolbar text-right"> | ||
<div class="btn-group"> | ||
<?php if(!empty($buttons['add'])):?><a class="group-add btn btn-mini button btn-success"><span class="icon-plus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['remove'])):?><a class="group-remove btn btn-mini button btn-danger"><span class="icon-minus"></span> </a><?php endif;?> | ||
<?php if(!empty($buttons['move'])):?><a class="group-move btn btn-mini button btn-primary"><span class="icon-move"></span> </a><?php endif;?> | ||
</div> | ||
</div> | ||
<?php foreach($form->getGroup(false) as $field): ?> | ||
<?php echo $field->renderField(); ?> | ||
<?php endforeach; ?> | ||
</div> |
Oops, something went wrong.