Added option to dynamicly set the sub-form layout from global options. Fixed bug in compiler that caused index warning.

This commit is contained in:
Llewellyn van der Merwe 2020-07-13 04:52:06 +02:00
parent 25afc31e7f
commit 3a5681ce43
Signed by untrusted user: Llewellyn
GPG Key ID: EFC0C720A240551C
21 changed files with 219 additions and 30 deletions

View File

@ -144,12 +144,12 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 11th July, 2020
+ *Last Build*: 13th July, 2020
+ *Version*: 2.11.2
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **282509**
+ *Field count*: **1522**
+ *Line count*: **282699**
+ *Field count*: **1525**
+ *File count*: **1785**
+ *Folder count*: **295**

View File

@ -144,12 +144,12 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 11th July, 2020
+ *Last Build*: 13th July, 2020
+ *Version*: 2.11.2
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **282509**
+ *Field count*: **1522**
+ *Line count*: **282699**
+ *Field count*: **1525**
+ *File count*: **1785**
+ *Folder count*: **295**

View File

@ -47,6 +47,71 @@
/>
<field type="spacer" name="spacerHistory" hr="true" />
<!-- Subform_layouts Field. Type: Subform. (joomla) -->
<field
type="subform"
name="subform_layouts"
label="COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_LABEL"
layout="joomla.form.field.subform.repeatable-table"
multiple="true"
buttons="add,remove,move"
description="COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_DESCRIPTION"
icon="list"
max="9"
min="1">
<form hidden="true" name="list_subform_layouts_modal" repeat="true">
<!-- View_field Field. Type: List. (joomla) -->
<field
type="list"
name="view_field"
label="COM_COMPONENTBUILDER_CONFIG_VIEW_FIELD_LABEL"
class="list_class"
multiple="false"
filter="CMD"
required="true"
default="default">
<!-- Option Set. -->
<option value="default">
COM_COMPONENTBUILDER_CONFIG_DEFAULT</option>
<option value="admin_custom_tabs.tabs">
COM_COMPONENTBUILDER_CONFIG_ADMIN_CUSTOM_TABS_TABS</option>
<option value="admin_fields.addfields">
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_ADDFIELDS</option>
<option value="admin_fields_conditions.addconditions">
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS</option>
<option value="admin_fields_relations.addrelations">
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_RELATIONS_ADDRELATIONS</option>
<option value="component_admin_views.addadmin_views">
COM_COMPONENTBUILDER_CONFIG_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS</option>
<option value="component_custom_admin_views.addcustom_admin_views">
COM_COMPONENTBUILDER_CONFIG_COMPONENT_CUSTOM_ADMIN_VIEWS_ADDCUSTOM_ADMIN_VIEWS</option>
<option value="component_site_views.addsite_views">
COM_COMPONENTBUILDER_CONFIG_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS</option>
<option value="dynamic_get.join_db_table">
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_DB_TABLE</option>
<option value="dynamic_get.join_view_table">
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_VIEW_TABLE</option>
</field>
<!-- Layout Field. Type: List. (joomla) -->
<field
type="list"
name="layout"
label="COM_COMPONENTBUILDER_CONFIG_LAYOUT_LABEL"
class="list_class"
multiple="false"
filter="CMD"
required="true"
default="joomla.form.field.subform.repeatable-table">
<!-- Option Set. -->
<option value="joomla.form.field.subform.repeatable-table">
COM_COMPONENTBUILDER_CONFIG_REPEATABLETABLE_JOOMLA</option>
<option value="joomla.form.field.subform.repeatable">
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_JOOMLA</option>
<option value="repeatablejcb">
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_UIKIT</option>
</field>
</form>
</field>
<!-- Editor Field. Type: Plugins. (joomla) -->
<field
type="plugins"

View File

