From 9781910dd368fc8f9fce9960e35d9d3b865ee54d Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Mon, 2 Sep 2019 10:27:11 +0200 Subject: [PATCH] Added option to pass user object to getActions helper method. --- README.md | 8 ++++---- admin/README.txt | 8 ++++---- admin/compiler/joomla_3/Helper.php | 11 ++++++++--- admin/compiler/joomla_3/Helper_site.php | 11 ++++++++--- admin/helpers/componentbuilder.php | 11 ++++++++--- componentbuilder.xml | 6 +++--- componentbuilder_update_server.xml | 4 ++-- script.php | 2 +- site/helpers/componentbuilder.php | 11 ++++++++--- 9 files changed, 46 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 722fbb7c6..c8bd84855 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,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 safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.0) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.1) 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) @@ -146,11 +146,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th August, 2019 -+ *Version*: 2.10.0 ++ *Last Build*: 2nd September, 2019 ++ *Version*: 2.10.1 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **250837** ++ *Line count*: **250924** + *Field count*: **1343** + *File count*: **1608** + *Folder count*: **253** diff --git a/admin/README.txt b/admin/README.txt index 722fbb7c6..c8bd84855 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,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 safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.0) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.1) 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) @@ -146,11 +146,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th August, 2019 -+ *Version*: 2.10.0 ++ *Last Build*: 2nd September, 2019 ++ *Version*: 2.10.1 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **250837** ++ *Line count*: **250924** + *Field count*: **1343** + *File count*: **1608** + *Folder count*: **253** diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index 30b8391bf..843e76d0c 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -308,14 +308,19 @@ abstract class ###Component###Helper * @param string $views The related list view name * @param mixed $target Only get this permission (like edit, create, delete) * @param string $component The target component + * @param object $user The user whose permissions we are loading * * @return object The JObject of permission/authorised actions * **/ - public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###') + public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') { - // get the user object - $user = JFactory::getUser(); + // load the user if not given + if (!self::checkObject($user)) + { + // get the user object + $user = JFactory::getUser(); + } // load the JObject $result = new JObject; // make view name safe (just incase) diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index cd0f87c48..6ea715db8 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -654,14 +654,19 @@ abstract class ###Component###Helper * @param string $views The related list view name * @param mixed $target Only get this permission (like edit, create, delete) * @param string $component The target component + * @param object $user The user whose permissions we are loading * * @return object The JObject of permission/authorised actions * **/ - public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###') + public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') { - // get the user object - $user = JFactory::getUser(); + // load the user if not given + if (!self::checkObject($user)) + { + // get the user object + $user = JFactory::getUser(); + } // load the JObject $result = new JObject; // make view name safe (just incase) diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 9f35ace27..5e837af7e 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -5942,14 +5942,19 @@ abstract class ComponentbuilderHelper * @param string $views The related list view name * @param mixed $target Only get this permission (like edit, create, delete) * @param string $component The target component + * @param object $user The user whose permissions we are loading * * @return object The JObject of permission/authorised actions * **/ - public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder') + public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder', $user = 'null') { - // get the user object - $user = JFactory::getUser(); + // load the user if not given + if (!self::checkObject($user)) + { + // get the user object + $user = JFactory::getUser(); + } // load the JObject $result = new JObject; // make view name safe (just incase) diff --git a/componentbuilder.xml b/componentbuilder.xml index 2a6a6c6cd..d22bbe527 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 28th August, 2019 + 2nd September, 2019 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 2.10.0 + 2.10.1 Component Builder (v.2.10.0) +

Component Builder (v.2.10.1)

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 91f1ddcc8..f68366b84 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -803,10 +803,10 @@ Builds Complex Joomla Components com_componentbuilder component - 2.10.0 + 2.10.1 http://www.joomlacomponentbuilder.com - https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.0/JCB_v2.10.0.zip + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.10.1/JCB_v2.10.1.zip stable diff --git a/script.php b/script.php index c9a736172..f4219a64f 100644 --- a/script.php +++ b/script.php @@ -7637,7 +7637,7 @@ class com_componentbuilderInstallerScript echo ' -

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

'; +

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

'; // Create the componentbuilder action logs extensions object. $componentbuilder_action_logs_extensions = new stdClass(); diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index 8fb06b96d..b7b8b8d7a 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -6022,14 +6022,19 @@ abstract class ComponentbuilderHelper * @param string $views The related list view name * @param mixed $target Only get this permission (like edit, create, delete) * @param string $component The target component + * @param object $user The user whose permissions we are loading * * @return object The JObject of permission/authorised actions * **/ - public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder') + public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder', $user = 'null') { - // get the user object - $user = JFactory::getUser(); + // load the user if not given + if (!self::checkObject($user)) + { + // get the user object + $user = JFactory::getUser(); + } // load the JObject $result = new JObject; // make view name safe (just incase)