diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ab8aad6f..8898cc1c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,4 @@ -# v3.2.3-beta4 - -- Add native plugin builder for Joomla 4 & 5 - -# v3.2.3-beta - -- Fix abstract schema class function check default index warring -- Fix dynamicGet so that the table values will load again. #1155 -- Keep jQuery in dynamicGet area for Joomla 3 - -# v3.2.3-alpha +# v3.2.3 - Fix site view form missing classes in J4+ - Fix permissions tab in items in J4+ @@ -21,7 +11,12 @@ - Fix helper area - Fix database mySql update in J4+ - Remove phpspreadsheet completely from Joomla 4+ -- Add option to use powers in preflight event in the installer class +- Add option to use powers in preflight event in the installer class +- Fix abstract schema class function check default index warring +- Fix dynamicGet so that the table values will load again. #1155 +- Keep jQuery in dynamicGet area for Joomla 3 +- Add native plugin builder for Joomla 4 & 5 +- Add basic API for admin views # v3.2.2 diff --git a/README.md b/README.md index edb4b893c..9c2e9262d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.3-beta4) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.3) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th August, 2024 -+ *Version*: 3.2.3-beta4 ++ *Last Build*: 16th August, 2024 ++ *Version*: 3.2.3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **831479** -+ *Field count*: **2093** -+ *File count*: **5672** ++ *Line count*: **831771** ++ *Field count*: **2094** ++ *File count*: **5670** + *Folder count*: **496** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index edb4b893c..9c2e9262d 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.3-beta4) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.3) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,13 +144,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 14th August, 2024 -+ *Version*: 3.2.3-beta4 ++ *Last Build*: 16th August, 2024 ++ *Version*: 3.2.3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **831479** -+ *Field count*: **2093** -+ *File count*: **5672** ++ *Line count*: **831771** ++ *Field count*: **2094** ++ *File count*: **5670** + *Folder count*: **496** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 65da0ce8b..a7c86d4c5 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -2224,6 +2224,8 @@ COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_DESCRIPTION="Setup the COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDADMIN_VIEWS_LABEL="Admin Views" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDMENU="Add+Menu" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADDRESS="Address" +COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADD_API_DESCRIPTION="add API option to this admin view. (only Joomla 4+)" +COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADD_API_LABEL="API" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW="Adminview" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW_DESCRIPTION="Select an admin view" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ADMINVIEW_LABEL="View" @@ -2254,6 +2256,7 @@ COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BASKET="Basket" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BOOK="Book" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BOOKMARK="Bookmark" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BOOKMARK_2="Bookmark 2" +COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BOTH="Both" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BOX_ADD="Box Add" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BOX_REMOVE="Box Remove" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_BRIEFCASE="Briefcase" @@ -2356,6 +2359,7 @@ COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_IMAGE="Image" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_IMAGES="Images" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_INFO="Info" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_INFO_CIRCLE="Info Circle" +COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ITEM="Item" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_JOOMLA="Joomla" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_JOOMLA_COMPONENT_LABEL="Component" diff --git a/admin/models/forms/component_admin_views.xml b/admin/models/forms/component_admin_views.xml index b2d6196fe..6b5918279 100644 --- a/admin/models/forms/component_admin_views.xml +++ b/admin/models/forms/component_admin_views.xml @@ -677,6 +677,24 @@ description="COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_PORT_DESCRIPTION" class="inputbox" /> + + + + + + + + COM_COMPONENTBUILDER - 14th August, 2024 + 16th August, 2024 Llewellyn van der Merwe joomla@vdm.io https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 3.2.3-beta4 + 3.2.3 Component Builder (v.3.2.3-beta4) +