@ -111,7 +111,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeUpdateFiles
$this->triggerEvent(
'jcb_ce_onBeforeUpdateFiles',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// now update the files
if (!$this->updateFiles())
@ -121,7 +121,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeGetCustomCode
$this->triggerEvent(
'jcb_ce_onBeforeGetCustomCode',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// now insert into the new files
if ($this->getCustomCode())
@ -129,7 +129,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeAddCustomCode
$this->triggerEvent(
'jcb_ce_onBeforeAddCustomCode',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
$this->addCustomCode();
@ -137,7 +137,7 @@ class Compiler extends Infusion
// Trigger Event: jcb_ce_onBeforeSetLangFileData
$this->triggerEvent(
'jcb_ce_onBeforeSetLangFileData',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// set the lang data now
$this->setLangFileData();

View File

@ -835,7 +835,7 @@ class Get
}
}
// Trigger Event: jcb_ce_onBeforeGet
$this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, $this));
$this->triggerEvent('jcb_ce_onBeforeGet', array(&$config, &$this));
// set the Joomla version
$this->joomlaVersion = $config['version'];
// set the minfy switch of the JavaScript
@ -923,14 +923,14 @@ class Get
// Trigger Event: jcb_ce_onBeforeGetComponentData
$this->triggerEvent(
'jcb_ce_onBeforeGetComponentData',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// get the component data
$this->componentData = $this->getComponentData();
// Trigger Event: jcb_ce_onAfterGetComponentData
$this->triggerEvent(
'jcb_ce_onAfterGetComponentData',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// make sure we have a version
if (strpos($this->componentData->component_version, '.')
@ -969,7 +969,7 @@ class Get
// Trigger Event: jcb_ce_onBeforeGet
$this->triggerEvent(
'jcb_ce_onAfterGet', array(&$this->componentContext, $this)
'jcb_ce_onAfterGet', array(&$this->componentContext, &$this)
);
return true;

View File

@ -4194,7 +4194,7 @@ class Fields extends Structure
= '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB';
foreach ($phpTracker as $searchKey => $phpKey)
{
// we must search for more code in the xml just incase
// we must search for more code in the xml just encase
foreach (range(2, 30) as $phpLine)
{
$get_ = $searchKey . '_' . $phpLine;
@ -4953,17 +4953,16 @@ class Fields extends Structure
$replace = array(
$this->bbb . 'JPREFIX' . $this->ddd => $jprefix,
$this->bbb . 'TABLE'
. $this->ddd => $data['custom']['table'],
. $this->ddd => (isset($data['custom']['table'])) ? $data['custom']['table'] :'',
$this->bbb . 'ID'
. $this->ddd => $data['custom']['id'],
. $this->ddd => (isset($data['custom']['id'])) ? $data['custom']['id'] :'',
$this->bbb . 'TEXT'
. $this->ddd => $data['custom']['text'],
$this->bbb . 'CODE_TEXT' . $this->ddd => $data['code'] . '_'
. $data['custom']['text'],
$this->bbb . 'CODE' . $this->ddd => $data['code'],
. $this->ddd => (isset($data['custom']['text'])) ? $data['custom']['text'] :'',
$this->bbb . 'CODE_TEXT' . $this->ddd => (isset($data['code'], $data['custom']['text'])) ? $data['code'] . '_' . $data['custom']['text'] :'',
$this->bbb . 'CODE' . $this->ddd => (isset($data['code'])) ? $data['code'] :'',
$this->bbb . 'view_type' . $this->ddd => $view_name_single
. '_' . $data['type'],
$this->bbb . 'type' . $this->ddd => $data['type'],
$this->bbb . 'type' . $this->ddd => (isset($data['type'])) ? $data['type'] :'',
$this->bbb . 'com_component'
. $this->ddd => (isset($data['custom']['component'])
&& ComponentbuilderHelper::checkString(

View File

@ -25193,7 +25193,7 @@ function vdm_dkim() {
// Trigger Event: jcb_ce_onBeforeBuildAccessSections
$this->triggerEvent(
'jcb_ce_onBeforeBuildAccessSections',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
$this->componentHead[] = '<section name="component">';
@ -25620,7 +25620,7 @@ function vdm_dkim() {
// Trigger Event: jcb_ce_onAfterBuildAccessSections
$this->triggerEvent(
'jcb_ce_onAfterBuildAccessSections',
array(&$this->componentContext, $this)
array(&$this->componentContext, &$this)
);
// set the views permissions now

View File

@ -1934,7 +1934,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onBeforeInfuseModuleData
$this->triggerEvent(
'jcb_ce_onBeforeInfuseModuleData',
array(&$this->componentContext, &$module, $this)
array(&$this->componentContext, &$module, &$this)
);
$this->target = $module->key;
$this->lang = $module->key;
@ -1998,7 +1998,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onAfterInfuseModuleData
$this->triggerEvent(
'jcb_ce_onAfterInfuseModuleData',
array(&$this->componentContext, &$module, $this)
array(&$this->componentContext, &$module, &$this)
);
}
}
@ -2013,7 +2013,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onBeforeInfusePluginData
$this->triggerEvent(
'jcb_ce_onBeforeInfusePluginData',
array(&$this->componentContext, &$plugin, $this)
array(&$this->componentContext, &$plugin, &$this)
);
$this->target = $plugin->key;
$this->lang = $plugin->key;
@ -2060,7 +2060,7 @@ class Infusion extends Interpretation
// Trigger Event: jcb_ce_onAfterInfusePluginData
$this->triggerEvent(
'jcb_ce_onAfterInfusePluginData',
array(&$this->componentContext, &$plugin, $this)
array(&$this->componentContext, &$plugin, &$this)
);
}
}

View File

@ -5865,6 +5865,47 @@ abstract class ComponentbuilderHelper
}
/**
* The subform layouts
**/
protected static $subformLayouts = false;
/**
* get the subform layout
*
* @input string The view name
* @input string The string name
*
* @returns string on success
**/
public static function getSubformLayout($view, $field, $default = 'repeatablejcb')
{
// get global values
if (self::$subformLayouts === false)
{
self::$subformLayouts = JComponentHelper::getParams('com_componentbuilder')->get('subform_layouts', false);
}
// check what we found (else) return default
if (self::checkObject(self::$subformLayouts))
{
// looking for
$target = $view . '.' . $field;
foreach (self::$subformLayouts as $subform)
{
if ($target === $subform->view_field)
{
return $subform->layout;
}
elseif ('default' === $subform->view_field)
{
$default = $subform->layout;
}
}
}
return $default;
}
/**
* Load the Composer Vendors
*/

View File

@ -3235,6 +3235,10 @@ COM_COMPONENTBUILDER_CONDITIONS="Conditions"
COM_COMPONENTBUILDER_CONFIG_ACTIVE="Active"
COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of your components"
COM_COMPONENTBUILDER_CONFIG_ADD_MENU_PREFIX_LABEL="Add Menu Prefix"
COM_COMPONENTBUILDER_CONFIG_ADMIN_CUSTOM_TABS_TABS="Admin Custom Tabs (tabs)"
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_ADDFIELDS="Admin Fields (addfields)"
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_CONDITIONS_ADDCONDITIONS="Admin Fields Conditions (addconditions)"
COM_COMPONENTBUILDER_CONFIG_ADMIN_FIELDS_RELATIONS_ADDRELATIONS="Admin Fields Relations (addrelations)"
COM_COMPONENTBUILDER_CONFIG_ALMOST_FLAT_LOAD="Almost Flat"
COM_COMPONENTBUILDER_CONFIG_ALPHANUMERIC="Alphanumeric"
COM_COMPONENTBUILDER_CONFIG_ALPHANUMERICDOT="Alphanumeric+dot"
@ -3336,7 +3340,10 @@ COM_COMPONENTBUILDER_CONFIG_COMPILER_FOLDER_PATH_MESSAGE="Error! Please add some
COM_COMPONENTBUILDER_CONFIG_COMPILER_PLUGIN_DESCRIPTION="Select the plugin you would like to use in JCB's compiler"
COM_COMPONENTBUILDER_CONFIG_COMPILER_PLUGIN_LABEL="Activate Compiler Plugins"
COM_COMPONENTBUILDER_CONFIG_COMPONENT="Component"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS="Component Admin Views (addadmin_views)"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_CUSTOM_ADMIN_VIEWS_ADDCUSTOM_ADMIN_VIEWS="Component Custom Admin Views (addcustom_admin_views)"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_LABEL="Component"
COM_COMPONENTBUILDER_CONFIG_COMPONENT_SITE_VIEWS_ADDSITE_VIEWS="Component Site Views (addsite_views)"
COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_DESCRIPTION="Here you can set the path to where all components are backed up to."
COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_HINT="/home/user/fullbackup"
COM_COMPONENTBUILDER_CONFIG_CRONJOB_BACKUP_FOLDER_PATH_LABEL="Cronjob Backup Folder Path"
@ -3379,6 +3386,8 @@ COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_DESCRIPTION="This is the TXT value to use
COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_HINT="v=DKIM1;k=rsa;g=*;s=email;h=sha1;t=s;p=PUBLICKEY"
COM_COMPONENTBUILDER_CONFIG_DKIM_VALUE_LABEL="Value"
COM_COMPONENTBUILDER_CONFIG_DONT_LOAD="Not"
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_DB_TABLE="Dynamic Get (join_db_table)"
COM_COMPONENTBUILDER_CONFIG_DYNAMIC_GET_JOIN_VIEW_TABLE="Dynamic Get (join_view_table)"
COM_COMPONENTBUILDER_CONFIG_EDITOR_DESCRIPTION="Select the editor you would like to use as the JCB global editor for all custom coding areas."
COM_COMPONENTBUILDER_CONFIG_EDITOR_LABEL="Select an editor"
COM_COMPONENTBUILDER_CONFIG_EMAILFROM_DESCRIPTION="The global email address that will be used to send system email."
@ -3486,6 +3495,7 @@ COM_COMPONENTBUILDER_CONFIG_JCB_COMMUNITY_PACKAGES="JCB Community Packages"
COM_COMPONENTBUILDER_CONFIG_JCB_PACKAGE_DIRECTORIES_DESCRIPTION="Here you can manage what package directories show in the JCB package import area."
COM_COMPONENTBUILDER_CONFIG_JCB_PACKAGE_DIRECTORIES_LABEL="Directories"
COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL="Language"
COM_COMPONENTBUILDER_CONFIG_LAYOUT_LABEL="Layout"
COM_COMPONENTBUILDER_CONFIG_LOCAL_FOLDER="Local Folder"
COM_COMPONENTBUILDER_CONFIG_MAILER_DESCRIPTION="Select what mailer you would like to use to send emails."
COM_COMPONENTBUILDER_CONFIG_MAILER_LABEL="Mailer"
@ -3568,6 +3578,9 @@ COM_COMPONENTBUILDER_CONFIG_PHP_MAIL="PHP Mail"
COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_DESCRIPTION="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code."
COM_COMPONENTBUILDER_CONFIG_PLACEHOLDERS_LABEL="Add Custom Code Placeholders"
COM_COMPONENTBUILDER_CONFIG_REMOTE_SERVER="Remote Server"
COM_COMPONENTBUILDER_CONFIG_REPEATABLETABLE_JOOMLA="Repeatable-table (joomla)"
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_JOOMLA="Repeatable (Joomla)"
COM_COMPONENTBUILDER_CONFIG_REPEATABLE_UIKIT="Repeatable (UIkit)"
COM_COMPONENTBUILDER_CONFIG_REPLYNAME_DESCRIPTION="Text displayed in the header &quot;Reply To:&quot; field when replying to the site email. Usually the the person that receives the response. (leave blank for none)"
COM_COMPONENTBUILDER_CONFIG_REPLYNAME_HINT="Reply Name Here"
COM_COMPONENTBUILDER_CONFIG_REPLYNAME_LABEL="Reply to Name"
@ -3603,6 +3616,8 @@ COM_COMPONENTBUILDER_CONFIG_SSL="SSL"
COM_COMPONENTBUILDER_CONFIG_STORAGE_TIME_TO_LIVE_DESCRIPTION="How long should the data that is stored in the browser memory remain unchanged before it is removed and updated."
COM_COMPONENTBUILDER_CONFIG_STORAGE_TIME_TO_LIVE_LABEL="Update Cycle"
COM_COMPONENTBUILDER_CONFIG_STRING_MANIPULATION="String Manipulation"
COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_DESCRIPTION="Select the sub-form layouts you would like to use."
COM_COMPONENTBUILDER_CONFIG_SUBFORM_LAYOUTS_LABEL="Sub-form Layouts"
COM_COMPONENTBUILDER_CONFIG_TLS="TLS"
COM_COMPONENTBUILDER_CONFIG_TRUE="True"
COM_COMPONENTBUILDER_CONFIG_TYPE_NAME_BUILDER_DESCRIPTION="The default option only uses alphabetical characters and converts all numbers in field names to the English equivalent like <em>1</em> becomes <b>one</b>.<br />Alphanumeric+dot keeps the numbers unconverted unless it is at the beginning of the field name, and allows for a dot (.) to be used in the type name for namespacing."
@ -3617,6 +3632,7 @@ COM_COMPONENTBUILDER_CONFIG_UIKIT_MIN_LABEL="Load Minified"
COM_COMPONENTBUILDER_CONFIG_UIKIT_STYLE_DESC="Set the css style that should be used."
COM_COMPONENTBUILDER_CONFIG_UIKIT_STYLE_LABEL="css Style"
COM_COMPONENTBUILDER_CONFIG_VDM_PACKAGES="VDM Packages"
COM_COMPONENTBUILDER_CONFIG_VIEW_FIELD_LABEL="View & Field"
COM_COMPONENTBUILDER_CONFIG_YES="Yes"
COM_COMPONENTBUILDER_CONFIRMATION_STEP_BEFORE_IMPORTING="Confirmation Step Before Importing!"
COM_COMPONENTBUILDER_CONTEXT="Context"

View File

@ -225,6 +225,9 @@ class ComponentbuilderModelAdmin_custom_tabs extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the tabs (sub form) layout
$form->setFieldAttribute('tabs', 'layout', ComponentbuilderHelper::getSubformLayout('admin_custom_tabs', 'tabs'));
return $form;
}

View File

@ -246,6 +246,9 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addfields (sub form) layout
$form->setFieldAttribute('addfields', 'layout', ComponentbuilderHelper::getSubformLayout('admin_fields', 'addfields'));
return $form;
}

View File

@ -246,6 +246,9 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addconditions (sub form) layout
$form->setFieldAttribute('addconditions', 'layout', ComponentbuilderHelper::getSubformLayout('admin_fields_conditions', 'addconditions'));
return $form;
}

View File

@ -308,6 +308,9 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addrelations (sub form) layout
$form->setFieldAttribute('addrelations', 'layout', ComponentbuilderHelper::getSubformLayout('admin_fields_relations', 'addrelations'));
return $form;
}

View File

@ -257,6 +257,9 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addadmin_views (sub form) layout
$form->setFieldAttribute('addadmin_views', 'layout', ComponentbuilderHelper::getSubformLayout('component_admin_views', 'addadmin_views'));
return $form;
}

View File

@ -257,6 +257,9 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addcustom_admin_views (sub form) layout
$form->setFieldAttribute('addcustom_admin_views', 'layout', ComponentbuilderHelper::getSubformLayout('component_custom_admin_views', 'addcustom_admin_views'));
return $form;
}

