Component Builder (v.2.9.1)
+ Component Builder (v.2.9.3)
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 e929773ac..2a2b2f96d 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -526,4 +526,21 @@
http://www.joomlacomponentbuilder.com
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.9.3
+ http://www.joomlacomponentbuilder.com
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.9.3/JCB_v2.9.3.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
\ No newline at end of file
diff --git a/script.php b/script.php
index 5d4eed64f..848645f4e 100644
--- a/script.php
+++ b/script.php
@@ -3452,9 +3452,9 @@ class com_componentbuilderInstallerScript
$joomla_component->type_title = 'Componentbuilder Joomla_component';
$joomla_component->type_alias = 'com_componentbuilder.joomla_component';
$joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
- $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_site_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_site_event":"php_site_event","php_admin_event":"php_admin_event","debug_linenr":"debug_linenr","sales_server":"sales_server","add_update_server":"add_update_server","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","mvc_versiondate":"mvc_versiondate","add_placeholders":"add_placeholders","css_admin":"css_admin","description":"description","php_postflight_install":"php_postflight_install","copyright":"copyright","sql_uninstall":"sql_uninstall","adduikit":"adduikit","php_helper_both":"php_helper_both","author":"author","component_version":"component_version","add_email_helper":"add_email_helper","email":"email","php_helper_admin":"php_helper_admin","website":"website","php_helper_site":"php_helper_site","add_license":"add_license","javascript":"javascript","license_type":"license_type","css_site":"css_site","whmcs_key":"whmcs_key","php_preflight_update":"php_preflight_update","whmcs_url":"whmcs_url","php_postflight_update":"php_postflight_update","whmcs_buy_link":"whmcs_buy_link","sql":"sql","license":"license","readme":"readme","bom":"bom","update_server_target":"update_server_target","image":"image","update_server":"update_server","not_required":"not_required","buildcomp":"buildcomp","creatuserhelper":"creatuserhelper","addfootable":"addfootable","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_css_admin":"add_css_admin","add_css_site":"add_css_site","toignore":"toignore","dashboard_type":"dashboard_type","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","export_key":"export_key","add_php_preflight_update":"add_php_preflight_update","joomla_source_link":"joomla_source_link","add_php_postflight_install":"add_php_postflight_install","export_buy_link":"export_buy_link","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","emptycontributors":"emptycontributors","addreadme":"addreadme","number":"number","update_server_url":"update_server_url","add_sales_server":"add_sales_server","buildcompsql":"buildcompsql","name":"name"}}';
+ $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_helper_admin","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_helper_admin":"php_helper_admin","add_email_helper":"add_email_helper","debug_linenr":"debug_linenr","sql":"sql","php_preflight_update":"php_preflight_update","css_site":"css_site","description":"description","mvc_versiondate":"mvc_versiondate","add_placeholders":"add_placeholders","php_helper_site":"php_helper_site","javascript":"javascript","copyright":"copyright","author":"author","php_postflight_update":"php_postflight_update","email":"email","readme":"readme","website":"website","buildcomp":"buildcomp","add_license":"add_license","adduikit":"adduikit","license_type":"license_type","php_helper_both":"php_helper_both","php_admin_event":"php_admin_event","whmcs_key":"whmcs_key","php_site_event":"php_site_event","whmcs_url":"whmcs_url","css_admin":"css_admin","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_install":"php_preflight_install","bom":"bom","php_postflight_install":"php_postflight_install","image":"image","php_method_uninstall":"php_method_uninstall","update_server_target":"update_server_target","sql_uninstall":"sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","component_version":"component_version","not_required":"not_required","sales_server":"sales_server","creatuserhelper":"creatuserhelper","addfootable":"addfootable","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_menu_prefix":"add_menu_prefix","add_javascript":"add_javascript","menu_prefix":"menu_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","dashboard_type":"dashboard_type","toignore":"toignore","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","export_key":"export_key","add_php_postflight_install":"add_php_postflight_install","joomla_source_link":"joomla_source_link","add_php_postflight_update":"add_php_postflight_update","export_buy_link":"export_buy_link","add_php_method_uninstall":"add_php_method_uninstall","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","addreadme":"addreadme","emptycontributors":"emptycontributors","number":"number","update_server_url":"update_server_url","add_sales_server":"add_sales_server","buildcompsql":"buildcompsql","name":"name"}}';
$joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute';
- $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.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","debug_linenr","sales_server","add_update_server","mvc_versiondate","add_placeholders","adduikit","add_email_helper","add_license","license_type","update_server_target","update_server","not_required","buildcomp","creatuserhelper","addfootable","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","emptycontributors","addreadme","number","add_sales_server"],"displayLookup": [{"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": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"}]}';
+ $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.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","add_email_helper","debug_linenr","mvc_versiondate","add_placeholders","buildcomp","add_license","adduikit","license_type","update_server_target","update_server","add_update_server","not_required","sales_server","creatuserhelper","addfootable","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","addreadme","emptycontributors","number","add_sales_server"],"displayLookup": [{"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": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"}]}';
// Set the object into the content types table.
$joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component);
@@ -3898,9 +3898,9 @@ class com_componentbuilderInstallerScript
$joomla_component->type_title = 'Componentbuilder Joomla_component';
$joomla_component->type_alias = 'com_componentbuilder.joomla_component';
$joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
- $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_site_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_site_event":"php_site_event","php_admin_event":"php_admin_event","debug_linenr":"debug_linenr","sales_server":"sales_server","add_update_server":"add_update_server","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","mvc_versiondate":"mvc_versiondate","add_placeholders":"add_placeholders","css_admin":"css_admin","description":"description","php_postflight_install":"php_postflight_install","copyright":"copyright","sql_uninstall":"sql_uninstall","adduikit":"adduikit","php_helper_both":"php_helper_both","author":"author","component_version":"component_version","add_email_helper":"add_email_helper","email":"email","php_helper_admin":"php_helper_admin","website":"website","php_helper_site":"php_helper_site","add_license":"add_license","javascript":"javascript","license_type":"license_type","css_site":"css_site","whmcs_key":"whmcs_key","php_preflight_update":"php_preflight_update","whmcs_url":"whmcs_url","php_postflight_update":"php_postflight_update","whmcs_buy_link":"whmcs_buy_link","sql":"sql","license":"license","readme":"readme","bom":"bom","update_server_target":"update_server_target","image":"image","update_server":"update_server","not_required":"not_required","buildcomp":"buildcomp","creatuserhelper":"creatuserhelper","addfootable":"addfootable","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_css_admin":"add_css_admin","add_css_site":"add_css_site","toignore":"toignore","dashboard_type":"dashboard_type","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","export_key":"export_key","add_php_preflight_update":"add_php_preflight_update","joomla_source_link":"joomla_source_link","add_php_postflight_install":"add_php_postflight_install","export_buy_link":"export_buy_link","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","emptycontributors":"emptycontributors","addreadme":"addreadme","number":"number","update_server_url":"update_server_url","add_sales_server":"add_sales_server","buildcompsql":"buildcompsql","name":"name"}}';
+ $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_helper_admin","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","php_helper_admin":"php_helper_admin","add_email_helper":"add_email_helper","debug_linenr":"debug_linenr","sql":"sql","php_preflight_update":"php_preflight_update","css_site":"css_site","description":"description","mvc_versiondate":"mvc_versiondate","add_placeholders":"add_placeholders","php_helper_site":"php_helper_site","javascript":"javascript","copyright":"copyright","author":"author","php_postflight_update":"php_postflight_update","email":"email","readme":"readme","website":"website","buildcomp":"buildcomp","add_license":"add_license","adduikit":"adduikit","license_type":"license_type","php_helper_both":"php_helper_both","php_admin_event":"php_admin_event","whmcs_key":"whmcs_key","php_site_event":"php_site_event","whmcs_url":"whmcs_url","css_admin":"css_admin","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_install":"php_preflight_install","bom":"bom","php_postflight_install":"php_postflight_install","image":"image","php_method_uninstall":"php_method_uninstall","update_server_target":"update_server_target","sql_uninstall":"sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","component_version":"component_version","not_required":"not_required","sales_server":"sales_server","creatuserhelper":"creatuserhelper","addfootable":"addfootable","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_menu_prefix":"add_menu_prefix","add_javascript":"add_javascript","menu_prefix":"menu_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","dashboard_type":"dashboard_type","toignore":"toignore","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","export_key":"export_key","add_php_postflight_install":"add_php_postflight_install","joomla_source_link":"joomla_source_link","add_php_postflight_update":"add_php_postflight_update","export_buy_link":"export_buy_link","add_php_method_uninstall":"add_php_method_uninstall","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","addreadme":"addreadme","emptycontributors":"emptycontributors","number":"number","update_server_url":"update_server_url","add_sales_server":"add_sales_server","buildcompsql":"buildcompsql","name":"name"}}';
$joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute';
- $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.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","debug_linenr","sales_server","add_update_server","mvc_versiondate","add_placeholders","adduikit","add_email_helper","add_license","license_type","update_server_target","update_server","not_required","buildcomp","creatuserhelper","addfootable","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","emptycontributors","addreadme","number","add_sales_server"],"displayLookup": [{"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": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"}]}';
+ $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.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","add_email_helper","debug_linenr","mvc_versiondate","add_placeholders","buildcomp","add_license","adduikit","license_type","update_server_target","update_server","add_update_server","not_required","sales_server","creatuserhelper","addfootable","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","addreadme","emptycontributors","number","add_sales_server"],"displayLookup": [{"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": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"}]}';
// Check if joomla_component type is already in content_type DB.
$joomla_component_id = null;
@@ -5116,7 +5116,7 @@ class com_componentbuilderInstallerScript
echo '
-
Upgrade to Version 2.9.1 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 2.9.3 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 4b7fd195d..4fa4d2dde 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/helpers/componentbuilder.php
@@ -32,6 +32,11 @@ abstract class ComponentbuilderHelper
**/
public static $libraryNames = array(1 => 'No Library', 2 => 'Bootstrap v4', 3 => 'Uikit v3', 4 => 'Uikit v2', 5 => 'FooTable v2', 6 => 'FooTable v3');
+ /**
+ * Array of php fields Allowed (16)
+ **/
+ public static $phpFieldArray = array('', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x');
+
/**
* The global params
**/
@@ -670,7 +675,7 @@ abstract class ComponentbuilderHelper
if ($db->getNumRows())
{
$result = $db->loadObject();
- $properties = json_decode($result->properties,true);
+ $properties = json_decode($result->properties, true);
$field = array(
'subform' => array(),
'nameListOptions' => array(),
@@ -684,11 +689,11 @@ abstract class ComponentbuilderHelper
// value to check since there are false and null values even 0 in the values returned
$confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB';
// set the headers
- $field['values_description'] .= ''.JText::_('COM_COMPONENTBUILDER_PROPERTY').' | '.JText::_('COM_COMPONENTBUILDER_EXAMPLE').' | '.JText::_('COM_COMPONENTBUILDER_DESCRIPTION').' |
';
+ $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'])) ? $property['example'] : '';
- $field['values_description'] .= ''.$property['name'].' | '.$example.' | '.$property['description'].' |
';
+ $field['values_description'] .= '' . $property['name'] . ' | ' . $example . ' | ' . $property['description'] . ' |
';
// check if we should load the value
$value = self::getValueFromXMLstring($xml, $property['name'], $confirmation);
// check if this is a php field
@@ -709,7 +714,7 @@ abstract class ComponentbuilderHelper
if(self::checkArray($settings) && isset($settings[$property['name']]))
{
// add the xml values
- $field['values'] .= PHP_EOL."\t".$property['name'].'="'.$settings[$property['name']].'" ';
+ $field['values'] .= PHP_EOL . "\t" . $property['name'] . '="'. $settings[$property['name']] . '" ';
// add the json values
if ($addPHP)
{
@@ -723,7 +728,7 @@ abstract class ComponentbuilderHelper
elseif (!$xml || $confirmation !== $value)
{
// add the xml values
- $field['values'] .= PHP_EOL."\t" . $property['name'] . '="'. ($confirmation !== $value) ? $value : $example .'" ';
+ $field['values'] .= PHP_EOL."\t" . $property['name'] . '="' . ($confirmation !== $value) ? $value : $example .'" ';
// add the json values
if ($addPHP)
{
@@ -742,7 +747,7 @@ abstract class ComponentbuilderHelper
// increment the number
$nr++;
}
- $field['values'] .= PHP_EOL."/>";
+ $field['values'] .= PHP_EOL . "/>";
$field['values_description'] .= '';
// return found field options
return $field;
@@ -750,11 +755,16 @@ abstract class ComponentbuilderHelper
return false;
}
- public static function getValueFromXMLstring($xml, $get, $confirmation)
+ public static function getValueFromXMLstring(&$xml, &$get, $confirmation = '')
{
if (self::checkString($xml))
{
- return self::getBetween($xml, $get.'="', '"', $confirmation);
+ // if we have a PHP value, we must base64 decode it
+ if (strpos($get, 'type_php') !== false)
+ {
+ return self::openValidBase64(self::getBetween($xml, $get.'="', '"', $confirmation));
+ }
+ return self::getBetween($xml, $get . '="', '"', $confirmation);
}
return $confirmation;
}
@@ -2254,6 +2264,38 @@ abstract class ComponentbuilderHelper
return ''.JText::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
';
}
+ /**
+ * open base64 string if stored as base64
+ *
+ * @param string $data The base64 string
+ * @param string $key We store the string with that suffix :)
+ *
+ * @return string The opened string
+ *
+ */
+ public static function openValidBase64($data, $key = '__.o0=base64=Oo.__')
+ {
+ // check that we have a string
+ if (self::checkString($data))
+ {
+ // check if we have a key
+ if (self::checkString($key))
+ {
+ if (strpos($data, $key) !== false)
+ {
+ return base64_decode(str_replace($key, '', $data));
+ }
+ }
+ // fallback to this, not perfect method
+ elseif (base64_encode(base64_decode($data, true)) === $data)
+ {
+ return base64_decode($data);
+ }
+ }
+ return $data;
+ }
+
+
/**
* prepare base64 string for url
**/