Component Builder (v.3.2.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 ddc6be6b1..9b292b4dd 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -166,49 +166,13 @@ pkg_component_builder package site - 3.2.3-alpha + 3.2.3 https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.3-alpha3.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.3.zip - alpha - - Llewellyn van der Merwe - https://dev.vdm.io - - - - Component Builder - Builds Complex Joomla Components - pkg_component_builder - package - site - 3.2.3-beta - https://dev.vdm.io - - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.3-beta4.zip - - - beta - - Llewellyn van der Merwe - https://dev.vdm.io - - - - Component Builder - Builds Complex Joomla Components - pkg_component_builder - package - site - 3.2.3-beta4 - https://dev.vdm.io - - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.3-beta4.zip - - - beta + stable Llewellyn van der Merwe https://dev.vdm.io diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php index 45f11cf58..e2c97785d 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Component/Structuremultiple.php @@ -157,6 +157,7 @@ final class Structuremultiple $config = []; $checkin = false; + $api = null; foreach ($this->component->get('admin_views') as $view) { @@ -174,8 +175,16 @@ final class Structuremultiple $checkin = true; $this->config->set('add_checkin', $checkin); } + + if (($target = $this->hasApi($view)) > 0) + { + $this->buildApi($view, $config, $target); + $api = 1; + } } + $this->config->set('add_api', $api); + return true; } @@ -265,6 +274,25 @@ final class Structuremultiple return true; } + /** + * Check if the view has an API + * + * @param array $view + * + * @return int + * @since 5.0.2 + */ + private function hasApi(array $view): int + { + // only for Joomla 4 and above + if ($this->config->get('joomla_version', 3) < 4 || !isset($view['add_api'])) + { + return 0; + } + + return (int) $view['add_api']; + } + /** * Check if the view is a valid view * @@ -333,6 +361,35 @@ final class Structuremultiple } } + /** + * Build the api + * + * @param array $view + * @param array $config + * @param int $targetArea + * + * @return void + * @since 5.0.2 + */ + private function buildApi(array $view, array $config, int $targetArea) + { + $settings = $view['settings']; + + // build the api + if ($settings->name_single != 'null' && $targetArea !== 1) + { + $target = ['api' => $settings->name_single]; + $this->structure->build($target, 'single', false, $config); + } + + // build the list view + if ($settings->name_list != 'null' && $targetArea !== 3) + { + $target = ['api' => $settings->name_list]; + $this->structure->build($target, 'list', false, $config); + } + } + /** * Build the custom view * diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Compiler.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Compiler.php index 6dc5f2592..2c31fff2e 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Compiler.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Compiler.php @@ -132,6 +132,12 @@ class Compiler extends Infusion ); CFactory::_('Utilities.File')->write($xmlPath, $componentXML); } + // remove API + if (CFactory::_('Config')->get('add_api') === null) + { + // first remove the files and folders + CFactory::_('Utilities.Folder')->remove(CFactory::_('Utilities.Paths')->component_path . '/api'); + } // Trigger Event: jcb_ce_onBeforeUpdateFiles CFactory::_('Event')->trigger( diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php index ae449d815..c71a30684 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/Helper/Infusion.php @@ -668,6 +668,7 @@ class Infusion extends Interpretation $nameSingleCode ) ); + // ADMIN_VIEW_MODEL_HEADER <<>> add the header details for the model CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|ADMIN_VIEW_MODEL_HEADER', CFactory::_('Header')->get( @@ -687,6 +688,22 @@ class Infusion extends Interpretation ) ); + // API_VIEW_CONTROLLER_HEADER <<>> add the header details for the controller + CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|API_VIEW_CONTROLLER_HEADER', + CFactory::_('Header')->get( + 'api.view.controller', + $nameSingleCode + ) + ); + + // API_VIEW_JSON_HEADER <<>> add the header details for the controller + CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|API_VIEW_JSON_HEADER', + CFactory::_('Header')->get( + 'api.view.json', + $nameSingleCode + ) + ); + // JQUERY <<>> CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|JQUERY', $this->setJquery( @@ -1028,6 +1045,20 @@ class Infusion extends Interpretation ) ); + // API_VIEWS_CONTROLLER_HEADER <<>> add the header details for the controller + CFactory::_('Compiler.Builder.Content.Multi')->set($nameListCode . '|API_VIEWS_CONTROLLER_HEADER', + CFactory::_('Header')->get( + 'api.views.controller', $nameListCode + ) + ); + + // API_VIEWS_JSON_HEADER <<>> add the header details for the controller + CFactory::_('Compiler.Builder.Content.Multi')->set($nameListCode . '|API_VIEWS_JSON_HEADER', + CFactory::_('Header')->get( + 'api.views.json', $nameListCode + ) + ); + // JQUERY <<>> CFactory::_('Compiler.Builder.Content.Multi')->set($nameListCode . '|JQUERY', $this->setJquery( diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php index a574ddd36..58576bb7c 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFive/Header.php @@ -565,6 +565,20 @@ final class Header implements HeaderInterface $headers[] = 'use Joomla\DI\Container;'; break; + case 'api.view.controller': + case 'api.views.controller': + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\ApiController;'; + break; + + case 'api.view.json': + case 'api.views.json': + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\MVC\View\JsonApiView as BaseApiView;'; + break; + default: break; } diff --git a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php index 42e8d5c3c..5c24e8f90 100644 --- a/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php +++ b/libraries/vendor_jcb/VDM.Joomla/src/Componentbuilder/Compiler/JoomlaFour/Header.php @@ -565,6 +565,20 @@ final class Header implements HeaderInterface $headers[] = 'use Joomla\DI\Container;'; break; + case 'api.view.controller': + case 'api.views.controller': + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\MVC\Controller\ApiController;'; + break; + + case 'api.view.json': + case 'api.views.json': + $headers = []; + $headers[] = 'use Joomla\CMS\Factory;'; + $headers[] = 'use Joomla\CMS\MVC\View\JsonApiView as BaseApiView;'; + break; + default: break; } diff --git a/script.php b/script.php index ad8aa09cb..3e33e2aad 100644 --- a/script.php +++ b/script.php @@ -10001,7 +10001,7 @@ class Com_ComponentbuilderInstallerScript echo '

-

Upgrade to Version 3.2.3-beta4 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 3.2.3 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db))