View File

@ -257,6 +257,9 @@ class ComponentbuilderModelComponent_site_views extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// update the addsite_views (sub form) layout
$form->setFieldAttribute('addsite_views', 'layout', ComponentbuilderHelper::getSubformLayout('component_site_views', 'addsite_views'));
return $form;
}

View File

@ -526,6 +526,12 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
// update the join_view_table (sub form) layout
$form->setFieldAttribute('join_view_table', 'layout', ComponentbuilderHelper::getSubformLayout('dynamic_get', 'join_view_table'));
// update the join_db_table (sub form) layout
$form->setFieldAttribute('join_db_table', 'layout', ComponentbuilderHelper::getSubformLayout('dynamic_get', 'join_db_table'));
return $form;
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>11th July, 2020</creationDate>
<creationDate>13th July, 2020</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>

View File

@ -6591,7 +6591,7 @@ class com_componentbuilderInstallerScript
$query = $db->getQuery(true);
// Field to update.
$fields = array(
$db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","editor":"none","manage_jcb_package_directories":"2","add_menu_prefix":"1","menu_prefix":"»","minify":"0","set_browser_storage":"1","storage_time_to_live":"global","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'),
$db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","add_menu_prefix":"1","menu_prefix":"»","minify":"0","set_browser_storage":"1","storage_time_to_live":"global","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'),
);
// Condition.
$conditions = array(

View File

@ -5862,6 +5862,47 @@ abstract class ComponentbuilderHelper
}
/**
* The subform layouts
**/
protected static $subformLayouts = false;
/**
* get the subform layout
*
* @input string The view name
* @input string The string name
*
* @returns string on success
**/
public static function getSubformLayout($view, $field, $default = 'repeatablejcb')
{
// get global values
if (self::$subformLayouts === false)
{
self::$subformLayouts = JComponentHelper::getParams('com_componentbuilder')->get('subform_layouts', false);
}
// check what we found (else) return default
if (self::checkObject(self::$subformLayouts))
{
// looking for
$target = $view . '.' . $field;
foreach (self::$subformLayouts as $subform)
{
if ($target === $subform->view_field)
{
return $subform->layout;
}
elseif ('default' === $subform->view_field)
{
$default = $subform->layout;
}
}
}
return $default;
}
/**
* Load the Composer Vendors
*/