Component Builder (v.2.7.1)
+ Component Builder (v.2.7.2)
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index ad0d15889..aa22366f6 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -339,4 +339,21 @@
http://joomlacomponentbuilder.com
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.7.2
+ http://joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.7.2/JCB_v2.7.2.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://joomlacomponentbuilder.com
+
+
\ No newline at end of file
diff --git a/script.php b/script.php
index 2cacf1a0a..603225603 100644
--- a/script.php
+++ b/script.php
@@ -3428,9 +3428,9 @@ class com_componentbuilderInstallerScript
$field->type_title = 'Componentbuilder Field';
$field->type_alias = 'com_componentbuilder.field';
$field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
- $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","add_css_view":"add_css_view","css_view":"css_view","not_required":"not_required","xml":"xml","add_javascript_view_footer":"add_javascript_view_footer","add_javascript_views_footer":"add_javascript_views_footer","add_css_views":"add_css_views","datalenght":"datalenght","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","css_views":"css_views","store":"store","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer"}}';
+ $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","datadefault_other":"datadefault_other","css_views":"css_views","javascript_views_footer":"javascript_views_footer","javascript_view_footer":"javascript_view_footer","datalenght":"datalenght","add_css_view":"add_css_view","not_required":"not_required","css_view":"css_view","store":"store","datalenght_other":"datalenght_other","add_javascript_view_footer":"add_javascript_view_footer","add_css_views":"add_css_views","add_javascript_views_footer":"add_javascript_views_footer","datadefault":"datadefault","xml":"xml"}}';
$field->router = 'ComponentbuilderHelperRoute::getFieldRoute';
- $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","add_css_view","not_required","catid","add_javascript_view_footer","add_javascript_views_footer","add_css_views","store"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
+ $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","add_css_view","not_required","catid","store","add_javascript_view_footer","add_css_views","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
// Set the object into the content types table.
$field_Inserted = $db->insertObject('#__content_types', $field);
@@ -4037,9 +4037,9 @@ class com_componentbuilderInstallerScript
$field->type_title = 'Componentbuilder Field';
$field->type_alias = 'com_componentbuilder.field';
$field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
- $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","add_css_view":"add_css_view","css_view":"css_view","not_required":"not_required","xml":"xml","add_javascript_view_footer":"add_javascript_view_footer","add_javascript_views_footer":"add_javascript_views_footer","add_css_views":"add_css_views","datalenght":"datalenght","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","css_views":"css_views","store":"store","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer"}}';
+ $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","datadefault_other":"datadefault_other","css_views":"css_views","javascript_views_footer":"javascript_views_footer","javascript_view_footer":"javascript_view_footer","datalenght":"datalenght","add_css_view":"add_css_view","not_required":"not_required","css_view":"css_view","store":"store","datalenght_other":"datalenght_other","add_javascript_view_footer":"add_javascript_view_footer","add_css_views":"add_css_views","add_javascript_views_footer":"add_javascript_views_footer","datadefault":"datadefault","xml":"xml"}}';
$field->router = 'ComponentbuilderHelperRoute::getFieldRoute';
- $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","add_css_view","not_required","catid","add_javascript_view_footer","add_javascript_views_footer","add_css_views","store"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
+ $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","add_css_view","not_required","catid","store","add_javascript_view_footer","add_css_views","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}';
// Check if field type is already in content_type DB.
$field_id = null;
@@ -4878,7 +4878,7 @@ class com_componentbuilderInstallerScript
echo '
-
Upgrade to Version 2.7.1 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 2.7.2 Was Successful! Let us know if anything is not working as expected.
';
}
}
diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php
index 51d021e7d..21dc4dc69 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/helpers/componentbuilder.php
@@ -590,6 +590,85 @@ abstract class ComponentbuilderHelper
$extruder = new Extrusion($data);
}
+ public static function getFieldOptions($value, $type, $settings = array(), $xml = null)
+ {
+ // Get a db connection.
+ $db = JFactory::getDbo();
+
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('properties', 'short_description', 'description')));
+ $query->from($db->quoteName('#__componentbuilder_fieldtype'));
+ $query->where($db->quoteName('published') . ' = 1');
+ $query->where($db->quoteName($type) . ' = '. $value);
+
+ // Reset the query using our newly populated query object.
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ $result = $db->loadObject();
+ $properties = json_decode($result->properties,true);
+ $field = array(
+ 'subform' => array(),
+ 'nameListOptions' => array(),
+ 'values' => " '',
+ 'short_description' => $result->short_description,
+ 'description' => $result->description);
+ // number pointer
+ $nr = 0;
+ // set the headers
+ $field['values_description'] .= ''.JText::_('COM_COMPONENTBUILDER_PROPERTY').' | '.JText::_('COM_COMPONENTBUILDER_EXAMPLE').' | '.JText::_('COM_COMPONENTBUILDER_DESCRIPTION').' |
';
+ foreach ($properties as $property)
+ {
+ $example = (isset($property['example']) && self::checkString($property['example'])) ? self::shorten($property['example'], 30) : '';
+ $field['values_description'] .= ''.$property['name'].' | '.$example.' | '.$property['description'].' |
';
+ // check if we should load the value
+ $value = self::getValueFromXMLstring($xml, $property['name']);
+ if(self::checkArray($settings) && isset($settings[$property['name']]))
+ {
+ // add the xml values
+ $field['values'] .= "\n\t".$property['name'].'="'.$settings[$property['name']].'" ';
+ // add the json values
+ $field['subform']['properties'.$nr] = array('name' => $property['name'], 'value' => $settings[$property['name']]);
+ // add the name List Options as set
+ $field['nameListOptionsSet'][$property['name']] = $property['name'];
+ }
+ elseif (!$xml || $value)
+ {
+ // add the xml values
+ $field['values'] .= "\n\t" . $property['name'] . '="'. ($value) ? $value : $property['example'] .'" ';
+ // add the json values
+ $field['subform']['properties' . $nr] = array('name' => $property['name'], 'value' => ($value) ? $value : $property['example'], 'desc' => $property['description']);
+ }
+ // add the name List Options
+ $field['nameListOptions'][$property['name']] = $property['name'];
+ // increment the number
+ $nr++;
+ }
+ $field['values'] .= "\n/>";
+ $field['values_description'] .= '
';
+ // return found field options
+ return $field;
+ }
+ return false;
+ }
+
+ public static function getValueFromXMLstring($xml, $get)
+ {
+ if (self::checkString($xml))
+ {
+ $value = self::getBetween($xml, $get.'="', '"');
+ if (self::checkString($value))
+ {
+ return $value;
+ }
+ }
+ return false;
+ }
+
+
/**
* The zipper method
*
@@ -673,50 +752,6 @@ abstract class ComponentbuilderHelper
return $klaar;
}
-
- public static function getFieldOptions($value, $type, $settings = array())
- {
- // Get a db connection.
- $db = JFactory::getDbo();
-
- // Create a new query object.
- $query = $db->getQuery(true);
- $query->select($db->quoteName(array('properties', 'short_description', 'description')));
- $query->from($db->quoteName('#__componentbuilder_fieldtype'));
- $query->where($db->quoteName('published') . ' = 1');
- $query->where($db->quoteName($type) . ' = '. $value);
-
- // Reset the query using our newly populated query object.
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- $result = $db->loadObject();
- $properties = json_decode($result->properties,true);
- $field = array('values' => " '', 'short_description' => $result->short_description, 'description' => $result->description);
- // set the headers
- $field['values_description'] .= ''.JText::_('COM_COMPONENTBUILDER_PROPERTY').' | '.JText::_('COM_COMPONENTBUILDER_EXAMPLE').' | '.JText::_('COM_COMPONENTBUILDER_DESCRIPTION').' |
';
- foreach ($properties as $property)
- {
- $example = (isset($property['example']) && self::checkString($property['example'])) ? self::shorten($property['example'], 30) : '';
- $field['values_description'] .= ''.$property['name'].' | '.$example.' | '.$property['description'].' |
';
- if(isset($settings[$property['name']]))
- {
- $field['values'] .= "\n\t".$property['name'].'="'.$settings[$property['name']].'" ';
- }
- else
- {
- $field['values'] .= "\n\t".$property['name'].'="'.$property['example'].'" ';
- }
- }
- $field['values'] .= "\n/>";
- $field['values_description'] .= '
';
- // return found field options
- return $field;
- }
- return false;
- }
-
/**
* the basic localkey
**/