* @license GNU General Public License version 2 or later; see LICENSE
*/
defined('JPATH_PLATFORM') or die;
/**
* Form Field class for the Joomla Platform.
* Display a JSON loaded window with a repeatable set of sub fields
*
* @since 3.2
*
* @deprecated 4.0 Use JFormFieldSubform
*/
class JFormFieldRepeatable extends JFormField
{
/**
* The form field type.
*
* @var string
* @since 3.2
*/
protected $type = 'Repeatable';
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 3.2
*/
protected function getInput()
{
JLog::add('JFormFieldRepeatable is deprecated. Use JFormFieldSubform instead.', JLog::WARNING, 'deprecated');
// Initialize variables.
$subForm = new JForm($this->name, array('control' => 'jform'));
$xml = $this->element->children()->asXml();
$subForm->load($xml);
// Needed for repeating modals in gmaps
// @TODO: what and where???
$subForm->repeatCounter = (int) @$this->form->repeatCounter;
$children = $this->element->children();
$subForm->setFields($children);
// If a maximum value isn't set then we'll make the maximum amount of cells a large number
$maximum = $this->element['maximum'] ? (int) $this->element['maximum'] : '999';
// Build a Table
$head_row_str = array();
$body_row_str = array();
$head_row_str[] = '
';
$body_row_str[] = '
';
foreach ($subForm->getFieldset() as $field)
{
// Reset name to simple
$field->name = (string) $field->element['name'];
// Build heading
$head_row_str[] = '