Component Builder (v.2.7.6)
+ Component Builder (v.2.7.7)
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 e6e3ef180..14c0ca072 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -344,10 +344,10 @@
Builds Complex Joomla Components
com_componentbuilder
component
- 2.7.6
+ 2.7.7
http://joomlacomponentbuilder.com
- https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.7.6/JCB_v2.7.6.zip
+ https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.7.7/JCB_v2.7.7.zip
stable
diff --git a/script.php b/script.php
index b4b18579d..2c10d9efe 100644
--- a/script.php
+++ b/script.php
@@ -3692,7 +3692,7 @@ class com_componentbuilderInstallerScript
$query = $db->getQuery(true);
// Field to update.
$fields = array(
- $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","minify":"0","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","set_browser_storage":"1","storage_time_to_live":"global","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'),
+ $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"llewellyn@joomlacomponentbuilder.com","manage_jcb_package_directories":"2","add_menu_prefix":"1","menu_prefix":"»","minify":"0","set_browser_storage":"1","storage_time_to_live":"global","language":"en-GB","percentagelanguageadd":"50","compiler_field_builder_type":"2","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'),
);
// Condition.
$conditions = array(
@@ -4878,7 +4878,7 @@ class com_componentbuilderInstallerScript
echo '
- Upgrade to Version 2.7.6 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 2.7.7 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 85534fe73..fc7883f75 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/helpers/componentbuilder.php
@@ -68,10 +68,16 @@ abstract class ComponentbuilderHelper
public static $snippetsPath = 'https://api.github.com/repos/vdm-io/Joomla-Component-Builder-Snippets/git/trees/master';
/**
- * The packages paths
+ * The VDM packages paths
**/
- public static $jcbGithubPackagesUrl = "https://api.github.com/repos/vdm-io/JCB-Packages/git/trees/master";
- public static $jcbGithubPackageUrl = "https://github.com/vdm-io/JCB-Packages/raw/master/";
+ public static $vdmGithubPackagesUrl = "https://api.github.com/repos/vdm-io/JCB-Packages/git/trees/master";
+ public static $vdmGithubPackageUrl = "https://github.com/vdm-io/JCB-Packages/raw/master/";
+
+ /**
+ * The JCB packages paths
+ **/
+ public static $jcbGithubPackagesUrl = "https://api.github.com/repos/vdm-io/JCB-Community-Packages/git/trees/master";
+ public static $jcbGithubPackageUrl = "https://github.com/vdm-io/JCB-Community-Packages/raw/master/";
// not needed at this time (maybe latter)
public static $accessToken = "";
@@ -2035,6 +2041,168 @@ abstract class ComponentbuilderHelper
}
return false;
}
+
+ protected static $pkOwnerSearch = array(
+ 'company' => 'COM_COMPONENTBUILDER_EMCOMPANYEM_BSB',
+ 'owner' => 'COM_COMPONENTBUILDER_EMOWNEREM_BSB',
+ 'website' => 'COM_COMPONENTBUILDER_EMWEBSITEEM_BSB',
+ 'email' => 'COM_COMPONENTBUILDER_EMEMAILEM_BSB',
+ 'license' => 'COM_COMPONENTBUILDER_EMLICENSEEM_BSB',
+ 'copyright' => 'COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB'
+ );
+
+ /**
+ * get the JCB package owner details display
+ **/
+ public static function getPackageOwnerDetailsDisplay(&$info, $trust = false)
+ {
+ $hasOwner = false;
+ $ownerDetails = '';
+ $ownerDetails .= '';
+ // load the list items
+ foreach (self::$pkOwnerSearch as $key => $li)
+ {
+ if ($value = self::getPackageOwnerValue($key, $info))
+ {
+ $ownerDetails .= '- ' . JText::sprintf($li, $value) . '
';
+ // check if we have a owner/source name
+ if (('owner' === $key || 'company' === $key) && !$hasOwner)
+ {
+ $hasOwner = true;
+ $owner = $value;
+ }
+ }
+ }
+ $ownerDetails .= '
';
+
+ // provide some details to how the user can get a key
+ if ($hasOwner && isset($info['getKeyFrom']['buy_link']) && self::checkString($info['getKeyFrom']['buy_link']))
+ {
+ $ownerDetails .= '
';
+ $ownerDetails .= JText::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_CLASSBTN_BTNPRIMARY_HREFS_TARGET_BLANK_TITLEGET_A_KEY_FROM_SSA', $info['getKeyFrom']['buy_link'], $owner, $owner);
+ }
+ // add more custom links
+ elseif ($hasOwner && isset($info['getKeyFrom']['buy_links']) && self::checkArray($info['getKeyFrom']['buy_links']))
+ {
+ $buttons = array();
+ foreach ($info['getKeyFrom']['buy_links'] as $keyName => $link)
+ {
+ $buttons[] = JText::sprintf('COM_COMPONENTBUILDER_GET_THE_KEY_FROM_BSB_FOR_A_CLASSBTN_BTNPRIMARY_HREFS_TARGET_BLANK_TITLEGET_A_KEY_FROM_SSA', $owner, $link, $owner, $keyName);
+ }
+ $ownerDetails .= '
';
+ $ownerDetails .= implode('
', $buttons);
+ }
+ // return the owner details
+ if (!$hasOwner)
+ {
+ $ownerDetails = '' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '
';
+ if (!$trust)
+ {
+ $ownerDetails .= '' . JText::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '
';
+ }
+ }
+ return $ownerDetails;
+ }
+
+ public static function getPackageOwnerValue($key, &$info)
+ {
+ $source = (isset($info['source']) && isset($info['source'][$key])) ? 'source' : ((isset($info['getKeyFrom']) && isset($info['getKeyFrom'][$key])) ? 'getKeyFrom' : false);
+ if ($source && self::checkString($info[$source][$key]))
+ {
+ return $info[$source][$key];
+ }
+ return false;
+ }
+
+ /**
+ * get the JCB package component key status
+ **/
+ public static function getPackageComponentsKeyStatus(&$info)
+ {
+ // check the package key status
+ if (!isset($info['key']))
+ {
+ if (isset($info['getKeyFrom']) && isset($info['getKeyFrom']['owner']))
+ {
+ // this just confirms it for older packages
+ $info['key'] = true;
+ }
+ else
+ {
+ // this just confirms it for older packages
+ $info['key'] = false;
+ }
+ }
+ return $info['key'];
+ }
+
+ /**
+ * get the JCB package component details display
+ **/
+ public static function getPackageComponentsDetailsDisplay(&$info)
+ {
+ // check if these components need a key
+ $needKey = self::getPackageComponentsKeyStatus($info);
+ if (isset($info['name']) && self::checkArray($info['name']))
+ {
+ $cAmount = count((array) $info['name']);
+ $class2 = ($cAmount == 1) ? 'span12' : 'span6';
+ $counter = 1;
+ $display = array();
+ foreach ($info['name'] as $key => $value)
+ {
+ if ($cAmount > 1 && $counter == 3)
+ {
+ $display[] = '