* @github Joomla Component Builder * @copyright Copyright (C) 2015 - 2019 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('_JEXEC') or die('Restricted access'); function buildSubform() { // get the subform $subform = JFormHelper::loadFieldType('subform', true); // make sure the layout is created // JLayoutHelper::render('assistantsubformrepeatable', null); // start building the subform field XML $subformXML = new SimpleXMLElement(''); // subform attributes $subformAttribute = array( 'type' => 'subform', 'name' => 'views', 'label' => 'COM_COMPONENTBUILDER_VIEW_BUILDER', 'layout' => 'assistantsubformrepeatable', 'multiple' => 'true', 'icon' => 'list', 'max' => 5, 'min' => 1 ); // load the subform attributes ComponentbuilderHelper::xmlAddAttributes($subformXML, $subformAttribute); // now add the subform child form $childForm = $subformXML->addChild('form'); // child form attributes $childFormAttribute = array( 'hidden' => 'true', 'name' => 'list_properties', 'repeat' => 'true'); // load the child form attributes ComponentbuilderHelper::xmlAddAttributes($childForm, $childFormAttribute); // view building the name field XML $nameXML = new SimpleXMLElement(''); // subform attributes $nameAttribute = array( 'type' => 'text', 'name' => 'name', 'label' => 'COM_COMPONENTBUILDER_VIEW_NAME', 'size' => '40', 'maxlength' => '150', 'class' => 'text_area', 'hint' => 'COM_COMPONENTBUILDER_VIEW_NAME', 'filter' => 'STRING' ); // load the subform attributes ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); // now add the fields to the child form ComponentbuilderHelper::xmlAppend($childForm, $nameXML); // view building the list name field XML $listnameXML = new SimpleXMLElement(''); // subform attributes $listnameAttribute = array( 'type' => 'text', 'name' => 'list_name', 'label' => 'COM_COMPONENTBUILDER_LIST_VIEW_NAME', 'size' => '40', 'maxlength' => '150', 'class' => 'text_area', 'hint' => 'COM_COMPONENTBUILDER_LIST_VIEW_NAME', 'filter' => 'STRING' ); // load the subform attributes ComponentbuilderHelper::xmlAddAttributes($listnameXML, $listnameAttribute); // now add the fields to the child form ComponentbuilderHelper::xmlAppend($childForm, $listnameXML); // start building the builder area XML $noteXML = new SimpleXMLElement(''); // subform attributes $noteAttribute = array( 'type' => 'note', 'name' => 'builder', 'label' => 'COM_COMPONENTBUILDER_BUILDER', 'description' => '

', 'heading' => 'h5' ); // load the subform attributes ComponentbuilderHelper::xmlAddAttributes($noteXML, $noteAttribute); // now add the fields to the child form ComponentbuilderHelper::xmlAppend($childForm, $noteXML); // setup subform with values $subform->setup($subformXML, null, 'jcbform'); // return subfrom object return $subform; } // get the subform $subform = buildSubform(); ?>
label; ?>
input; ?>
loading..