Component Builder (v.2.5.1)
+ Component Builder (v.2.5.2)
The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanced, 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 5b15ff0ec..ddb39bc93 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -407,4 +407,21 @@
http://vdm.bz/component-builder
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.5.2
+ http://vdm.bz/component-builder
+
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.5.2/JCB_v2.5.2.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://vdm.bz/component-builder
+
+
\ No newline at end of file
diff --git a/script.php b/script.php
index 2a015923f..b5088c13d 100644
--- a/script.php
+++ b/script.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage script.php
@@ -1348,6 +1348,92 @@ class com_componentbuilderInstallerScript
}
}
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // Select id from content type table
+ $query->select($db->quoteName('type_id'));
+ $query->from($db->quoteName('#__content_types'));
+ // Where Ftp alias is found
+ $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.ftp') );
+ $db->setQuery($query);
+ // Execute query to see if alias is found
+ $db->execute();
+ $ftp_found = $db->getNumRows();
+ // Now check if there were any rows
+ if ($ftp_found)
+ {
+ // Since there are load the needed ftp type ids
+ $ftp_ids = $db->loadColumn();
+ // Remove Ftp from the content type table
+ $ftp_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.ftp') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__content_types'));
+ $query->where($ftp_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Ftp items
+ $ftp_done = $db->execute();
+ if ($ftp_done);
+ {
+ // If succesfully remove Ftp add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.ftp) type alias was removed from the #__content_type table'));
+ }
+
+ // Remove Ftp items from the contentitem tag map table
+ $ftp_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.ftp') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__contentitem_tag_map'));
+ $query->where($ftp_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Ftp items
+ $ftp_done = $db->execute();
+ if ($ftp_done);
+ {
+ // If succesfully remove Ftp add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.ftp) type alias was removed from the #__contentitem_tag_map table'));
+ }
+
+ // Remove Ftp items from the ucm content table
+ $ftp_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.ftp') );
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_content'));
+ $query->where($ftp_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Ftp items
+ $ftp_done = $db->execute();
+ if ($ftp_done);
+ {
+ // If succesfully remove Ftp add queued success message.
+ $app->enqueueMessage(JText::_('The (com_componentbuilder.ftp) type alias was removed from the #__ucm_content table'));
+ }
+
+ // Make sure that all the Ftp items are cleared from DB
+ foreach ($ftp_ids as $ftp_id)
+ {
+ // Remove Ftp items from the ucm base table
+ $ftp_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $ftp_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_base'));
+ $query->where($ftp_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Ftp items
+ $db->execute();
+
+ // Remove Ftp items from the ucm history table
+ $ftp_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $ftp_id);
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ $query->delete($db->quoteName('#__ucm_history'));
+ $query->where($ftp_condition);
+ $db->setQuery($query);
+ // Execute the query to remove Ftp items
+ $db->execute();
+ }
+ }
+
// Create a new query object.
$query = $db->getQuery(true);
// Select id from content type table
@@ -1494,7 +1580,91 @@ class com_componentbuilderInstallerScript
}
// do any updates needed
if ($type == 'update')
+ {
+ // load the helper class
+ JLoader::register('ComponentbuilderHelper', JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/componentbuilder.php');
+ // check the version of JCB
+ $manifest = ComponentbuilderHelper::manifest();
+ if (isset($manifest->version) && strpos($manifest->version, '.') !== false)
{
+ $version = explode('.', $manifest->version);
+ // target version less then 2.5.2
+ if (count($version) == 3 && $version[0] <= 2 && $version[1] <= 5 && (($version[1] == 5 && $version[2] <= 1) || ($version[1] < 5)))
+ {
+ // the set values
+ $this->setValues = array();
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // Create a new query object.
+ $query = $db->getQuery(true);
+ // update all manual and auto links in sermons
+ $query->select($db->quoteName(array('id', 'sales_server_ftp', 'update_server_ftp')));
+ $query->from($db->quoteName('#__componentbuilder_joomla_component'));
+ // Reset the query using our newly populated query object.
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ $rows = $db->loadObjectList();
+ // Get the basic encryption.
+ $basickey = ComponentbuilderHelper::getCryptKey('basic');
+ // Get the encryption object.
+ $basic = new FOFEncryptAes($basickey, 128);
+ foreach ($rows as $row)
+ {
+ if (ComponentbuilderHelper::checkString($row->sales_server_ftp) || ComponentbuilderHelper::checkString($row->update_server_ftp))
+ {
+ $updatevalue = null;
+ // update the update_server_ftp
+ if (ComponentbuilderHelper::checkString($row->update_server_ftp) && !is_numeric($row->update_server_ftp) && $basickey && $row->update_server_ftp === base64_encode(base64_decode($row->update_server_ftp, true)))
+ {
+ $updatevalue = rtrim($basic->decryptString($row->update_server_ftp), "\0");
+ }
+ elseif (ComponentbuilderHelper::checkString($row->update_server_ftp))
+ {
+ $updatevalue = $row->update_server_ftp;
+ }
+ $salesvalue = null;
+ // update the sales_server_ftp
+ if (ComponentbuilderHelper::checkString($row->sales_server_ftp) && !is_numeric($row->sales_server_ftp) && $basickey && $row->sales_server_ftp === base64_encode(base64_decode($row->sales_server_ftp, true)))
+ {
+ $salesvalue = rtrim($basic->decryptString($row->sales_server_ftp), "\0");
+ }
+ elseif (ComponentbuilderHelper::checkString($row->sales_server_ftp))
+ {
+ $salesvalue = $row->sales_server_ftp;
+ }
+ // set update Values
+ if ($updatevalue)
+ {
+ $hash = md5($updatevalue) . '__update_server_ftp';
+ if (!isset($this->setValues[$hash]))
+ {
+ $this->setValues[$hash] = array();
+ $this->setValues[$hash]['ids'] = array();
+ $this->setValues[$hash]['ftp'] = $updatevalue;
+ $this->setValues[$hash]['signature'] = $row->update_server_ftp;
+ }
+ $this->setValues[$hash]['ids'][] = $row->id;
+ }
+ // set sales Values
+ if ($salesvalue)
+ {
+ $hash = md5($salesvalue) . '__sales_server_ftp';
+ if (!isset($this->setValues[$hash]))
+ {
+ $this->setValues[$hash] = array();
+ $this->setValues[$hash]['ids'] = array();
+ $this->setValues[$hash]['ftp'] = $salesvalue;
+ $this->setValues[$hash]['signature'] = $row->sales_server_ftp;
+ }
+ $this->setValues[$hash]['ids'][] = $row->id;
+ }
+ }
+ }
+ }
+ }
+ }
}
// do any install needed
if ($type == 'install')
@@ -1523,7 +1693,7 @@ class com_componentbuilderInstallerScript
$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": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "readme","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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","component_version":"component_version","short_description":"short_description","companyname":"companyname","author":"author","add_update_server":"add_update_server","add_placeholders":"add_placeholders","description":"description","add_admin_event":"add_admin_event","copyright":"copyright","php_postflight_update":"php_postflight_update","debug_linenr":"debug_linenr","mvc_versiondate":"mvc_versiondate","add_site_event":"add_site_event","export_package_link":"export_package_link","php_preflight_update":"php_preflight_update","addfootable":"addfootable","sql":"sql","add_php_helper_both":"add_php_helper_both","email":"email","website":"website","creatuserhelper":"creatuserhelper","add_license":"add_license","css":"css","license_type":"license_type","add_php_helper_admin":"add_php_helper_admin","add_php_helper_site":"add_php_helper_site","whmcs_key":"whmcs_key","add_php_dashboard_methods":"add_php_dashboard_methods","whmcs_url":"whmcs_url","php_preflight_install":"php_preflight_install","license":"license","php_postflight_install":"php_postflight_install","bom":"bom","php_method_uninstall":"php_method_uninstall","image":"image","readme":"readme","sales_server_ftp":"sales_server_ftp","update_server_target":"update_server_target","name":"name","update_server_ftp":"update_server_ftp","not_required":"not_required","buildcomp":"buildcomp","export_key":"export_key","export_buy_link":"export_buy_link","adduikit":"adduikit","add_css":"add_css","add_email_helper":"add_email_helper","php_helper_both":"php_helper_both","php_helper_admin":"php_helper_admin","php_admin_event":"php_admin_event","php_helper_site":"php_helper_site","php_site_event":"php_site_event","php_dashboard_methods":"php_dashboard_methods","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","emptycontributors":"emptycontributors","add_php_method_uninstall":"add_php_method_uninstall","number":"number","add_sql":"add_sql","addreadme":"addreadme","update_server":"update_server","add_sales_server":"add_sales_server","buildcompsql":"buildcompsql"}}';
$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","add_update_server","add_placeholders","add_admin_event","debug_linenr","mvc_versiondate","add_site_event","addfootable","add_php_helper_both","creatuserhelper","add_license","license_type","add_php_helper_admin","add_php_helper_site","add_php_dashboard_methods","update_server_target","not_required","buildcomp","adduikit","add_css","add_email_helper","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","emptycontributors","add_php_method_uninstall","number","add_sql","addreadme","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"}]}';
+ $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_update_server","add_placeholders","add_admin_event","debug_linenr","mvc_versiondate","add_site_event","addfootable","add_php_helper_both","creatuserhelper","add_license","license_type","add_php_helper_admin","add_php_helper_site","add_php_dashboard_methods","sales_server_ftp","update_server_target","update_server_ftp","not_required","buildcomp","adduikit","add_css","add_email_helper","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","emptycontributors","add_php_method_uninstall","number","add_sql","addreadme","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_ftp","targetTable": "#__componentbuilder_ftp","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server_ftp","targetTable": "#__componentbuilder_ftp","targetColumn": "id","displayColumn": "name"}]}';
// Set the object into the content types table.
$joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component);
@@ -1696,6 +1866,18 @@ class com_componentbuilderInstallerScript
// Set the object into the content types table.
$language_Inserted = $db->insertObject('#__content_types', $language);
+ // Create the ftp content type object.
+ $ftp = new stdClass();
+ $ftp->type_title = 'Componentbuilder Ftp';
+ $ftp->type_alias = 'com_componentbuilder.ftp';
+ $ftp->table = '{"special": {"dbtable": "#__componentbuilder_ftp","key": "id","type": "Ftp","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $ftp->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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","signature":"signature"}}';
+ $ftp->router = 'ComponentbuilderHelperRoute::getFtpRoute';
+ $ftp->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/ftp.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"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"}]}';
+
+ // Set the object into the content types table.
+ $ftp_Inserted = $db->insertObject('#__content_types', $ftp);
+
// Create the help_document content type object.
$help_document = new stdClass();
$help_document->type_title = 'Componentbuilder Help_document';
@@ -1741,7 +1923,7 @@ class com_componentbuilderInstallerScript
$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": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "readme","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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","component_version":"component_version","short_description":"short_description","companyname":"companyname","author":"author","add_update_server":"add_update_server","add_placeholders":"add_placeholders","description":"description","add_admin_event":"add_admin_event","copyright":"copyright","php_postflight_update":"php_postflight_update","debug_linenr":"debug_linenr","mvc_versiondate":"mvc_versiondate","add_site_event":"add_site_event","export_package_link":"export_package_link","php_preflight_update":"php_preflight_update","addfootable":"addfootable","sql":"sql","add_php_helper_both":"add_php_helper_both","email":"email","website":"website","creatuserhelper":"creatuserhelper","add_license":"add_license","css":"css","license_type":"license_type","add_php_helper_admin":"add_php_helper_admin","add_php_helper_site":"add_php_helper_site","whmcs_key":"whmcs_key","add_php_dashboard_methods":"add_php_dashboard_methods","whmcs_url":"whmcs_url","php_preflight_install":"php_preflight_install","license":"license","php_postflight_install":"php_postflight_install","bom":"bom","php_method_uninstall":"php_method_uninstall","image":"image","readme":"readme","sales_server_ftp":"sales_server_ftp","update_server_target":"update_server_target","name":"name","update_server_ftp":"update_server_ftp","not_required":"not_required","buildcomp":"buildcomp","export_key":"export_key","export_buy_link":"export_buy_link","adduikit":"adduikit","add_css":"add_css","add_email_helper":"add_email_helper","php_helper_both":"php_helper_both","php_helper_admin":"php_helper_admin","php_admin_event":"php_admin_event","php_helper_site":"php_helper_site","php_site_event":"php_site_event","php_dashboard_methods":"php_dashboard_methods","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","emptycontributors":"emptycontributors","add_php_method_uninstall":"add_php_method_uninstall","number":"number","add_sql":"add_sql","addreadme":"addreadme","update_server":"update_server","add_sales_server":"add_sales_server","buildcompsql":"buildcompsql"}}';
$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","add_update_server","add_placeholders","add_admin_event","debug_linenr","mvc_versiondate","add_site_event","addfootable","add_php_helper_both","creatuserhelper","add_license","license_type","add_php_helper_admin","add_php_helper_site","add_php_dashboard_methods","update_server_target","not_required","buildcomp","adduikit","add_css","add_email_helper","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","emptycontributors","add_php_method_uninstall","number","add_sql","addreadme","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"}]}';
+ $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_update_server","add_placeholders","add_admin_event","debug_linenr","mvc_versiondate","add_site_event","addfootable","add_php_helper_both","creatuserhelper","add_license","license_type","add_php_helper_admin","add_php_helper_site","add_php_dashboard_methods","sales_server_ftp","update_server_target","update_server_ftp","not_required","buildcomp","adduikit","add_css","add_email_helper","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","emptycontributors","add_php_method_uninstall","number","add_sql","addreadme","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_ftp","targetTable": "#__componentbuilder_ftp","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server_ftp","targetTable": "#__componentbuilder_ftp","targetColumn": "id","displayColumn": "name"}]}';
// Check if joomla_component type is already in content_type DB.
$joomla_component_id = null;
@@ -2169,6 +2351,35 @@ class com_componentbuilderInstallerScript
$language_Inserted = $db->insertObject('#__content_types', $language);
}
+ // Create the ftp content type object.
+ $ftp = new stdClass();
+ $ftp->type_title = 'Componentbuilder Ftp';
+ $ftp->type_alias = 'com_componentbuilder.ftp';
+ $ftp->table = '{"special": {"dbtable": "#__componentbuilder_ftp","key": "id","type": "Ftp","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
+ $ftp->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": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","signature":"signature"}}';
+ $ftp->router = 'ComponentbuilderHelperRoute::getFtpRoute';
+ $ftp->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/ftp.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"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"}]}';
+
+ // Check if ftp type is already in content_type DB.
+ $ftp_id = null;
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('type_id')));
+ $query->from($db->quoteName('#__content_types'));
+ $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($ftp->type_alias));
+ $db->setQuery($query);
+ $db->execute();
+
+ // Set the object into the content types table.
+ if ($db->getNumRows())
+ {
+ $ftp->type_id = $db->loadResult();
+ $ftp_Updated = $db->updateObject('#__content_types', $ftp, 'type_id');
+ }
+ else
+ {
+ $ftp_Inserted = $db->insertObject('#__content_types', $ftp);
+ }
+
// Create the help_document content type object.
$help_document = new stdClass();
$help_document->type_title = 'Componentbuilder Help_document';
@@ -2199,10 +2410,81 @@ class com_componentbuilderInstallerScript
}
+
+ // check if any links were found
+ if (isset($this->setValues) && ComponentbuilderHelper::checkArray($this->setValues))
+ {
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // Get the date
+ $today = JFactory::getDate()->toSql();
+ // Get the user object
+ $user = JFactory::getUser();
+ // build the storage buckets
+ foreach ($this->setValues as $hash => $item)
+ {
+ // get host name
+ $hostusername = ComponentbuilderHelper::getBetween($item['ftp'], 'username=', '&');
+ // get key
+ $keys = explode('__', $hash);
+ $key = $keys[1];
+ if (ComponentbuilderHelper::checkString($hostusername) && $hostusername !== 'user@name.com' && strpos($hostusername, '@') !== false && strpos($hostusername, '.') !== false)
+ {
+ $name = explode('.', $hostusername);
+ // Create an object.
+ $object = new stdClass();
+ $object->signature = $item['signature']; // the still locked version (if there is a basic key)
+ $object->name = str_replace('@', ' ', $name[0]);
+ $object->published = 1;
+ $object->version = 2;
+ $object->created = $today;
+ $object->created_by = (int) $user->id;
+ // safe the FTP server
+ $done = $db->insertObject('#__componentbuilder_ftp', $object);
+ // update the component if stored
+ if ($done)
+ {
+ // get the last ID
+ $newId = $db->insertid();
+ // make sure the access of asset is set
+ ComponentbuilderHelper::setAsset($newId,'ftp');
+ // now update the components
+ if (ComponentbuilderHelper::checkArray($item['ids']))
+ {
+ foreach ($item['ids'] as $compId)
+ {
+ // Create an object.
+ $object = new stdClass();
+ $object->id = $compId;
+ $object->{$key} = $newId;
+ // Update with the object the joomla_component table.
+ $db->updateObject('#__componentbuilder_joomla_component', $object, 'id');
+ }
+ }
+ }
+ }
+ else
+ {
+ // now update the components
+ if (ComponentbuilderHelper::checkArray($item['ids']))
+ {
+ foreach ($item['ids'] as $compId)
+ {
+ // Create an object.
+ $object = new stdClass();
+ $object->id = $compId;
+ $object->{$key} = ''; // remove all values to insure stability
+ // Insert the object into the joomla_component table.
+ $db->updateObject('#__componentbuilder_joomla_component', $object, 'id');
+ }
+ }
+ }
+ }
+ }
echo '
-
Upgrade to Version 2.5.1 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 2.5.2 Was Successful! Let us know if anything is not working as expected.
';
}
}
}
diff --git a/site/assets/css/site.css b/site/assets/css/site.css
index 7ba4944ae..fa618d285 100644
--- a/site/assets/css/site.css
+++ b/site/assets/css/site.css
@@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage site.css
diff --git a/site/componentbuilder.php b/site/componentbuilder.php
index b41785e2c..478dc9576 100644
--- a/site/componentbuilder.php
+++ b/site/componentbuilder.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
diff --git a/site/controller.php b/site/controller.php
index f1b440a81..4dc815614 100644
--- a/site/controller.php
+++ b/site/controller.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage controller.php
diff --git a/site/controllers/api.php b/site/controllers/api.php
index 9a0bd51e5..71135c2aa 100644
--- a/site/controllers/api.php
+++ b/site/controllers/api.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage api.php
diff --git a/site/controllers/help.php b/site/controllers/help.php
index 8cbc26e2a..5d3e34ff5 100644
--- a/site/controllers/help.php
+++ b/site/controllers/help.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage help.php
diff --git a/site/helpers/category.php b/site/helpers/category.php
index 2bfaced90..13e470d66 100644
--- a/site/helpers/category.php
+++ b/site/helpers/category.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage category.php
diff --git a/site/helpers/categoryfields.php b/site/helpers/categoryfields.php
index 5f93170ac..2fab70514 100644
--- a/site/helpers/categoryfields.php
+++ b/site/helpers/categoryfields.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage categoryfields.php
diff --git a/site/helpers/categoryfieldtypes.php b/site/helpers/categoryfieldtypes.php
index 7d72348d8..263d0f6f0 100644
--- a/site/helpers/categoryfieldtypes.php
+++ b/site/helpers/categoryfieldtypes.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage categoryfieldtypes.php
diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php
index 57628f30f..b72713c5f 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/helpers/componentbuilder.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
@@ -32,6 +32,11 @@ defined('_JEXEC') or die('Restricted access');
abstract class ComponentbuilderHelper
{
+ /**
+ * The global params
+ **/
+ protected static $params = false;
+
/*
* get all component IDs
*/
@@ -200,31 +205,6 @@ abstract class ComponentbuilderHelper
fclose($fh);
return $klaar;
}
-
- /**
- * The user notice info File Name
- **/
- protected static $usernotice = false;
-
- /**
- * The backup hash file name
- **/
- protected static $backuphash = false;
-
- public static function getFilePath($type, $name = 'listing', $key = '', $fileType = '.json', $PATH = JPATH_COMPONENT_SITE)
- {
- if (!self::checkString(self::${$type.$name}))
- {
- // Get local key
- $localkey = self::getLocalKey();
- // set the name
- $fileName = md5($type.$name.$localkey.$key);
- // set file path
- self::${$type.$name} = $PATH.'/helpers/'.$fileName.$fileType;
- }
- // return the path
- return self::${$type.$name};
- }
public static function getFieldOptions($value, $type, $settings = array())
{
@@ -1153,13 +1133,13 @@ abstract class ComponentbuilderHelper
/**
* check if it is a new hash
**/
- public static function newHash($hash, $name = 'backup', $type = 'hash', $key = '', $fileType = '.txt')
+ public static function newHash($hash, $name = 'backup', $type = 'hash', $key = '', $fileType = 'txt')
{
// make sure we have a hash
if (self::checkString($hash))
{
// first get the file path
- $path_filename = self::getFilePath($name, $type, $key, $fileType, JPATH_COMPONENT_ADMINISTRATOR);
+ $path_filename = self::getFilePath('path', $name.$type, $fileType, $key, JPATH_COMPONENT_ADMINISTRATOR);
// set as read if not already set
if (($content = @file_get_contents($path_filename)) !== FALSE)
{
@@ -1173,6 +1153,71 @@ abstract class ComponentbuilderHelper
}
return false;
}
+
+ /**
+ * Get the file path or url
+ *
+ * @param string $type The (url/path) type to return
+ * @param string $target The Params Target name (if set)
+ * @param string $fileType The kind of filename to generate (if not set no file name is generated)
+ * @param string $key The key to adjust the filename (if not set ignored)
+ * @param string $default The default path if not set in Params (fallback path)
+ * @param bool $createIfNotSet The switch to create the folder if not found
+ *
+ * @return string On success the path or url is returned based on the type requested
+ *
+ */
+ public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = JPATH_SITE . '/images/', $createIfNotSet = true)
+ {
+ // get the global settings
+ if (!self::checkObject(self::$params))
+ {
+ self::$params = JComponentHelper::getParams('com_componentbuilder');
+ }
+ $filePath = self::$params->get($target, $default);
+ // check the file path (revert to default only of not a hidden file path)
+ if ('hiddenfilepath' !== $target && strpos($filePath, JPATH_SITE) === false)
+ {
+ $filePath = JPATH_SITE . '/images/';
+ }
+ jimport('joomla.filesystem.folder');
+ // create the folder if it does not exist
+ if ($createIfNotSet && !JFolder::exists($filePath))
+ {
+ JFolder::create($filePath);
+ }
+ // setup the file name
+ $fileName = '';
+ if (self::checkString($fileType))
+ {
+ // Get basic key
+ $basickey = 'Th!s_iS_n0t_sAfe_buT_b3tter_then_n0thiug';
+ if (method_exists(get_called_class(), "getCryptKey"))
+ {
+ $basickey = self::getCryptKey('basic', $basickey);
+ }
+ // check the key
+ if (self::checkString($key))
+ {
+ $key = 'vDm';
+ }
+ // set the name
+ $fileName = trim(md5($type.$target.$basickey.$key) . '.' . trim($fileType, '.'));
+ }
+ // return the url
+ if ($type === 'url')
+ {
+ if (strpos($filePath, JPATH_SITE) !== false)
+ {
+ $filePath = trim( str_replace( JPATH_SITE, '', $filePath), '/');
+ return JURI::root() . $filePath . '/' . $fileName;
+ }
+ // since the path is behind the root folder of the site, return only the root url (may be used to build the link)
+ return JURI::root();
+ }
+ // sanitize the path
+ return '/' . trim( $filePath, '/' ) . '/' . $fileName;
+ }
public static function jsonToString($value, $sperator = ", ", $table = null)
{
diff --git a/site/helpers/headercheck.php b/site/helpers/headercheck.php
index 8ed81d711..e46b98b5b 100644
--- a/site/helpers/headercheck.php
+++ b/site/helpers/headercheck.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage headercheck.php
diff --git a/site/helpers/route.php b/site/helpers/route.php
index bb363f1d7..97d986228 100644
--- a/site/helpers/route.php
+++ b/site/helpers/route.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage route.php
diff --git a/site/router.php b/site/router.php
index 65b1bf1eb..163f2cb2f 100644
--- a/site/router.php
+++ b/site/router.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage router.php
diff --git a/site/views/api/submitbutton.js b/site/views/api/submitbutton.js
index c9a464aac..db308f587 100644
--- a/site/views/api/submitbutton.js
+++ b/site/views/api/submitbutton.js
@@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.1
- @build 23rd August, 2017
+ @version 2.5.2
+ @build 25th August, 2017
@created 30th April, 2015
@package Component Builder
@subpackage submitbutton.js