Component Builder (v.3.1.26)
+ Component Builder (v.3.1.27)
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 3114fb0e6..815317423 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -1199,4 +1199,22 @@
https://dev.vdm.io
+
+ Component Builder
+ Builds Complex Joomla Components
+ pkg_component_builder
+ package
+ site
+ 3.1.27
+ https://dev.vdm.io
+
+ https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.1.27.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ https://dev.vdm.io
+
+
\ No newline at end of file
diff --git a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Abstraction/Api.php b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Abstraction/Api.php
index 912af825d..7d57da4f5 100644
--- a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Abstraction/Api.php
+++ b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Abstraction/Api.php
@@ -85,6 +85,16 @@ abstract class Api
$this->http->setToken($token);
}
}
-
+
+ /**
+ * Get the API url
+ *
+ * @return string
+ * @since 3.2.0
+ **/
+ public function api()
+ {
+ return $this->uri->api();
+ }
}
diff --git a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Service/Jcb.php b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Service/Jcb.php
index 8f358a3e9..783527505 100644
--- a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Service/Jcb.php
+++ b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Service/Jcb.php
@@ -58,7 +58,7 @@ class Jcb implements ServiceProviderInterface
$gitea_url = Helper::getParams('com_componentbuilder')->get('custom_gitea_url');
// only load this if we have a custom URL set
- if ($add_gitea_url == 2 && is_string($gitea_url) && strpos($gitea_url, 'http') !== false)
+ if ($add_gitea_url == 2 && !empty($gitea_url) && strpos($gitea_url, 'http') !== false)
{
return new Uri($gitea_url);
}
diff --git a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Http.php b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Http.php
index 7f0b817b6..763308e69 100644
--- a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Http.php
+++ b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Http.php
@@ -72,7 +72,6 @@ final class Http extends JoomlaHttp
$headers['Authorization'] = 'token ' . $token;
$this->setOption('headers', $headers);
- }
-
+ }
}
diff --git a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Uri.php b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Uri.php
index 406caec67..8755b7b7b 100644
--- a/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Uri.php
+++ b/libraries/jcb_powers/VDM.Joomla.Gitea/src/Utilities/Uri.php
@@ -134,7 +134,6 @@ final class Uri
private function setVersion($version)
{
$this->version = $version;
- }
-
+ }
}
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php
index e08f68c10..475959753 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Config.php
@@ -111,6 +111,73 @@ class Config extends BaseConfig
return null;
}
+ /**
+ * Get super power core organisation
+ *
+ * @return string The super power core organisation
+ * @since 3.2.0
+ */
+ protected function getSuperpowerscoreorganisation(): string
+ {
+ // the VDM default organisation is [joomla]
+ $organisation = 'joomla';
+
+ if ($this->add_custom_gitea_url == 2)
+ {
+ return $this->params->get('super_powers_core_organisation', $organisation);
+ }
+
+ return $organisation;
+ }
+
+ /**
+ * Get super power core repos
+ *
+ * @return array The core repositories on Gitea
+ * @since 3.2.0
+ */
+ protected function getSuperpowerscorerepos(): array
+ {
+ // some defaults repos we need by JCB
+ $repos = [];
+
+ // only add custom init with custom gitea
+ $paths = null;
+ if ($this->add_custom_gitea_url == 2)
+ {
+ $paths = $this->params->get('super_powers_core_repos');
+ }
+
+ if (!empty($paths) && is_array($paths))
+ {
+ foreach ($paths as $path)
+ {
+ $owner = $path->owner ?? null;
+ $repo = $path->repo ?? null;
+ if ($owner !== null && $repo !== null)
+ {
+ // we make sure to get only the objects
+ $repos = ["{$owner}.{$repo}" => $path] + $repos;
+ }
+ }
+ }
+ else
+ {
+ $repos[$this->super_powers_core_organisation . '.super-powers'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'super-powers', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.jcb-compiler'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'jcb-compiler', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.jcb-packager'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'jcb-packager', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.phpseclib'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'phpseclib', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.search'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'search', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.gitea'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'gitea', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.openai'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'openai', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.minify'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'minify', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.psr'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'psr', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.fof'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'fof', 'branch' => 'master'];
+ }
+
+ return $repos;
+ }
+
/**
* get add contributors switch
*
@@ -630,20 +697,11 @@ class Config extends BaseConfig
protected function getApprovedpaths(): array
{
// some defaults repos we need by JCB
- $approved = [];
- $approved['joomla.super-powers'] = (object) ['owner' => 'joomla', 'repo' => 'super-powers', 'branch' => 'master'];
- $approved['joomla.jcb-compiler'] = (object) ['owner' => 'joomla', 'repo' => 'jcb-compiler', 'branch' => 'master'];
- $approved['joomla.phpseclib'] = (object) ['owner' => 'joomla', 'repo' => 'phpseclib', 'branch' => 'master'];
- $approved['joomla.search'] = (object) ['owner' => 'joomla', 'repo' => 'search', 'branch' => 'master'];
- $approved['joomla.gitea'] = (object) ['owner' => 'joomla', 'repo' => 'gitea', 'branch' => 'master'];
- $approved['joomla.openai'] = (object) ['owner' => 'joomla', 'repo' => 'openai', 'branch' => 'master'];
- $approved['joomla.minify'] = (object) ['owner' => 'joomla', 'repo' => 'minify', 'branch' => 'master'];
- $approved['joomla.psr'] = (object) ['owner' => 'joomla', 'repo' => 'psr', 'branch' => 'master'];
- $approved['joomla.fof'] = (object) ['owner' => 'joomla', 'repo' => 'fof', 'branch' => 'master'];
+ $approved = $this->super_powers_core_repos;
if (!$this->add_own_powers)
{
- return $approved;
+ return array_values($approved);
}
$paths = $this->params->get('approved_paths');
@@ -762,6 +820,7 @@ class Config extends BaseConfig
{
// get posted value
$value = $this->input->post->get('add_placeholders', 2, 'INT');
+
// get global value
if ($value > 1)
{
@@ -780,6 +839,7 @@ class Config extends BaseConfig
{
// get posted value
$value = $this->input->post->get('powers', 2, 'INT');
+
// get global value
if ($value > 1)
{
@@ -945,7 +1005,6 @@ class Config extends BaseConfig
protected function getFootableversion(): int
{
return 2; // default is version 2
- }
-
+ }
}
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Config.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Config.php
index 7517cb02c..8e0085333 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Config.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Config.php
@@ -111,6 +111,66 @@ class Config extends BaseConfig
return null;
}
+ /**
+ * Get super power core organisation
+ *
+ * @return string The super power core organisation
+ * @since 3.2.0
+ */
+ protected function getSuperpowerscoreorganisation(): string
+ {
+ // the VDM default organisation is [joomla]
+ $organisation = 'joomla';
+
+ if ($this->add_custom_gitea_url == 2)
+ {
+ return $this->params->get('super_powers_core_organisation', $organisation);
+ }
+
+ return $organisation;
+ }
+
+ /**
+ * Get super power init repos
+ *
+ * @return array The init repositories on Gitea
+ * @since 3.2.0
+ */
+ protected function getSuperpowersinitrepos(): array
+ {
+ // some defaults repos we need by JCB
+ $repos = [];
+
+ // only add custom init with custom gitea
+ $paths = null;
+ if ($this->add_custom_gitea_url == 2)
+ {
+ $paths = $this->params->get('super_powers_init_repos');
+ }
+
+ if (!empty($paths) && is_array($paths))
+ {
+ foreach ($paths as $path)
+ {
+ $owner = $path->owner ?? null;
+ $repo = $path->repo ?? null;
+ if ($owner !== null && $repo !== null)
+ {
+ // we make sure to get only the objects
+ $repos = ["{$owner}.{$repo}" => $path] + $repos;
+ }
+ }
+ }
+ else
+ {
+ $repos[$this->super_powers_core_organisation . '.super-powers'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'super-powers', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.gitea'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'gitea', 'branch' => 'master'];
+ $repos[$this->super_powers_core_organisation . '.openai'] = (object) ['owner' => $this->super_powers_core_organisation, 'repo' => 'openai', 'branch' => 'master'];
+ }
+
+ return $repos;
+ }
+
/**
* get temporary path
*
@@ -177,10 +237,7 @@ class Config extends BaseConfig
protected function getApprovedpaths(): array
{
// some defaults repos we need by JCB
- $approved = [];
- $approved['joomla.super-powers'] = (object) ['owner' => 'joomla', 'repo' => 'super-powers', 'branch' => 'master'];
- $approved['joomla.gitea'] = (object) ['owner' => 'joomla', 'repo' => 'gitea', 'branch' => 'master'];
- $approved['joomla.openai'] = (object) ['owner' => 'joomla', 'repo' => 'openai', 'branch' => 'master'];
+ $approved = $this->super_powers_init_repos;
if (!$this->add_own_powers)
{
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Grep.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Grep.php
index 84d7d87ca..709036fd9 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Grep.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Grep.php
@@ -347,7 +347,7 @@ final class Grep
catch (\Exception $e)
{
$this->app->enqueueMessage(
- Text::sprintf('COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BGITVDMDEVSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $path->path, $e->getMessage()),
+ Text::sprintf('COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path->path, $e->getMessage()),
'Error'
);
@@ -375,7 +375,7 @@ final class Grep
catch (\Exception $e)
{
$this->app->enqueueMessage(
- Text::sprintf('COM_COMPONENTBUILDER_PFILE_AT_BGITEAREMOTESB_GAVE_THE_FOLLOWING_ERRORBR_SP', $path, $e->getMessage()),
+ Text::sprintf('COM_COMPONENTBUILDER_PFILE_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path, $e->getMessage()),
'Error'
);
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/Gitea.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/Gitea.php
index ca1d6f39a..a4299c614 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/Gitea.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/Gitea.php
@@ -57,7 +57,7 @@ class Gitea implements ServiceProviderInterface
$gitea_url = $container->get('Config')->get('custom_gitea_url');
// only load this if we have a custom URL set
- if ($add_gitea_url == 2 && is_string($gitea_url) && strpos($gitea_url, 'http') !== false)
+ if ($add_gitea_url == 2 && !empty($gitea_url) && strpos($gitea_url, 'http') !== false)
{
return new Uri($gitea_url);
}
diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/FieldHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/FieldHelper.php
index 0f687b621..00a44d2b3 100644
--- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/FieldHelper.php
+++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/FieldHelper.php
@@ -12,7 +12,6 @@
namespace VDM\Joomla\Utilities\String;
-use Joomla\CMS\Component\ComponentHelper;
use VDM\Joomla\Utilities\StringHelper;
use VDM\Joomla\Utilities\Component\Helper;
@@ -97,7 +96,6 @@ abstract class FieldHelper
// use the default (original behavior/convention)
return StringHelper::safe($string);
- }
-
+ }
}
diff --git a/libraries/jcb_powers/VDM.Joomla/src/index.html b/libraries/jcb_powers/VDM.Joomla/src/index.html
deleted file mode 100644
index fa6d84e80..000000000
--- a/libraries/jcb_powers/VDM.Joomla/src/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/script.php b/script.php
index 8d72d7e9a..31c188a66 100644
--- a/script.php
+++ b/script.php
@@ -6746,7 +6746,7 @@ class com_componentbuilderInstallerScript
$query = $db->getQuery(true);
// Field to update.
$fields = array(
- $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","super_powers_documentation":"0","powers_repository":"0","super_powers_repositories":"0","approved_paths":"default","add_custom_gitea_url":"1","custom_gitea_url":"https://git.vdm.dev","super_powers_core":"joomla/super-powers","builder_gif_size":"480-272","compiler_plugin":["componentbuilderactionlogcompiler","componentbuilderfieldorderingcompiler","componentbuilderheaderscompiler","componentbuilderpowersautoloadercompiler","componentbuilderprivacycompiler"],"add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","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","add_jquery_framework":"1","uikit_load":"1","uikit_min":"","uikit_style":""}'),
+ $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","super_powers_documentation":"0","powers_repository":"0","super_powers_repositories":"0","approved_paths":"default","add_custom_gitea_url":"1","custom_gitea_url":"https://git.vdm.dev","super_powers_core_organisation":"joomla","super_powers_core":"joomla/super-powers","builder_gif_size":"480-272","compiler_plugin":["componentbuilderactionlogcompiler","componentbuilderfieldorderingcompiler","componentbuilderheaderscompiler","componentbuilderpowersautoloadercompiler","componentbuilderprivacycompiler"],"add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","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","add_jquery_framework":"1","uikit_load":"1","uikit_min":"","uikit_style":""}'),
);
// Condition.
$conditions = array(
@@ -9437,7 +9437,7 @@ class com_componentbuilderInstallerScript
echo '
- Upgrade to Version 3.1.26 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 3.1.27 Was Successful! Let us know if anything is not working as expected.
';
// Set db if not set already.
if (!isset($db))
diff --git a/site/language/en-GB/en-GB.com_componentbuilder.ini b/site/language/en-GB/en-GB.com_componentbuilder.ini
index 32d6dac9c..f6d3fcaa2 100644
--- a/site/language/en-GB/en-GB.com_componentbuilder.ini
+++ b/site/language/en-GB/en-GB.com_componentbuilder.ini
@@ -82,11 +82,11 @@ COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS="Package Owner Details"
COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND="Package owner details not found!"
COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET="Package Owner Not Set"
COM_COMPONENTBUILDER_PAIDLOCKED="Paid/Locked"
-COM_COMPONENTBUILDER_PFILE_AT_BGITEAREMOTESB_GAVE_THE_FOLLOWING_ERRORBR_SP="File at gitea.remote/%s gave the following error!
%s
"
+COM_COMPONENTBUILDER_PFILE_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="File at %s/%s gave the following error!
%s
"
COM_COMPONENTBUILDER_PLUGIN="Plugin"
COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP="Power guid:%s not found!
"
COM_COMPONENTBUILDER_PROPERTY="Property"
-COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BGITVDMDEVSB_GAVE_THE_FOLLOWING_ERRORBR_SP="Super Power repository at git.vdm.dev/%s gave the following error!
%s
"
+COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="Super Power repository at %s/%s gave the following error!
%s
"
COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDING_FILE_NAME_IN_THE_NAMESPACE_IS_BSB_THIS_IS_BAD_CONVENTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPA_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="%s naming mismatch error (%s)
The %s name is %s and the ending file name in the namespace is %s. This is bad convention, please see psr-4 for more info.
Click here to fix this issue.
"
COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S="%s
You can add a gitHub Access Token to Componentbuilder global options to make authenticated requests to gitHub. An access token with only public access will do to retrieve %s."
COM_COMPONENTBUILDER_SELECT_EXTENSION="Select Extension"