convert repeatable properties field in the field types view to subform field
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage ajax.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage componentbuilder.php
|
||||
@ -308,7 +308,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList
|
||||
jQuery("#openissues")
|
||||
.append("<h3><a href=\"" + issue.html_url + "\" target=\"_blank\">" + issue.title + "</a></h3>")
|
||||
.append("<img alt=\"@" + issue.user.login + "\" style=\"vertical-align: baseline;\" src=\"" + issue.user.avatar_url +"&s=60\" width=\"30\" height=\"30\"> ")
|
||||
.append("<em><a href=\"" + issue.user.html_url + "\" target=\"_blank\">" + issue.user.login + "</a> '.JText::_('COM_COMPONENTBUILDER_OPENED_THIS').' <a href=\"" + issue.html_url + "\" target=\"_blank\">'.JText::_('COM_COMPONENTBUILDER_ISSUE').'-" + issue.number + "</a> (" + timeago + ")</em>")
|
||||
.append("<em><a href=\"" + issue.user.html_url + "\" target=\"_blank\">" + issue.user.login + "</a> '.JText::_('COM_COMPONENTBUILDER_OPENED_THIS').' <a href=\"" + issue.html_url + "\" target=\"_blank\">'.JText::_('COM_COMPONENTBUILDER_ISSUE').'-" + issue.number + "</a> (" + timeago + ")</em> ")
|
||||
.append(marked(issue.body))
|
||||
.append("<a href=\"" + issue.html_url + "\" target=\"_blank\"><span class=\'icon-new-tab\'></span>'.JText::_('COM_COMPONENTBUILDER_RESPOND_TO_THIS_ISSUE_ON_GITHUB').'</a>...<hr />");
|
||||
});
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage adminviewfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage adminviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage articles.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage component.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage components.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customadminviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customfilelist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage customgets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dbtables.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamicget.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage dynamicgets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fields.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldsmulti.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtypes.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage lang.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage maingets.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage siteviewfolderlist.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage siteviews.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage snippets.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 13 of this MVC
|
||||
@build 13th June, 2017
|
||||
@version @update number 15 of this MVC
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtype.php
|
||||
@ -93,6 +93,14 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->metadata);
|
||||
$item->metadata = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->properties))
|
||||
{
|
||||
// Convert the properties field to an array.
|
||||
$properties = new Registry;
|
||||
$properties->loadString($item->properties);
|
||||
$item->properties = $properties->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
@ -359,6 +367,70 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('created', 'filter', 'unset');
|
||||
}
|
||||
// Modify the form based on Edit Name access controls.
|
||||
if ($id != 0 && (!$user->authorise('fieldtype.edit.name', 'com_componentbuilder.fieldtype.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('fieldtype.edit.name', 'com_componentbuilder')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('name', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('name', 'readonly', 'true');
|
||||
if (!$form->getValue('name'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('name', 'filter', 'unset');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('name', 'required', 'false');
|
||||
}
|
||||
}
|
||||
// Modify the form based on Edit Description access controls.
|
||||
if ($id != 0 && (!$user->authorise('fieldtype.edit.description', 'com_componentbuilder.fieldtype.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('fieldtype.edit.description', 'com_componentbuilder')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('description', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('description', 'readonly', 'true');
|
||||
if (!$form->getValue('description'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('description', 'filter', 'unset');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('description', 'required', 'false');
|
||||
}
|
||||
}
|
||||
// Modify the form based on Edit Short Description access controls.
|
||||
if ($id != 0 && (!$user->authorise('fieldtype.edit.short_description', 'com_componentbuilder.fieldtype.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('fieldtype.edit.short_description', 'com_componentbuilder')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('short_description', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('short_description', 'readonly', 'true');
|
||||
if (!$form->getValue('short_description'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('short_description', 'filter', 'unset');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('short_description', 'required', 'false');
|
||||
}
|
||||
}
|
||||
// Modify the form based on Edit Properties access controls.
|
||||
if ($id != 0 && (!$user->authorise('fieldtype.edit.properties', 'com_componentbuilder.fieldtype.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('fieldtype.edit.properties', 'com_componentbuilder')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('properties', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('properties', 'readonly', 'true');
|
||||
if (!$form->getValue('properties'))
|
||||
{
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('properties', 'filter', 'unset');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('properties', 'required', 'false');
|
||||
}
|
||||
}
|
||||
// Only load these values if no id is found
|
||||
if (0 == $id)
|
||||
{
|
||||
@ -992,7 +1064,20 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
|
||||
$metadata = new JRegistry;
|
||||
$metadata->loadArray($data['metadata']);
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the properties items to data.
|
||||
if (isset($data['properties']) && is_array($data['properties']))
|
||||
{
|
||||
$properties = new JRegistry;
|
||||
$properties->loadArray($data['properties']);
|
||||
$data['properties'] = (string) $properties;
|
||||
}
|
||||
elseif (!isset($data['properties']))
|
||||
{
|
||||
// Set the empty properties to data
|
||||
$data['properties'] = '';
|
||||
}
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 13 of this MVC
|
||||
@build 13th June, 2017
|
||||
@version @update number 15 of this MVC
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtypes.php
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 13 of this MVC
|
||||
@build 13th June, 2017
|
||||
@version @update number 15 of this MVC
|
||||
@build 17th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage fieldtype.js
|
||||
|
@ -143,107 +143,107 @@
|
||||
message="Error! Please add some short description here."
|
||||
hint="COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_HINT"
|
||||
/>
|
||||
<!-- Properties Field. Type: Repeatable. (joomla) -->
|
||||
<!-- Properties Field. Type: Subform. (joomla) -->
|
||||
<field
|
||||
type="repeatable"
|
||||
type="subform"
|
||||
name="properties"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_LABEL"
|
||||
layout="joomla.form.field.subform.repeatable-table"
|
||||
multiple="true"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_DESCRIPTION"
|
||||
id="addproperties"
|
||||
class="addproperty"
|
||||
select="COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_SELECT"
|
||||
icon="list"
|
||||
maximum="500">
|
||||
<fields name="properties_fields" label="">
|
||||
<fieldset hidden="true" name="properties_modal" repeat="true">
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="false"
|
||||
filter="STRING"
|
||||
message="Error! Please add name here."
|
||||
hint="COM_COMPONENTBUILDER_FIELDTYPE_NAME_HINT"
|
||||
/>
|
||||
<!-- Example Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="example"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="false"
|
||||
filter="STRING"
|
||||
message="Error! Please add value/example here."
|
||||
hint="COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT"
|
||||
/>
|
||||
<!-- Adjustable Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="adjustable"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_ADJUSTABLE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_ADJUSTABLE_DESCRIPTION"
|
||||
default="1"
|
||||
required="false">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_NO</option>
|
||||
</field>
|
||||
<!-- Mandatory Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="mandatory"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_MANDATORY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_MANDATORY_DESCRIPTION"
|
||||
default="0"
|
||||
required="false">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_NO</option>
|
||||
</field>
|
||||
<!-- Translatable Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="translatable"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_TRANSLATABLE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_TRANSLATABLE_DESCRIPTION"
|
||||
default="0"
|
||||
required="false">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_NO</option>
|
||||
</field>
|
||||
<!-- Description Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="description"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_LABEL"
|
||||
rows="5"
|
||||
cols="8"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="HTML"
|
||||
hint="COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_HINT"
|
||||
required="false"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
<form hidden="true" name="list_properties_modal" repeat="true">
|
||||
<!-- Name Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="name"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_NAME_DESCRIPTION"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="false"
|
||||
filter="STRING"
|
||||
message="Error! Please add name here."
|
||||
hint="COM_COMPONENTBUILDER_FIELDTYPE_NAME_HINT"
|
||||
/>
|
||||
<!-- Example Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="example"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL"
|
||||
size="40"
|
||||
maxlength="150"
|
||||
class="text_area"
|
||||
readonly="false"
|
||||
disabled="false"
|
||||
required="false"
|
||||
filter="STRING"
|
||||
message="Error! Please add value/example here."
|
||||
hint="COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT"
|
||||
/>
|
||||
<!-- Adjustable Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="adjustable"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_ADJUSTABLE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_ADJUSTABLE_DESCRIPTION"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
required="false">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_NO</option>
|
||||
</field>
|
||||
<!-- Mandatory Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="mandatory"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_MANDATORY_LABEL"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_MANDATORY_DESCRIPTION"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="false">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_NO</option>
|
||||
</field>
|
||||
<!-- Translatable Field. Type: Radio. (joomla) -->
|
||||
<field
|
||||
type="radio"
|
||||
name="translatable"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_TRANSLATABLE_LABEL"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_TRANSLATABLE_DESCRIPTION"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
required="false">
|
||||
<!-- Option Set. -->
|
||||
<option value="1">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_YES</option>
|
||||
<option value="0">
|
||||
COM_COMPONENTBUILDER_FIELDTYPE_NO</option>
|
||||
</field>
|
||||
<!-- Description Field. Type: Textarea. (joomla) -->
|
||||
<field
|
||||
type="textarea"
|
||||
name="description"
|
||||
label="COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_LABEL"
|
||||
rows="5"
|
||||
cols="8"
|
||||
description="COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_DESCRIPTION"
|
||||
class="text_area"
|
||||
filter="HTML"
|
||||
hint="COM_COMPONENTBUILDER_FIELDTYPE_DESCRIPTION_HINT"
|
||||
required="false"
|
||||
/>
|
||||
</form>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 375 of this MVC
|
||||
@build 17th September, 2017
|
||||
@version @update number 378 of this MVC
|
||||
@build 18th September, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage joomla_component.js
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import.php
|
||||
|
@ -11,7 +11,7 @@
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.5.5
|
||||
@build 17th September, 2017
|
||||
@build 18th September, 2017
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import_joomla_components.php
|
||||
@ -88,7 +88,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
|
||||
protected $sleutle = null;
|
||||
protected $updateAfter = array('field' => array(), 'adminview' => array());
|
||||
protected $fieldTypes = array();
|
||||
protected $isRepeatable = array();
|
||||
protected $isMultiple = array();
|
||||
protected $specialValue = false;
|
||||
|
||||
/**
|
||||
@ -1046,10 +1046,10 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
|
||||
if (isset($item->fieldtype) && is_numeric($item->fieldtype) && $item->fieldtype > 0 && isset($this->newID['fieldtype'][$item->fieldtype]))
|
||||
{
|
||||
$item->fieldtype = $this->newID['fieldtype'][$item->fieldtype];
|
||||
// update repeatable field values
|
||||
if ($this->checkRepeatable($item->fieldtype))
|
||||
// update multi field values
|
||||
if ($this->checkMultiFields($item->fieldtype))
|
||||
{
|
||||
$this->updateAfter['field'][$item->id] = $item->id; // repeatable
|
||||
$this->updateAfter['field'][$item->id] = $item->id; // multi field
|
||||
}
|
||||
}
|
||||
elseif (!is_numeric($item->fieldtype) || $item->fieldtype == 0)
|
||||
@ -1587,31 +1587,33 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Check if a field is a repeatable field
|
||||
* Check if a field has multiple fields
|
||||
*
|
||||
* @param string $typeID The type ID
|
||||
*
|
||||
* @return bool true on success
|
||||
*
|
||||
*/
|
||||
protected function checkRepeatable($typeID)
|
||||
protected function checkMultiFields($typeID)
|
||||
{
|
||||
if(isset($this->isRepeatable[$typeID]))
|
||||
if(isset($this->isMultiple[$typeID]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkArray($this->isRepeatable))
|
||||
{
|
||||
return false;
|
||||
return $this->isMultiple[$typeID];
|
||||
}
|
||||
elseif ($type = $this->getFieldType($typeID))
|
||||
{
|
||||
if ('repeatable' === $type)
|
||||
if ('repeatable' === $type || 'subform' === $type )
|
||||
{
|
||||
$this->isRepeatable[$typeID] = true;
|
||||
return true;
|
||||
$this->isMultiple[$typeID] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->isMultiple[$typeID] = false;
|
||||
}
|
||||
return $this->isMultiple[$typeID];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1632,17 +1634,14 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
|
||||
if (ComponentbuilderHelper::checkJson($properties))
|
||||
{
|
||||
$properties = json_decode($properties, true);
|
||||
if (isset($properties['name']) && ComponentbuilderHelper::checkArray($properties['name']))
|
||||
foreach ($properties as $property)
|
||||
{
|
||||
foreach ($properties['name'] as $key => $value)
|
||||
if ('type' === $property['name'])
|
||||
{
|
||||
if ('type' === $value)
|
||||
if (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']))
|
||||
{
|
||||
if (isset($properties['example'][$key]) && ComponentbuilderHelper::checkString($properties['example'][$key]))
|
||||
{
|
||||
$this->fieldTypes[$id] = $properties['example'][$key];
|
||||
break;
|
||||
}
|
||||
$this->fieldTypes[$id] = $property['example'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 375 of this MVC
|
||||
@build 17th September, 2017
|
||||
@version @update number 378 of this MVC
|
||||
@build 18th September, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage joomla_component.php
|
||||
|
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version @update number 375 of this MVC
|
||||
@build 17th September, 2017
|
||||
@version @update number 378 of this MVC
|
||||
@build 18th September, 2017
|
||||
@created 6th May, 2015
|
||||
@package Component Builder
|
||||
@subpackage joomla_components.php
|
||||
@ -86,7 +86,7 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
protected $customCodeIds = array();
|
||||
protected $customCodeM = array();
|
||||
protected $fieldTypes = array();
|
||||
protected $isRepeatable = array();
|
||||
protected $isMultiple = array();
|
||||
|
||||
/**
|
||||
* Method to build the export package
|
||||
@ -659,8 +659,8 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
{
|
||||
// add field types
|
||||
$this->setData('fieldtype', array('fieldtype' => array($item->fieldtype)), 'fieldtype');
|
||||
// we must add a repeatable field subfields
|
||||
if ($this->checkRepeatable($item->fieldtype))
|
||||
// check if this field has multiple fields
|
||||
if ($this->checkMultiFields($item->fieldtype))
|
||||
{
|
||||
$fields = ComponentbuilderHelper::getBetween(json_decode($item->xml), 'fields="', '"');
|
||||
$fieldsSets = array();
|
||||
@ -726,30 +726,30 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a field is a repeatable field
|
||||
* Check if a field has multiple fields
|
||||
*
|
||||
* @param string $typeID The type ID
|
||||
*
|
||||
* @return bool true on success
|
||||
*
|
||||
*/
|
||||
protected function checkRepeatable($typeID)
|
||||
protected function checkMultiFields($typeID)
|
||||
{
|
||||
if(isset($this->isRepeatable[$typeID]))
|
||||
if(isset($this->isMultiple[$typeID]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
elseif (ComponentbuilderHelper::checkArray($this->isRepeatable))
|
||||
{
|
||||
return false;
|
||||
return $this->isMultiple[$typeID];
|
||||
}
|
||||
elseif ($type = $this->getFieldType($typeID))
|
||||
{
|
||||
if ('repeatable' === $type)
|
||||
if ('repeatable' === $type || 'subform' === $type )
|
||||
{
|
||||
$this->isRepeatable[$typeID] = true;
|
||||
return true;
|
||||
$this->isMultiple[$typeID] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->isMultiple[$typeID] = false;
|
||||
}
|
||||
return $this->isMultiple[$typeID];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -770,17 +770,14 @@ class ComponentbuilderModelJoomla_components extends JModelList
|
||||
if (ComponentbuilderHelper::checkJson($properties))
|
||||
{
|
||||
$properties = json_decode($properties, true);
|
||||
if (isset($properties['name']) && ComponentbuilderHelper::checkArray($properties['name']))
|
||||
foreach ($properties as $property)
|
||||
{
|
||||
foreach ($properties['name'] as $key => $value)
|
||||
if ('type' === $property['name'])
|
||||
{
|
||||
if ('type' === $value)
|
||||
if (isset($property['example']) && ComponentbuilderHelper::checkString($property['example']))
|
||||
{
|
||||
if (isset($properties['example'][$key]) && ComponentbuilderHelper::checkString($properties['example'][$key]))
|
||||
{
|
||||
$this->fieldTypes[$id] = $properties['example'][$key];
|
||||
break;
|
||||
}
|
||||
$this->fieldTypes[$id] = $property['example'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user