Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
714cb5588a
|
|||
c103c93e06
|
|||
112961dabf
|
|||
9d7ab17df6
|
|||
5a1ad16c9e
|
|||
6c2f52f59f
|
|||
209f625923
|
|||
3ca5548481
|
|||
4bed7a52da
|
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,3 +1,25 @@
|
|||||||
|
# v3.2.4
|
||||||
|
|
||||||
|
- Add [push] option to Powers area.
|
||||||
|
- Fix [Save As Copy] error in library. #1162
|
||||||
|
- Fix error when no components exist. #1164
|
||||||
|
- Fix search page error caused by File class.
|
||||||
|
- Fix UserGroupList compiler triggers. #1100
|
||||||
|
- Add Power field type integration: init, reset, push.
|
||||||
|
- Fix database default fields to allow NULL. #1169
|
||||||
|
- Fix Power List field to allow searching. #1167
|
||||||
|
- Remove Demo component from JCB v3; add Hello World component as demo.
|
||||||
|
- Fix missing working path in ZIP.
|
||||||
|
- Fix demo site view to display files.
|
||||||
|
- Fix message for Field Type init.
|
||||||
|
- Ensure type-agnostic comparisons by casting to CHAR in joins for dynamic retrieval.
|
||||||
|
- Fix dynamic download in site area with correct namespace.
|
||||||
|
- Fix missing edit button on fields in related views.
|
||||||
|
- Fix dashboard display issues.
|
||||||
|
- Re-add search option in use field of related views.
|
||||||
|
- Fix namespace issue that broke the linker.
|
||||||
|
|
||||||
|
|
||||||
# v3.2.3
|
# v3.2.3
|
||||||
|
|
||||||
- Fix site view form missing classes in J4+
|
- Fix site view form missing classes in J4+
|
||||||
|
16
README.md
16
README.md
@@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
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!
|
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) 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.4) 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)
|
> 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,14 +144,14 @@ TODO
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||||
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 16th August, 2024
|
+ *Last Build*: 20th September, 2024
|
||||||
+ *Version*: 3.2.3
|
+ *Version*: 3.2.4
|
||||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
+ *Line count*: **831771**
|
+ *Line count*: **851089**
|
||||||
+ *Field count*: **2094**
|
+ *Field count*: **2098**
|
||||||
+ *File count*: **5670**
|
+ *File count*: **5786**
|
||||||
+ *Folder count*: **496**
|
+ *Folder count*: **505**
|
||||||
|
|
||||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
||||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||||
|
@@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
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!
|
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) 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.4) 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)
|
> 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,14 +144,14 @@ TODO
|
|||||||
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||||
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||||
+ *First Build*: 30th April, 2015
|
+ *First Build*: 30th April, 2015
|
||||||
+ *Last Build*: 16th August, 2024
|
+ *Last Build*: 20th September, 2024
|
||||||
+ *Version*: 3.2.3
|
+ *Version*: 3.2.4
|
||||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
+ *Line count*: **831771**
|
+ *Line count*: **851089**
|
||||||
+ *Field count*: **2094**
|
+ *Field count*: **2098**
|
||||||
+ *File count*: **5670**
|
+ *File count*: **5786**
|
||||||
+ *Folder count*: **496**
|
+ *Folder count*: **505**
|
||||||
|
|
||||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).
|
||||||
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
|
||||||
|
@@ -288,6 +288,9 @@
|
|||||||
<action name="field.export" title="COM_COMPONENTBUILDER_FIELDS_EXPORT" description="COM_COMPONENTBUILDER_FIELDS_EXPORT_DESC" />
|
<action name="field.export" title="COM_COMPONENTBUILDER_FIELDS_EXPORT" description="COM_COMPONENTBUILDER_FIELDS_EXPORT_DESC" />
|
||||||
<action name="field.import" title="COM_COMPONENTBUILDER_FIELDS_IMPORT" description="COM_COMPONENTBUILDER_FIELDS_IMPORT_DESC" />
|
<action name="field.import" title="COM_COMPONENTBUILDER_FIELDS_IMPORT" description="COM_COMPONENTBUILDER_FIELDS_IMPORT_DESC" />
|
||||||
<action name="field.submenu" title="COM_COMPONENTBUILDER_FIELDS_SUBMENU" description="COM_COMPONENTBUILDER_FIELDS_SUBMENU_DESC" />
|
<action name="field.submenu" title="COM_COMPONENTBUILDER_FIELDS_SUBMENU" description="COM_COMPONENTBUILDER_FIELDS_SUBMENU_DESC" />
|
||||||
|
<action name="fieldtype.init" title="COM_COMPONENTBUILDER_FIELDTYPE_INIT_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPE_INIT_BUTTON_ACCESS_DESC" />
|
||||||
|
<action name="fieldtype.push" title="COM_COMPONENTBUILDER_FIELDTYPE_PUSH_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPE_PUSH_BUTTON_ACCESS_DESC" />
|
||||||
|
<action name="fieldtype.reset" title="COM_COMPONENTBUILDER_FIELDTYPE_RESET_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPE_RESET_BUTTON_ACCESS_DESC" />
|
||||||
<action name="fieldtype.access" title="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS_DESC" />
|
<action name="fieldtype.access" title="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS" description="COM_COMPONENTBUILDER_FIELDTYPES_ACCESS_DESC" />
|
||||||
<action name="fieldtype.batch" title="COM_COMPONENTBUILDER_FIELDTYPES_BATCH_USE" description="COM_COMPONENTBUILDER_FIELDTYPES_BATCH_USE_DESC" />
|
<action name="fieldtype.batch" title="COM_COMPONENTBUILDER_FIELDTYPES_BATCH_USE" description="COM_COMPONENTBUILDER_FIELDTYPES_BATCH_USE_DESC" />
|
||||||
<action name="fieldtype.create" title="COM_COMPONENTBUILDER_FIELDTYPES_CREATE" description="COM_COMPONENTBUILDER_FIELDTYPES_CREATE_DESC" />
|
<action name="fieldtype.create" title="COM_COMPONENTBUILDER_FIELDTYPES_CREATE" description="COM_COMPONENTBUILDER_FIELDTYPES_CREATE_DESC" />
|
||||||
@@ -501,6 +504,7 @@
|
|||||||
<action name="placeholder.import" title="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT" description="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT_DESC" />
|
<action name="placeholder.import" title="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT" description="COM_COMPONENTBUILDER_PLACEHOLDERS_IMPORT_DESC" />
|
||||||
<action name="placeholder.submenu" title="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU" description="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU_DESC" />
|
<action name="placeholder.submenu" title="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU" description="COM_COMPONENTBUILDER_PLACEHOLDERS_SUBMENU_DESC" />
|
||||||
<action name="power.init" title="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS_DESC" />
|
<action name="power.init" title="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS_DESC" />
|
||||||
|
<action name="power.push" title="COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS_DESC" />
|
||||||
<action name="power.reset" title="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC" />
|
<action name="power.reset" title="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC" />
|
||||||
<action name="power.access" title="COM_COMPONENTBUILDER_POWERS_ACCESS" description="COM_COMPONENTBUILDER_POWERS_ACCESS_DESC" />
|
<action name="power.access" title="COM_COMPONENTBUILDER_POWERS_ACCESS" description="COM_COMPONENTBUILDER_POWERS_ACCESS_DESC" />
|
||||||
<action name="power.batch" title="COM_COMPONENTBUILDER_POWERS_BATCH_USE" description="COM_COMPONENTBUILDER_POWERS_BATCH_USE_DESC" />
|
<action name="power.batch" title="COM_COMPONENTBUILDER_POWERS_BATCH_USE" description="COM_COMPONENTBUILDER_POWERS_BATCH_USE_DESC" />
|
||||||
|
@@ -52,7 +52,23 @@ class ###View###Controller extends FormController
|
|||||||
* @var string
|
* @var string
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected $view_list = '###views###';###ADMIN_CUSTOM_BUTTONS_CONTROLLER###
|
protected $view_list = '###views###';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Referral value
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
protected string $ref;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Referral ID value
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
protected int $refid;###ADMIN_CUSTOM_BUTTONS_CONTROLLER###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method override to check if you can add a new record.
|
* Method override to check if you can add a new record.
|
||||||
|
@@ -544,7 +544,7 @@ class ComponentbuilderControllerCompiler extends AdminController
|
|||||||
$tmp = $comConfig->get('tmp_path');
|
$tmp = $comConfig->get('tmp_path');
|
||||||
if ($model->emptyFolder($tmp))
|
if ($model->emptyFolder($tmp))
|
||||||
{
|
{
|
||||||
$message = Text::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB');
|
$message = Text::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEARED_SUCCESSFULLYB');
|
||||||
$this->setRedirect($redirect_url, $message, 'message');
|
$this->setRedirect($redirect_url, $message, 'message');
|
||||||
// get application
|
// get application
|
||||||
$app = Factory::getApplication();
|
$app = Factory::getApplication();
|
||||||
|
@@ -20,6 +20,7 @@ use Joomla\Utilities\ArrayHelper;
|
|||||||
use Joomla\CMS\Router\Route;
|
use Joomla\CMS\Router\Route;
|
||||||
use Joomla\CMS\Session\Session;
|
use Joomla\CMS\Session\Session;
|
||||||
use Joomla\CMS\Uri\Uri;
|
use Joomla\CMS\Uri\Uri;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Factory as FieldtypeFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fieldtype Form Controller
|
* Fieldtype Form Controller
|
||||||
@@ -48,6 +49,157 @@ class ComponentbuilderControllerFieldtype extends FormController
|
|||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets the specified Joomla Field Type.
|
||||||
|
*
|
||||||
|
* This function performs several checks and operations:
|
||||||
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
|
* 2. It retrieves the item data posted by the user.
|
||||||
|
* 3. It checks whether the current user has the necessary permissions to reset the Joomla Field Type.
|
||||||
|
* 4. It validates the presence of the necessary item identifiers (ID and GUID).
|
||||||
|
* 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Joomla Field Type.
|
||||||
|
* 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
||||||
|
* 7. It redirects the user to a specified URL with the result message and status.
|
||||||
|
*
|
||||||
|
* @return bool True on successful reset, false on failure.
|
||||||
|
*/
|
||||||
|
public function resetPowers()
|
||||||
|
{
|
||||||
|
// Check for request forgeries
|
||||||
|
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
|
// get Item posted
|
||||||
|
$item = $this->input->post->get('jform', array(), 'array');
|
||||||
|
|
||||||
|
// check if user has the right
|
||||||
|
$user = Factory::getUser();
|
||||||
|
|
||||||
|
// set default error message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_FIELD_TYPE') . '</p>';
|
||||||
|
$status = 'error';
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
// load the ID
|
||||||
|
$id = $item['id'] ?? null;
|
||||||
|
$guid = $item['guid'] ?? null;
|
||||||
|
|
||||||
|
// check if there is any selections
|
||||||
|
if ($id === null || $guid === null)
|
||||||
|
{
|
||||||
|
// set error message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_FIELD_TYPE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
||||||
|
}
|
||||||
|
elseif($user->authorise('fieldtype.reset', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->reset([$guid]))
|
||||||
|
{
|
||||||
|
// set success message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_RESET').'</p>';
|
||||||
|
$status = 'success';
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_FIELD_TYPE_HAS_FAILED') . '</p>';
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_(
|
||||||
|
'index.php?option=com_componentbuilder&view=fieldtype'
|
||||||
|
. $this->getRedirectToItemAppend($id), $success
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->setRedirect($redirect_url, $message, $status);
|
||||||
|
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pushes the specified Joomla Field Type.
|
||||||
|
*
|
||||||
|
* This function performs several checks and operations:
|
||||||
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
|
* 2. It retrieves the item data posted by the user.
|
||||||
|
* 3. It checks whether the current user has the necessary permissions to push the Joomla Field Type.
|
||||||
|
* 4. It validates the presence of the necessary item identifiers (ID and GUID).
|
||||||
|
* 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Joomla Field Type.
|
||||||
|
* 6. Depending on the result of the push operation, it sets the appropriate success or error message.
|
||||||
|
* 7. It redirects the user to a specified URL with the result message and status.
|
||||||
|
*
|
||||||
|
* @return bool True on successful push, false on failure.
|
||||||
|
*/
|
||||||
|
public function pushPowers()
|
||||||
|
{
|
||||||
|
// Check for request forgeries
|
||||||
|
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
|
// get Item posted
|
||||||
|
$item = $this->input->post->get('jform', array(), 'array');
|
||||||
|
|
||||||
|
// check if user has the right
|
||||||
|
$user = Factory::getUser();
|
||||||
|
|
||||||
|
// set default error message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_FIELD_TYPE') . '</p>';
|
||||||
|
$status = 'error';
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
// load the ID
|
||||||
|
$id = $item['id'] ?? null;
|
||||||
|
$guid = $item['guid'] ?? null;
|
||||||
|
|
||||||
|
// check if there is any selections
|
||||||
|
if ($id === null || $guid === null)
|
||||||
|
{
|
||||||
|
// set error message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_FIELD_TYPE_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
||||||
|
}
|
||||||
|
elseif($user->authorise('fieldtype.push', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Set')->items([$guid]))
|
||||||
|
{
|
||||||
|
// set success message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_PUSHED').'</p>';
|
||||||
|
$status = 'success';
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_FIELD_TYPE_HAS_FAILED') . '</p>';
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_(
|
||||||
|
'index.php?option=com_componentbuilder&view=fieldtype'
|
||||||
|
. $this->getRedirectToItemAppend($id), $success
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->setRedirect($redirect_url, $message, $status);
|
||||||
|
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method override to check if you can add a new record.
|
* Method override to check if you can add a new record.
|
||||||
*
|
*
|
||||||
|
@@ -20,6 +20,8 @@ use Joomla\CMS\Router\Route;
|
|||||||
use Joomla\CMS\Session\Session;
|
use Joomla\CMS\Session\Session;
|
||||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||||
use VDM\Joomla\Utilities\ObjectHelper;
|
use VDM\Joomla\Utilities\ObjectHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Factory as FieldtypeFactory;
|
||||||
|
use VDM\Joomla\Utilities\GetHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fieldtypes Admin Controller
|
* Fieldtypes Admin Controller
|
||||||
@@ -112,4 +114,219 @@ class ComponentbuilderControllerFieldtypes extends AdminController
|
|||||||
$this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error');
|
$this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes all remote Joomla Field Types and syncs them with the local database.
|
||||||
|
*
|
||||||
|
* This function performs several checks and operations:
|
||||||
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
|
* 2. It checks whether the current user has the necessary permissions to initialize the Joomla Field Types.
|
||||||
|
* 3. If the user is authorized, it attempts to initialize the remote Joomla Field Types.
|
||||||
|
* 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
|
||||||
|
* 5. It redirects the user to a specified URL with the result message and status.
|
||||||
|
*
|
||||||
|
* @return bool True on successful initialization, false on failure.
|
||||||
|
*/
|
||||||
|
public function initPowers()
|
||||||
|
{
|
||||||
|
// Check for request forgeries
|
||||||
|
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
|
// check if user has the right
|
||||||
|
$user = Factory::getUser();
|
||||||
|
|
||||||
|
// set default error message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_JOOMLA_FIELD_TYPES') . '</p>';
|
||||||
|
$status = 'error';
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
if($user->authorise('fieldtype.init', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->init())
|
||||||
|
{
|
||||||
|
// set success message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_JOOMLA_FIELD_TYPES') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_FIELD_TYPES_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '</p>';
|
||||||
|
|
||||||
|
$status = 'success';
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_FIELD_TYPES_HAS_FAILED') . '</p>';
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', $success);
|
||||||
|
$this->setRedirect($redirect_url, $message, $status);
|
||||||
|
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets the selected Joomla Field Types.
|
||||||
|
*
|
||||||
|
* This function performs several checks and operations:
|
||||||
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
|
* 2. It retrieves the IDs of the selected powers from the user input.
|
||||||
|
* 3. It sanitizes the input by converting the IDs to integers.
|
||||||
|
* 4. It checks whether any powers have been selected.
|
||||||
|
* 5. It checks whether the current user has the necessary permissions to reset the selected Joomla Field Types.
|
||||||
|
* 6. If the user is authorized and powers are selected, it attempts to reset the selected Joomla Field Types.
|
||||||
|
* 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
||||||
|
* 8. It redirects the user to a specified URL with the result message and status.
|
||||||
|
*
|
||||||
|
* @return bool True on successful reset, false on failure.
|
||||||
|
*/
|
||||||
|
public function resetPowers()
|
||||||
|
{
|
||||||
|
// Check for request forgeries
|
||||||
|
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
|
// get IDS of the selected powers
|
||||||
|
$pks = $this->input->post->get('cid', [], 'array');
|
||||||
|
|
||||||
|
// Sanitize the input
|
||||||
|
ArrayHelper::toInteger($pks);
|
||||||
|
|
||||||
|
// check if there is any selections
|
||||||
|
if ($pks === [])
|
||||||
|
{
|
||||||
|
// set error message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'</p>';
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
|
||||||
|
$this->setRedirect($redirect_url, $message, 'error');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$status = 'error';
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
// check if user has the right
|
||||||
|
$user = Factory::getUser();
|
||||||
|
if($user->authorise('fieldtype.reset', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
$guids = GetHelper::vars('fieldtype', $pks, 'id', 'guid');
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Get')->reset($guids))
|
||||||
|
{
|
||||||
|
// set success message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_RESET').'</p>';
|
||||||
|
$status = 'success';
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_FIELD_TYPES_HAS_FAILED') . '</p>';
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', $success);
|
||||||
|
$this->setRedirect($redirect_url, $message, $status);
|
||||||
|
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
|
||||||
|
$this->setRedirect($redirect_url);
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pushes the selected Joomla Field Types.
|
||||||
|
*
|
||||||
|
* This function performs several checks and operations:
|
||||||
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
|
* 2. It retrieves the IDs of the selected powers from the user input.
|
||||||
|
* 3. It sanitizes the input by converting the IDs to integers.
|
||||||
|
* 4. It checks whether any powers have been selected.
|
||||||
|
* 5. It checks whether the current user has the necessary permissions to push the selected Joomla Field Types.
|
||||||
|
* 6. If the user is authorized and powers are selected, it attempts to push the selected Joomla Field Types.
|
||||||
|
* 7. Depending on the result of the push operation, it sets the appropriate success or error message.
|
||||||
|
* 8. It redirects the user to a specified URL with the result message and status.
|
||||||
|
*
|
||||||
|
* @return bool True on successful push, false on failure.
|
||||||
|
*/
|
||||||
|
public function pushPowers()
|
||||||
|
{
|
||||||
|
// Check for request forgeries
|
||||||
|
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
|
// get IDS of the selected powers
|
||||||
|
$pks = $this->input->post->get('cid', [], 'array');
|
||||||
|
|
||||||
|
// Sanitize the input
|
||||||
|
ArrayHelper::toInteger($pks);
|
||||||
|
|
||||||
|
// check if there is any selections
|
||||||
|
if ($pks === [])
|
||||||
|
{
|
||||||
|
// set error message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'</p>';
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
|
||||||
|
$this->setRedirect($redirect_url, $message, 'error');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$status = 'error';
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
// check if user has the right
|
||||||
|
$user = Factory::getUser();
|
||||||
|
if($user->authorise('fieldtype.push', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
$guids = GetHelper::vars('fieldtype', $pks, 'id', 'guid');
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (FieldtypeFactory::_('Joomla.Fieldtype.Remote.Set')->items($guids))
|
||||||
|
{
|
||||||
|
// set success message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_PUSHED').'</p>';
|
||||||
|
$status = 'success';
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_FIELD_TYPES_HAS_FAILED') . '</p>';
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', $success);
|
||||||
|
$this->setRedirect($redirect_url, $message, $status);
|
||||||
|
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false);
|
||||||
|
$this->setRedirect($redirect_url);
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
}
|
}
|
@@ -139,7 +139,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController
|
|||||||
$tmp = $comConfig->get('tmp_path');
|
$tmp = $comConfig->get('tmp_path');
|
||||||
if ($model->emptyFolder($tmp))
|
if ($model->emptyFolder($tmp))
|
||||||
{
|
{
|
||||||
$message = Text::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB');
|
$message = Text::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEARED_SUCCESSFULLYB');
|
||||||
$this->setRedirect($redirect_url, $message, 'message');
|
$this->setRedirect($redirect_url, $message, 'message');
|
||||||
// get application
|
// get application
|
||||||
$app = Factory::getApplication();
|
$app = Factory::getApplication();
|
||||||
|
@@ -49,15 +49,16 @@ class ComponentbuilderControllerJoomla_power extends FormController
|
|||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the specified Joomla power.
|
* Resets the specified Joomla Power.
|
||||||
*
|
*
|
||||||
* This function performs several checks and operations:
|
* This function performs several checks and operations:
|
||||||
* 1. It verifies the authenticity of the request to prevent request forgery.
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
* 2. It retrieves the item data posted by the user.
|
* 2. It retrieves the item data posted by the user.
|
||||||
* 3. It checks whether the current user has the necessary permissions to reset the Joomla power.
|
* 3. It checks whether the current user has the necessary permissions to reset the Joomla Power.
|
||||||
* 4. It validates the presence of the necessary item identifiers (ID and GUID).
|
* 4. It validates the presence of the necessary item identifiers (ID and GUID).
|
||||||
* 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified power.
|
* 5. If the user is authorized and the identifiers are valid, it attempts to reset the specified Joomla Power.
|
||||||
* 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
* 6. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
||||||
* 7. It redirects the user to a specified URL with the result message and status.
|
* 7. It redirects the user to a specified URL with the result message and status.
|
||||||
*
|
*
|
||||||
@@ -91,7 +92,7 @@ class ComponentbuilderControllerJoomla_power extends FormController
|
|||||||
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
||||||
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
||||||
}
|
}
|
||||||
elseif($user->authorise('power.reset', 'com_componentbuilder'))
|
elseif($user->authorise('joomla_power.reset', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->reset([$guid]))
|
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->reset([$guid]))
|
||||||
@@ -125,14 +126,14 @@ class ComponentbuilderControllerJoomla_power extends FormController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pushes the specified Joomla power.
|
* Pushes the specified Joomla Power.
|
||||||
*
|
*
|
||||||
* This function performs several checks and operations:
|
* This function performs several checks and operations:
|
||||||
* 1. It verifies the authenticity of the request to prevent request forgery.
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
* 2. It retrieves the item data posted by the user.
|
* 2. It retrieves the item data posted by the user.
|
||||||
* 3. It checks whether the current user has the necessary permissions to push the Joomla power.
|
* 3. It checks whether the current user has the necessary permissions to push the Joomla Power.
|
||||||
* 4. It validates the presence of the necessary item identifiers (ID and GUID).
|
* 4. It validates the presence of the necessary item identifiers (ID and GUID).
|
||||||
* 5. If the user is authorized and the identifiers are valid, it attempts to push the specified power.
|
* 5. If the user is authorized and the identifiers are valid, it attempts to push the specified Joomla Power.
|
||||||
* 6. Depending on the result of the push operation, it sets the appropriate success or error message.
|
* 6. Depending on the result of the push operation, it sets the appropriate success or error message.
|
||||||
* 7. It redirects the user to a specified URL with the result message and status.
|
* 7. It redirects the user to a specified URL with the result message and status.
|
||||||
*
|
*
|
||||||
@@ -166,7 +167,7 @@ class ComponentbuilderControllerJoomla_power extends FormController
|
|||||||
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
||||||
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
||||||
}
|
}
|
||||||
elseif($user->authorise('power.push', 'com_componentbuilder'))
|
elseif($user->authorise('joomla_power.push', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Set')->items([$guid]))
|
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Set')->items([$guid]))
|
||||||
|
@@ -50,13 +50,14 @@ class ComponentbuilderControllerJoomla_powers extends AdminController
|
|||||||
return parent::getModel($name, $prefix, $config);
|
return parent::getModel($name, $prefix, $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes all remote Joomla powers and syncs them with the local database.
|
* Initializes all remote Joomla Powers and syncs them with the local database.
|
||||||
*
|
*
|
||||||
* This function performs several checks and operations:
|
* This function performs several checks and operations:
|
||||||
* 1. It verifies the authenticity of the request to prevent request forgery.
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
* 2. It checks whether the current user has the necessary permissions to initialize the Joomla powers.
|
* 2. It checks whether the current user has the necessary permissions to initialize the Joomla Powers.
|
||||||
* 3. If the user is authorized, it attempts to initialize the remote Joomla powers.
|
* 3. If the user is authorized, it attempts to initialize the remote Joomla Powers.
|
||||||
* 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
|
* 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
|
||||||
* 5. It redirects the user to a specified URL with the result message and status.
|
* 5. It redirects the user to a specified URL with the result message and status.
|
||||||
*
|
*
|
||||||
@@ -76,7 +77,7 @@ class ComponentbuilderControllerJoomla_powers extends AdminController
|
|||||||
$status = 'error';
|
$status = 'error';
|
||||||
$success = false;
|
$success = false;
|
||||||
|
|
||||||
if($user->authorise('power.init', 'com_componentbuilder'))
|
if($user->authorise('joomla_power.init', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->init())
|
if (JoomlaPowerFactory::_('Joomla.Power.Remote.Get')->init())
|
||||||
@@ -107,15 +108,15 @@ class ComponentbuilderControllerJoomla_powers extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the selected Joomla powers.
|
* Resets the selected Joomla Powers.
|
||||||
*
|
*
|
||||||
* This function performs several checks and operations:
|
* This function performs several checks and operations:
|
||||||
* 1. It verifies the authenticity of the request to prevent request forgery.
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
* 2. It retrieves the IDs of the selected powers from the user input.
|
* 2. It retrieves the IDs of the selected powers from the user input.
|
||||||
* 3. It sanitizes the input by converting the IDs to integers.
|
* 3. It sanitizes the input by converting the IDs to integers.
|
||||||
* 4. It checks whether any powers have been selected.
|
* 4. It checks whether any powers have been selected.
|
||||||
* 5. It checks whether the current user has the necessary permissions to reset the selected Joomla powers.
|
* 5. It checks whether the current user has the necessary permissions to reset the selected Joomla Powers.
|
||||||
* 6. If the user is authorized and powers are selected, it attempts to reset the selected Joomla powers.
|
* 6. If the user is authorized and powers are selected, it attempts to reset the selected Joomla Powers.
|
||||||
* 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
* 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
||||||
* 8. It redirects the user to a specified URL with the result message and status.
|
* 8. It redirects the user to a specified URL with the result message and status.
|
||||||
*
|
*
|
||||||
@@ -149,7 +150,7 @@ class ComponentbuilderControllerJoomla_powers extends AdminController
|
|||||||
|
|
||||||
// check if user has the right
|
// check if user has the right
|
||||||
$user = Factory::getUser();
|
$user = Factory::getUser();
|
||||||
if($user->authorise('power.reset', 'com_componentbuilder'))
|
if($user->authorise('joomla_power.reset', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
$guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid');
|
$guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid');
|
||||||
|
|
||||||
@@ -186,15 +187,15 @@ class ComponentbuilderControllerJoomla_powers extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pushes the selected Joomla powers.
|
* Pushes the selected Joomla Powers.
|
||||||
*
|
*
|
||||||
* This function performs several checks and operations:
|
* This function performs several checks and operations:
|
||||||
* 1. It verifies the authenticity of the request to prevent request forgery.
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
* 2. It retrieves the IDs of the selected powers from the user input.
|
* 2. It retrieves the IDs of the selected powers from the user input.
|
||||||
* 3. It sanitizes the input by converting the IDs to integers.
|
* 3. It sanitizes the input by converting the IDs to integers.
|
||||||
* 4. It checks whether any powers have been selected.
|
* 4. It checks whether any powers have been selected.
|
||||||
* 5. It checks whether the current user has the necessary permissions to push the selected Joomla powers.
|
* 5. It checks whether the current user has the necessary permissions to push the selected Joomla Powers.
|
||||||
* 6. If the user is authorized and powers are selected, it attempts to push the selected Joomla powers.
|
* 6. If the user is authorized and powers are selected, it attempts to push the selected Joomla Powers.
|
||||||
* 7. Depending on the result of the push operation, it sets the appropriate success or error message.
|
* 7. Depending on the result of the push operation, it sets the appropriate success or error message.
|
||||||
* 8. It redirects the user to a specified URL with the result message and status.
|
* 8. It redirects the user to a specified URL with the result message and status.
|
||||||
*
|
*
|
||||||
@@ -228,7 +229,7 @@ class ComponentbuilderControllerJoomla_powers extends AdminController
|
|||||||
|
|
||||||
// check if user has the right
|
// check if user has the right
|
||||||
$user = Factory::getUser();
|
$user = Factory::getUser();
|
||||||
if($user->authorise('power.push', 'com_componentbuilder'))
|
if($user->authorise('joomla_power.push', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
$guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid');
|
$guids = GetHelper::vars('joomla_power', $pks, 'id', 'guid');
|
||||||
|
|
||||||
|
@@ -49,6 +49,7 @@ class ComponentbuilderControllerPower extends FormController
|
|||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the specified power.
|
* Resets the specified power.
|
||||||
*
|
*
|
||||||
@@ -93,6 +94,7 @@ class ComponentbuilderControllerPower extends FormController
|
|||||||
}
|
}
|
||||||
elseif($user->authorise('power.reset', 'com_componentbuilder'))
|
elseif($user->authorise('power.reset', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
if (PowerFactory::_('Power.Remote.Get')->reset([$guid]))
|
if (PowerFactory::_('Power.Remote.Get')->reset([$guid]))
|
||||||
{
|
{
|
||||||
// set success message
|
// set success message
|
||||||
@@ -106,6 +108,85 @@ class ComponentbuilderControllerPower extends FormController
|
|||||||
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED') . '</p>';
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED') . '</p>';
|
||||||
}
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_(
|
||||||
|
'index.php?option=com_componentbuilder&view=power'
|
||||||
|
. $this->getRedirectToItemAppend($id), $success
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->setRedirect($redirect_url, $message, $status);
|
||||||
|
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pushes the specified power.
|
||||||
|
*
|
||||||
|
* This function performs several checks and operations:
|
||||||
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
|
* 2. It retrieves the item data posted by the user.
|
||||||
|
* 3. It checks whether the current user has the necessary permissions to push the power.
|
||||||
|
* 4. It validates the presence of the necessary item identifiers (ID and GUID).
|
||||||
|
* 5. If the user is authorized and the identifiers are valid, it attempts to push the specified power.
|
||||||
|
* 6. Depending on the result of the push operation, it sets the appropriate success or error message.
|
||||||
|
* 7. It redirects the user to a specified URL with the result message and status.
|
||||||
|
*
|
||||||
|
* @return bool True on successful push, false on failure.
|
||||||
|
*/
|
||||||
|
public function pushPowers()
|
||||||
|
{
|
||||||
|
// Check for request forgeries
|
||||||
|
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
|
// get Item posted
|
||||||
|
$item = $this->input->post->get('jform', array(), 'array');
|
||||||
|
|
||||||
|
// check if user has the right
|
||||||
|
$user = Factory::getUser();
|
||||||
|
|
||||||
|
// set default error message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_POWER') . '</p>';
|
||||||
|
$status = 'error';
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
// load the ID
|
||||||
|
$id = $item['id'] ?? null;
|
||||||
|
$guid = $item['guid'] ?? null;
|
||||||
|
|
||||||
|
// check if there is any selections
|
||||||
|
if ($id === null || $guid === null)
|
||||||
|
{
|
||||||
|
// set error message
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '</p>';
|
||||||
|
}
|
||||||
|
elseif($user->authorise('power.push', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
if (PowerFactory::_('Power.Remote.Set')->items([$guid]))
|
||||||
|
{
|
||||||
|
// set success message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED').'</p>';
|
||||||
|
$status = 'success';
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_HAS_FAILED') . '</p>';
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set redirect
|
// set redirect
|
||||||
|
@@ -50,13 +50,14 @@ class ComponentbuilderControllerPowers extends AdminController
|
|||||||
return parent::getModel($name, $prefix, $config);
|
return parent::getModel($name, $prefix, $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes all remote powers and syncs them with the local database.
|
* Initializes all remote Powers and syncs them with the local database.
|
||||||
*
|
*
|
||||||
* This function performs several checks and operations:
|
* This function performs several checks and operations:
|
||||||
* 1. It verifies the authenticity of the request to prevent request forgery.
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
* 2. It checks whether the current user has the necessary permissions to initialize the powers.
|
* 2. It checks whether the current user has the necessary permissions to initialize the Powers.
|
||||||
* 3. If the user is authorized, it attempts to initialize the remote powers.
|
* 3. If the user is authorized, it attempts to initialize the remote Powers.
|
||||||
* 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
|
* 4. Depending on the result of the initialization operation, it sets the appropriate success or error message.
|
||||||
* 5. It redirects the user to a specified URL with the result message and status.
|
* 5. It redirects the user to a specified URL with the result message and status.
|
||||||
*
|
*
|
||||||
@@ -78,6 +79,7 @@ class ComponentbuilderControllerPowers extends AdminController
|
|||||||
|
|
||||||
if($user->authorise('power.init', 'com_componentbuilder'))
|
if($user->authorise('power.init', 'com_componentbuilder'))
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
if (PowerFactory::_('Power.Remote.Get')->init())
|
if (PowerFactory::_('Power.Remote.Get')->init())
|
||||||
{
|
{
|
||||||
// set success message
|
// set success message
|
||||||
@@ -92,6 +94,10 @@ class ComponentbuilderControllerPowers extends AdminController
|
|||||||
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '</h1>';
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '</h1>';
|
||||||
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED') . '</p>';
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED') . '</p>';
|
||||||
}
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set redirect
|
// set redirect
|
||||||
@@ -102,15 +108,15 @@ class ComponentbuilderControllerPowers extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the selected powers.
|
* Resets the selected Powers.
|
||||||
*
|
*
|
||||||
* This function performs several checks and operations:
|
* This function performs several checks and operations:
|
||||||
* 1. It verifies the authenticity of the request to prevent request forgery.
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
* 2. It retrieves the IDs of the selected powers from the user input.
|
* 2. It retrieves the IDs of the selected powers from the user input.
|
||||||
* 3. It sanitizes the input by converting the IDs to integers.
|
* 3. It sanitizes the input by converting the IDs to integers.
|
||||||
* 4. It checks whether any powers have been selected.
|
* 4. It checks whether any powers have been selected.
|
||||||
* 5. It checks whether the current user has the necessary permissions to reset the selected powers.
|
* 5. It checks whether the current user has the necessary permissions to reset the selected Powers.
|
||||||
* 6. If the user is authorized and powers are selected, it attempts to reset the selected powers.
|
* 6. If the user is authorized and powers are selected, it attempts to reset the selected Powers.
|
||||||
* 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
* 7. Depending on the result of the reset operation, it sets the appropriate success or error message.
|
||||||
* 8. It redirects the user to a specified URL with the result message and status.
|
* 8. It redirects the user to a specified URL with the result message and status.
|
||||||
*
|
*
|
||||||
@@ -148,6 +154,7 @@ class ComponentbuilderControllerPowers extends AdminController
|
|||||||
{
|
{
|
||||||
$guids = GetHelper::vars('power', $pks, 'id', 'guid');
|
$guids = GetHelper::vars('power', $pks, 'id', 'guid');
|
||||||
|
|
||||||
|
try {
|
||||||
if (PowerFactory::_('Power.Remote.Get')->reset($guids))
|
if (PowerFactory::_('Power.Remote.Get')->reset($guids))
|
||||||
{
|
{
|
||||||
// set success message
|
// set success message
|
||||||
@@ -161,6 +168,89 @@ class ComponentbuilderControllerPowers extends AdminController
|
|||||||
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_POWERS_HAS_FAILED') . '</p>';
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THESE_POWERS_HAS_FAILED') . '</p>';
|
||||||
}
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success);
|
||||||
|
$this->setRedirect($redirect_url, $message, $status);
|
||||||
|
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||||
|
$this->setRedirect($redirect_url);
|
||||||
|
return $success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pushes the selected Powers.
|
||||||
|
*
|
||||||
|
* This function performs several checks and operations:
|
||||||
|
* 1. It verifies the authenticity of the request to prevent request forgery.
|
||||||
|
* 2. It retrieves the IDs of the selected powers from the user input.
|
||||||
|
* 3. It sanitizes the input by converting the IDs to integers.
|
||||||
|
* 4. It checks whether any powers have been selected.
|
||||||
|
* 5. It checks whether the current user has the necessary permissions to push the selected Powers.
|
||||||
|
* 6. If the user is authorized and powers are selected, it attempts to push the selected Powers.
|
||||||
|
* 7. Depending on the result of the push operation, it sets the appropriate success or error message.
|
||||||
|
* 8. It redirects the user to a specified URL with the result message and status.
|
||||||
|
*
|
||||||
|
* @return bool True on successful push, false on failure.
|
||||||
|
*/
|
||||||
|
public function pushPowers()
|
||||||
|
{
|
||||||
|
// Check for request forgeries
|
||||||
|
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
|
// get IDS of the selected powers
|
||||||
|
$pks = $this->input->post->get('cid', [], 'array');
|
||||||
|
|
||||||
|
// Sanitize the input
|
||||||
|
ArrayHelper::toInteger($pks);
|
||||||
|
|
||||||
|
// check if there is any selections
|
||||||
|
if ($pks === [])
|
||||||
|
{
|
||||||
|
// set error message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'</p>';
|
||||||
|
// set redirect
|
||||||
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false);
|
||||||
|
$this->setRedirect($redirect_url, $message, 'error');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$status = 'error';
|
||||||
|
$success = false;
|
||||||
|
|
||||||
|
// check if user has the right
|
||||||
|
$user = Factory::getUser();
|
||||||
|
if($user->authorise('power.push', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
$guids = GetHelper::vars('power', $pks, 'id', 'guid');
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (PowerFactory::_('Power.Remote.Set')->items($guids))
|
||||||
|
{
|
||||||
|
// set success message
|
||||||
|
$message = '<h1>'.Text::_('COM_COMPONENTBUILDER_SUCCESS').'</h1>';
|
||||||
|
$message .= '<p>'.Text::_('COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED').'</p>';
|
||||||
|
$status = 'success';
|
||||||
|
$success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . Text::_('COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_POWERS_HAS_FAILED') . '</p>';
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = '<h1>' . Text::_('COM_COMPONENTBUILDER_PUSH_FAILED') . '</h1>';
|
||||||
|
$message .= '<p>' . \htmlspecialchars($e->getMessage()) . '</p>';
|
||||||
|
}
|
||||||
|
|
||||||
// set redirect
|
// set redirect
|
||||||
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success);
|
$redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success);
|
||||||
|
16
admin/custom/DownloadControllerAdmin.php
Normal file
16
admin/custom/DownloadControllerAdmin.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @version 2.0.0 - September 03, 2014
|
||||||
|
* @package Component Builder
|
||||||
|
* @author Llewellyn van de Merwe <http://www.vdm.io>
|
||||||
|
* @copyright Copyright (C) 2014. All Rights Reserved
|
||||||
|
* @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
// No direct access to this file
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
?>
|
||||||
|
###BOM###
|
||||||
|
[CUSTOMCODE=dynamicDownloadController+Administrator]
|
16
admin/custom/DownloadControllerSite.php
Normal file
16
admin/custom/DownloadControllerSite.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @version 2.0.0 - September 03, 2014
|
||||||
|
* @package Component Builder
|
||||||
|
* @author Llewellyn van de Merwe <http://www.vdm.io>
|
||||||
|
* @copyright Copyright (C) 2014. All Rights Reserved
|
||||||
|
* @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
|
||||||
|
// No direct access to this file
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
?>
|
||||||
|
###BOM###
|
||||||
|
[CUSTOMCODE=dynamicDownloadController+Site]
|
@@ -3513,12 +3513,12 @@ abstract class ComponentbuilderHelper
|
|||||||
'editor', 'editors', 'email', 'file', 'file', 'filelist', 'folderlist', 'groupedlist', 'headertag', 'helpsite', 'hidden', 'imagelist',
|
'editor', 'editors', 'email', 'file', 'file', 'filelist', 'folderlist', 'groupedlist', 'headertag', 'helpsite', 'hidden', 'imagelist',
|
||||||
'integer', 'language', 'list', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition',
|
'integer', 'language', 'list', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition',
|
||||||
'moduletag', 'note', 'number', 'password', 'plugins', 'predefinedlist', 'radio', 'range', 'repeatable', 'rules',
|
'moduletag', 'note', 'number', 'password', 'plugins', 'predefinedlist', 'radio', 'range', 'repeatable', 'rules',
|
||||||
'sessionhandler', 'spacer', 'sql', 'subform', 'tag', 'tel', 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
'sessionhandler', 'spacer', 'sql', 'subform', 'tag', 'tel', 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup', 'usergrouplist'
|
||||||
),
|
),
|
||||||
'plain' => array(
|
'plain' => array(
|
||||||
'cachehandler', 'calendar', 'checkbox', 'chromestyle', 'color', 'componentlayout', 'contenttype', 'editor', 'editors', 'captcha',
|
'cachehandler', 'calendar', 'checkbox', 'chromestyle', 'color', 'componentlayout', 'contenttype', 'editor', 'editors', 'captcha',
|
||||||
'email', 'file', 'headertag', 'helpsite', 'hidden', 'integer', 'language', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'templatestyle',
|
'email', 'file', 'headertag', 'helpsite', 'hidden', 'integer', 'language', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'templatestyle',
|
||||||
'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', 'tag', 'tel', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', 'tag', 'tel', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup', 'usergrouplist'
|
||||||
),
|
),
|
||||||
'option' => array(
|
'option' => array(
|
||||||
'accesslevel', 'category', 'checkboxes', 'combo', 'contentlanguage', 'databaseconnection', 'components',
|
'accesslevel', 'category', 'checkboxes', 'combo', 'contentlanguage', 'databaseconnection', 'components',
|
||||||
@@ -5417,7 +5417,6 @@ abstract class ComponentbuilderHelper
|
|||||||
return $d && $d->format($format) == $date;
|
return $d && $d->format($format) == $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The subform layouts
|
* The subform layouts
|
||||||
**/
|
**/
|
||||||
|
@@ -1347,7 +1347,7 @@ COM_COMPONENTBUILDER_BSB_COULD_NOT_BE_IMPORTEDS="<b>%s</b> could not be imported
|
|||||||
COM_COMPONENTBUILDER_BSB_HAS_BEEN_IMPORTED="<b>%s</b> has been imported!"
|
COM_COMPONENTBUILDER_BSB_HAS_BEEN_IMPORTED="<b>%s</b> has been imported!"
|
||||||
COM_COMPONENTBUILDER_BSB_HAS_BEEN_UPDATED="<b>%s</b> has been updated!"
|
COM_COMPONENTBUILDER_BSB_HAS_BEEN_UPDATED="<b>%s</b> has been updated!"
|
||||||
COM_COMPONENTBUILDER_BSB_WAS_FOUND="<b>%s</b> was found!"
|
COM_COMPONENTBUILDER_BSB_WAS_FOUND="<b>%s</b> was found!"
|
||||||
COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB="<b>The tmp folder has been clear successfully!</b>"
|
COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEARED_SUCCESSFULLYB="<b>The tmp folder has been cleared successfully!</b>"
|
||||||
COM_COMPONENTBUILDER_BUILD="Build"
|
COM_COMPONENTBUILDER_BUILD="Build"
|
||||||
COM_COMPONENTBUILDER_BUILDIN="Build-in"
|
COM_COMPONENTBUILDER_BUILDIN="Build-in"
|
||||||
COM_COMPONENTBUILDER_BUILD_DATE="Build Date"
|
COM_COMPONENTBUILDER_BUILD_DATE="Build Date"
|
||||||
@@ -1360,6 +1360,7 @@ COM_COMPONENTBUILDER_BULK_UPDATE_ALL_DIVERGED_SNIPPETS="Bulk Update All Diverged
|
|||||||
COM_COMPONENTBUILDER_BULK_UPDATE_ALL_OUT_DATED_SNIPPETS="Bulk Update All Out Dated Snippets"
|
COM_COMPONENTBUILDER_BULK_UPDATE_ALL_OUT_DATED_SNIPPETS="Bulk Update All Out Dated Snippets"
|
||||||
COM_COMPONENTBUILDER_BUTTON_TO_CREATE_S_WILL_SHOW_ONCE_S_IS_SAVED_FOR_THE_FIRST_TIME="Button to create %s will show once %s is saved for the first time."
|
COM_COMPONENTBUILDER_BUTTON_TO_CREATE_S_WILL_SHOW_ONCE_S_IS_SAVED_FOR_THE_FIRST_TIME="Button to create %s will show once %s is saved for the first time."
|
||||||
COM_COMPONENTBUILDER_CANCEL="Cancel"
|
COM_COMPONENTBUILDER_CANCEL="Cancel"
|
||||||
|
COM_COMPONENTBUILDER_CAN_NOT_SAVE_USER_WITHOUT_EMAIL_VALUE="Can not save user without email value."
|
||||||
COM_COMPONENTBUILDER_CHAIN="Chain"
|
COM_COMPONENTBUILDER_CHAIN="Chain"
|
||||||
COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="Check your owner details, it has not been set. Open the JCB Global Options, go to the Company tab and add the correct company details there."
|
COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="Check your owner details, it has not been set. Open the JCB Global Options, go to the Company tab and add the correct company details there."
|
||||||
COM_COMPONENTBUILDER_CLASS_EXTENDINGS="Class Extendings"
|
COM_COMPONENTBUILDER_CLASS_EXTENDINGS="Class Extendings"
|
||||||
@@ -4227,6 +4228,7 @@ COM_COMPONENTBUILDER_DTEMAILDTDDSDD="<dt>Email</dt><dd>%s</dd>"
|
|||||||
COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="<dt>License</dt><dd>%s</dd>"
|
COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="<dt>License</dt><dd>%s</dd>"
|
||||||
COM_COMPONENTBUILDER_DTOWNERDTDDSDD="<dt>Owner</dt><dd>%s</dd>"
|
COM_COMPONENTBUILDER_DTOWNERDTDDSDD="<dt>Owner</dt><dd>%s</dd>"
|
||||||
COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="<dt>Website</dt><dd>%s</dd>"
|
COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="<dt>Website</dt><dd>%s</dd>"
|
||||||
|
COM_COMPONENTBUILDER_DURING_THE_INITIAL_COMPILATION_OF_ANY_COMPONENT_THE_PROCESS_MAY_TAKE_ADDITIONAL_TIME_AS_WE_RETRIEVE_AND_CONFIGURE_THE_ASSOCIATED_SUPERPOWERS_="During the initial compilation of any component, the process may take additional time as we retrieve and configure the associated super-powers.."
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_BUTTON_ERROR="Dynamic Button Error"
|
COM_COMPONENTBUILDER_DYNAMIC_BUTTON_ERROR="Dynamic Button Error"
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GET="Dynamic Get"
|
COM_COMPONENTBUILDER_DYNAMIC_GET="Dynamic Get"
|
||||||
COM_COMPONENTBUILDER_DYNAMIC_GETS="Dynamic Gets"
|
COM_COMPONENTBUILDER_DYNAMIC_GETS="Dynamic Gets"
|
||||||
@@ -4729,6 +4731,8 @@ COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS_DESCRIPTION="set the database defaul
|
|||||||
COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS_LABEL="Set Database Defaults"
|
COM_COMPONENTBUILDER_FIELDTYPE_HAS_DEFAULTS_LABEL="Set Database Defaults"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_ID="Id"
|
COM_COMPONENTBUILDER_FIELDTYPE_ID="Id"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_INDEXES_LABEL="Indexes Type"
|
COM_COMPONENTBUILDER_FIELDTYPE_INDEXES_LABEL="Indexes Type"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_INIT_BUTTON_ACCESS="Fieldtype Init Button Access"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_INIT_BUTTON_ACCESS_DESC="Allows the users in this group to access the init button."
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_INT="INT"
|
COM_COMPONENTBUILDER_FIELDTYPE_INT="INT"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_JSON="JSON"
|
COM_COMPONENTBUILDER_FIELDTYPE_JSON="JSON"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_KEY="KEY"
|
COM_COMPONENTBUILDER_FIELDTYPE_KEY="KEY"
|
||||||
@@ -4770,6 +4774,10 @@ COM_COMPONENTBUILDER_FIELDTYPE_PERMISSION="Permissions"
|
|||||||
COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_DESCRIPTION="Options for this field"
|
COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_DESCRIPTION="Options for this field"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_LABEL="Properties"
|
COM_COMPONENTBUILDER_FIELDTYPE_PROPERTIES_LABEL="Properties"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_PUBLISHING="Publishing"
|
COM_COMPONENTBUILDER_FIELDTYPE_PUBLISHING="Publishing"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_PUSH_BUTTON_ACCESS="Fieldtype Push Button Access"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button."
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_RESET_BUTTON_ACCESS="Fieldtype Reset Button Access"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Fieldtype to customise the alias."
|
COM_COMPONENTBUILDER_FIELDTYPE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Fieldtype to customise the alias."
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_SELECT_AN_OPTION="Select an option"
|
COM_COMPONENTBUILDER_FIELDTYPE_SELECT_AN_OPTION="Select an option"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPE_SEVEN="7"
|
COM_COMPONENTBUILDER_FIELDTYPE_SEVEN="7"
|
||||||
@@ -5859,7 +5867,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUBLISHING="Publishing"
|
|||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README="Readme"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README="Readme"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README_LABEL="README.md"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README_LABEL="README.md"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_DESCRIPTION="Should we remove all line breaks ("\r", "\n") from all language strings in this component."
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_DESCRIPTION="Should we remove all line breaks ("\r", "\n") from all language strings in this component."
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL="Remove line breaks<br /><small>from language strings</small>"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL="Remove line breaks<br /><small>from language strings<br>This switch will be removed since it must always be true for J4+.</small>"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SALES_SERVER_DESCRIPTION="Select your sales server for this component"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SALES_SERVER_DESCRIPTION="Select your sales server for this component"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SALES_SERVER_LABEL="Sales Server"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SALES_SERVER_LABEL="Sales Server"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Joomla Component to customise the alias."
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Joomla Component to customise the alias."
|
||||||
@@ -7480,7 +7488,7 @@ COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_THREE_DESCRIPTION="There is no be
|
|||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_THREE_LABEL="No Behaviour"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_THREE_LABEL="No Behaviour"
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_TWO_DESCRIPTION="There is no behaviour set for this library. This means JCB will not add any files unless you custom code it in somewhere."
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_TWO_DESCRIPTION="There is no behaviour set for this library. This means JCB will not add any files unless you custom code it in somewhere."
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_TWO_LABEL="No Behaviour"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_NO_BEHAVIOUR_TWO_LABEL="No Behaviour"
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_LIBRARY_DESCRIPTION="We are working on this feature it is not yet ready, but soon enough you will be able to build real Joomla library integration here."
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_LIBRARY_DESCRIPTION="To effectively integrate a PHP library into your component, leverage the [Powers] Area within JCB. This feature empowers you to seamlessly incorporate Composer packages as well as standard PHP class structures into your component, ensuring a robust and maintainable solution."
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_LIBRARY_LABEL="Set Behaviour"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_LIBRARY_LABEL="Set Behaviour"
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_DESCRIPTION="All the library files linked to this library will always be added to a view if linked to the view."
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_DESCRIPTION="All the library files linked to this library will always be added to a view if linked to the view."
|
||||||
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_LABEL="Set Behaviour"
|
COM_COMPONENTBUILDER_LIBRARY_NOTE_YES_BEHAVIOUR_ONE_LABEL="Set Behaviour"
|
||||||
@@ -7621,6 +7629,7 @@ COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S="Path to the
|
|||||||
COM_COMPONENTBUILDER_PERMISSIONS="Permissions"
|
COM_COMPONENTBUILDER_PERMISSIONS="Permissions"
|
||||||
COM_COMPONENTBUILDER_PERMISSION_DENIED="Permission Denied!"
|
COM_COMPONENTBUILDER_PERMISSION_DENIED="Permission Denied!"
|
||||||
COM_COMPONENTBUILDER_PFILE_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>File at <b>%s/%s</b> gave the following error!<br />%s</p>"
|
COM_COMPONENTBUILDER_PFILE_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>File at <b>%s/%s</b> gave the following error!<br />%s</p>"
|
||||||
|
COM_COMPONENTBUILDER_PJOOMLA_FIELD_TYPEB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>Joomla Field Type</b> repository at <b>%s/%s</b> gave the following error!<br />%s</p>"
|
||||||
COM_COMPONENTBUILDER_PJOOMLA_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>Joomla Power</b> repository at <b>%s/%s</b> gave the following error!<br />%s</p>"
|
COM_COMPONENTBUILDER_PJOOMLA_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="<p>Joomla Power</b> repository at <b>%s/%s</b> gave the following error!<br />%s</p>"
|
||||||
COM_COMPONENTBUILDER_PJOOMLA_POWER_BGUIDSB_NOT_FOUNDP="<p>Joomla Power <b>guid:%s</b> not found!</p>"
|
COM_COMPONENTBUILDER_PJOOMLA_POWER_BGUIDSB_NOT_FOUNDP="<p>Joomla Power <b>guid:%s</b> not found!</p>"
|
||||||
COM_COMPONENTBUILDER_PJOOMLA_POWER_BGUIDSB_WAS_FOUND_BUT_MISSING_A_NAMESPACE_VALUE_FOR_JOOMLA_SP="<p>Joomla Power <b>guid:%s</b> was found, but missing a namespace value for Joomla %s!</p>"
|
COM_COMPONENTBUILDER_PJOOMLA_POWER_BGUIDSB_WAS_FOUND_BUT_MISSING_A_NAMESPACE_VALUE_FOR_JOOMLA_SP="<p>Joomla Power <b>guid:%s</b> was found, but missing a namespace value for Joomla %s!</p>"
|
||||||
@@ -7873,6 +7882,8 @@ COM_COMPONENTBUILDER_POWER_PROPERTY_LABEL="Properties"
|
|||||||
COM_COMPONENTBUILDER_POWER_PROPERTY_SELECTION_DESCRIPTION="Select properties you want to use in your power."
|
COM_COMPONENTBUILDER_POWER_PROPERTY_SELECTION_DESCRIPTION="Select properties you want to use in your power."
|
||||||
COM_COMPONENTBUILDER_POWER_PROPERTY_SELECTION_LABEL="Property Selection"
|
COM_COMPONENTBUILDER_POWER_PROPERTY_SELECTION_LABEL="Property Selection"
|
||||||
COM_COMPONENTBUILDER_POWER_PUBLISHING="Publishing"
|
COM_COMPONENTBUILDER_POWER_PUBLISHING="Publishing"
|
||||||
|
COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS="Power Push Button Access"
|
||||||
|
COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button."
|
||||||
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS="Power Reset Button Access"
|
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS="Power Reset Button Access"
|
||||||
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
|
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
|
||||||
COM_COMPONENTBUILDER_POWER_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Power to customise the alias."
|
COM_COMPONENTBUILDER_POWER_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Power to customise the alias."
|
||||||
@@ -7969,6 +7980,8 @@ COM_COMPONENTBUILDER_REPOSITORIES_SUBMENU_DESC="Allows the users in this group t
|
|||||||
COM_COMPONENTBUILDER_REPOSITORY="Repository"
|
COM_COMPONENTBUILDER_REPOSITORY="Repository"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_DESCRIPTION="Set the access options to this repository"
|
COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_DESCRIPTION="Set the access options to this repository"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_LABEL="Access"
|
COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_LABEL="Access"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_ADDPLACEHOLDERS_DESCRIPTION="Set dnamic placeholders for this component."
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_ADDPLACEHOLDERS_LABEL="Placeholders"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_BASE_DESCRIPTION="Enter Base URL"
|
COM_COMPONENTBUILDER_REPOSITORY_BASE_DESCRIPTION="Enter Base URL"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_BASE_HINT="https://git.vdm.dev"
|
COM_COMPONENTBUILDER_REPOSITORY_BASE_HINT="https://git.vdm.dev"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_BASE_LABEL="Base URL"
|
COM_COMPONENTBUILDER_REPOSITORY_BASE_LABEL="Base URL"
|
||||||
@@ -7987,6 +8000,7 @@ COM_COMPONENTBUILDER_REPOSITORY_GUID_DESCRIPTION="Globally Unique Identifier"
|
|||||||
COM_COMPONENTBUILDER_REPOSITORY_GUID_HINT="Auto Generated"
|
COM_COMPONENTBUILDER_REPOSITORY_GUID_HINT="Auto Generated"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_GUID_LABEL="GUID"
|
COM_COMPONENTBUILDER_REPOSITORY_GUID_LABEL="GUID"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_ID="Id"
|
COM_COMPONENTBUILDER_REPOSITORY_ID="Id"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_FIELD_TYPES="Joomla Field Types"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER="Joomla Power"
|
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER="Joomla Power"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_MODIFIED_BY_DESC="The last user that modified this Repository."
|
COM_COMPONENTBUILDER_REPOSITORY_MODIFIED_BY_DESC="The last user that modified this Repository."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_MODIFIED_BY_LABEL="Modified By"
|
COM_COMPONENTBUILDER_REPOSITORY_MODIFIED_BY_LABEL="Modified By"
|
||||||
@@ -8000,6 +8014,9 @@ COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_LABEL="Organisation"
|
|||||||
COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_MESSAGE="Error! Please add organisation here."
|
COM_COMPONENTBUILDER_REPOSITORY_ORGANISATION_MESSAGE="Error! Please add organisation here."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_OVERRIDE="Override"
|
COM_COMPONENTBUILDER_REPOSITORY_OVERRIDE="Override"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_PERMISSION="Permissions"
|
COM_COMPONENTBUILDER_REPOSITORY_PERMISSION="Permissions"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDERS="Placeholders"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_DESCRIPTION="<p>When powers are connected to components, we utilize global placeholders. These placeholders are linked to the specific component, allowing for dynamic updates to any placeholders found within the powers. However, when we directly <b>push</b> powers from the powers area to this repository, we require <b>placeholders</b> that are specific to this repository.</p><p>You can add these repository-specific placeholders here. Please note that these placeholders are only utilized during direct pushes from the powers area and are not considered during the compilation of any component. Although you can use the same placeholders to ensure consistent outcomes, they technically have no direct relationship with the components.</p>"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_LABEL="The Repository Placeholders"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_PUBLISHING="Publishing"
|
COM_COMPONENTBUILDER_REPOSITORY_PUBLISHING="Publishing"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_DESCRIPTION="The read branch to use in the API calls."
|
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_DESCRIPTION="The read branch to use in the API calls."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_HINT="[master]"
|
COM_COMPONENTBUILDER_REPOSITORY_READ_BRANCH_HINT="[master]"
|
||||||
@@ -8016,7 +8033,9 @@ COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_HINT="The System Name Here"
|
|||||||
COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_LABEL="System Name"
|
COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_LABEL="System Name"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_MESSAGE="Error! Please add some text here."
|
COM_COMPONENTBUILDER_REPOSITORY_SYSTEM_NAME_MESSAGE="Error! Please add some text here."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_TARGET_DESCRIPTION="The target content this repository holds."
|
COM_COMPONENTBUILDER_REPOSITORY_TARGET_DESCRIPTION="The target content this repository holds."
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_TARGET_HINT="coral"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_TARGET_LABEL="Target Content"
|
COM_COMPONENTBUILDER_REPOSITORY_TARGET_LABEL="Target Content"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_TARGET_MESSAGE="Error! That target placeholder text already exist. Please add an unique placeholder target."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_TOKEN_DESCRIPTION="This token is used to access the api."
|
COM_COMPONENTBUILDER_REPOSITORY_TOKEN_DESCRIPTION="This token is used to access the api."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_TOKEN_HINT="Access Tokens"
|
COM_COMPONENTBUILDER_REPOSITORY_TOKEN_HINT="Access Tokens"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_TOKEN_LABEL="Access Token"
|
COM_COMPONENTBUILDER_REPOSITORY_TOKEN_LABEL="Access Token"
|
||||||
@@ -8026,6 +8045,10 @@ COM_COMPONENTBUILDER_REPOSITORY_USERNAME_DESCRIPTION="The username to use in the
|
|||||||
COM_COMPONENTBUILDER_REPOSITORY_USERNAME_HINT="Username"
|
COM_COMPONENTBUILDER_REPOSITORY_USERNAME_HINT="Username"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_USERNAME_LABEL="Username"
|
COM_COMPONENTBUILDER_REPOSITORY_USERNAME_LABEL="Username"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_USERNAME_MESSAGE="Error! Please add username here."
|
COM_COMPONENTBUILDER_REPOSITORY_USERNAME_MESSAGE="Error! Please add username here."
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_VALUE_DESCRIPTION="Set the text you would like to set as the replacement value for the targeted placeholder."
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_VALUE_HINT="membersmanager"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_VALUE_LABEL="Set String Value"
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_VALUE_MESSAGE="Error! Please add some set target value here."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_VERSION_DESC="A count of the number of times this Repository has been revised."
|
COM_COMPONENTBUILDER_REPOSITORY_VERSION_DESC="A count of the number of times this Repository has been revised."
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_VERSION_LABEL="Version"
|
COM_COMPONENTBUILDER_REPOSITORY_VERSION_LABEL="Version"
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_WRITE_BRANCH_DESCRIPTION="The write branch to use in the API calls. This can be the same as the read branch."
|
COM_COMPONENTBUILDER_REPOSITORY_WRITE_BRANCH_DESCRIPTION="The write branch to use in the API calls. This can be the same as the read branch."
|
||||||
@@ -8885,6 +8908,7 @@ COM_COMPONENTBUILDER_SUBMENU_SNIPPETS="Snippets"
|
|||||||
COM_COMPONENTBUILDER_SUBMENU_TEMPLATES="Templates"
|
COM_COMPONENTBUILDER_SUBMENU_TEMPLATES="Templates"
|
||||||
COM_COMPONENTBUILDER_SUBMENU_VALIDATION_RULES="Validation Rules"
|
COM_COMPONENTBUILDER_SUBMENU_VALIDATION_RULES="Validation Rules"
|
||||||
COM_COMPONENTBUILDER_SUCCESS="Success"
|
COM_COMPONENTBUILDER_SUCCESS="Success"
|
||||||
|
COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_JOOMLA_FIELD_TYPES="Successfully Initialized all Remote Joomla Field Types"
|
||||||
COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_JOOMLA_POWERS="Successfully Initialized all Remote Joomla Powers"
|
COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_JOOMLA_POWERS="Successfully Initialized all Remote Joomla Powers"
|
||||||
COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_POWERS="Successfully Initialized all Remote Powers"
|
COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_POWERS="Successfully Initialized all Remote Powers"
|
||||||
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED="Success! The snippet was saved."
|
COM_COMPONENTBUILDER_SUCCESS_THE_SNIPPET_WAS_SAVED="Success! The snippet was saved."
|
||||||
@@ -9033,11 +9057,14 @@ COM_COMPONENTBUILDER_THERE_WAS_AN_ERROR_GETTING_THE_PACKAGE_INFO="There was an e
|
|||||||
COM_COMPONENTBUILDER_THERE_WAS_A_PROBLEM_BNO_VIEW_OR_ID_FOUND_IN_SESSION_OR_VIEW_NOT_ALLOWED_TO_ACCESS_AREAB_WE_COULD_NOT_LOAD_ANY_LINKED_TO_VALUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR="There was a problem, <b>no view or id found in session or view not allowed to access area</b>, we could not load any linked to values. Please inform your system administrator!"
|
COM_COMPONENTBUILDER_THERE_WAS_A_PROBLEM_BNO_VIEW_OR_ID_FOUND_IN_SESSION_OR_VIEW_NOT_ALLOWED_TO_ACCESS_AREAB_WE_COULD_NOT_LOAD_ANY_LINKED_TO_VALUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR="There was a problem, <b>no view or id found in session or view not allowed to access area</b>, we could not load any linked to values. Please inform your system administrator!"
|
||||||
COM_COMPONENTBUILDER_THESE_ARE_THE_SAME_PACKAGES_FOUND_ON_A_S_GITHUBA_AND_CAN_BE_IMPORTED_BY_SIMPLY_MAKING_A_SELECTION_AND_THEN_CLICKING_THE_BGET_PACKAGEB_BUTTONBR_SOME_OF_THESE_PACKAGES_WOULD_REQUIRE_A_KEY_SINCE_THEY_ARE_NOT_FREE="These are the same packages found on <a %s >gitHub</a> and can be imported by simply making a selection and then clicking the <b>[Get Package]</b> button.<br />Some of these packages would require a key, since they are not free."
|
COM_COMPONENTBUILDER_THESE_ARE_THE_SAME_PACKAGES_FOUND_ON_A_S_GITHUBA_AND_CAN_BE_IMPORTED_BY_SIMPLY_MAKING_A_SELECTION_AND_THEN_CLICKING_THE_BGET_PACKAGEB_BUTTONBR_SOME_OF_THESE_PACKAGES_WOULD_REQUIRE_A_KEY_SINCE_THEY_ARE_NOT_FREE="These are the same packages found on <a %s >gitHub</a> and can be imported by simply making a selection and then clicking the <b>[Get Package]</b> button.<br />Some of these packages would require a key, since they are not free."
|
||||||
COM_COMPONENTBUILDER_THESE_ARE_THE_SAME_PACKAGES_FOUND_ON_A_S_GITHUBA_AND_CAN_BE_IMPORTED_BY_SIMPLY_MAKING_A_SELECTION_AND_THEN_CLICKING_THE_BGET_PACKAGEB_BUTTONBR_SOME_OF_THESE_PACKAGES_WOULD_REQUIRE_A_KEY_SINCE_THEY_ARE_NOT_FREE_A_S_GET_A_KEY_TODAYA="These are the same packages found on <a %s >gitHub</a> and can be imported by simply making a selection and then clicking the <b>[Get Package]</b> button.<br />Some of these packages would require a key, since they are not free. <a %s >Get a key today!</a>."
|
COM_COMPONENTBUILDER_THESE_ARE_THE_SAME_PACKAGES_FOUND_ON_A_S_GITHUBA_AND_CAN_BE_IMPORTED_BY_SIMPLY_MAKING_A_SELECTION_AND_THEN_CLICKING_THE_BGET_PACKAGEB_BUTTONBR_SOME_OF_THESE_PACKAGES_WOULD_REQUIRE_A_KEY_SINCE_THEY_ARE_NOT_FREE_A_S_GET_A_KEY_TODAYA="These are the same packages found on <a %s >gitHub</a> and can be imported by simply making a selection and then clicking the <b>[Get Package]</b> button.<br />Some of these packages would require a key, since they are not free. <a %s >Get a key today!</a>."
|
||||||
COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Joomla powers have successfully been pushed."
|
COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Joomla Field Types have successfully been pushed."
|
||||||
COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET="These Joomla powers have successfully been reset."
|
COM_COMPONENTBUILDER_THESE_JOOMLA_FIELD_TYPES_HAVE_SUCCESSFULLY_BEEN_RESET="These Joomla Field Types have successfully been reset."
|
||||||
|
COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Joomla Powers have successfully been pushed."
|
||||||
|
COM_COMPONENTBUILDER_THESE_JOOMLA_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET="These Joomla Powers have successfully been reset."
|
||||||
COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_NOT_AVAILABLE_TO_THE_FIELD_IF_BNONE_DBB_OPTION_IS_SELECTED="These options are not available to the field if <b>None DB</b> option is selected."
|
COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_NOT_AVAILABLE_TO_THE_FIELD_IF_BNONE_DBB_OPTION_IS_SELECTED="These options are not available to the field if <b>None DB</b> option is selected."
|
||||||
COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_ONLY_AVAILABLE_TO_THE_FIELD_IF_BSHOW_IN_LIST_VIEWB_OPTION_IS_SELECTED="These options are only available to the field if <b>Show in list view</b> option is selected."
|
COM_COMPONENTBUILDER_THESE_OPTIONS_ARE_ONLY_AVAILABLE_TO_THE_FIELD_IF_BSHOW_IN_LIST_VIEWB_OPTION_IS_SELECTED="These options are only available to the field if <b>Show in list view</b> option is selected."
|
||||||
COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET="These powers have successfully been reset."
|
COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_PUSHED="These Powers have successfully been pushed."
|
||||||
|
COM_COMPONENTBUILDER_THESE_POWERS_HAVE_SUCCESSFULLY_BEEN_RESET="These Powers have successfully been reset."
|
||||||
COM_COMPONENTBUILDER_THE_ADMIN_CUSTOM_TABS="The admin custom tabs"
|
COM_COMPONENTBUILDER_THE_ADMIN_CUSTOM_TABS="The admin custom tabs"
|
||||||
COM_COMPONENTBUILDER_THE_ADMIN_FIELDS="The admin fields"
|
COM_COMPONENTBUILDER_THE_ADMIN_FIELDS="The admin fields"
|
||||||
COM_COMPONENTBUILDER_THE_ADMIN_FIELDS_CONDITIONS="The admin fields conditions"
|
COM_COMPONENTBUILDER_THE_ADMIN_FIELDS_CONDITIONS="The admin fields conditions"
|
||||||
@@ -9082,15 +9109,19 @@ COM_COMPONENTBUILDER_THE_FILE_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The fil
|
|||||||
COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The folder path: <b>%s</b> does not exist, and was not added!"
|
COM_COMPONENTBUILDER_THE_FOLDER_PATH_BSB_DOES_NOT_EXIST_AND_WAS_NOT_ADDED="The folder path: <b>%s</b> does not exist, and was not added!"
|
||||||
COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for <b>%s</b> could not be made. Please check your signature details!"
|
COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP connection for <b>%s</b> could not be made. Please check your signature details!"
|
||||||
COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for <b>%s</b> was not well formed, please check your signature details!"
|
COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS="The FTP signature for <b>%s</b> was not well formed, please check your signature details!"
|
||||||
COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_POWERS_HAS_FAILED="The initialization of this Joomla powers has failed."
|
COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_FIELD_TYPES_HAS_FAILED="The initialization of this Joomla Field Types has failed."
|
||||||
COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED="The initialization of this powers has failed."
|
COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_JOOMLA_POWERS_HAS_FAILED="The initialization of this Joomla Powers has failed."
|
||||||
COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED="The Joomla power has successfully been pushed."
|
COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED="The initialization of this Powers has failed."
|
||||||
COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_RESET="The Joomla power has successfully been reset."
|
COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_PUSHED="The Joomla Field Type has successfully been pushed."
|
||||||
|
COM_COMPONENTBUILDER_THE_JOOMLA_FIELD_TYPE_HAS_SUCCESSFULLY_BEEN_RESET="The Joomla Field Type has successfully been reset."
|
||||||
|
COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED="The Joomla Power has successfully been pushed."
|
||||||
|
COM_COMPONENTBUILDER_THE_JOOMLA_POWER_HAS_SUCCESSFULLY_BEEN_RESET="The Joomla Power has successfully been reset."
|
||||||
COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE="The key of this package."
|
COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE="The key of this package."
|
||||||
COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS="The library config fields"
|
COM_COMPONENTBUILDER_THE_LIBRARY_CONFIG_FIELDS="The library config fields"
|
||||||
COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS="The library files, folders & URLs"
|
COM_COMPONENTBUILDER_THE_LIBRARY_FILES_FOLDERS_URLS="The library files, folders & URLs"
|
||||||
COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES="The local database Joomla powers has successfully been synced with the remote repositories."
|
COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_FIELD_TYPES_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES="The local database Joomla Field Types has successfully been synced with the remote repositories."
|
||||||
COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES="The local database powers has successfully been synced with the remote repositories."
|
COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_JOOMLA_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES="The local database Joomla Powers has successfully been synced with the remote repositories."
|
||||||
|
COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES="The local database Powers has successfully been synced with the remote repositories."
|
||||||
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your details are correct!"
|
COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT="The login to <b>%s</b> has failed, please check that your details are correct!"
|
||||||
COM_COMPONENTBUILDER_THE_MODULE_FILES_FOLDERS="The module files & folders"
|
COM_COMPONENTBUILDER_THE_MODULE_FILES_FOLDERS="The module files & folders"
|
||||||
COM_COMPONENTBUILDER_THE_MODULE_UPDATES="The module updates"
|
COM_COMPONENTBUILDER_THE_MODULE_UPDATES="The module updates"
|
||||||
@@ -9101,17 +9132,24 @@ COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: <code>%s<
|
|||||||
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
|
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
|
||||||
COM_COMPONENTBUILDER_THE_PLUGIN_FILES_FOLDERS="The plugin files & folders"
|
COM_COMPONENTBUILDER_THE_PLUGIN_FILES_FOLDERS="The plugin files & folders"
|
||||||
COM_COMPONENTBUILDER_THE_PLUGIN_UPDATES="The plugin updates"
|
COM_COMPONENTBUILDER_THE_PLUGIN_UPDATES="The plugin updates"
|
||||||
|
COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_PUSHED="The power has successfully been pushed."
|
||||||
COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET="The power has successfully been reset."
|
COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET="The power has successfully been reset."
|
||||||
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="The private key field could not be loaded for <b>%s</b> server!"
|
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER="The private key field could not be loaded for <b>%s</b> server!"
|
||||||
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!"
|
COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER="The private key file could not be loaded/found for <b>%s</b> server!"
|
||||||
COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING="The pro board is loading"
|
COM_COMPONENTBUILDER_THE_PRO_BOARD_IS_LOADING="The pro board is loading"
|
||||||
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_POWERS_HAS_FAILED="The push of these Joomla powers has failed."
|
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_FIELD_TYPES_HAS_FAILED="The push of these Joomla Field Types has failed."
|
||||||
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_POWER_HAS_FAILED="The push of this Joomla power has failed."
|
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_JOOMLA_POWERS_HAS_FAILED="The push of these Joomla Powers has failed."
|
||||||
|
COM_COMPONENTBUILDER_THE_PUSH_OF_THESE_POWERS_HAS_FAILED="The push of these Powers has failed."
|
||||||
|
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_FIELD_TYPE_HAS_FAILED="The push of this Joomla Field Type has failed."
|
||||||
|
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_JOOMLA_POWER_HAS_FAILED="The push of this Joomla Power has failed."
|
||||||
|
COM_COMPONENTBUILDER_THE_PUSH_OF_THIS_POWER_HAS_FAILED="The push of this power has failed."
|
||||||
COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading"
|
COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading"
|
||||||
COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE="The replace process had an error with table"
|
COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE="The replace process had an error with table"
|
||||||
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_POWERS_HAS_FAILED="The reset of these Joomla powers has failed."
|
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_FIELD_TYPES_HAS_FAILED="The reset of these Joomla Field Types has failed."
|
||||||
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_POWERS_HAS_FAILED="The reset of these powers has failed."
|
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_JOOMLA_POWERS_HAS_FAILED="The reset of these Joomla Powers has failed."
|
||||||
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_POWER_HAS_FAILED="The reset of this Joomla power has failed."
|
COM_COMPONENTBUILDER_THE_RESET_OF_THESE_POWERS_HAS_FAILED="The reset of these Powers has failed."
|
||||||
|
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_FIELD_TYPE_HAS_FAILED="The reset of this Joomla Field Type has failed."
|
||||||
|
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_JOOMLA_POWER_HAS_FAILED="The reset of this Joomla Power has failed."
|
||||||
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED="The reset of this power has failed."
|
COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED="The reset of this power has failed."
|
||||||
COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CHANGED_THE_LOCAL_BNAMESB_OF_EITHER_OR_THE_BSNIPPET_LIBRARY_OR_SNIPPET_TYPESB_IN_ANY_SMALL_WAY_THE_SYSTEM_WILL_NOT_BE_ABLE_TO_CONNECT_YOUR_LOCAL_SNIPPETS_WITH_THOSE_IN_THE_COMMUNITY_REPOSITORY_SO_WE_STRONGLY_ADVICE_TO_BKEEP_TO_THE_COMMUNITY_NAMINGB_TO_AVOID_MISMATCHING_THAT_WILL_IN_TURN_CAUSE_DUPLICATION_SO_IF_YOU_CHANGED_ANY_NAMES_JUST_CHANGE_THEM_BACK_AND_ALL_WILL_AGAIN_WORK_AS_EXPECTED="The search for the snippets are case sensitive so if you changed the local <b>names</b> of either or the <b>snippet, library or snippet types</b> in any small way, the system will not be able to connect your local snippets with those in the community repository. So we strongly advice to <b>keep to the community naming</b> to avoid mismatching, that will in turn cause duplication. So if you changed any names, just change them back and all will again work as expected."
|
COM_COMPONENTBUILDER_THE_SEARCH_FOR_THE_SNIPPETS_ARE_CASE_SENSITIVE_SO_IF_YOU_CHANGED_THE_LOCAL_BNAMESB_OF_EITHER_OR_THE_BSNIPPET_LIBRARY_OR_SNIPPET_TYPESB_IN_ANY_SMALL_WAY_THE_SYSTEM_WILL_NOT_BE_ABLE_TO_CONNECT_YOUR_LOCAL_SNIPPETS_WITH_THOSE_IN_THE_COMMUNITY_REPOSITORY_SO_WE_STRONGLY_ADVICE_TO_BKEEP_TO_THE_COMMUNITY_NAMINGB_TO_AVOID_MISMATCHING_THAT_WILL_IN_TURN_CAUSE_DUPLICATION_SO_IF_YOU_CHANGED_ANY_NAMES_JUST_CHANGE_THEM_BACK_AND_ALL_WILL_AGAIN_WORK_AS_EXPECTED="The search for the snippets are case sensitive so if you changed the local <b>names</b> of either or the <b>snippet, library or snippet types</b> in any small way, the system will not be able to connect your local snippets with those in the community repository. So we strongly advice to <b>keep to the community naming</b> to avoid mismatching, that will in turn cause duplication. So if you changed any names, just change them back and all will again work as expected."
|
||||||
COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE="The search process had an error with table"
|
COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE="The search process had an error with table"
|
||||||
@@ -9211,9 +9249,12 @@ COM_COMPONENTBUILDER_UPDATE_ALL="Update All"
|
|||||||
COM_COMPONENTBUILDER_UPDATE_ALL_DIVERGED_SNIPPETS="Update All Diverged Snippets"
|
COM_COMPONENTBUILDER_UPDATE_ALL_DIVERGED_SNIPPETS="Update All Diverged Snippets"
|
||||||
COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE="Update all items found with this database search, with the replace value."
|
COM_COMPONENTBUILDER_UPDATE_ALL_ITEMS_FOUND_WITH_THIS_DATABASE_SEARCH_WITH_THE_REPLACE_VALUE="Update all items found with this database search, with the replace value."
|
||||||
COM_COMPONENTBUILDER_UPDATE_ALL_OUT_DATED_SNIPPETS="Update All Out Dated Snippets"
|
COM_COMPONENTBUILDER_UPDATE_ALL_OUT_DATED_SNIPPETS="Update All Out Dated Snippets"
|
||||||
|
COM_COMPONENTBUILDER_UPDATE_OF_USER_S_S_FAILEDS="Update of user %s (%s) failed!%s"
|
||||||
COM_COMPONENTBUILDER_UP_TO_DATE="Up to date"
|
COM_COMPONENTBUILDER_UP_TO_DATE="Up to date"
|
||||||
COM_COMPONENTBUILDER_USAGE="Usage"
|
COM_COMPONENTBUILDER_USAGE="Usage"
|
||||||
COM_COMPONENTBUILDER_USED_IN="Used in"
|
COM_COMPONENTBUILDER_USED_IN="Used in"
|
||||||
|
COM_COMPONENTBUILDER_USER_CREATION_FAILED="User creation failed!"
|
||||||
|
COM_COMPONENTBUILDER_USER_S_S_CREATION_FAILEDS="User %s (%s) creation failed!%s"
|
||||||
COM_COMPONENTBUILDER_USE_BATCH="Use Batch"
|
COM_COMPONENTBUILDER_USE_BATCH="Use Batch"
|
||||||
COM_COMPONENTBUILDER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method."
|
COM_COMPONENTBUILDER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method."
|
||||||
COM_COMPONENTBUILDER_USE_KEY="Use Key"
|
COM_COMPONENTBUILDER_USE_KEY="Use Key"
|
||||||
@@ -9359,14 +9400,18 @@ COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_
|
|||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to clone a component, please contact your system administrator for more help."
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to clone a component, please contact your system administrator for more help."
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_DOWNLOAD_THE_COMPILER_ANIMATIONS="You do not have permission to download the compiler animations!"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_DOWNLOAD_THE_COMPILER_ANIMATIONS="You do not have permission to download the compiler animations!"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to import a component, please contact your system administrator for more help."
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to import a component, please contact your system administrator for more help."
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_JOOMLA_POWERS="You do not have permission to initialize Joomla powers"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_JOOMLA_FIELD_TYPES="You do not have permission to initialize Joomla Field Types"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_POWERS="You do not have permission to initialize powers"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_JOOMLA_POWERS="You do not have permission to initialize Joomla Powers"
|
||||||
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_POWERS="You do not have permission to initialize Powers"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THESE_EXTENSIONS="You do not have permission to install these extensions!"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THESE_EXTENSIONS="You do not have permission to install these extensions!"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_COMPONENT="You do not have permission to install the component!"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_COMPONENT="You do not have permission to install the component!"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_MODULE="You do not have permission to install the module!"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_MODULE="You do not have permission to install the module!"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_PLUGIN="You do not have permission to install the plugin!"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_PLUGIN="You do not have permission to install the plugin!"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_POWER="You do not have permission to push this Joomla power"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_FIELD_TYPE="You do not have permission to push this Joomla Field Type"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_POWER="You do not have permission to reset this Joomla power"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_JOOMLA_POWER="You do not have permission to push this Joomla Power"
|
||||||
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_PUSH_THIS_POWER="You do not have permission to push this power"
|
||||||
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_FIELD_TYPE="You do not have permission to reset this Joomla Field Type"
|
||||||
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_JOOMLA_POWER="You do not have permission to reset this Joomla Power"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_POWER="You do not have permission to reset this power"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_POWER="You do not have permission to reset this power"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE="You do not have permission to run the get boilerplate module!"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE="You do not have permission to run the get boilerplate module!"
|
||||||
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_TRANSLATOR_MODULE="You do not have permission to run the translator module!"
|
COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_TRANSLATOR_MODULE="You do not have permission to run the translator module!"
|
||||||
@@ -9378,7 +9423,8 @@ COM_COMPONENTBUILDER_YOU_MUST_ADD_AN_UNIQUE_PLACEHOLDER="You must add an unique
|
|||||||
COM_COMPONENTBUILDER_YOU_MUST_ADD_AN_UNIQUE_VALIDATION_RULE_NAME="You must add an unique validation rule name."
|
COM_COMPONENTBUILDER_YOU_MUST_ADD_AN_UNIQUE_VALIDATION_RULE_NAME="You must add an unique validation rule name."
|
||||||
COM_COMPONENTBUILDER_YOU_MUST_ENABLE_THE_BTIDYB_EXTENSION_IN_YOUR_PHPINI_FILE_SO_WE_CAN_TIDY_UP_YOUR_XML_IF_YOU_NEED_HELP_PLEASE_A_SSTART_HEREA="You must enable the <b>Tidy</b> extension in your php.ini file so we can tidy up your xml! If you need help please <a %s>start here</a>!"
|
COM_COMPONENTBUILDER_YOU_MUST_ENABLE_THE_BTIDYB_EXTENSION_IN_YOUR_PHPINI_FILE_SO_WE_CAN_TIDY_UP_YOUR_XML_IF_YOU_NEED_HELP_PLEASE_A_SSTART_HEREA="You must enable the <b>Tidy</b> extension in your php.ini file so we can tidy up your xml! If you need help please <a %s>start here</a>!"
|
||||||
COM_COMPONENTBUILDER_YOU_MUST_FIRST_LINK_AN_ADMIN_OR_A_CUSTOM_ADMIN_VIEW_TO_THIS_COMPONENT_THEN_YOU_CAN_SELECT_IT_HERE="You must first link an admin or a custom admin view to this component, then you can select it here"
|
COM_COMPONENTBUILDER_YOU_MUST_FIRST_LINK_AN_ADMIN_OR_A_CUSTOM_ADMIN_VIEW_TO_THIS_COMPONENT_THEN_YOU_CAN_SELECT_IT_HERE="You must first link an admin or a custom admin view to this component, then you can select it here"
|
||||||
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Joomla power, before you can use this feature."
|
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_FIELD_TYPE_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Joomla Field Type, before you can use this feature."
|
||||||
|
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_JOOMLA_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the Joomla Power, before you can use this feature."
|
||||||
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the power, before you can use this feature."
|
COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE="You must first save the power, before you can use this feature."
|
||||||
COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT="You must select a component!"
|
COM_COMPONENTBUILDER_YOU_MUST_SELECT_A_COMPONENT="You must select a component!"
|
||||||
COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS="You should add the correct owner details."
|
COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS="You should add the correct owner details."
|
||||||
|
@@ -588,6 +588,12 @@ COM_COMPONENTBUILDER_FIELDTYPES_IMPORT="Fieldtypes Import"
|
|||||||
COM_COMPONENTBUILDER_FIELDTYPES_IMPORT_DESC="Allows the users in this group to import import fieldtypes"
|
COM_COMPONENTBUILDER_FIELDTYPES_IMPORT_DESC="Allows the users in this group to import import fieldtypes"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU="Fieldtypes Submenu"
|
COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU="Fieldtypes Submenu"
|
||||||
COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU_DESC="Allows the users in this group to submenu of fieldtype"
|
COM_COMPONENTBUILDER_FIELDTYPES_SUBMENU_DESC="Allows the users in this group to submenu of fieldtype"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_INIT_BUTTON_ACCESS="Fieldtype Init Button Access"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_INIT_BUTTON_ACCESS_DESC="Allows the users in this group to access the init button."
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_PUSH_BUTTON_ACCESS="Fieldtype Push Button Access"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button."
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_RESET_BUTTON_ACCESS="Fieldtype Reset Button Access"
|
||||||
|
COM_COMPONENTBUILDER_FIELDTYPE_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
|
||||||
COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS="Get Snippets Access"
|
COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS="Get Snippets Access"
|
||||||
COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS_DESC="Allows the users in this group to access get snippets."
|
COM_COMPONENTBUILDER_GET_SNIPPETS_ACCESS_DESC="Allows the users in this group to access get snippets."
|
||||||
COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS="Get Snippets Custom Admin Views Button Access"
|
COM_COMPONENTBUILDER_GET_SNIPPETS_CUSTOM_ADMIN_VIEWS_BUTTON_ACCESS="Get Snippets Custom Admin Views Button Access"
|
||||||
@@ -1049,6 +1055,8 @@ COM_COMPONENTBUILDER_POWERS_SUBMENU="Powers Submenu"
|
|||||||
COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power"
|
COM_COMPONENTBUILDER_POWERS_SUBMENU_DESC="Allows the users in this group to submenu of power"
|
||||||
COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS="Power Init Button Access"
|
COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS="Power Init Button Access"
|
||||||
COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS_DESC="Allows the users in this group to access the init button."
|
COM_COMPONENTBUILDER_POWER_INIT_BUTTON_ACCESS_DESC="Allows the users in this group to access the init button."
|
||||||
|
COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS="Power Push Button Access"
|
||||||
|
COM_COMPONENTBUILDER_POWER_PUSH_BUTTON_ACCESS_DESC="Allows the users in this group to access the push button."
|
||||||
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS="Power Reset Button Access"
|
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS="Power Reset Button Access"
|
||||||
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
|
COM_COMPONENTBUILDER_POWER_RESET_BUTTON_ACCESS_DESC="Allows the users in this group to access the reset button."
|
||||||
COM_COMPONENTBUILDER_REPOSITORIES_ACCESS="Repositories Access"
|
COM_COMPONENTBUILDER_REPOSITORIES_ACCESS="Repositories Access"
|
||||||
|
45
admin/layouts/repository/placeholders_fullwidth.php
Normal file
45
admin/layouts/repository/placeholders_fullwidth.php
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 30th April, 2015
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
// No direct access to this file
|
||||||
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
// get the form
|
||||||
|
$form = $displayData->getForm();
|
||||||
|
|
||||||
|
// get the layout fields override method name (from layout path/ID)
|
||||||
|
$layout_path_array = explode('.', $this->getLayoutId());
|
||||||
|
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||||
|
// this name combination of tab and layout in the method name is the only work around
|
||||||
|
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||||
|
// example of layout name: details_left.php
|
||||||
|
// example of method name: getFields_details_left()
|
||||||
|
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||||
|
|
||||||
|
// get the fields
|
||||||
|
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||||
|
'placeholder_note',
|
||||||
|
'addplaceholders'
|
||||||
|
);
|
||||||
|
|
||||||
|
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||||
|
|
||||||
|
?>
|
||||||
|
<?php if ($fields && count((array) $fields)) :?>
|
||||||
|
<div class="form-vertical">
|
||||||
|
<?php foreach($fields as $field): ?>
|
||||||
|
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||||
|
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
@@ -18,12 +18,28 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
|
|||||||
use Joomla\CMS\Layout\LayoutHelper;
|
use Joomla\CMS\Layout\LayoutHelper;
|
||||||
use VDM\Joomla\Utilities\StringHelper;
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
|
||||||
$table_id = (isset($displayData['id'])) ? $displayData['id'] : StringHelper::random(7);
|
// Extract all keys from $displayData as individual variables.
|
||||||
$name = (isset($displayData['name'])) ? $displayData['name'] : false;
|
extract($displayData);
|
||||||
$table_class = (isset($displayData['table_class'])) ? $displayData['table_class'] : 'uk-table';
|
|
||||||
$table_container_class = (isset($displayData['table_container_class'])) ? $displayData['table_container_class'] : 'uk-overflow-auto';
|
// Assign default values for variables that might not be present in $displayData.
|
||||||
$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [Text::_('COM_COMPONENTBUILDER_NO'), Text::_('COM_COMPONENTBUILDER_HEADERS'), Text::_('COM_COMPONENTBUILDER_FOUND')];
|
|
||||||
$items = (isset($displayData['items'])) ? $displayData['items'] : 6;
|
// The 'table_id' parameter, defaulting to a randomly generated value if not set or is null.
|
||||||
|
$table_id = $id ?? StringHelper::random(7);
|
||||||
|
|
||||||
|
// The 'name' parameter, defaulting to false if not set or is null.
|
||||||
|
$name ??= false;
|
||||||
|
|
||||||
|
// The 'table_class' parameter, defaulting to 'uk-table' if not set or is null.
|
||||||
|
$table_class ??= 'uk-table';
|
||||||
|
|
||||||
|
// The 'table_container_class' parameter, defaulting to 'uk-overflow-auto' if not set or is null.
|
||||||
|
$table_container_class ??= 'uk-overflow-auto';
|
||||||
|
|
||||||
|
// The 'headers' parameter, defaulting to an array of default header values if not set or is null.
|
||||||
|
$headers ??= [Text::_('COM_COMPONENTBUILDER_NO'), Text::_('COM_COMPONENTBUILDER_HEADERS'), Text::_('COM_COMPONENTBUILDER_FOUND')];
|
||||||
|
|
||||||
|
// The 'items' parameter, defaulting to 6 if not set or is null.
|
||||||
|
$items ??= 6;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="<?php echo $$table_container_class; ?>">
|
<div class="<?php echo $$table_container_class; ?>">
|
||||||
|
@@ -1948,15 +1948,15 @@ class ComponentbuilderModelAjax extends ListModel
|
|||||||
{
|
{
|
||||||
// check if we have GUID setup
|
// check if we have GUID setup
|
||||||
$validGUID = function ($guid) {
|
$validGUID = function ($guid) {
|
||||||
if (method_exists('ComponentbuilderHelper', 'validGUID') && ComponentbuilderHelper::validGUID($guid))
|
if (method_exists(ComponentbuilderHelper::class, 'validGUID') && ComponentbuilderHelper::validGUID($guid))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
// check if functions exists
|
// check if functions exists
|
||||||
$guidEdit = method_exists('ComponentbuilderHelper', 'getEditButtonGUID');
|
$guidEdit = method_exists(ComponentbuilderHelper::class, 'getEditButtonGUID');
|
||||||
$getEdit = method_exists('ComponentbuilderHelper', 'getEditButton');
|
$getEdit = method_exists(ComponentbuilderHelper::class, 'getEditButton');
|
||||||
// reset bucket
|
// reset bucket
|
||||||
$bucket = array();
|
$bucket = array();
|
||||||
if (UtilitiesArrayHelper::check($value))
|
if (UtilitiesArrayHelper::check($value))
|
||||||
|
@@ -308,10 +308,10 @@ class ComponentbuilderModelCompiler extends ListModel
|
|||||||
/**
|
/**
|
||||||
* Get all components in the system
|
* Get all components in the system
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array|null
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
**/
|
**/
|
||||||
public function getComponents(): array
|
public function getComponents(): ?array
|
||||||
{
|
{
|
||||||
// Get a db connection.
|
// Get a db connection.
|
||||||
$db = $this->getDbo();
|
$db = $this->getDbo();
|
||||||
@@ -334,10 +334,9 @@ class ComponentbuilderModelCompiler extends ListModel
|
|||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
|
||||||
// return the result
|
// return the result
|
||||||
return $db->loadObjectList();
|
return $db->loadObjectList() ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all dynamic content
|
* Get all dynamic content
|
||||||
*
|
*
|
||||||
|
@@ -40,9 +40,9 @@ class JFormFieldNamespaces extends JFormFieldList
|
|||||||
protected function getOptions()
|
protected function getOptions()
|
||||||
{
|
{
|
||||||
// Get the user object.
|
// Get the user object.
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
// Get the databse object.
|
// Get the databse object.
|
||||||
$db = JFactory::getDBO();
|
$db = Factory::getDBO();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select($db->quoteName(array('a.guid','a.name','a.namespace','a.type','a.power_version'),array('guid','use_name','namespace','type','version')));
|
$query->select($db->quoteName(array('a.guid','a.name','a.namespace','a.type','a.power_version'),array('guid','use_name','namespace','type','version')));
|
||||||
$query->from($db->quoteName('#__componentbuilder_power', 'a'));
|
$query->from($db->quoteName('#__componentbuilder_power', 'a'));
|
||||||
@@ -60,7 +60,7 @@ class JFormFieldNamespaces extends JFormFieldList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get the input
|
// get the input
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
// get the id
|
// get the id
|
||||||
$power_id = $jinput->getInt('id', 0);
|
$power_id = $jinput->getInt('id', 0);
|
||||||
// if we have an id we remove all classes of the same namespace and name
|
// if we have an id we remove all classes of the same namespace and name
|
||||||
@@ -74,17 +74,17 @@ class JFormFieldNamespaces extends JFormFieldList
|
|||||||
// if none was found, we add this to set an alternative to set custom
|
// if none was found, we add this to set an alternative to set custom
|
||||||
if (!$items)
|
if (!$items)
|
||||||
{
|
{
|
||||||
$options[] = JHtml::_('select.option', '', JText::_('COM_COMPONENTBUILDER_NONE_FOUND'));
|
$options[] = Html::_('select.option', '', Text::_('COM_COMPONENTBUILDER_NONE_FOUND'));
|
||||||
}
|
}
|
||||||
if ($items)
|
if ($items)
|
||||||
{
|
{
|
||||||
if ($this->multiple === false)
|
if ($this->multiple === false)
|
||||||
{
|
{
|
||||||
$options[] = JHtml::_('select.option', '', JText::_('COM_COMPONENTBUILDER_SELECT_AN_OPTION'));
|
$options[] = Html::_('select.option', '', Text::_('COM_COMPONENTBUILDER_SELECT_AN_OPTION'));
|
||||||
}
|
}
|
||||||
foreach($items as $item)
|
foreach($items as $item)
|
||||||
{
|
{
|
||||||
$options[] = JHtml::_('select.option', $item->guid, str_replace('.','\\', $item->namespace) . ' [' . $item->use_name . '] (v' . $item->version . ' - ' . $item->type . ')');
|
$options[] = Html::_('select.option', $item->guid, str_replace('.','\\', $item->namespace) . ' [' . $item->use_name . '] (v' . $item->version . ' - ' . $item->type . ')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
@@ -141,6 +141,7 @@
|
|||||||
label="COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL"
|
label="COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_DESCRIPTION"
|
description="COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_DESCRIPTION"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
required="true">
|
required="true">
|
||||||
<!-- Option Set. -->
|
<!-- Option Set. -->
|
||||||
<option value="1">
|
<option value="1">
|
||||||
|
@@ -73,10 +73,10 @@
|
|||||||
<option value="a.type DESC">COM_COMPONENTBUILDER_FILTER_TYPE_DESCENDING</option>
|
<option value="a.type DESC">COM_COMPONENTBUILDER_FILTER_TYPE_DESCENDING</option>
|
||||||
<option value="a.location ASC">COM_COMPONENTBUILDER_FILTER_LOCATION_ASCENDING</option>
|
<option value="a.location ASC">COM_COMPONENTBUILDER_FILTER_LOCATION_ASCENDING</option>
|
||||||
<option value="a.location DESC">COM_COMPONENTBUILDER_FILTER_LOCATION_DESCENDING</option>
|
<option value="a.location DESC">COM_COMPONENTBUILDER_FILTER_LOCATION_DESCENDING</option>
|
||||||
<option value="h. ASC">COM_COMPONENTBUILDER_FILTER_ADMIN_VIEWS_ASCENDING</option>
|
<option value="g. ASC">COM_COMPONENTBUILDER_FILTER_ADMIN_VIEWS_ASCENDING</option>
|
||||||
<option value="h. DESC">COM_COMPONENTBUILDER_FILTER_ADMIN_VIEWS_DESCENDING</option>
|
<option value="g. DESC">COM_COMPONENTBUILDER_FILTER_ADMIN_VIEWS_DESCENDING</option>
|
||||||
<option value="i. ASC">COM_COMPONENTBUILDER_FILTER_SITE_VIEWS_ASCENDING</option>
|
<option value="h. ASC">COM_COMPONENTBUILDER_FILTER_SITE_VIEWS_ASCENDING</option>
|
||||||
<option value="i. DESC">COM_COMPONENTBUILDER_FILTER_SITE_VIEWS_DESCENDING</option>
|
<option value="h. DESC">COM_COMPONENTBUILDER_FILTER_SITE_VIEWS_DESCENDING</option>
|
||||||
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
|
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
|
||||||
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
|
<option value="a.id DESC">JGRID_HEADING_ID_DESC</option>
|
||||||
</field>
|
</field>
|
||||||
|
@@ -115,7 +115,7 @@
|
|||||||
<option value="3">
|
<option value="3">
|
||||||
COM_COMPONENTBUILDER_HELP_DOCUMENT_URL</option>
|
COM_COMPONENTBUILDER_HELP_DOCUMENT_URL</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Groups Field. Type: Usergrouplist. (custom) -->
|
<!-- Groups Field. Type: Usergrouplist. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="usergrouplist"
|
type="usergrouplist"
|
||||||
name="groups"
|
name="groups"
|
||||||
|
@@ -284,7 +284,7 @@
|
|||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL"
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_DESCRIPTION"
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_DESCRIPTION"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="0"
|
default="1"
|
||||||
required="true">
|
required="true">
|
||||||
<!-- Option Set. -->
|
<!-- Option Set. -->
|
||||||
<option value="1">
|
<option value="1">
|
||||||
|
@@ -235,10 +235,10 @@
|
|||||||
label="COM_COMPONENTBUILDER_POWER_NAMESPACE_LABEL"
|
label="COM_COMPONENTBUILDER_POWER_NAMESPACE_LABEL"
|
||||||
layout="joomla.form.field.subform.repeatable-table"
|
layout="joomla.form.field.subform.repeatable-table"
|
||||||
multiple="true"
|
multiple="true"
|
||||||
buttons="add,remove,move"
|
buttons="add,remove"
|
||||||
icon="list"
|
icon="list"
|
||||||
max="30"
|
max="30"
|
||||||
min="1"
|
min="0"
|
||||||
nested_depth="1">
|
nested_depth="1">
|
||||||
<form hidden="true" name="list_namespace_modal" repeat="true">
|
<form hidden="true" name="list_namespace_modal" repeat="true">
|
||||||
<!-- Use Field. Type: Text. (joomla) -->
|
<!-- Use Field. Type: Text. (joomla) -->
|
||||||
@@ -493,7 +493,8 @@
|
|||||||
type="namespaces"
|
type="namespaces"
|
||||||
name="use"
|
name="use"
|
||||||
label="COM_COMPONENTBUILDER_POWER_USE_LABEL"
|
label="COM_COMPONENTBUILDER_POWER_USE_LABEL"
|
||||||
class="list_class span12"
|
class="span12"
|
||||||
|
layout="joomla.form.field.list-fancy-select"
|
||||||
multiple="false"
|
multiple="false"
|
||||||
default="0"
|
default="0"
|
||||||
button="false"
|
button="false"
|
||||||
|
@@ -155,6 +155,8 @@
|
|||||||
COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER</option>
|
COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER</option>
|
||||||
<option value="2">
|
<option value="2">
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER</option>
|
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER</option>
|
||||||
|
<option value="3">
|
||||||
|
COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_FIELD_TYPES</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Type Field. Type: List. (joomla) -->
|
<!-- Type Field. Type: List. (joomla) -->
|
||||||
<field
|
<field
|
||||||
@@ -207,6 +209,51 @@
|
|||||||
validate="guid"
|
validate="guid"
|
||||||
hint="COM_COMPONENTBUILDER_REPOSITORY_GUID_HINT"
|
hint="COM_COMPONENTBUILDER_REPOSITORY_GUID_HINT"
|
||||||
/>
|
/>
|
||||||
|
<!-- Addplaceholders Field. Type: Subform. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="subform"
|
||||||
|
name="addplaceholders"
|
||||||
|
label="COM_COMPONENTBUILDER_REPOSITORY_ADDPLACEHOLDERS_LABEL"
|
||||||
|
layout="joomla.form.field.subform.repeatable-table"
|
||||||
|
multiple="true"
|
||||||
|
description="COM_COMPONENTBUILDER_REPOSITORY_ADDPLACEHOLDERS_DESCRIPTION"
|
||||||
|
default=""
|
||||||
|
icon="list">
|
||||||
|
<form hidden="true" name="list_addplaceholders_modal" repeat="true">
|
||||||
|
<!-- Target Field. Type: Text. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="text"
|
||||||
|
name="target"
|
||||||
|
label="COM_COMPONENTBUILDER_REPOSITORY_TARGET_LABEL"
|
||||||
|
size="50"
|
||||||
|
maxlength="150"
|
||||||
|
description="COM_COMPONENTBUILDER_REPOSITORY_TARGET_DESCRIPTION"
|
||||||
|
class="text_area"
|
||||||
|
required="true"
|
||||||
|
filter="STRING"
|
||||||
|
message="COM_COMPONENTBUILDER_REPOSITORY_TARGET_MESSAGE"
|
||||||
|
hint="COM_COMPONENTBUILDER_REPOSITORY_TARGET_HINT"
|
||||||
|
autocomplete="off"
|
||||||
|
/>
|
||||||
|
<!-- Value Field. Type: Textarea. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="textarea"
|
||||||
|
name="value"
|
||||||
|
label="COM_COMPONENTBUILDER_REPOSITORY_VALUE_LABEL"
|
||||||
|
rows="1"
|
||||||
|
cols="5"
|
||||||
|
default="default text"
|
||||||
|
description="COM_COMPONENTBUILDER_REPOSITORY_VALUE_DESCRIPTION"
|
||||||
|
message="COM_COMPONENTBUILDER_REPOSITORY_VALUE_MESSAGE"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="RAW"
|
||||||
|
hint="COM_COMPONENTBUILDER_REPOSITORY_VALUE_HINT"
|
||||||
|
required="true"
|
||||||
|
/>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
<!-- Placeholder_note Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
|
<field type="note" name="placeholder_note" label="COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_LABEL" description="COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDER_NOTE_DESCRIPTION" heading="h4" class="alert alert-info placeholder_note" />
|
||||||
<!-- Access_repo Field. Type: Radio. (joomla) -->
|
<!-- Access_repo Field. Type: Radio. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="radio"
|
type="radio"
|
||||||
@@ -214,9 +261,9 @@
|
|||||||
label="COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_LABEL"
|
label="COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_DESCRIPTION"
|
description="COM_COMPONENTBUILDER_REPOSITORY_ACCESS_REPO_DESCRIPTION"
|
||||||
class="btn-group btn-group-yesno"
|
class="btn-group btn-group-yesno"
|
||||||
default="">
|
default="0">
|
||||||
<!-- Option Set. -->
|
<!-- Option Set. -->
|
||||||
<option value="">
|
<option value="0">
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_GLOBAL</option>
|
COM_COMPONENTBUILDER_REPOSITORY_GLOBAL</option>
|
||||||
<option value="1">
|
<option value="1">
|
||||||
COM_COMPONENTBUILDER_REPOSITORY_OVERRIDE</option>
|
COM_COMPONENTBUILDER_REPOSITORY_OVERRIDE</option>
|
||||||
|
@@ -21,7 +21,6 @@ use Joomla\Utilities\ArrayHelper;
|
|||||||
use Joomla\CMS\Helper\TagsHelper;
|
use Joomla\CMS\Helper\TagsHelper;
|
||||||
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper;
|
||||||
use VDM\Joomla\Utilities\ObjectHelper;
|
use VDM\Joomla\Utilities\ObjectHelper;
|
||||||
use VDM\Joomla\Utilities\JsonHelper;
|
|
||||||
use VDM\Joomla\Utilities\StringHelper;
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -166,8 +165,17 @@ class ComponentbuilderModelHelp_documents extends ListModel
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert groups
|
// decode groups
|
||||||
$item->groups = JsonHelper::string($item->groups, ', ', 'groups');
|
$groupsArray = json_decode($item->groups, true);
|
||||||
|
if (UtilitiesArrayHelper::check($groupsArray))
|
||||||
|
{
|
||||||
|
$groupsNames = [];
|
||||||
|
foreach ($groupsArray as $groups)
|
||||||
|
{
|
||||||
|
$groupsNames[] = ComponentbuilderHelper::getGroupName($groups);
|
||||||
|
}
|
||||||
|
$item->groups = implode(', ', $groupsNames);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,7 +274,7 @@ class ComponentbuilderModelHelp_documents extends ListModel
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$search = $db->quote('%' . $db->escape($search) . '%');
|
$search = $db->quote('%' . $db->escape($search) . '%');
|
||||||
$query->where('(a.title LIKE '.$search.' OR a.type LIKE '.$search.' OR a.location LIKE '.$search.' OR a.admin_view LIKE '.$search.' OR h. LIKE '.$search.' OR a.site_view LIKE '.$search.' OR i. LIKE '.$search.')');
|
$query->where('(a.title LIKE '.$search.' OR a.type LIKE '.$search.' OR a.location LIKE '.$search.' OR a.admin_view LIKE '.$search.' OR g. LIKE '.$search.' OR a.site_view LIKE '.$search.' OR h. LIKE '.$search.')');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1125,7 +1125,7 @@ class ComponentbuilderModelLibrary extends AdminModel
|
|||||||
// also check to insure these names are not used again
|
// also check to insure these names are not used again
|
||||||
if (!isset(ComponentbuilderHelper::$libraryNames[$data['id']]) && in_array($data['name'], ComponentbuilderHelper::$libraryNames))
|
if (!isset(ComponentbuilderHelper::$libraryNames[$data['id']]) && in_array($data['name'], ComponentbuilderHelper::$libraryNames))
|
||||||
{
|
{
|
||||||
$data['name'] = $this->generateUniqe('name', $data['name']);
|
$data['name'] = $this->generateUnique('name', $data['name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the Params Items to data
|
// Set the Params Items to data
|
||||||
|
@@ -199,7 +199,8 @@ class ComponentbuilderModelRepositories extends ListModel
|
|||||||
$targetArray = array(
|
$targetArray = array(
|
||||||
0 => 'COM_COMPONENTBUILDER_REPOSITORY_SELECT_AN_OPTION',
|
0 => 'COM_COMPONENTBUILDER_REPOSITORY_SELECT_AN_OPTION',
|
||||||
1 => 'COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER',
|
1 => 'COM_COMPONENTBUILDER_REPOSITORY_SUPER_POWER',
|
||||||
2 => 'COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER'
|
2 => 'COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_POWER',
|
||||||
|
3 => 'COM_COMPONENTBUILDER_REPOSITORY_JOOMLA_FIELD_TYPES'
|
||||||
);
|
);
|
||||||
// Now check if value is found in this array
|
// Now check if value is found in this array
|
||||||
if (isset($targetArray[$value]) && StringHelper::check($targetArray[$value]))
|
if (isset($targetArray[$value]) && StringHelper::check($targetArray[$value]))
|
||||||
|
@@ -58,6 +58,12 @@ class ComponentbuilderModelRepository extends AdminModel
|
|||||||
'target',
|
'target',
|
||||||
'access_repo'
|
'access_repo'
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
'placeholders' => array(
|
||||||
|
'fullwidth' => array(
|
||||||
|
'placeholder_note',
|
||||||
|
'addplaceholders'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -122,6 +128,14 @@ class ComponentbuilderModelRepository extends AdminModel
|
|||||||
$registry->loadString($item->metadata);
|
$registry->loadString($item->metadata);
|
||||||
$item->metadata = $registry->toArray();
|
$item->metadata = $registry->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($item->addplaceholders))
|
||||||
|
{
|
||||||
|
// Convert the addplaceholders field to an array.
|
||||||
|
$addplaceholders = new Registry;
|
||||||
|
$addplaceholders->loadString($item->addplaceholders);
|
||||||
|
$item->addplaceholders = $addplaceholders->toArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
@@ -840,6 +854,19 @@ class ComponentbuilderModelRepository extends AdminModel
|
|||||||
$data['guid'] = (string) GuidHelper::get();
|
$data['guid'] = (string) GuidHelper::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the addplaceholders items to data.
|
||||||
|
if (isset($data['addplaceholders']) && is_array($data['addplaceholders']))
|
||||||
|
{
|
||||||
|
$addplaceholders = new Registry;
|
||||||
|
$addplaceholders->loadArray($data['addplaceholders']);
|
||||||
|
$data['addplaceholders'] = (string) $addplaceholders;
|
||||||
|
}
|
||||||
|
elseif (!isset($data['addplaceholders']))
|
||||||
|
{
|
||||||
|
// Set the empty addplaceholders to data
|
||||||
|
$data['addplaceholders'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
// Set the Params Items to data
|
// Set the Params Items to data
|
||||||
if (isset($data['params']) && is_array($data['params']))
|
if (isset($data['params']) && is_array($data['params']))
|
||||||
{
|
{
|
||||||
|
@@ -220,10 +220,10 @@ class ComponentbuilderModelSearch extends ItemModel
|
|||||||
/**
|
/**
|
||||||
* Get all components in the system
|
* Get all components in the system
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array|null
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
**/
|
**/
|
||||||
public function getComponents(): array
|
public function getComponents(): ?array
|
||||||
{
|
{
|
||||||
// Get a db connection.
|
// Get a db connection.
|
||||||
$db = $this->getDbo();
|
$db = $this->getDbo();
|
||||||
@@ -246,7 +246,6 @@ class ComponentbuilderModelSearch extends ItemModel
|
|||||||
$db->setQuery($query);
|
$db->setQuery($query);
|
||||||
|
|
||||||
// return the result
|
// return the result
|
||||||
return $db->loadObjectList();
|
return $db->loadObjectList() ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
1
admin/sql/updates/mysql/3.2.3.sql
Normal file
1
admin/sql/updates/mysql/3.2.3.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
@@ -188,6 +188,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
<h3><?php echo Text::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT', $this->user->name); ?></h3>
|
<h3><?php echo Text::sprintf('COM_COMPONENTBUILDER_S_PLEASE_WAIT', $this->user->name); ?></h3>
|
||||||
<p style="font-size: smaller;"><?php echo Text::_('COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT'); ?></p>
|
<p style="font-size: smaller;"><?php echo Text::_('COM_COMPONENTBUILDER_THIS_MAY_TAKE_A_WHILE_DEPENDING_ON_THE_SIZE_OF_YOUR_PROJECT'); ?></p>
|
||||||
<p><b><span class="component-name"><?php echo Text::_('COM_COMPONENTBUILDER_THE_COMPONENT'); ?></span></b> <?php echo Text::_('COM_COMPONENTBUILDER_IS_BEING_COMPILED'); ?> <span class="loading-dots">.</span></p>
|
<p><b><span class="component-name"><?php echo Text::_('COM_COMPONENTBUILDER_THE_COMPONENT'); ?></span></b> <?php echo Text::_('COM_COMPONENTBUILDER_IS_BEING_COMPILED'); ?> <span class="loading-dots">.</span></p>
|
||||||
|
<p style="font-size: smaller;"><?php echo Text::_('COM_COMPONENTBUILDER_DURING_THE_INITIAL_COMPILATION_OF_ANY_COMPONENT_THE_PROCESS_MAY_TAKE_ADDITIONAL_TIME_AS_WE_RETRIEVE_AND_CONFIGURE_THE_ASSOCIATED_SUPERPOWERS_'); ?></p>
|
||||||
<div style="text-align: center;"><?php echo ComponentbuilderHelper::getDynamicContent('builder-gif', $this->builder_gif_size); ?></div>
|
<div style="text-align: center;"><?php echo ComponentbuilderHelper::getDynamicContent('builder-gif', $this->builder_gif_size); ?></div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -638,13 +638,13 @@ class ComponentbuilderViewCompiler extends HtmlView
|
|||||||
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
|
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
|
||||||
{
|
{
|
||||||
// check if the CSS file exists.
|
// check if the CSS file exists.
|
||||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
||||||
{
|
{
|
||||||
// load the css.
|
// load the css.
|
||||||
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
||||||
}
|
}
|
||||||
// check if the JavaScript file exists.
|
// check if the JavaScript file exists.
|
||||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
||||||
{
|
{
|
||||||
// load the js.
|
// load the js.
|
||||||
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
||||||
|
@@ -161,6 +161,16 @@ class ComponentbuilderViewFieldtype extends HtmlView
|
|||||||
{
|
{
|
||||||
ToolbarHelper::custom('fieldtype.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
|
ToolbarHelper::custom('fieldtype.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
|
||||||
}
|
}
|
||||||
|
if ($this->canDo->get('fieldtype.reset'))
|
||||||
|
{
|
||||||
|
// add Reset button.
|
||||||
|
ToolbarHelper::custom('fieldtype.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
|
||||||
|
}
|
||||||
|
if ($this->canDo->get('fieldtype.push'))
|
||||||
|
{
|
||||||
|
// add Push button.
|
||||||
|
ToolbarHelper::custom('fieldtype.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
|
||||||
|
}
|
||||||
ToolbarHelper::cancel('fieldtype.cancel', 'JTOOLBAR_CLOSE');
|
ToolbarHelper::cancel('fieldtype.cancel', 'JTOOLBAR_CLOSE');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -154,6 +154,21 @@ class ComponentbuilderViewFieldtypes extends HtmlView
|
|||||||
ToolbarHelper::custom('fieldtypes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
|
ToolbarHelper::custom('fieldtypes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($this->user->authorise('fieldtype.init', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
// add Init button.
|
||||||
|
ToolbarHelper::custom('fieldtypes.initPowers', 'health custom-button-initpowers', '', 'COM_COMPONENTBUILDER_INIT', false);
|
||||||
|
}
|
||||||
|
if ($this->user->authorise('fieldtype.reset', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
// add Reset button.
|
||||||
|
ToolbarHelper::custom('fieldtypes.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
|
||||||
|
}
|
||||||
|
if ($this->user->authorise('fieldtype.push', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
// add Push button.
|
||||||
|
ToolbarHelper::custom('fieldtypes.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->canDo->get('core.import') && $this->canDo->get('fieldtype.import'))
|
if ($this->canDo->get('core.import') && $this->canDo->get('fieldtype.import'))
|
||||||
{
|
{
|
||||||
|
@@ -117,13 +117,13 @@ class ComponentbuilderViewGet_snippets extends HtmlView
|
|||||||
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
|
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
|
||||||
{
|
{
|
||||||
// check if the CSS file exists.
|
// check if the CSS file exists.
|
||||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
||||||
{
|
{
|
||||||
// load the css.
|
// load the css.
|
||||||
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
||||||
}
|
}
|
||||||
// check if the JavaScript file exists.
|
// check if the JavaScript file exists.
|
||||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
||||||
{
|
{
|
||||||
// load the js.
|
// load the js.
|
||||||
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
||||||
|
@@ -45,10 +45,10 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
|
|||||||
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL', 'a.location', $this->listDirn, $this->listOrder); ?>
|
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL', 'a.location', $this->listDirn, $this->listOrder); ?>
|
||||||
</th>
|
</th>
|
||||||
<th class="nowrap hidden-phone" >
|
<th class="nowrap hidden-phone" >
|
||||||
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL', 'h.', $this->listDirn, $this->listOrder); ?>
|
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL', 'g.', $this->listDirn, $this->listOrder); ?>
|
||||||
</th>
|
</th>
|
||||||
<th class="nowrap hidden-phone" >
|
<th class="nowrap hidden-phone" >
|
||||||
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL', 'i.', $this->listDirn, $this->listOrder); ?>
|
<?php echo Html::_('searchtools.sort', 'COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL', 'h.', $this->listDirn, $this->listOrder); ?>
|
||||||
</th>
|
</th>
|
||||||
<?php if ($this->canState): ?>
|
<?php if ($this->canState): ?>
|
||||||
<th width="10" class="nowrap center" >
|
<th width="10" class="nowrap center" >
|
||||||
|
@@ -310,8 +310,8 @@ class ComponentbuilderViewHelp_documents extends HtmlView
|
|||||||
'a.title' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TITLE_LABEL'),
|
'a.title' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TITLE_LABEL'),
|
||||||
'a.type' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL'),
|
'a.type' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL'),
|
||||||
'a.location' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL'),
|
'a.location' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL'),
|
||||||
'h.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL'),
|
'g.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL'),
|
||||||
'i.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL'),
|
'h.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL'),
|
||||||
'a.id' => Text::_('JGRID_HEADING_ID')
|
'a.id' => Text::_('JGRID_HEADING_ID')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -163,6 +163,11 @@ class ComponentbuilderViewPower extends HtmlView
|
|||||||
// add Reset button.
|
// add Reset button.
|
||||||
ToolbarHelper::custom('power.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
|
ToolbarHelper::custom('power.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
|
||||||
}
|
}
|
||||||
|
if ($this->canDo->get('power.push'))
|
||||||
|
{
|
||||||
|
// add Push button.
|
||||||
|
ToolbarHelper::custom('power.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
|
||||||
|
}
|
||||||
ToolbarHelper::cancel('power.cancel', 'JTOOLBAR_CLOSE');
|
ToolbarHelper::cancel('power.cancel', 'JTOOLBAR_CLOSE');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -159,6 +159,11 @@ class ComponentbuilderViewPowers extends HtmlView
|
|||||||
// add Reset button.
|
// add Reset button.
|
||||||
ToolbarHelper::custom('powers.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
|
ToolbarHelper::custom('powers.resetPowers', 'joomla custom-button-resetpowers', '', 'COM_COMPONENTBUILDER_RESET', false);
|
||||||
}
|
}
|
||||||
|
if ($this->user->authorise('power.push', 'com_componentbuilder'))
|
||||||
|
{
|
||||||
|
// add Push button.
|
||||||
|
ToolbarHelper::custom('powers.pushPowers', 'share custom-button-pushpowers', '', 'COM_COMPONENTBUILDER_PUSH', false);
|
||||||
|
}
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ComponentbuilderHelper::getHelpUrl('powers');
|
$this->help_url = ComponentbuilderHelper::getHelpUrl('powers');
|
||||||
|
@@ -58,6 +58,16 @@ $componentParams = $this->params; // will be removed just use $this->params inst
|
|||||||
</div>
|
</div>
|
||||||
<?php echo Html::_('bootstrap.endTab'); ?>
|
<?php echo Html::_('bootstrap.endTab'); ?>
|
||||||
|
|
||||||
|
<?php echo Html::_('bootstrap.addTab', 'repositoryTab', 'placeholders', Text::_('COM_COMPONENTBUILDER_REPOSITORY_PLACEHOLDERS', true)); ?>
|
||||||
|
<div class="row-fluid form-horizontal-desktop">
|
||||||
|
</div>
|
||||||
|
<div class="row-fluid form-horizontal-desktop">
|
||||||
|
<div class="span12">
|
||||||
|
<?php echo LayoutHelper::render('repository.placeholders_fullwidth', $this); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php echo Html::_('bootstrap.endTab'); ?>
|
||||||
|
|
||||||
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
|
<?php $this->ignore_fieldsets = array('details','metadata','vdmmetadata','accesscontrol'); ?>
|
||||||
<?php $this->tab_name = 'repositoryTab'; ?>
|
<?php $this->tab_name = 'repositoryTab'; ?>
|
||||||
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
|
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
|
||||||
|
@@ -372,13 +372,13 @@ class ComponentbuilderViewSearch extends HtmlView
|
|||||||
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
|
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
|
||||||
{
|
{
|
||||||
// check if the CSS file exists.
|
// check if the CSS file exists.
|
||||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
|
||||||
{
|
{
|
||||||
// load the css.
|
// load the css.
|
||||||
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
|
||||||
}
|
}
|
||||||
// check if the JavaScript file exists.
|
// check if the JavaScript file exists.
|
||||||
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
if (@file_exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
|
||||||
{
|
{
|
||||||
// load the js.
|
// load the js.
|
||||||
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
|
||||||
|
@@ -1,15 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<extension type="component" version="3.10" method="upgrade">
|
<extension type="component" version="3.10" method="upgrade">
|
||||||
<name>COM_COMPONENTBUILDER</name>
|
<name>COM_COMPONENTBUILDER</name>
|
||||||
<creationDate>16th August, 2024</creationDate>
|
<creationDate>20th September, 2024</creationDate>
|
||||||
<author>Llewellyn van der Merwe</author>
|
<author>Llewellyn van der Merwe</author>
|
||||||
<authorEmail>joomla@vdm.io</authorEmail>
|
<authorEmail>joomla@vdm.io</authorEmail>
|
||||||
<authorUrl>https://dev.vdm.io</authorUrl>
|
<authorUrl>https://dev.vdm.io</authorUrl>
|
||||||
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
|
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
|
||||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||||
<version>3.2.3</version>
|
<version>3.2.4</version>
|
||||||
<description>< is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
|
<p>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.
|
||||||
|
|
||||||
|
@@ -178,4 +178,22 @@
|
|||||||
<maintainerurl>https://dev.vdm.io</maintainerurl>
|
<maintainerurl>https://dev.vdm.io</maintainerurl>
|
||||||
<targetplatform name="joomla" version="3.*"/>
|
<targetplatform name="joomla" version="3.*"/>
|
||||||
</update>
|
</update>
|
||||||
|
<update>
|
||||||
|
<name>Component Builder</name>
|
||||||
|
<description>Builds Complex Joomla Components</description>
|
||||||
|
<element>pkg_component_builder</element>
|
||||||
|
<type>package</type>
|
||||||
|
<client>site</client>
|
||||||
|
<version>3.2.4</version>
|
||||||
|
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
||||||
|
<downloads>
|
||||||
|
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.4.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<tags>
|
||||||
|
<tag>stable</tag>
|
||||||
|
</tags>
|
||||||
|
<maintainer>Llewellyn van der Merwe</maintainer>
|
||||||
|
<maintainerurl>https://dev.vdm.io</maintainerurl>
|
||||||
|
<targetplatform name="joomla" version="3.*"/>
|
||||||
|
</update>
|
||||||
</updates>
|
</updates>
|
@@ -65,7 +65,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'comment' => 'FK to the #__assets table.'
|
'comment' => 'FK to the #__assets table.'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
@@ -80,7 +80,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(11)',
|
'type' => 'INT(11)',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'published' => [
|
'published' => [
|
||||||
@@ -94,7 +94,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'TINYINT(3)',
|
'type' => 'TINYINT(3)',
|
||||||
'default' => '1',
|
'default' => '1',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'state'
|
'key_name' => 'state'
|
||||||
]
|
]
|
||||||
@@ -110,7 +110,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'modifiedby'
|
'key_name' => 'modifiedby'
|
||||||
]
|
]
|
||||||
@@ -126,7 +126,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'created_by' => [
|
'created_by' => [
|
||||||
@@ -140,7 +140,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'createdby'
|
'key_name' => 'createdby'
|
||||||
]
|
]
|
||||||
@@ -156,7 +156,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'checked_out' => [
|
'checked_out' => [
|
||||||
@@ -170,7 +170,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL',
|
'null_switch' => 'NULL',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'key_name' => 'checkout'
|
'key_name' => 'checkout'
|
||||||
]
|
]
|
||||||
@@ -186,7 +186,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'DATETIME',
|
'type' => 'DATETIME',
|
||||||
'default' => '0000-00-00 00:00:00',
|
'default' => '0000-00-00 00:00:00',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'hits' => [
|
'hits' => [
|
||||||
@@ -200,7 +200,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'version' => [
|
'version' => [
|
||||||
@@ -214,7 +214,7 @@ abstract class BaseTable implements Tableinterface
|
|||||||
'db' => [
|
'db' => [
|
||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '1',
|
'default' => '1',
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'params' => [
|
'params' => [
|
||||||
|
@@ -118,7 +118,7 @@ abstract class Model implements ModelInterface
|
|||||||
* @return array|null
|
* @return array|null
|
||||||
* @since 3.2.2
|
* @since 3.2.2
|
||||||
*/
|
*/
|
||||||
public function values(?array $items = null, string $field, ?string $table = null): ?array
|
public function values(?array $items, string $field, ?string $table = null): ?array
|
||||||
{
|
{
|
||||||
// check if this is a valid table
|
// check if this is a valid table
|
||||||
if (ArrayHelper::check($items))
|
if (ArrayHelper::check($items))
|
||||||
|
@@ -17,6 +17,7 @@ use VDM\Joomla\Interfaces\Data\ItemsInterface as Items;
|
|||||||
use VDM\Joomla\Interfaces\Readme\ItemInterface as ItemReadme;
|
use VDM\Joomla\Interfaces\Readme\ItemInterface as ItemReadme;
|
||||||
use VDM\Joomla\Interfaces\Readme\MainInterface as MainReadme;
|
use VDM\Joomla\Interfaces\Readme\MainInterface as MainReadme;
|
||||||
use VDM\Joomla\Interfaces\Git\Repository\ContentsInterface as Git;
|
use VDM\Joomla\Interfaces\Git\Repository\ContentsInterface as Git;
|
||||||
|
use VDM\Joomla\Utilities\ObjectHelper;
|
||||||
use VDM\Joomla\Interfaces\Remote\SetInterface;
|
use VDM\Joomla\Interfaces\Remote\SetInterface;
|
||||||
|
|
||||||
|
|
||||||
@@ -147,6 +148,27 @@ abstract class Set implements SetInterface
|
|||||||
*/
|
*/
|
||||||
protected string $index_settings_path = 'index.json';
|
protected string $index_settings_path = 'index.json';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Core Placeholders
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected array $placeholders = [
|
||||||
|
'[['.'[NamespacePrefix]]]' => 'VDM',
|
||||||
|
'[['.'[ComponentNamespace]]]' => 'Componentbuilder',
|
||||||
|
'[['.'[Component]]]' => 'Componentbuilder',
|
||||||
|
'[['.'[component]]]' => 'componentbuilder'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Repo Placeholders
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected array $repoPlaceholders = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
@@ -499,55 +521,10 @@ abstract class Set implements SetInterface
|
|||||||
* @since 3.2.2
|
* @since 3.2.2
|
||||||
*/
|
*/
|
||||||
protected function getLocalItems(array $guids): ?array
|
protected function getLocalItems(array $guids): ?array
|
||||||
{
|
|
||||||
$items = $this->fetchLocalItems($guids);
|
|
||||||
|
|
||||||
if ($items === null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->mapItems($items);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch items from the database
|
|
||||||
*
|
|
||||||
* @param array $guids The global unique ids of the items
|
|
||||||
*
|
|
||||||
* @return array|null
|
|
||||||
* @since 3.2.2
|
|
||||||
*/
|
|
||||||
protected function fetchLocalItems(array $guids): ?array
|
|
||||||
{
|
{
|
||||||
return $this->items->table($this->getTable())->get($guids);
|
return $this->items->table($this->getTable())->get($guids);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Map items to their properties
|
|
||||||
*
|
|
||||||
* @param array $items The items fetched from the database
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
* @since 3.2.2
|
|
||||||
*/
|
|
||||||
protected function mapItems(array $items): array
|
|
||||||
{
|
|
||||||
$bucket = [];
|
|
||||||
|
|
||||||
foreach ($items as $item)
|
|
||||||
{
|
|
||||||
if (!isset($item->guid))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$bucket[$item->guid] = $this->mapItem($item);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $bucket;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map a single item to its properties
|
* Map a single item to its properties
|
||||||
*
|
*
|
||||||
@@ -561,9 +538,17 @@ abstract class Set implements SetInterface
|
|||||||
$power = [];
|
$power = [];
|
||||||
|
|
||||||
foreach ($this->map as $key => $map)
|
foreach ($this->map as $key => $map)
|
||||||
|
{
|
||||||
|
$methodName = "mapItemValue_{$key}";
|
||||||
|
if (method_exists($this, $methodName))
|
||||||
|
{
|
||||||
|
$this->{$methodName}($item, $power);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
$power[$key] = $item->{$map} ?? null;
|
$power[$key] = $item->{$map} ?? null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (object) $power;
|
return (object) $power;
|
||||||
}
|
}
|
||||||
@@ -586,11 +571,15 @@ abstract class Set implements SetInterface
|
|||||||
$index_item = null;
|
$index_item = null;
|
||||||
foreach ($this->repos as $key => $repo)
|
foreach ($this->repos as $key => $repo)
|
||||||
{
|
{
|
||||||
if (empty($repo->write_branch) || $repo->write_branch === 'default')
|
if (empty($repo->write_branch) || $repo->write_branch === 'default' || !$this->targetRepo($item, $repo))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$item = $this->mapItem($item);
|
||||||
|
|
||||||
|
$this->setRepoPlaceholders($repo);
|
||||||
|
|
||||||
$this->git->load_($repo->base ?? null, $repo->token ?? null);
|
$this->git->load_($repo->base ?? null, $repo->token ?? null);
|
||||||
|
|
||||||
if (($existing = $this->grep->get($item->guid, ['remote'], $repo)) !== null)
|
if (($existing = $this->grep->get($item->guid, ['remote'], $repo)) !== null)
|
||||||
@@ -622,6 +611,43 @@ abstract class Set implements SetInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the Repo Placeholders
|
||||||
|
*
|
||||||
|
* @param object $repo The repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function setRepoPlaceholders(object $repo): void
|
||||||
|
{
|
||||||
|
$this->repoPlaceholders = $this->placeholders;
|
||||||
|
if (!empty($repo->placeholders) && is_array($repo->placeholders))
|
||||||
|
{
|
||||||
|
foreach ($repo->placeholders as $key => $value)
|
||||||
|
{
|
||||||
|
$this->repoPlaceholders[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update Placeholders in String
|
||||||
|
*
|
||||||
|
* @param string $string The value to update
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function updatePlaceholders(string $string): string
|
||||||
|
{
|
||||||
|
return str_replace(
|
||||||
|
array_keys($this->repoPlaceholders),
|
||||||
|
array_values($this->repoPlaceholders),
|
||||||
|
$string
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get index values
|
* Get index values
|
||||||
*
|
*
|
||||||
@@ -669,25 +695,36 @@ abstract class Set implements SetInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if two objects are equal by comparing their JSON representations.
|
* check that we have a target repo of this item
|
||||||
*
|
*
|
||||||
* This method converts both input objects to JSON strings and compares these strings.
|
* @param object $item The item
|
||||||
* If the JSON strings are identical, the objects are considered equal.
|
* @param object $repo The current repo
|
||||||
*
|
*
|
||||||
* @param object $obj1 The first object to compare.
|
* @return bool
|
||||||
* @param object $obj2 The second object to compare.
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function targetRepo(object $item, object $repo): bool
|
||||||
|
{
|
||||||
|
return true; // for more control in children classes
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if two objects are equal by comparing their properties and values.
|
||||||
|
*
|
||||||
|
* This method converts both input objects to associative arrays, sorts the arrays by keys,
|
||||||
|
* and compares these sorted arrays.
|
||||||
|
*
|
||||||
|
* If the arrays are identical, the objects are considered equal.
|
||||||
|
*
|
||||||
|
* @param object|null $obj1 The first object to compare.
|
||||||
|
* @param object|null $obj2 The second object to compare.
|
||||||
*
|
*
|
||||||
* @return bool True if the objects are equal, false otherwise.
|
* @return bool True if the objects are equal, false otherwise.
|
||||||
* @since 3.2.2
|
* @since 5.0.2
|
||||||
*/
|
*/
|
||||||
protected function areObjectsEqual(object $obj1, object $obj2): bool
|
protected function areObjectsEqual(?object $obj1, ?object $obj2): bool
|
||||||
{
|
{
|
||||||
// Convert both objects to JSON strings
|
return ObjectHelper::equal($obj1, $obj2); // basic comparison
|
||||||
$json1 = json_encode($obj1);
|
|
||||||
$json2 = json_encode($obj2);
|
|
||||||
|
|
||||||
// Compare the JSON strings
|
|
||||||
return $json1 === $json2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -344,7 +344,7 @@ abstract class Schema implements SchemaInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
// check if update of default values is needed
|
// check if update of default values is needed
|
||||||
elseif ($this->checkDefault($table, $column))
|
if ($this->checkDefault($table, $column))
|
||||||
{
|
{
|
||||||
$requireUpdate[$column] = [
|
$requireUpdate[$column] = [
|
||||||
'column' => $column,
|
'column' => $column,
|
||||||
@@ -353,7 +353,7 @@ abstract class Schema implements SchemaInterface
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
// check if update of null is needed
|
// check if update of null is needed
|
||||||
elseif ($this->checkNull($table, $column))
|
if ($this->checkNull($table, $column))
|
||||||
{
|
{
|
||||||
$requireUpdate[$column] = [
|
$requireUpdate[$column] = [
|
||||||
'column' => $column,
|
'column' => $column,
|
||||||
|
@@ -0,0 +1,127 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\ComHelperClass;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\ComHelperClass\CreateUserInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper Class Create User Class for Joomla 5
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class CreateUser implements CreateUserInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Generates the method definition for creating or updating a user based on the provided parameters.
|
||||||
|
*
|
||||||
|
* This method returns a string representation of a PHP function that includes various
|
||||||
|
* steps for handling user creation and updates, depending on the mode (site registration or admin registration).
|
||||||
|
*
|
||||||
|
* @param $add Determines whether to generate the user creation method or not.
|
||||||
|
* If true, the method will be generated and returned as a string.
|
||||||
|
*
|
||||||
|
* @return string The generated method code as a string if $add is true.
|
||||||
|
* Returns an empty string if $add is false.
|
||||||
|
*/
|
||||||
|
public function get($add): string
|
||||||
|
{
|
||||||
|
if ($add)
|
||||||
|
{
|
||||||
|
$method = [];
|
||||||
|
$method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Save user details by either creating a new user or updating an existing user.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$credentials ['name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string]";
|
||||||
|
$method[] = Indent::_(1) . " * @param int \$autologin";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$params ['useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int]";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @return int User ID on success";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @throws \InvalidArgumentException If required credentials are missing.";
|
||||||
|
$method[] = Indent::_(1) . " * @throws \RuntimeException If the user update or creation fails.";
|
||||||
|
$method[] = Indent::_(1) . " * @throws Super__"."_1c10a5f1_204d_4f17_ad9f_0e0684f2030d___Power If the user is not found.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @since 3.0.0";
|
||||||
|
$method[] = Indent::_(1) . " * @deprecated 4.3 Use Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::create(\$credentials, \$autologin, \$params, \$mode);";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. "public static function createUser(\$credentials, \$autologin = 0,";
|
||||||
|
$method[] = Indent::_(2) . "\$params = [";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "'useractivation' => 0, 'sendpassword' => 1";
|
||||||
|
$method[] = Indent::_(2) . "], \$mode = 1";
|
||||||
|
$method[] = Indent::_(1) . ")";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Create a user with the UserHelper class (Super---7832a726_87b6_4e95_887e_7b725d3fab8f---Power)";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "return Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::create(\$credentials, \$autologin, \$params, \$mode);";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
$method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Update the given component params.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @param string|null \$option The optional extension element name.";
|
||||||
|
$method[] = Indent::_(1) . " * @param string \$target The parameter name to be updated.";
|
||||||
|
$method[] = Indent::_(1) . " * @param mixed \$value The value to set for the parameter.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @since 3.0.0";
|
||||||
|
$method[] = Indent::_(1) . " * @deprecated 4.3 Use Super__"."_640b5352_fb09_425f_a26e_cd44eda03f15___Power::setParams(\$target, \$value, \$option);";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = PHP_EOL . Indent::_(1)
|
||||||
|
. "public static function setParams(\$option, \$target, \$value)";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Sets a parameter value for the given target in the specified option's params";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " (Super---640b5352_fb09_425f_a26e_cd44eda03f15---Power)";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "return Super__"."_640b5352_fb09_425f_a26e_cd44eda03f15___Power::setParams(\$target, \$value, \$option);";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
$method[] = PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Update user details";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @param array \$userDetails Array containing user details to be updated";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @return int Updated user ID on success.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @throws \RuntimeException If user update fails.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @since 3.0.0";
|
||||||
|
$method[] = Indent::_(1) . " * @deprecated 4.3 Use Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::update(\$userDetails);";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. "public static function updateUser(\$userDetails): int";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Update user details with the UserHelper class (Super---7832a726_87b6_4e95_887e_7b725d3fab8f---Power)";
|
||||||
|
$method[] = Indent::_(2) . "return Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::update(\$userDetails);";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
// return the help method
|
||||||
|
return implode(PHP_EOL, $method);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -155,7 +155,7 @@ final class Extension implements ExtensionInterface
|
|||||||
$counter = 0;
|
$counter = 0;
|
||||||
foreach ($methods as $method)
|
foreach ($methods as $method)
|
||||||
{
|
{
|
||||||
if ($method['access'] === 'public' && !$method['static'] && !$method['abstract'])
|
if ($this->validEventName($method))
|
||||||
{
|
{
|
||||||
$events[$method['name']] = Indent::_(3) . "'{$method['name']}' => '{$method['name']}'";
|
$events[$method['name']] = Indent::_(3) . "'{$method['name']}' => '{$method['name']}'";
|
||||||
|
|
||||||
@@ -191,6 +191,37 @@ final class Extension implements ExtensionInterface
|
|||||||
return implode(PHP_EOL, $method);
|
return implode(PHP_EOL, $method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates if a method name is a valid event name for a Joomla plugin.
|
||||||
|
*
|
||||||
|
* The method must meet the following criteria:
|
||||||
|
* - It must be public, not static, and not abstract.
|
||||||
|
* - It must not be a magic method (i.e., should not start with '__').
|
||||||
|
*
|
||||||
|
* @param array $method The method details, including 'name', 'access', 'static', and 'abstract'.
|
||||||
|
*
|
||||||
|
* @return bool Returns true if the method is a valid event name, otherwise false.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function validEventName(array $method): bool
|
||||||
|
{
|
||||||
|
// Check if the method is public, static, and not abstract
|
||||||
|
if ($method['access'] !== 'public' || $method['static'] || $method['abstract'])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the method is a magic method (starts with '__')
|
||||||
|
if (substr($method['name'], 0, 2) === '__')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If all checks pass, the method is a valid event name
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the getSubscribedEvents is set
|
* Check if the getSubscribedEvents is set
|
||||||
*
|
*
|
||||||
|
@@ -0,0 +1,125 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\ComHelperClass;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\ComHelperClass\CreateUserInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper Class Create User Class for Joomla 4
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class CreateUser implements CreateUserInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Generates the method definition for creating or updating a user based on the provided parameters.
|
||||||
|
*
|
||||||
|
* This method returns a string representation of a PHP function that includes various
|
||||||
|
* steps for handling user creation and updates, depending on the mode (site registration or admin registration).
|
||||||
|
*
|
||||||
|
* @param $add Determines whether to generate the user creation method or not.
|
||||||
|
* If true, the method will be generated and returned as a string.
|
||||||
|
*
|
||||||
|
* @return string The generated method code as a string if $add is true.
|
||||||
|
* Returns an empty string if $add is false.
|
||||||
|
*/
|
||||||
|
public function get($add): string
|
||||||
|
{
|
||||||
|
if ($add)
|
||||||
|
{
|
||||||
|
$method = [];
|
||||||
|
$method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Save user details by either creating a new user or updating an existing user.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$credentials ['name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string]";
|
||||||
|
$method[] = Indent::_(1) . " * @param int \$autologin";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$params ['useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int]";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @return int User ID on success";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @throws \InvalidArgumentException If required credentials are missing.";
|
||||||
|
$method[] = Indent::_(1) . " * @throws \RuntimeException If the user update or creation fails.";
|
||||||
|
$method[] = Indent::_(1) . " * @throws Super__"."_1c10a5f1_204d_4f17_ad9f_0e0684f2030d___Power If the user is not found.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @since 3.0.0";
|
||||||
|
$method[] = Indent::_(1) . " * @deprecated 4.3 Use Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::create(\$credentials, \$autologin, \$params, \$mode);";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. "public static function createUser(\$credentials, \$autologin = 0,";
|
||||||
|
$method[] = Indent::_(2) . "\$params = [";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "'useractivation' => 0, 'sendpassword' => 1";
|
||||||
|
$method[] = Indent::_(2) . "], \$mode = 1";
|
||||||
|
$method[] = Indent::_(1) . ")";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Create a user with the UserHelper class";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "return Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::create(\$credentials, \$autologin, \$params, \$mode);";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
$method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Update the given component params.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @param string|null \$option The optional extension element name.";
|
||||||
|
$method[] = Indent::_(1) . " * @param string \$target The parameter name to be updated.";
|
||||||
|
$method[] = Indent::_(1) . " * @param mixed \$value The value to set for the parameter.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @since 3.0.0";
|
||||||
|
$method[] = Indent::_(1) . " * @deprecated 4.3 Use Super__"."_640b5352_fb09_425f_a26e_cd44eda03f15___Power::setParams(\$target, \$value, \$option);";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = PHP_EOL . Indent::_(1)
|
||||||
|
. "public static function setParams(\$option, \$target, \$value)";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Sets a parameter value for the given target in the specified option's params";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "return Super__"."_640b5352_fb09_425f_a26e_cd44eda03f15___Power::setParams(\$target, \$value, \$option);";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
$method[] = PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Update user details";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @param array \$userDetails Array containing user details to be updated";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @return int Updated user ID on success.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @throws \RuntimeException If user update fails.";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1) . " * @since 3.0.0";
|
||||||
|
$method[] = Indent::_(1) . " * @deprecated 4.3 Use Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::update(\$userDetails);";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. "public static function updateUser(\$userDetails): int";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Update user details with the UserHelper class";
|
||||||
|
$method[] = Indent::_(2) . "return Super__"."_7832a726_87b6_4e95_887e_7b725d3fab8f___Power::update(\$userDetails);";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
// return the help method
|
||||||
|
return implode(PHP_EOL, $method);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -155,7 +155,7 @@ final class Extension implements ExtensionInterface
|
|||||||
$counter = 0;
|
$counter = 0;
|
||||||
foreach ($methods as $method)
|
foreach ($methods as $method)
|
||||||
{
|
{
|
||||||
if ($method['access'] === 'public' && !$method['static'] && !$method['abstract'])
|
if ($this->validEventName($method))
|
||||||
{
|
{
|
||||||
$events[$method['name']] = Indent::_(3) . "'{$method['name']}' => '{$method['name']}'";
|
$events[$method['name']] = Indent::_(3) . "'{$method['name']}' => '{$method['name']}'";
|
||||||
|
|
||||||
@@ -191,6 +191,37 @@ final class Extension implements ExtensionInterface
|
|||||||
return implode(PHP_EOL, $method);
|
return implode(PHP_EOL, $method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates if a method name is a valid event name for a Joomla plugin.
|
||||||
|
*
|
||||||
|
* The method must meet the following criteria:
|
||||||
|
* - It must be public, not static, and not abstract.
|
||||||
|
* - It must not be a magic method (i.e., should not start with '__').
|
||||||
|
*
|
||||||
|
* @param array $method The method details, including 'name', 'access', 'static', and 'abstract'.
|
||||||
|
*
|
||||||
|
* @return bool Returns true if the method is a valid event name, otherwise false.
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function validEventName(array $method): bool
|
||||||
|
{
|
||||||
|
// Check if the method is public, static, and not abstract
|
||||||
|
if ($method['access'] !== 'public' || $method['static'] || $method['abstract'])
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the method is a magic method (starts with '__')
|
||||||
|
if (substr($method['name'], 0, 2) === '__')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If all checks pass, the method is a valid event name
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the getSubscribedEvents is set
|
* Check if the getSubscribedEvents is set
|
||||||
*
|
*
|
||||||
|
@@ -0,0 +1,364 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\ComHelperClass;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\ComHelperClass\CreateUserInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper Class Create User Class for Joomla 3
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class CreateUser implements CreateUserInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Generates the method definition for creating or updating a user based on the provided parameters.
|
||||||
|
*
|
||||||
|
* This method returns a string representation of a PHP function that includes various
|
||||||
|
* steps for handling user creation and updates, depending on the mode (site registration or admin registration).
|
||||||
|
*
|
||||||
|
* @param $add Determines whether to generate the user creation method or not.
|
||||||
|
* If true, the method will be generated and returned as a string.
|
||||||
|
*
|
||||||
|
* @return string The generated method code as a string if $add is true.
|
||||||
|
* Returns an empty string if $add is false.
|
||||||
|
*/
|
||||||
|
public function get($add): string
|
||||||
|
{
|
||||||
|
if ($add)
|
||||||
|
{
|
||||||
|
$method = [];
|
||||||
|
$method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Greate user and update given table";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$credentials Array('name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string)";
|
||||||
|
$method[] = Indent::_(1) . " * @param int \$autologin";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$params Array('useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int)";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @param array \$mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser";
|
||||||
|
$method[] = Indent::_(1) . " *";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. " * @return int|Error User ID on success, or an error.";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. "public static function createUser(\$credentials, \$autologin = 0,";
|
||||||
|
$method[] = Indent::_(2) . "\$params = array(";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "'useractivation' => 0, 'sendpassword' => 1";
|
||||||
|
$method[] = Indent::_(2) . "), \$mode = 1";
|
||||||
|
$method[] = Indent::_(1) . ")";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Override mode";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (\$mode == 2 && method_exists(__CLASS__, 'registerUser'))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Update params";
|
||||||
|
$method[] = Indent::_(3) . "\$params['autologin'] = \$autologin;";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Now Register User";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "return self::registerUser(\$credentials, \$params);";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "elseif (\$mode == 2)";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Fallback to Site Registrations";
|
||||||
|
$method[] = Indent::_(3) . "\$mode = 1;";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " load the user component language files if there is an error.";
|
||||||
|
$method[] = Indent::_(2) . "\$lang = Factory::getLanguage();";
|
||||||
|
$method[] = Indent::_(2) . "\$extension = 'com_users';";
|
||||||
|
$method[] = Indent::_(2) . "\$base_dir = JPATH_SITE;";
|
||||||
|
$method[] = Indent::_(2) . "\$language_tag = 'en-GB';";
|
||||||
|
$method[] = Indent::_(2) . "\$reload = true;";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Load the correct user model.";
|
||||||
|
$method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
|
||||||
|
__LINE__,__CLASS__
|
||||||
|
)
|
||||||
|
. " 1 = Site Registrations";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Load the user site-registration model";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$model = self::getModel('registration', \$base_dir . '/components/' . \$extension, 'Users');";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
|
||||||
|
. " 0 = Admin Registration";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Load the backend-user model";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/' . \$extension, 'Users');";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Check if we have params/config";
|
||||||
|
$method[] = Indent::_(2) . "if (Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$params))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Make changes to user config";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "foreach (\$params as \$param => \$set)";
|
||||||
|
$method[] = Indent::_(3) . "{";
|
||||||
|
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " If you know of a better path, let me know";
|
||||||
|
$method[] = Indent::_(4)
|
||||||
|
. "\$params[\$param] = self::setParams(\$extension, \$param, \$set);";
|
||||||
|
$method[] = Indent::_(3) . "}";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Set username to email if not set";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (!isset(\$credentials['username']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['username']))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$credentials['username'] = \$credentials['email'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Lineup new user data array";
|
||||||
|
$method[] = Indent::_(2) . "\$data = array(";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "'username' => \$credentials['username'],";
|
||||||
|
$method[] = Indent::_(3) . "'name' => \$credentials['name'],";
|
||||||
|
$method[] = Indent::_(3) . "'block' => 0 );";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Added details based on mode";
|
||||||
|
$method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
|
||||||
|
__LINE__,__CLASS__
|
||||||
|
)
|
||||||
|
. " 1 = Site-registration mode";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$data['email1'] = \$credentials['email'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
|
||||||
|
. " 0 = Admin-registration mode";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$data['email'] = \$credentials['email'];";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$data['registerDate'] = Factory::getDate()->toSql();";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Check if password was set";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (\$mode == 1 && (!isset(\$credentials['password']) || !isset(\$credentials['password2']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password2'])))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Set random password when empty password was submitted,";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " when using the 1 = site-registration mode";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$credentials['password'] = self::randomkey(8);";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$credentials['password2'] = \$credentials['password'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Now Add password if set";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (isset(\$credentials['password']) && isset(\$credentials['password2']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password2']))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "if (\$mode == 1) //" . Line::_(
|
||||||
|
__LINE__,__CLASS__
|
||||||
|
)
|
||||||
|
. " 1 = Site-registration mode";
|
||||||
|
$method[] = Indent::_(3) . "{";
|
||||||
|
$method[] = Indent::_(4)
|
||||||
|
. "\$data['password1'] = \$credentials['password'];";
|
||||||
|
$method[] = Indent::_(3) . "}";
|
||||||
|
$method[] = Indent::_(3) . "else //" . Line::_(__Line__, __Class__)
|
||||||
|
. " 0 = Admin-registration mode";
|
||||||
|
$method[] = Indent::_(3) . "{";
|
||||||
|
$method[] = Indent::_(4)
|
||||||
|
. "\$data['password'] = \$credentials['password'];";
|
||||||
|
$method[] = Indent::_(3) . "}";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$data['password2'] = \$credentials['password2'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Load the group/s value if set, only for Admin Registration (\$mode == 0)";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (\$mode == 0 && isset(\$credentials['groups']) && Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$credentials['groups']))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$data['groups'] = \$credentials['groups'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Create the new user";
|
||||||
|
$method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
|
||||||
|
__LINE__,__CLASS__
|
||||||
|
)
|
||||||
|
. " 1 = Site-registration mode";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "\$userId = \$model->register(\$data);";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
|
||||||
|
. " 0 = Admin-registration mode";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "\$model->save(\$data);";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$userId = \$model->getState('user.id', 0);";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Check if we have params";
|
||||||
|
$method[] = Indent::_(2) . "if (Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$params))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Change user params/config back";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "foreach (\$params as \$param => \$set)";
|
||||||
|
$method[] = Indent::_(3) . "{";
|
||||||
|
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " If you know of a better path, let me know";
|
||||||
|
$method[] = Indent::_(4)
|
||||||
|
. "self::setParams(\$extension, \$param, \$set);";
|
||||||
|
$method[] = Indent::_(3) . "}";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " if user is created";
|
||||||
|
$method[] = Indent::_(2) . "if (\$userId > 0)";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Auto Login if Needed";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "if (\$autologin && isset(\$credentials['password']))";
|
||||||
|
$method[] = Indent::_(3) . "{";
|
||||||
|
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Try to login";
|
||||||
|
$method[] = Indent::_(4) . "try{";
|
||||||
|
$method[] = Indent::_(5)
|
||||||
|
. "Factory::getApplication()->login(\$credentials);";
|
||||||
|
$method[] = Indent::_(4) . "} catch (\Exception \$exception){";
|
||||||
|
$method[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Do noting for now, may want to set redirect.";
|
||||||
|
$method[] = Indent::_(4) . "}";
|
||||||
|
$method[] = Indent::_(3) . "}";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Return ID";
|
||||||
|
$method[] = Indent::_(3) . "return \$userId;";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "return \$model->getError();";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
$method[] = PHP_EOL . Indent::_(1)
|
||||||
|
. "public static function setParams(\$component,\$target,\$value)";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Get the params and set the new values";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "\$params = ComponentHelper::getParams(\$component);";
|
||||||
|
$method[] = Indent::_(2) . "\$was = \$params->get(\$target, null);";
|
||||||
|
$method[] = Indent::_(2) . "if (\$was != \$value)";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "\$params->set(\$target, \$value);";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Get a new database query instance";
|
||||||
|
$method[] = Indent::_(3) . "\$db = Factory::getDBO();";
|
||||||
|
$method[] = Indent::_(3) . "\$query = \$db->getQuery(true);";
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Build the query";
|
||||||
|
$method[] = Indent::_(3) . "\$query->update('#__extensions AS a');";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$query->set('a.params = ' . \$db->quote((string)\$params));";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$query->where('a.element = ' . \$db->quote((string)\$component));";
|
||||||
|
$method[] = Indent::_(3);
|
||||||
|
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Execute the query";
|
||||||
|
$method[] = Indent::_(3) . "\$db->setQuery(\$query);";
|
||||||
|
$method[] = Indent::_(3) . "\$db->execute();";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "return \$was;";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
$method[] = PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$method[] = Indent::_(1) . " * Update user values";
|
||||||
|
$method[] = Indent::_(1) . " */";
|
||||||
|
$method[] = Indent::_(1)
|
||||||
|
. "public static function updateUser(\$new)";
|
||||||
|
$method[] = Indent::_(1) . "{";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "// load the user component language files if there is an error.";
|
||||||
|
$method[] = Indent::_(2) . "\$lang = Factory::getLanguage();";
|
||||||
|
$method[] = Indent::_(2) . "\$extension = 'com_users';";
|
||||||
|
$method[] = Indent::_(2) . "\$base_dir = JPATH_ADMINISTRATOR;";
|
||||||
|
$method[] = Indent::_(2) . "\$language_tag = 'en-GB';";
|
||||||
|
$method[] = Indent::_(2) . "\$reload = true;";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
|
||||||
|
$method[] = Indent::_(2) . "// load the user model";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');";
|
||||||
|
$method[] = Indent::_(2) . "// Check if password was set";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (isset(\$new['password']) && isset(\$new['password2']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$new['password']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$new['password2']))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "// Use the users passwords";
|
||||||
|
$method[] = Indent::_(3) . "\$password = \$new['password'];";
|
||||||
|
$method[] = Indent::_(3) . "\$password2 = \$new['password2'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "// set username";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (!isset(\$new['username']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$new['username']))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "\$new['username'] = \$new['email'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "// lineup update user data";
|
||||||
|
$method[] = Indent::_(2) . "\$data = array(";
|
||||||
|
$method[] = Indent::_(3) . "'id' => \$new['id'],";
|
||||||
|
$method[] = Indent::_(3) . "'username' => \$new['username'],";
|
||||||
|
$method[] = Indent::_(3) . "'name' => \$new['name'],";
|
||||||
|
$method[] = Indent::_(3) . "'email' => \$new['email'],";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "'password' => \$password, // First password field";
|
||||||
|
$method[] = Indent::_(3)
|
||||||
|
. "'password2' => \$password2, // Confirm password field";
|
||||||
|
$method[] = Indent::_(3) . "'block' => 0 );";
|
||||||
|
$method[] = Indent::_(2) . "// set groups if found";
|
||||||
|
$method[] = Indent::_(2)
|
||||||
|
. "if (isset(\$new['groups']) && Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$new['groups']))";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "\$data['groups'] = \$new['groups'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "// register the new user";
|
||||||
|
$method[] = Indent::_(2) . "\$done = \$model->save(\$data);";
|
||||||
|
$method[] = Indent::_(2) . "// if user is updated";
|
||||||
|
$method[] = Indent::_(2) . "if (\$done)";
|
||||||
|
$method[] = Indent::_(2) . "{";
|
||||||
|
$method[] = Indent::_(3) . "return \$new['id'];";
|
||||||
|
$method[] = Indent::_(2) . "}";
|
||||||
|
$method[] = Indent::_(2) . "return \$model->getError();";
|
||||||
|
$method[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
// return the help method
|
||||||
|
return implode(PHP_EOL, $method);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -543,14 +543,7 @@ class Config extends BaseConfig
|
|||||||
*/
|
*/
|
||||||
protected function getRemovelinebreaks(): bool
|
protected function getRemovelinebreaks(): bool
|
||||||
{
|
{
|
||||||
// get posted value
|
return (bool) true;
|
||||||
$value = $this->input->post->get('remove_line_breaks', 2, 'INT');
|
|
||||||
// get global
|
|
||||||
if ($value > 1)
|
|
||||||
{
|
|
||||||
return (bool) GetHelper::var('joomla_component', $this->component_id, 'id', 'remove_line_breaks');
|
|
||||||
}
|
|
||||||
return (bool) $value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -889,7 +882,26 @@ class Config extends BaseConfig
|
|||||||
*/
|
*/
|
||||||
protected function getApprovedjoomlapaths(): array
|
protected function getApprovedjoomlapaths(): array
|
||||||
{
|
{
|
||||||
return array_values($this->joomla_powers_init_repos);
|
// some defaults repos we need by JCB
|
||||||
|
$approved = $this->joomla_powers_init_repos;
|
||||||
|
|
||||||
|
$paths = RepoHelper::get(2); // Joomla Power = 2
|
||||||
|
|
||||||
|
if ($paths !== null)
|
||||||
|
{
|
||||||
|
foreach ($paths as $path)
|
||||||
|
{
|
||||||
|
$owner = $path->organisation ?? null;
|
||||||
|
$repo = $path->repository ?? null;
|
||||||
|
if ($owner !== null && $repo !== null)
|
||||||
|
{
|
||||||
|
// we make sure to get only the objects
|
||||||
|
$approved = ["{$owner}.{$repo}" => $path] + $approved;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_values($approved);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -992,7 +992,8 @@ final class Builders
|
|||||||
'code' => $name,
|
'code' => $name,
|
||||||
'name' => $listLangName,
|
'name' => $listLangName,
|
||||||
'extension' => $_extension,
|
'extension' => $_extension,
|
||||||
'filter' => $field['filter']
|
'filter' => $field['filter'],
|
||||||
|
'add_icon' => StringHelper::check($view['settings']->icon_category)
|
||||||
]);
|
]);
|
||||||
// also set code name for title alias fix
|
// also set code name for title alias fix
|
||||||
$this->categorycode->set($nameSingleCode, [
|
$this->categorycode->set($nameSingleCode, [
|
||||||
@@ -1116,7 +1117,7 @@ final class Builders
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// just a heads-up for usergroups set to multiple
|
// just a heads-up for usergroups set to multiple
|
||||||
if ($typeName === 'usergroup')
|
if ($typeName === 'usergroup' || $typeName === 'usergrouplist')
|
||||||
{
|
{
|
||||||
$this->sitefielddata->set(
|
$this->sitefielddata->set(
|
||||||
$nameSingleCode, $name, 'json', $typeName
|
$nameSingleCode, $name, 'json', $typeName
|
||||||
|
@@ -329,10 +329,11 @@ final class ConfigFieldsets
|
|||||||
$field['custom_value']
|
$field['custom_value']
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
// add array if found
|
// add array or object if found
|
||||||
if ((strpos((string) $field['custom_value'], '["') !== false)
|
if (((strpos((string) $field['custom_value'], '["') !== false)
|
||||||
&& (strpos((string) $field['custom_value'], '"]')
|
&& (strpos((string) $field['custom_value'], '"]') !== false)) ||
|
||||||
!== false))
|
((strpos((string) $field['custom_value'], '{"') !== false)
|
||||||
|
&& (strpos((string) $field['custom_value'], '"}') !== false)))
|
||||||
{
|
{
|
||||||
// load the Global checkin defautls
|
// load the Global checkin defautls
|
||||||
$this->extensionsparams->add('component', '"' . $fieldName
|
$this->extensionsparams->add('component', '"' . $fieldName
|
||||||
|
@@ -138,7 +138,7 @@ final class ConfigFieldsetsGroupControl
|
|||||||
{
|
{
|
||||||
$this->configfieldsets->add('component', Indent::_(2) . '<field name="'
|
$this->configfieldsets->add('component', Indent::_(2) . '<field name="'
|
||||||
. $selector . '"');
|
. $selector . '"');
|
||||||
$this->configfieldsets->add('component', Indent::_(3) . 'type="usergroup"');
|
$this->configfieldsets->add('component', Indent::_(3) . 'type="usergrouplist"');
|
||||||
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $label . '"');
|
$this->configfieldsets->add('component', Indent::_(3) . 'label="' . $label . '"');
|
||||||
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
$this->configfieldsets->add('component', Indent::_(3) . 'description="'
|
||||||
. $lang . '_TARGET_GROUP_DESC"');
|
. $lang . '_TARGET_GROUP_DESC"');
|
||||||
|
@@ -12,13 +12,12 @@
|
|||||||
namespace VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
namespace VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
||||||
|
|
||||||
|
|
||||||
use VDM\Joomla\Utilities\StringHelper;
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Gui;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Hash;
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Hash;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\LockBase;
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode\LockBase;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\DispenserInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode\DispenserInterface;
|
||||||
|
|
||||||
|
|
||||||
@@ -80,22 +79,22 @@ class Dispenser implements DispenserInterface
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param Placeholder|null $placeholder The compiler placeholder object.
|
* @param Placeholder $placeholder The Placeholder Class.
|
||||||
* @param Customcode|null $customcode The compiler customcode object.
|
* @param Customcode $customcode The Customcode Class.
|
||||||
* @param Gui|null $gui The compiler customcode gui object.
|
* @param Gui $gui The Gui Class.
|
||||||
* @param Hash|null $hash The compiler customcode hash object.
|
* @param Hash $hash The Hash Class.
|
||||||
* @param LockBase|null $base64 The compiler customcode lock base64 object.
|
* @param LockBase $lockbase The LockBase Class.
|
||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public function __construct(?Placeholder $placeholder = null, ?Customcode $customcode = null,
|
public function __construct(Placeholder $placeholder, Customcode $customcode, Gui $gui,
|
||||||
?Gui $gui = null, ?Hash $hash = null, ?LockBase $base64 = null)
|
Hash $hash, LockBase $lockbase)
|
||||||
{
|
{
|
||||||
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
$this->placeholder = $placeholder;
|
||||||
$this->customcode = $customcode ?: Compiler::_('Customcode');
|
$this->customcode = $customcode;
|
||||||
$this->gui = $gui ?: Compiler::_('Customcode.Gui');
|
$this->gui = $gui;
|
||||||
$this->hash = $hash ?: Compiler::_('Customcode.Hash');
|
$this->hash = $hash;
|
||||||
$this->base64 = $base64 ?: Compiler::_('Customcode.LockBase');
|
$this->base64 = $lockbase;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -787,7 +787,7 @@ class Extractor implements ExtractorInterface
|
|||||||
$query->columns($this->db->quoteName($columns));
|
$query->columns($this->db->quoteName($columns));
|
||||||
foreach ($this->new as $values)
|
foreach ($this->new as $values)
|
||||||
{
|
{
|
||||||
if (count((array) $values) == 15)
|
if (count((array) $values) == 16)
|
||||||
{
|
{
|
||||||
$query->values(implode(',', $values));
|
$query->values(implode(',', $values));
|
||||||
$continue = true;
|
$continue = true;
|
||||||
|
@@ -42,6 +42,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Service\Utilities;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Service\BuilderAJ;
|
use VDM\Joomla\Componentbuilder\Compiler\Service\BuilderAJ;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Service\BuilderLZ;
|
use VDM\Joomla\Componentbuilder\Compiler\Service\BuilderLZ;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Service\Creator;
|
use VDM\Joomla\Componentbuilder\Compiler\Service\Creator;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureComHelperClass;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureController;
|
use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureController;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureModel;
|
use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitectureModel;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitecturePlugin;
|
use VDM\Joomla\Componentbuilder\Compiler\Service\ArchitecturePlugin;
|
||||||
@@ -142,6 +143,7 @@ abstract class Factory extends ExtendingFactory implements FactoryInterface
|
|||||||
->registerServiceProvider(new BuilderAJ())
|
->registerServiceProvider(new BuilderAJ())
|
||||||
->registerServiceProvider(new BuilderLZ())
|
->registerServiceProvider(new BuilderLZ())
|
||||||
->registerServiceProvider(new Creator())
|
->registerServiceProvider(new Creator())
|
||||||
|
->registerServiceProvider(new ArchitectureComHelperClass())
|
||||||
->registerServiceProvider(new ArchitectureController())
|
->registerServiceProvider(new ArchitectureController())
|
||||||
->registerServiceProvider(new ArchitectureModel())
|
->registerServiceProvider(new ArchitectureModel())
|
||||||
->registerServiceProvider(new ArchitecturePlugin())
|
->registerServiceProvider(new ArchitecturePlugin())
|
||||||
|
@@ -36,13 +36,13 @@ final class Groups
|
|||||||
'color', 'combo', 'componentlayout', 'contentlanguage', 'contenttype', 'databaseconnection', 'components',
|
'color', 'combo', 'componentlayout', 'contentlanguage', 'contenttype', 'databaseconnection', 'components',
|
||||||
'editor', 'editors', 'email', 'file', 'file', 'filelist', 'folderlist', 'groupedlist', 'headertag', 'helpsite', 'hidden', 'imagelist',
|
'editor', 'editors', 'email', 'file', 'file', 'filelist', 'folderlist', 'groupedlist', 'headertag', 'helpsite', 'hidden', 'imagelist',
|
||||||
'integer', 'language', 'list', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition',
|
'integer', 'language', 'list', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'moduleorder', 'moduleposition',
|
||||||
'moduletag', 'note', 'number', 'password', 'plugins', 'predefinedlist', 'radio', 'range', 'repeatable', 'rules',
|
'moduletag', 'note', 'number', 'password', 'plugins', 'predefinedlist', 'radio', 'range', 'repeatable', 'rules', 'usergrouplist',
|
||||||
'sessionhandler', 'spacer', 'sql', 'subform', 'tag', 'tel', 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
'sessionhandler', 'spacer', 'sql', 'subform', 'tag', 'tel', 'templatestyle', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
||||||
],
|
],
|
||||||
'plain' => [
|
'plain' => [
|
||||||
'cachehandler', 'calendar', 'checkbox', 'chromestyle', 'color', 'componentlayout', 'contenttype', 'editor', 'editors', 'captcha',
|
'cachehandler', 'calendar', 'checkbox', 'chromestyle', 'color', 'componentlayout', 'contenttype', 'editor', 'editors', 'captcha',
|
||||||
'email', 'file', 'headertag', 'helpsite', 'hidden', 'integer', 'language', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'templatestyle',
|
'email', 'file', 'headertag', 'helpsite', 'hidden', 'integer', 'language', 'media', 'menu', 'modal_menu', 'menuitem', 'meter', 'modulelayout', 'templatestyle',
|
||||||
'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', 'tag', 'tel', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup'
|
'moduleorder', 'moduletag', 'number', 'password', 'range', 'rules', 'tag', 'tel', 'text', 'textarea', 'timezone', 'url', 'user', 'usergroup' , 'usergrouplist'
|
||||||
],
|
],
|
||||||
'option' => [
|
'option' => [
|
||||||
'accesslevel', 'category', 'checkboxes', 'combo', 'contentlanguage', 'databaseconnection', 'components',
|
'accesslevel', 'category', 'checkboxes', 'combo', 'contentlanguage', 'databaseconnection', 'components',
|
||||||
|
@@ -154,7 +154,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
. "\$button_code_name = \$this->getAttribute('name');";
|
. "\$button_code_name = \$this->getAttribute('name');";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the input from url";
|
. " get the input from url";
|
||||||
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
|
$addButton[] = Indent::_(3) . "\$app = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication();";
|
||||||
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
|
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the view name & id";
|
. " get the view name & id";
|
||||||
@@ -181,7 +181,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the return value.";
|
. " get the return value.";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
|
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_return = urlencode(base64_encode(\$_uri));";
|
. "\$_return = urlencode(base64_encode(\$_uri));";
|
||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
@@ -206,7 +206,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the return value.";
|
. " get the return value.";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
|
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_return = urlencode(base64_encode(\$_uri));";
|
. "\$_return = urlencode(base64_encode(\$_uri));";
|
||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
@@ -231,7 +231,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
. "\$button_label = ucfirst(strtolower(\$button_label));";
|
. "\$button_label = ucfirst(strtolower(\$button_label));";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get user object";
|
. " get user object";
|
||||||
$addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();";
|
$addButton[] = Indent::_(3) . "\$user = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getIdentity();";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " only add if user allowed to create " . $fieldData['view'];
|
. " only add if user allowed to create " . $fieldData['view'];
|
||||||
// check if the item has permissions.
|
// check if the item has permissions.
|
||||||
@@ -272,7 +272,11 @@ final class InputButton implements InputButtonInterface
|
|||||||
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
||||||
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
|
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
|
||||||
$addButton[] = Indent::_(6)
|
$addButton[] = Indent::_(6)
|
||||||
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
|
. "let \".\$button_code_name.\"Field = document.getElementById('jform_\".\$button_code_name.\"');";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "if (!\".\$button_code_name.\"Field) { return; }";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "\".\$button_code_name.\"Field.addEventListener('change', function(e) {";
|
||||||
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
||||||
$addButton[] = Indent::_(7)
|
$addButton[] = Indent::_(7)
|
||||||
. "let \".\$button_code_name.\"Value = this.value;";
|
. "let \".\$button_code_name.\"Value = this.value;";
|
||||||
@@ -280,7 +284,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
|
|||||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||||
$addButton[] = Indent::_(6) . "});";
|
$addButton[] = Indent::_(6) . "});";
|
||||||
$addButton[] = Indent::_(6)
|
$addButton[] = Indent::_(6)
|
||||||
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
|
. "let \".\$button_code_name.\"Value = \".\$button_code_name.\"Field.value;";
|
||||||
$addButton[] = Indent::_(6)
|
$addButton[] = Indent::_(6)
|
||||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||||
$addButton[] = Indent::_(5) . "});";
|
$addButton[] = Indent::_(5) . "});";
|
||||||
@@ -324,7 +328,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
|
|||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " Load the needed script.";
|
. " Load the needed script.";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$document = Factory::getApplication()->getDocument();";
|
. "\$document = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getDocument();";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
@@ -154,7 +154,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
. "\$button_code_name = \$this->getAttribute('name');";
|
. "\$button_code_name = \$this->getAttribute('name');";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the input from url";
|
. " get the input from url";
|
||||||
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
|
$addButton[] = Indent::_(3) . "\$app = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication();";
|
||||||
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
|
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the view name & id";
|
. " get the view name & id";
|
||||||
@@ -181,7 +181,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the return value.";
|
. " get the return value.";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
|
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_return = urlencode(base64_encode(\$_uri));";
|
. "\$_return = urlencode(base64_encode(\$_uri));";
|
||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
@@ -206,7 +206,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get the return value.";
|
. " get the return value.";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
|
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$_return = urlencode(base64_encode(\$_uri));";
|
. "\$_return = urlencode(base64_encode(\$_uri));";
|
||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
@@ -231,7 +231,7 @@ final class InputButton implements InputButtonInterface
|
|||||||
. "\$button_label = ucfirst(strtolower(\$button_label));";
|
. "\$button_label = ucfirst(strtolower(\$button_label));";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " get user object";
|
. " get user object";
|
||||||
$addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();";
|
$addButton[] = Indent::_(3) . "\$user = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getIdentity();";
|
||||||
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " only add if user allowed to create " . $fieldData['view'];
|
. " only add if user allowed to create " . $fieldData['view'];
|
||||||
// check if the item has permissions.
|
// check if the item has permissions.
|
||||||
@@ -272,7 +272,11 @@ final class InputButton implements InputButtonInterface
|
|||||||
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
||||||
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
|
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
|
||||||
$addButton[] = Indent::_(6)
|
$addButton[] = Indent::_(6)
|
||||||
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
|
. "let \".\$button_code_name.\"Field = document.getElementById('jform_\".\$button_code_name.\"');";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "if (!\".\$button_code_name.\"Field) { return; }";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "\".\$button_code_name.\"Field.addEventListener('change', function(e) {";
|
||||||
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
||||||
$addButton[] = Indent::_(7)
|
$addButton[] = Indent::_(7)
|
||||||
. "let \".\$button_code_name.\"Value = this.value;";
|
. "let \".\$button_code_name.\"Value = this.value;";
|
||||||
@@ -280,7 +284,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
|
|||||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||||
$addButton[] = Indent::_(6) . "});";
|
$addButton[] = Indent::_(6) . "});";
|
||||||
$addButton[] = Indent::_(6)
|
$addButton[] = Indent::_(6)
|
||||||
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
|
. "let \".\$button_code_name.\"Value = \".\$button_code_name.\"Field.value;";
|
||||||
$addButton[] = Indent::_(6)
|
$addButton[] = Indent::_(6)
|
||||||
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||||
$addButton[] = Indent::_(5) . "});";
|
$addButton[] = Indent::_(5) . "});";
|
||||||
@@ -324,7 +328,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
|
|||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
. " Load the needed script.";
|
. " Load the needed script.";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$document = Factory::getApplication()->getDocument();";
|
. "\$document = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getDocument();";
|
||||||
$addButton[] = Indent::_(4)
|
$addButton[] = Indent::_(4)
|
||||||
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
||||||
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
@@ -173,7 +173,7 @@ class Get
|
|||||||
* @var bool
|
* @var bool
|
||||||
* @deprecated 3.3 Use CFactory::_('Config')->remove_line_breaks;
|
* @deprecated 3.3 Use CFactory::_('Config')->remove_line_breaks;
|
||||||
*/
|
*/
|
||||||
public $removeLineBreaks = false;
|
public $removeLineBreaks = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The placeholders for custom code keys
|
* The placeholders for custom code keys
|
||||||
|
@@ -337,9 +337,10 @@ class Infusion extends Interpretation
|
|||||||
|
|
||||||
// HELPER_CREATEUSER
|
// HELPER_CREATEUSER
|
||||||
CFactory::_('Compiler.Builder.Content.One')->add('HELPER_CREATEUSER',
|
CFactory::_('Compiler.Builder.Content.One')->add('HELPER_CREATEUSER',
|
||||||
$this->setCreateUserHelperMethod(
|
CFactory::_('Architecture.ComHelperClass.CreateUser')->get(
|
||||||
CFactory::_('Component')->get('creatuserhelper')
|
CFactory::_('Component')->get('creatuserhelper', 0)
|
||||||
));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// HELP
|
// HELP
|
||||||
CFactory::_('Compiler.Builder.Content.One')->set('HELP', $this->noHelp());
|
CFactory::_('Compiler.Builder.Content.One')->set('HELP', $this->noHelp());
|
||||||
@@ -1587,7 +1588,7 @@ class Infusion extends Interpretation
|
|||||||
|
|
||||||
// DASHBOARDICONACCESS
|
// DASHBOARDICONACCESS
|
||||||
CFactory::_('Compiler.Builder.Content.Multi')->set(CFactory::_('Config')->component_code_name . '|DASHBOARDICONACCESS',
|
CFactory::_('Compiler.Builder.Content.Multi')->set(CFactory::_('Config')->component_code_name . '|DASHBOARDICONACCESS',
|
||||||
$this->setDashboardIconAccess()
|
CFactory::_('Compiler.Builder.Permission.Dashboard')->build()
|
||||||
);
|
);
|
||||||
|
|
||||||
// DASH_MODEL_METHODS
|
// DASH_MODEL_METHODS
|
||||||
|
@@ -1827,340 +1827,24 @@ class Interpretation extends Fields
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCreateUserHelperMethod($add)
|
/**
|
||||||
|
* Generates the method definition for creating or updating a user based on the provided parameters.
|
||||||
|
*
|
||||||
|
* This method returns a string representation of a PHP function that includes various
|
||||||
|
* steps for handling user creation and updates, depending on the mode (site registration or admin registration).
|
||||||
|
*
|
||||||
|
* @param int $add Determines whether to generate the user creation method or not.
|
||||||
|
* If true, the method will be generated and returned as a string.
|
||||||
|
*
|
||||||
|
* @return string The generated method code as a string if $add is true.
|
||||||
|
* Returns an empty string if $add is false.
|
||||||
|
*
|
||||||
|
* @since 3.0
|
||||||
|
* @deprecated 5.0.3 Use CFactory::_('Architecture.ComHelperClass.CreateUser')->get($add);
|
||||||
|
*/
|
||||||
|
public function setCreateUserHelperMethod($add): string
|
||||||
{
|
{
|
||||||
if ($add)
|
return CFactory::_('Architecture.ComHelperClass.CreateUser')->get($add);
|
||||||
{
|
|
||||||
$method = [];
|
|
||||||
$method[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
|
||||||
$method[] = Indent::_(1) . " * Greate user and update given table";
|
|
||||||
$method[] = Indent::_(1) . " *";
|
|
||||||
$method[] = Indent::_(1)
|
|
||||||
. " * @param array \$credentials Array('name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string)";
|
|
||||||
$method[] = Indent::_(1) . " * @param int \$autologin";
|
|
||||||
$method[] = Indent::_(1)
|
|
||||||
. " * @param array \$params Array('useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int)";
|
|
||||||
$method[] = Indent::_(1)
|
|
||||||
. " * @param array \$mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser";
|
|
||||||
$method[] = Indent::_(1) . " *";
|
|
||||||
$method[] = Indent::_(1)
|
|
||||||
. " * @return int|Error User ID on success, or an error.";
|
|
||||||
$method[] = Indent::_(1) . " */";
|
|
||||||
$method[] = Indent::_(1)
|
|
||||||
. "public static function createUser(\$credentials, \$autologin = 0,";
|
|
||||||
$method[] = Indent::_(2) . "\$params = array(";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "'useractivation' => 0, 'sendpassword' => 1";
|
|
||||||
$method[] = Indent::_(2) . "), \$mode = 1";
|
|
||||||
$method[] = Indent::_(1) . ")";
|
|
||||||
$method[] = Indent::_(1) . "{";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Override mode";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (\$mode == 2 && method_exists(__CLASS__, 'registerUser'))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Update params";
|
|
||||||
$method[] = Indent::_(3) . "\$params['autologin'] = \$autologin;";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Now Register User";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "return self::registerUser(\$credentials, \$params);";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "elseif (\$mode == 2)";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Fallback to Site Registrations";
|
|
||||||
$method[] = Indent::_(3) . "\$mode = 1;";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " load the user component language files if there is an error.";
|
|
||||||
$method[] = Indent::_(2) . "\$lang = Factory::getLanguage();";
|
|
||||||
$method[] = Indent::_(2) . "\$extension = 'com_users';";
|
|
||||||
$method[] = Indent::_(2) . "\$base_dir = JPATH_SITE;";
|
|
||||||
$method[] = Indent::_(2) . "\$language_tag = '" . CFactory::_('Config')->get('lang_tag', 'en-GB')
|
|
||||||
. "';";
|
|
||||||
$method[] = Indent::_(2) . "\$reload = true;";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Load the correct user model.";
|
|
||||||
$method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
|
|
||||||
__LINE__,__CLASS__
|
|
||||||
)
|
|
||||||
. " 1 = Site Registrations";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Load the user site-registration model";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$model = self::getModel('registration', \$base_dir . '/components/' . \$extension, 'Users');";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
|
|
||||||
. " 0 = Admin Registration";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Load the backend-user model";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/' . \$extension, 'Users');";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Check if we have params/config";
|
|
||||||
$method[] = Indent::_(2) . "if (Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$params))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Make changes to user config";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "foreach (\$params as \$param => \$set)";
|
|
||||||
$method[] = Indent::_(3) . "{";
|
|
||||||
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " If you know of a better path, let me know";
|
|
||||||
$method[] = Indent::_(4)
|
|
||||||
. "\$params[\$param] = self::setParams(\$extension, \$param, \$set);";
|
|
||||||
$method[] = Indent::_(3) . "}";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Set username to email if not set";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (!isset(\$credentials['username']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['username']))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$credentials['username'] = \$credentials['email'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Lineup new user data array";
|
|
||||||
$method[] = Indent::_(2) . "\$data = array(";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "'username' => \$credentials['username'],";
|
|
||||||
$method[] = Indent::_(3) . "'name' => \$credentials['name'],";
|
|
||||||
$method[] = Indent::_(3) . "'block' => 0 );";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Added details based on mode";
|
|
||||||
$method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
|
|
||||||
__LINE__,__CLASS__
|
|
||||||
)
|
|
||||||
. " 1 = Site-registration mode";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$data['email1'] = \$credentials['email'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
|
|
||||||
. " 0 = Admin-registration mode";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$data['email'] = \$credentials['email'];";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$data['registerDate'] = Factory::getDate()->toSql();";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Check if password was set";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (\$mode == 1 && (!isset(\$credentials['password']) || !isset(\$credentials['password2']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password2'])))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Set random password when empty password was submitted,";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " when using the 1 = site-registration mode";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$credentials['password'] = self::randomkey(8);";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$credentials['password2'] = \$credentials['password'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Now Add password if set";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (isset(\$credentials['password']) && isset(\$credentials['password2']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$credentials['password2']))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "if (\$mode == 1) //" . Line::_(
|
|
||||||
__LINE__,__CLASS__
|
|
||||||
)
|
|
||||||
. " 1 = Site-registration mode";
|
|
||||||
$method[] = Indent::_(3) . "{";
|
|
||||||
$method[] = Indent::_(4)
|
|
||||||
. "\$data['password1'] = \$credentials['password'];";
|
|
||||||
$method[] = Indent::_(3) . "}";
|
|
||||||
$method[] = Indent::_(3) . "else //" . Line::_(__Line__, __Class__)
|
|
||||||
. " 0 = Admin-registration mode";
|
|
||||||
$method[] = Indent::_(3) . "{";
|
|
||||||
$method[] = Indent::_(4)
|
|
||||||
. "\$data['password'] = \$credentials['password'];";
|
|
||||||
$method[] = Indent::_(3) . "}";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$data['password2'] = \$credentials['password2'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Load the group/s value if set, only for Admin Registration (\$mode == 0)";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (\$mode == 0 && isset(\$credentials['groups']) && Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$credentials['groups']))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$data['groups'] = \$credentials['groups'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Create the new user";
|
|
||||||
$method[] = Indent::_(2) . "if (\$mode == 1) //" . Line::_(
|
|
||||||
__LINE__,__CLASS__
|
|
||||||
)
|
|
||||||
. " 1 = Site-registration mode";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "\$userId = \$model->register(\$data);";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "else //" . Line::_(__Line__, __Class__)
|
|
||||||
. " 0 = Admin-registration mode";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "\$model->save(\$data);";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$userId = \$model->getState('user.id', 0);";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Check if we have params";
|
|
||||||
$method[] = Indent::_(2) . "if (Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$params))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Change user params/config back";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "foreach (\$params as \$param => \$set)";
|
|
||||||
$method[] = Indent::_(3) . "{";
|
|
||||||
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " If you know of a better path, let me know";
|
|
||||||
$method[] = Indent::_(4)
|
|
||||||
. "self::setParams(\$extension, \$param, \$set);";
|
|
||||||
$method[] = Indent::_(3) . "}";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " if user is created";
|
|
||||||
$method[] = Indent::_(2) . "if (\$userId > 0)";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Auto Login if Needed";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "if (\$autologin && isset(\$credentials['password']))";
|
|
||||||
$method[] = Indent::_(3) . "{";
|
|
||||||
$method[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Try to login";
|
|
||||||
$method[] = Indent::_(4) . "try{";
|
|
||||||
$method[] = Indent::_(5)
|
|
||||||
. "Factory::getApplication()->login(\$credentials);";
|
|
||||||
$method[] = Indent::_(4) . "} catch (\Exception \$exception){";
|
|
||||||
$method[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Do noting for now, may want to set redirect.";
|
|
||||||
$method[] = Indent::_(4) . "}";
|
|
||||||
$method[] = Indent::_(3) . "}";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Return ID";
|
|
||||||
$method[] = Indent::_(3) . "return \$userId;";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "return \$model->getError();";
|
|
||||||
$method[] = Indent::_(1) . "}";
|
|
||||||
|
|
||||||
$method[] = PHP_EOL . Indent::_(1)
|
|
||||||
. "public static function setParams(\$component,\$target,\$value)";
|
|
||||||
$method[] = Indent::_(1) . "{";
|
|
||||||
$method[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Get the params and set the new values";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "\$params = ComponentHelper::getParams(\$component);";
|
|
||||||
$method[] = Indent::_(2) . "\$was = \$params->get(\$target, null);";
|
|
||||||
$method[] = Indent::_(2) . "if (\$was != \$value)";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "\$params->set(\$target, \$value);";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Get a new database query instance";
|
|
||||||
|
|
||||||
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
|
||||||
{
|
|
||||||
$method[] = Indent::_(3) . "\$db = Factory::getDBO();";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$method[] = Indent::_(3) . "\$db = Factory::getContainer()->get(DatabaseInterface::class);";
|
|
||||||
}
|
|
||||||
|
|
||||||
$method[] = Indent::_(3) . "\$query = \$db->getQuery(true);";
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Build the query";
|
|
||||||
$method[] = Indent::_(3) . "\$query->update('#__extensions AS a');";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$query->set('a.params = ' . \$db->quote((string)\$params));";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$query->where('a.element = ' . \$db->quote((string)\$component));";
|
|
||||||
$method[] = Indent::_(3);
|
|
||||||
$method[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
|
||||||
. " Execute the query";
|
|
||||||
$method[] = Indent::_(3) . "\$db->setQuery(\$query);";
|
|
||||||
$method[] = Indent::_(3) . "\$db->execute();";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "return \$was;";
|
|
||||||
$method[] = Indent::_(1) . "}";
|
|
||||||
|
|
||||||
$method[] = PHP_EOL . Indent::_(1) . "/**";
|
|
||||||
$method[] = Indent::_(1) . " * Update user values";
|
|
||||||
$method[] = Indent::_(1) . " */";
|
|
||||||
$method[] = Indent::_(1)
|
|
||||||
. "public static function updateUser(\$new)";
|
|
||||||
$method[] = Indent::_(1) . "{";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "// load the user component language files if there is an error.";
|
|
||||||
$method[] = Indent::_(2) . "\$lang = Factory::getLanguage();";
|
|
||||||
$method[] = Indent::_(2) . "\$extension = 'com_users';";
|
|
||||||
$method[] = Indent::_(2) . "\$base_dir = JPATH_ADMINISTRATOR;";
|
|
||||||
$method[] = Indent::_(2) . "\$language_tag = '" . CFactory::_('Config')->get('lang_tag', 'en-GB')
|
|
||||||
. "';";
|
|
||||||
$method[] = Indent::_(2) . "\$reload = true;";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
|
|
||||||
$method[] = Indent::_(2) . "// load the user model";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');";
|
|
||||||
$method[] = Indent::_(2) . "// Check if password was set";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (isset(\$new['password']) && isset(\$new['password2']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$new['password']) && Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$new['password2']))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "// Use the users passwords";
|
|
||||||
$method[] = Indent::_(3) . "\$password = \$new['password'];";
|
|
||||||
$method[] = Indent::_(3) . "\$password2 = \$new['password2'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "// set username";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (!isset(\$new['username']) || !Super_" . "__1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check(\$new['username']))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "\$new['username'] = \$new['email'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "// lineup update user data";
|
|
||||||
$method[] = Indent::_(2) . "\$data = array(";
|
|
||||||
$method[] = Indent::_(3) . "'id' => \$new['id'],";
|
|
||||||
$method[] = Indent::_(3) . "'username' => \$new['username'],";
|
|
||||||
$method[] = Indent::_(3) . "'name' => \$new['name'],";
|
|
||||||
$method[] = Indent::_(3) . "'email' => \$new['email'],";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "'password' => \$password, // First password field";
|
|
||||||
$method[] = Indent::_(3)
|
|
||||||
. "'password2' => \$password2, // Confirm password field";
|
|
||||||
$method[] = Indent::_(3) . "'block' => 0 );";
|
|
||||||
$method[] = Indent::_(2) . "// set groups if found";
|
|
||||||
$method[] = Indent::_(2)
|
|
||||||
. "if (isset(\$new['groups']) && Super_" . "__0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$new['groups']))";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "\$data['groups'] = \$new['groups'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "// register the new user";
|
|
||||||
$method[] = Indent::_(2) . "\$done = \$model->save(\$data);";
|
|
||||||
$method[] = Indent::_(2) . "// if user is updated";
|
|
||||||
$method[] = Indent::_(2) . "if (\$done)";
|
|
||||||
$method[] = Indent::_(2) . "{";
|
|
||||||
$method[] = Indent::_(3) . "return \$new['id'];";
|
|
||||||
$method[] = Indent::_(2) . "}";
|
|
||||||
$method[] = Indent::_(2) . "return \$model->getError();";
|
|
||||||
$method[] = Indent::_(1) . "}";
|
|
||||||
|
|
||||||
// return the help method
|
|
||||||
return implode(PHP_EOL, $method);
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setAdminViewMenu(&$nameSingleCode, &$view)
|
public function setAdminViewMenu(&$nameSingleCode, &$view)
|
||||||
@@ -6614,7 +6298,7 @@ class Interpretation extends Fields
|
|||||||
__LINE__,__CLASS__
|
__LINE__,__CLASS__
|
||||||
) . " check if the CSS file exists.";
|
) . " check if the CSS file exists.";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
||||||
. "if (File::exists(JPATH_ROOT.'/media/com_"
|
. "if (@file_exists(JPATH_ROOT.'/media/com_"
|
||||||
. CFactory::_('Config')->component_code_name
|
. CFactory::_('Config')->component_code_name
|
||||||
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
|
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
||||||
@@ -6630,7 +6314,7 @@ class Interpretation extends Fields
|
|||||||
__LINE__,__CLASS__
|
__LINE__,__CLASS__
|
||||||
) . " check if the JavaScript file exists.";
|
) . " check if the JavaScript file exists.";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
||||||
. "if (File::exists(JPATH_ROOT.'/media/com_"
|
. "if (@file_exists(JPATH_ROOT.'/media/com_"
|
||||||
. CFactory::_('Config')->component_code_name
|
. CFactory::_('Config')->component_code_name
|
||||||
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
|
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
||||||
@@ -6671,7 +6355,7 @@ class Interpretation extends Fields
|
|||||||
__LINE__,__CLASS__
|
__LINE__,__CLASS__
|
||||||
) . " check if the CSS file exists.";
|
) . " check if the CSS file exists.";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
||||||
. "if (File::exists(JPATH_ROOT.'/media/com_"
|
. "if (@file_exists(JPATH_ROOT.'/media/com_"
|
||||||
. CFactory::_('Config')->component_code_name
|
. CFactory::_('Config')->component_code_name
|
||||||
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
|
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
||||||
@@ -6687,7 +6371,7 @@ class Interpretation extends Fields
|
|||||||
__LINE__,__CLASS__
|
__LINE__,__CLASS__
|
||||||
) . " check if the JavaScript file exists.";
|
) . " check if the JavaScript file exists.";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
$setter .= PHP_EOL . $tabV . Indent::_(5)
|
||||||
. "if (File::exists(JPATH_ROOT.'/media/com_"
|
. "if (@file_exists(JPATH_ROOT.'/media/com_"
|
||||||
. CFactory::_('Config')->component_code_name
|
. CFactory::_('Config')->component_code_name
|
||||||
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
|
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
|
||||||
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
$setter .= PHP_EOL . $tabV . Indent::_(5) . "{";
|
||||||
@@ -7154,7 +6838,7 @@ class Interpretation extends Fields
|
|||||||
$file
|
$file
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
if (File::exists($file['path']))
|
if (@file_exists($file['path']))
|
||||||
{
|
{
|
||||||
$string = FileHelper::getContent(
|
$string = FileHelper::getContent(
|
||||||
$file['path']
|
$file['path']
|
||||||
@@ -7170,7 +6854,7 @@ class Interpretation extends Fields
|
|||||||
{
|
{
|
||||||
if (ArrayHelper::check($doc))
|
if (ArrayHelper::check($doc))
|
||||||
{
|
{
|
||||||
if (File::exists($doc['path']))
|
if (@file_exists($doc['path']))
|
||||||
{
|
{
|
||||||
$string
|
$string
|
||||||
= FileHelper::getContent(
|
= FileHelper::getContent(
|
||||||
@@ -10251,7 +9935,7 @@ class Interpretation extends Fields
|
|||||||
. "`id` INT(11) NOT NULL AUTO_INCREMENT,";
|
. "`id` INT(11) NOT NULL AUTO_INCREMENT,";
|
||||||
}
|
}
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',";
|
. "`asset_id` INT(10) unsigned NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',";
|
||||||
ksort($fields);
|
ksort($fields);
|
||||||
$last_name = 'asset_id';
|
$last_name = 'asset_id';
|
||||||
foreach ($fields as $field => $data)
|
foreach ($fields as $field => $data)
|
||||||
@@ -10350,19 +10034,19 @@ class Interpretation extends Fields
|
|||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.published'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.published'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`published` TINYINT(3) NOT NULL DEFAULT 1,";
|
. "`published` TINYINT(3) NULL DEFAULT 1,";
|
||||||
}
|
}
|
||||||
// check if default field was overwritten
|
// check if default field was overwritten
|
||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.created_by'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.created_by'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`created_by` INT(10) unsigned NOT NULL DEFAULT 0,";
|
. "`created_by` INT(10) unsigned NULL DEFAULT 0,";
|
||||||
}
|
}
|
||||||
// check if default field was overwritten
|
// check if default field was overwritten
|
||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.modified_by'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.modified_by'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,";
|
. "`modified_by` INT(10) unsigned NULL DEFAULT 0,";
|
||||||
}
|
}
|
||||||
// check if default field was overwritten
|
// check if default field was overwritten
|
||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.created'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.created'))
|
||||||
@@ -10370,7 +10054,7 @@ class Interpretation extends Fields
|
|||||||
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',";
|
. "`created` DATETIME NULL DEFAULT '0000-00-00 00:00:00',";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10384,7 +10068,7 @@ class Interpretation extends Fields
|
|||||||
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',";
|
. "`modified` DATETIME NULL DEFAULT '0000-00-00 00:00:00',";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10396,7 +10080,7 @@ class Interpretation extends Fields
|
|||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.checked_out'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.checked_out'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`checked_out` int(11) unsigned NOT NULL DEFAULT 0,";
|
. "`checked_out` int(11) unsigned NULL DEFAULT 0,";
|
||||||
}
|
}
|
||||||
// check if default field was overwritten
|
// check if default field was overwritten
|
||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.checked_out_time'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.checked_out_time'))
|
||||||
@@ -10404,7 +10088,7 @@ class Interpretation extends Fields
|
|||||||
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',";
|
. "`checked_out_time` DATETIME NULL DEFAULT '0000-00-00 00:00:00',";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10416,20 +10100,20 @@ class Interpretation extends Fields
|
|||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.version'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.version'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`version` INT(10) unsigned NOT NULL DEFAULT 1,";
|
. "`version` INT(10) unsigned NULL DEFAULT 1,";
|
||||||
}
|
}
|
||||||
// check if default field was overwritten
|
// check if default field was overwritten
|
||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.hits'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.hits'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`hits` INT(10) unsigned NOT NULL DEFAULT 0,";
|
. "`hits` INT(10) unsigned NULL DEFAULT 0,";
|
||||||
}
|
}
|
||||||
// check if view has access
|
// check if view has access
|
||||||
if (CFactory::_('Compiler.Builder.Access.Switch')->exists($view)
|
if (CFactory::_('Compiler.Builder.Access.Switch')->exists($view)
|
||||||
&& !CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.access'))
|
&& !CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.access'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`access` INT(10) unsigned NOT NULL DEFAULT 0,";
|
. "`access` INT(10) unsigned NULL DEFAULT 0,";
|
||||||
// add to component dynamic fields
|
// add to component dynamic fields
|
||||||
CFactory::_('Compiler.Builder.Component.Fields')->set($view . '.access',
|
CFactory::_('Compiler.Builder.Component.Fields')->set($view . '.access',
|
||||||
[
|
[
|
||||||
@@ -10443,7 +10127,7 @@ class Interpretation extends Fields
|
|||||||
'type' => 'INT(10) unsigned',
|
'type' => 'INT(10) unsigned',
|
||||||
'default' => '0',
|
'default' => '0',
|
||||||
'key' => true,
|
'key' => true,
|
||||||
'null_switch' => 'NOT NULL'
|
'null_switch' => 'NULL'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@@ -10452,7 +10136,7 @@ class Interpretation extends Fields
|
|||||||
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.ordering'))
|
if (!CFactory::_('Compiler.Builder.Field.Names')->isString($view . '.ordering'))
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`ordering` INT(11) NOT NULL DEFAULT 0,";
|
. "`ordering` INT(11) NULL DEFAULT 0,";
|
||||||
}
|
}
|
||||||
// check if metadata is added to this view
|
// check if metadata is added to this view
|
||||||
if (CFactory::_('Compiler.Builder.Meta.Data')->isString($view))
|
if (CFactory::_('Compiler.Builder.Meta.Data')->isString($view))
|
||||||
@@ -10463,7 +10147,7 @@ class Interpretation extends Fields
|
|||||||
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`metakey` TEXT NOT NULL,";
|
. "`metakey` TEXT NULL,";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10477,7 +10161,7 @@ class Interpretation extends Fields
|
|||||||
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`metadesc` TEXT NOT NULL,";
|
. "`metadesc` TEXT NULL,";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10491,7 +10175,7 @@ class Interpretation extends Fields
|
|||||||
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
{
|
{
|
||||||
$db_ .= PHP_EOL . Indent::_(1)
|
$db_ .= PHP_EOL . Indent::_(1)
|
||||||
. "`metadata` TEXT NOT NULL,";
|
. "`metadata` TEXT NULL,";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -10663,22 +10347,25 @@ class Interpretation extends Fields
|
|||||||
// add to main DB string
|
// add to main DB string
|
||||||
$db .= $db_ . PHP_EOL . PHP_EOL;
|
$db .= $db_ . PHP_EOL . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add custom sql dump to the file
|
// add custom sql dump to the file
|
||||||
if (isset(CFactory::_('Customcode.Dispenser')->hub['sql'])
|
if (isset(CFactory::_('Customcode.Dispenser')->hub['sql'])
|
||||||
&& ArrayHelper::check(
|
&& ArrayHelper::check(
|
||||||
CFactory::_('Customcode.Dispenser')->hub['sql']
|
CFactory::_('Customcode.Dispenser')->hub['sql']
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
foreach (
|
foreach (CFactory::_('Customcode.Dispenser')->hub['sql'] as $for => $customSql)
|
||||||
CFactory::_('Customcode.Dispenser')->hub['sql'] as $for => $customSql
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
$placeholders = array(Placefix::_('component') => $component,
|
$placeholders = [
|
||||||
Placefix::_('view') => $for);
|
Placefix::_('component') => $component,
|
||||||
|
Placefix::_('view') => $for
|
||||||
|
]; // dont change this just use ###view### or componentbuilder (took you a while to get here right :)
|
||||||
|
|
||||||
$db .= CFactory::_('Placeholder')->update(
|
$db .= CFactory::_('Placeholder')->update(
|
||||||
$customSql, $placeholders
|
$customSql, $placeholders
|
||||||
) . PHP_EOL . PHP_EOL;
|
) . PHP_EOL . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
unset(CFactory::_('Customcode.Dispenser')->hub['sql']);
|
unset(CFactory::_('Customcode.Dispenser')->hub['sql']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13762,6 +13449,14 @@ class Interpretation extends Fields
|
|||||||
$headerscript .= PHP_EOL . '}';
|
$headerscript .= PHP_EOL . '}';
|
||||||
if ($addNewButon > 0)
|
if ($addNewButon > 0)
|
||||||
{
|
{
|
||||||
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
|
{
|
||||||
|
$add_key = 'edit';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$add_key = 'add';
|
||||||
|
}
|
||||||
// add the link for new
|
// add the link for new
|
||||||
if ($addNewButon == 1 || $addNewButon == 2)
|
if ($addNewButon == 1 || $addNewButon == 2)
|
||||||
{
|
{
|
||||||
@@ -13770,7 +13465,7 @@ class Interpretation extends Fields
|
|||||||
$headerscript .= PHP_EOL . '$new = "index.php?option=com_'
|
$headerscript .= PHP_EOL . '$new = "index.php?option=com_'
|
||||||
. CFactory::_('Config')->component_code_name . '&view=' . $name_list_code
|
. CFactory::_('Config')->component_code_name . '&view=' . $name_list_code
|
||||||
. '&task='
|
. '&task='
|
||||||
. $name_single_code . '.edit" . $ref;';
|
. $name_single_code . '.' . $add_key . '" . $ref;';
|
||||||
}
|
}
|
||||||
// and the link for close and new
|
// and the link for close and new
|
||||||
if ($addNewButon == 2 || $addNewButon == 3)
|
if ($addNewButon == 2 || $addNewButon == 3)
|
||||||
@@ -13781,7 +13476,7 @@ class Interpretation extends Fields
|
|||||||
. '$close_new = "index.php?option=com_'
|
. '$close_new = "index.php?option=com_'
|
||||||
. CFactory::_('Config')->component_code_name . '&view=' . $name_list_code
|
. CFactory::_('Config')->component_code_name . '&view=' . $name_list_code
|
||||||
. '&task='
|
. '&task='
|
||||||
. $name_single_code . '.edit";';
|
. $name_single_code . '.' . $add_key . '";';
|
||||||
}
|
}
|
||||||
$headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
|
$headerscript .= PHP_EOL . '//' . Line::_(__Line__, __Class__)
|
||||||
. ' load the action object';
|
. ' load the action object';
|
||||||
@@ -18062,7 +17757,7 @@ class Interpretation extends Fields
|
|||||||
. "\$query = \$db->getQuery(true);";
|
. "\$query = \$db->getQuery(true);";
|
||||||
|
|
||||||
// check if usergroup as we change to an object query
|
// check if usergroup as we change to an object query
|
||||||
if ($filter['type'] === 'usergroup')
|
if ($filter['type'] === 'usergroup' || $filter['type'] === 'usergrouplist')
|
||||||
{
|
{
|
||||||
$function[] = PHP_EOL . Indent::_(2) . "//"
|
$function[] = PHP_EOL . Indent::_(2) . "//"
|
||||||
. Line::_(__Line__, __Class__) . " Select the text.";
|
. Line::_(__Line__, __Class__) . " Select the text.";
|
||||||
@@ -18139,7 +17834,7 @@ class Interpretation extends Fields
|
|||||||
. $nameListCode . "');";
|
. $nameListCode . "');";
|
||||||
}
|
}
|
||||||
// check if usergroup as we change to an object query
|
// check if usergroup as we change to an object query
|
||||||
if ($filter['type'] !== 'usergroup')
|
if ($filter['type'] !== 'usergroup' && $filter['type'] !== 'usergrouplist')
|
||||||
{
|
{
|
||||||
$function[] = Indent::_(3)
|
$function[] = Indent::_(3)
|
||||||
. "\$_results = array_unique(\$_results);";
|
. "\$_results = array_unique(\$_results);";
|
||||||
@@ -18197,7 +17892,7 @@ class Interpretation extends Fields
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($filter['type'] === 'usergroup')
|
if ($filter['type'] === 'usergroup' || $filter['type'] === 'usergrouplist')
|
||||||
{
|
{
|
||||||
$function[] = Indent::_(4) . "//" . Line::_(
|
$function[] = Indent::_(4) . "//" . Line::_(
|
||||||
__LINE__,__CLASS__
|
__LINE__,__CLASS__
|
||||||
@@ -20677,7 +20372,7 @@ class Interpretation extends Fields
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['type'] === 'usergroup' && !$export
|
if (($item['type'] === 'usergroup' || $item['type'] === 'usergrouplist') && !$export
|
||||||
&& $item['method'] != 6)
|
&& $item['method'] != 6)
|
||||||
{
|
{
|
||||||
$fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//"
|
$fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "//"
|
||||||
@@ -20704,7 +20399,7 @@ class Interpretation extends Fields
|
|||||||
. $item['name'] . "Names);";
|
. $item['name'] . "Names);";
|
||||||
$fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}";
|
$fix .= PHP_EOL . Indent::_(1) . $tab . Indent::_(3) . "}";
|
||||||
}
|
}
|
||||||
/* elseif ($item['type'] === 'usergroup' && $export)
|
/* elseif (($item['type'] === 'usergroup' || $item['type'] === 'usergrouplist') && $export)
|
||||||
{
|
{
|
||||||
$fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "//".Line::_(__Line__, __Class__)." decode ".$item['name'];
|
$fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "//".Line::_(__Line__, __Class__)." decode ".$item['name'];
|
||||||
$fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");";
|
$fix .= PHP_EOL.Indent::_(1).$tab.Indent::_(3) . "\$".$item['name']."Array = ".$decode."(\$item->".$item['name'].$suffix_decode.");";
|
||||||
@@ -21553,7 +21248,8 @@ class Interpretation extends Fields
|
|||||||
$counter++;
|
$counter++;
|
||||||
}
|
}
|
||||||
// dashboard link to category on dashboard is build here
|
// dashboard link to category on dashboard is build here
|
||||||
if (CFactory::_('Compiler.Builder.Category')->exists("{$name_list}.code"))
|
if (CFactory::_('Compiler.Builder.Category')->exists("{$name_list}.code") &&
|
||||||
|
CFactory::_('Compiler.Builder.Category')->get("{$name_list}.add_icon"))
|
||||||
{
|
{
|
||||||
$catCode = CFactory::_('Compiler.Builder.Category')->get("{$name_list}.code");
|
$catCode = CFactory::_('Compiler.Builder.Category')->get("{$name_list}.code");
|
||||||
|
|
||||||
@@ -21728,6 +21424,15 @@ class Interpretation extends Fields
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function setDashboardDisplayData()
|
public function setDashboardDisplayData()
|
||||||
|
{
|
||||||
|
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
|
||||||
|
{
|
||||||
|
return $this->setDashboardDisplayDataJ3();
|
||||||
|
}
|
||||||
|
return $this->setDashboardDisplayDataJ4();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDashboardDisplayDataJ3()
|
||||||
{
|
{
|
||||||
// display array reset
|
// display array reset
|
||||||
$display = [];
|
$display = [];
|
||||||
@@ -21739,13 +21444,7 @@ class Interpretation extends Fields
|
|||||||
$row_class = 'row-fluid';
|
$row_class = 'row-fluid';
|
||||||
$form_class = 'form-horizontal';
|
$form_class = 'form-horizontal';
|
||||||
$uitab = 'bootstrap';
|
$uitab = 'bootstrap';
|
||||||
if (CFactory::_('Config')->get('joomla_version', 3) != 3)
|
|
||||||
{
|
|
||||||
$width_class = 'col-md-';
|
|
||||||
$row_class = 'row';
|
|
||||||
$form_class = 'main-card';
|
|
||||||
$uitab = 'uitab';
|
|
||||||
}
|
|
||||||
// check if we have custom tabs
|
// check if we have custom tabs
|
||||||
if (CFactory::_('Component')->isArray('dashboard_tab'))
|
if (CFactory::_('Component')->isArray('dashboard_tab'))
|
||||||
{
|
{
|
||||||
@@ -21878,6 +21577,120 @@ class Interpretation extends Fields
|
|||||||
return PHP_EOL . implode(PHP_EOL, $display);
|
return PHP_EOL . implode(PHP_EOL, $display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setDashboardDisplayDataJ4()
|
||||||
|
{
|
||||||
|
// display array reset
|
||||||
|
$display = [];
|
||||||
|
$mainAccordianName = 'cPanel';
|
||||||
|
$builder = [];
|
||||||
|
$tab = Indent::_(3);
|
||||||
|
$loadTabs = false;
|
||||||
|
$width_class = 'col-md-';
|
||||||
|
$row_class = 'row';
|
||||||
|
$form_class = 'main-card';
|
||||||
|
$uitab = 'uitab';
|
||||||
|
|
||||||
|
// check if we have custom tabs
|
||||||
|
if (CFactory::_('Component')->isArray('dashboard_tab'))
|
||||||
|
{
|
||||||
|
// build the tabs and accordians
|
||||||
|
foreach (CFactory::_('Component')->get('dashboard_tab') as $data)
|
||||||
|
{
|
||||||
|
$builder[$data['name']][$data['header']]
|
||||||
|
= CFactory::_('Placeholder')->update_(
|
||||||
|
$data['html']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// since we have custom tabs we must load the tab structure around the cpanel
|
||||||
|
$display[] = '<div id="j-main-container">';
|
||||||
|
$display[] = Indent::_(1) . '<div class="' . $form_class . '">';
|
||||||
|
$display[] = Indent::_(1)
|
||||||
|
. "<?php echo Html::_('{$uitab}.startTabSet', 'cpanel_tab', array('active' => 'cpanel')); ?>";
|
||||||
|
$display[] = PHP_EOL . Indent::_(2)
|
||||||
|
. "<?php echo Html::_('{$uitab}.addTab', 'cpanel_tab', 'cpanel', Text:"
|
||||||
|
. ":_('cPanel', true)); ?>";
|
||||||
|
$display[] = Indent::_(2) . '<div class="' . $row_class . '">';
|
||||||
|
// change the name of the main tab
|
||||||
|
$mainAccordianName = 'Control Panel';
|
||||||
|
$loadTabs = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$display[] = '<div id="j-main-container">';
|
||||||
|
$display[] = Indent::_(1) . '<div class="' . $form_class . '" style="padding: 20px;">';
|
||||||
|
$display[] = Indent::_(2) . '<div class="' . $row_class . '">';
|
||||||
|
}
|
||||||
|
// set dashboard display
|
||||||
|
$display[] = $tab . '<div class="' . $width_class . '9">';
|
||||||
|
$display[] = $tab . Indent::_(1)
|
||||||
|
. "<?php echo \$this->loadTemplate('main');?>";
|
||||||
|
$display[] = $tab . "</div>";
|
||||||
|
$display[] = $tab . '<div class="' . $width_class . '3">';
|
||||||
|
$display[] = $tab . Indent::_(1)
|
||||||
|
. "<?php echo \$this->loadTemplate('vdm');?>";
|
||||||
|
$display[] = $tab . "</div>";
|
||||||
|
|
||||||
|
if ($loadTabs)
|
||||||
|
{
|
||||||
|
$display[] = Indent::_(2) . "</div>";
|
||||||
|
$display[] = Indent::_(2)
|
||||||
|
. "<?php echo Html::_('{$uitab}.endTab'); ?>";
|
||||||
|
// load the new tabs
|
||||||
|
foreach ($builder as $tabname => $accordians)
|
||||||
|
{
|
||||||
|
$alias = StringHelper::safe($tabname);
|
||||||
|
$display[] = PHP_EOL . Indent::_(2)
|
||||||
|
. "<?php echo Html::_('{$uitab}.addTab', 'cpanel_tab', '"
|
||||||
|
. $alias . "', Text:" . ":_('" . $tabname
|
||||||
|
. "', true)); ?>";
|
||||||
|
$display[] = Indent::_(2) . '<div class="' . $row_class . '">';
|
||||||
|
$display[] = $tab . '<div class="' . $width_class . '12">';
|
||||||
|
$slidecounter = 1;
|
||||||
|
foreach ($accordians as $accordianname => $html)
|
||||||
|
{
|
||||||
|
$ac_alias = StringHelper::safe(
|
||||||
|
$accordianname
|
||||||
|
);
|
||||||
|
$counterName = StringHelper::safe(
|
||||||
|
$slidecounter
|
||||||
|
);
|
||||||
|
$tempName = $alias . '_' . $ac_alias;
|
||||||
|
$display[] = $tab . Indent::_(1)
|
||||||
|
. "<?php echo \$this->loadTemplate('" . $tempName
|
||||||
|
. "');?>";
|
||||||
|
$slidecounter++;
|
||||||
|
// build the template file
|
||||||
|
$target = array('custom_admin' => CFactory::_('Config')->component_code_name);
|
||||||
|
CFactory::_('Utilities.Structure')->build($target, 'template', $tempName);
|
||||||
|
// set the file data
|
||||||
|
$TARGET = StringHelper::safe(
|
||||||
|
CFactory::_('Config')->build_target, 'U'
|
||||||
|
);
|
||||||
|
// SITE_TEMPLATE_BODY <<<DYNAMIC>>>
|
||||||
|
CFactory::_('Compiler.Builder.Content.Multi')->set(CFactory::_('Config')->component_code_name . '_' . $tempName . '|CUSTOM_ADMIN_TEMPLATE_BODY', PHP_EOL . $html);
|
||||||
|
// SITE_TEMPLATE_CODE_BODY <<<DYNAMIC>>>
|
||||||
|
CFactory::_('Compiler.Builder.Content.Multi')->set(CFactory::_('Config')->component_code_name . '_' . $tempName . '|CUSTOM_ADMIN_TEMPLATE_CODE_BODY', '');
|
||||||
|
}
|
||||||
|
$display[] = $tab . "</div>";
|
||||||
|
$display[] = Indent::_(2) . "</div>";
|
||||||
|
$display[] = Indent::_(2)
|
||||||
|
. "<?php echo Html::_('{$uitab}.endTab'); ?>";
|
||||||
|
}
|
||||||
|
|
||||||
|
$display[] = PHP_EOL . Indent::_(1)
|
||||||
|
. "<?php echo Html::_('{$uitab}.endTabSet'); ?>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$display[] = Indent::_(2) . "</div>";
|
||||||
|
}
|
||||||
|
$display[] = Indent::_(1) . "</div>";
|
||||||
|
$display[] = "</div>";
|
||||||
|
|
||||||
|
// return the display
|
||||||
|
return PHP_EOL . implode(PHP_EOL, $display);
|
||||||
|
}
|
||||||
|
|
||||||
public function addCustomDashboardIcons(&$view, &$counter)
|
public function addCustomDashboardIcons(&$view, &$counter)
|
||||||
{
|
{
|
||||||
$icon = '';
|
$icon = '';
|
||||||
|
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\ComHelperClass;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component Helper Class Create User Interface
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
interface CreateUserInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Generates the method definition for creating or updating a user based on the provided parameters.
|
||||||
|
*
|
||||||
|
* This method returns a string representation of a PHP function that includes various
|
||||||
|
* steps for handling user creation and updates, depending on the mode (site registration or admin registration).
|
||||||
|
*
|
||||||
|
* @param $add Determines whether to generate the user creation method or not.
|
||||||
|
* If true, the method will be generated and returned as a string.
|
||||||
|
*
|
||||||
|
* @return string The generated method code as a string if $add is true.
|
||||||
|
* Returns an empty string if $add is false.
|
||||||
|
*/
|
||||||
|
public function get($add): string;
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -12,7 +12,6 @@
|
|||||||
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
||||||
|
|
||||||
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump;
|
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump;
|
||||||
|
|
||||||
@@ -43,15 +42,15 @@ class Sql
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param Dispenser|null $dispenser The compiler customcode dispenser.
|
* @param Dispenser $dispenser The compiler customcode dispenser.
|
||||||
* @param Sqldump|null $dump The compiler SQL dump.
|
* @param Sqldump $dump The compiler SQL dump.
|
||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public function __construct(?Dispenser $dispenser = null, ?Sqldump $dump = null)
|
public function __construct(Dispenser $dispenser, Sqldump $dump)
|
||||||
{
|
{
|
||||||
$this->dispenser = $dispenser ?: Compiler::_('Customcode.Dispenser');
|
$this->dispenser = $dispenser;
|
||||||
$this->dump = $dump ?: Compiler::_('Model.Sqldump');
|
$this->dump = $dump;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -92,6 +91,5 @@ class Sql
|
|||||||
unset($item->tables);
|
unset($item->tables);
|
||||||
unset($item->sql);
|
unset($item->sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,7 +13,6 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
|||||||
|
|
||||||
|
|
||||||
use Joomla\CMS\Factory;
|
use Joomla\CMS\Factory;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
||||||
use VDM\Joomla\Utilities\ArrayHelper;
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||||
@@ -45,14 +44,13 @@ class Sqldump
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param Registry|null $registry The compiler registry object.
|
* @param Registry $registry The compiler registry object.
|
||||||
* @param \JDatabaseDriver|null $db The database object.
|
|
||||||
|
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public function __construct(?Registry $registry = null)
|
public function __construct(Registry $registry)
|
||||||
{
|
{
|
||||||
$this->registry = $registry ?: Compiler::_('Registry');
|
$this->registry = $registry;
|
||||||
$this->db = Factory::getDbo();
|
$this->db = Factory::getDbo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
||||||
|
|
||||||
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
||||||
use VDM\Joomla\Utilities\JsonHelper;
|
use VDM\Joomla\Utilities\JsonHelper;
|
||||||
use VDM\Joomla\Utilities\ArrayHelper;
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
@@ -37,13 +36,13 @@ class Sqltweaking
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param Registry|null $registry The compiler registry object.
|
* @param Registry $registry The compiler registry object.
|
||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public function __construct(?Registry $registry = null)
|
public function __construct(Registry $registry)
|
||||||
{
|
{
|
||||||
$this->registry = $registry ?: Compiler::_('Registry');
|
$this->registry = $registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
namespace VDM\Joomla\Componentbuilder\Compiler\Model;
|
||||||
|
|
||||||
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
||||||
use VDM\Joomla\Utilities\ArrayHelper;
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
use VDM\Joomla\Utilities\StringHelper;
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
@@ -45,13 +44,13 @@ class Updatesql
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param Registry|null $registry The compiler registry object.
|
* @param Registry $registry The compiler registry object.
|
||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public function __construct(?Registry $registry = null)
|
public function __construct(Registry $registry)
|
||||||
{
|
{
|
||||||
$this->registry = $registry ?: Compiler::_('Registry');
|
$this->registry = $registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -492,7 +492,7 @@ class Power implements PowerInterface
|
|||||||
$this->active[$guid]->file_name = array_pop($src_array);
|
$this->active[$guid]->file_name = array_pop($src_array);
|
||||||
|
|
||||||
// namespace array
|
// namespace array
|
||||||
$namespace_array = [...$path_array, ...$src_array];
|
$namespace_array = array_merge($path_array, $src_array);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -534,12 +534,12 @@ class Power implements PowerInterface
|
|||||||
// set the actual class namespace
|
// set the actual class namespace
|
||||||
$this->active[$guid]->_namespace = implode('\\', $namespace_array);
|
$this->active[$guid]->_namespace = implode('\\', $namespace_array);
|
||||||
|
|
||||||
// set global namespaces for autoloader
|
|
||||||
$this->namespace[implode('.', $path_array)] = $path_array;
|
|
||||||
|
|
||||||
// get the parent folder (the first value in array)
|
// get the parent folder (the first value in array)
|
||||||
$prefix_folder = implode('.', $path_array);
|
$prefix_folder = implode('.', $path_array);
|
||||||
|
|
||||||
|
// set global namespaces for autoloader
|
||||||
|
$this->namespace[$prefix_folder] = $path_array;
|
||||||
|
|
||||||
// make sub folders if still found
|
// make sub folders if still found
|
||||||
$sub_folder = '';
|
$sub_folder = '';
|
||||||
if (ArrayHelper::check($src_array))
|
if (ArrayHelper::check($src_array))
|
||||||
|
@@ -398,13 +398,13 @@ final class Infusion
|
|||||||
$code[] = 'namespace ' . $power->_namespace . ';' . PHP_EOL;
|
$code[] = 'namespace ' . $power->_namespace . ';' . PHP_EOL;
|
||||||
|
|
||||||
// check if we have header data
|
// check if we have header data
|
||||||
if (StringHelper::check($power->head))
|
if (isset($power->head) && StringHelper::check($power->head))
|
||||||
{
|
{
|
||||||
$code[] = PHP_EOL . $power->head;
|
$code[] = PHP_EOL . $power->head;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add description if set
|
// add description if set
|
||||||
if (StringHelper::check($power->description))
|
if (isset($power->description) && StringHelper::check($power->description))
|
||||||
{
|
{
|
||||||
// check if this is escaped
|
// check if this is escaped
|
||||||
if (strpos((string) $power->description, '/*') === false)
|
if (strpos((string) $power->description, '/*') === false)
|
||||||
@@ -419,13 +419,13 @@ final class Infusion
|
|||||||
$declaration = $power->type . ' ' . $power->class_name;
|
$declaration = $power->type . ' ' . $power->class_name;
|
||||||
|
|
||||||
// check if we have extends
|
// check if we have extends
|
||||||
if (StringHelper::check($power->extends_name))
|
if (isset($power->extends_name) && StringHelper::check($power->extends_name))
|
||||||
{
|
{
|
||||||
$declaration .= ' extends ' . $power->extends_name;
|
$declaration .= ' extends ' . $power->extends_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if we have implements
|
// check if we have implements
|
||||||
if (ArrayHelper::check($power->implement_names))
|
if (isset($power->implement_names) && ArrayHelper::check($power->implement_names))
|
||||||
{
|
{
|
||||||
$declaration .= ' implements ' . implode(', ', $power->implement_names);
|
$declaration .= ' implements ' . implode(', ', $power->implement_names);
|
||||||
}
|
}
|
||||||
@@ -434,7 +434,7 @@ final class Infusion
|
|||||||
$code[] = '{';
|
$code[] = '{';
|
||||||
|
|
||||||
// add the main code if set
|
// add the main code if set
|
||||||
if (StringHelper::check($power->main_class_code))
|
if (isset($power->main_class_code) && StringHelper::check($power->main_class_code))
|
||||||
{
|
{
|
||||||
$code[] = $power->main_class_code;
|
$code[] = $power->main_class_code;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,118 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Compiler\Service;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\DI\Container;
|
||||||
|
use Joomla\DI\ServiceProviderInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\ComHelperClass\CreateUserInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\ComHelperClass\CreateUser as J5CreateUser;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\ComHelperClass\CreateUser as J4CreateUser;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\ComHelperClass\CreateUser as J3CreateUser;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Architecture Component Helper Class Service Provider
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
class ArchitectureComHelperClass implements ServiceProviderInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Current Joomla Version Being Build
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 5.0.2
|
||||||
|
**/
|
||||||
|
protected $targetVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers the service provider with a DI container.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function register(Container $container)
|
||||||
|
{
|
||||||
|
$container->alias(CreateUserInterface::class, 'Architecture.ComHelperClass.CreateUser')
|
||||||
|
->share('Architecture.ComHelperClass.CreateUser', [$this, 'getCreateUser'], true);
|
||||||
|
|
||||||
|
$container->alias(J5CreateUser::class, 'Architecture.ComHelperClass.J5.CreateUser')
|
||||||
|
->share('Architecture.ComHelperClass.J5.CreateUser', [$this, 'getJ5CreateUser'], true);
|
||||||
|
|
||||||
|
$container->alias(J4CreateUser::class, 'Architecture.ComHelperClass.J4.CreateUser')
|
||||||
|
->share('Architecture.ComHelperClass.J4.CreateUser', [$this, 'getJ4CreateUser'], true);
|
||||||
|
|
||||||
|
$container->alias(J3CreateUser::class, 'Architecture.ComHelperClass.J3.CreateUser')
|
||||||
|
->share('Architecture.ComHelperClass.J3.CreateUser', [$this, 'getJ3CreateUser'], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The CreateUserInterface Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return CreateUserInterface
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function getCreateUser(Container $container): CreateUserInterface
|
||||||
|
{
|
||||||
|
if (empty($this->targetVersion))
|
||||||
|
{
|
||||||
|
$this->targetVersion = $container->get('Config')->joomla_version;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $container->get('Architecture.ComHelperClass.J' . $this->targetVersion . '.CreateUser');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The CreateUser Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5CreateUser
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function getJ5CreateUser(Container $container): J5CreateUser
|
||||||
|
{
|
||||||
|
return new J5CreateUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The CreateUser Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J4CreateUser
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function getJ4CreateUser(Container $container): J4CreateUser
|
||||||
|
{
|
||||||
|
return new J4CreateUser();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The CreateUser Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J3CreateUser
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
public function getJ3CreateUser(Container $container): J3CreateUser
|
||||||
|
{
|
||||||
|
return new J3CreateUser();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 3rd September, 2020
|
* @created 4th September, 2020
|
||||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
/**
|
/**
|
||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 3rd September, 2020
|
* @created 4th September, 2020
|
||||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
@@ -0,0 +1,147 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\Registry\Registry as JoomlaRegistry;
|
||||||
|
use Joomla\CMS\Factory as JoomlaFactory;
|
||||||
|
use VDM\Joomla\Utilities\GetHelper;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Utilities\RepoHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Abstraction\BaseConfig;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Configurations
|
||||||
|
*
|
||||||
|
* All these functions are accessed via the direct name without the get:
|
||||||
|
* example: $this->component_code_name calls: $this->getComponentcodename()
|
||||||
|
*
|
||||||
|
* All values once called are cached, yet can be updated directly:
|
||||||
|
* example: $this->component_code_name = 'new_code_name'; // be warned!
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
class Config extends BaseConfig
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Global Joomla Configuration
|
||||||
|
*
|
||||||
|
* @var JoomlaRegistry
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected JoomlaRegistry $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param Input|null $input Input
|
||||||
|
* @param Registry|null $params The component parameters
|
||||||
|
* @param Registry|null $config The Joomla configuration
|
||||||
|
*
|
||||||
|
* @throws \Exception
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function __construct(?Input $input = null, ?JoomlaRegistry $params = null, ?JoomlaRegistry $config = null)
|
||||||
|
{
|
||||||
|
parent::__construct($input, $params);
|
||||||
|
|
||||||
|
$this->config = $config ?: JoomlaFactory::getConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get Gitea Username
|
||||||
|
*
|
||||||
|
* @return string the access token
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getGiteausername(): ?string
|
||||||
|
{
|
||||||
|
return $this->params->get('gitea_username');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get Gitea Access Token
|
||||||
|
*
|
||||||
|
* @return string the access token
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getGiteatoken(): ?string
|
||||||
|
{
|
||||||
|
return $this->params->get('gitea_token');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get fieldtype core organisation
|
||||||
|
*
|
||||||
|
* @return string The fieldtype core organisation
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getJoomlafieldtypecoreorganisation(): string
|
||||||
|
{
|
||||||
|
// the VDM default organisation is [joomla]
|
||||||
|
$organisation = 'joomla';
|
||||||
|
|
||||||
|
return $this->params->get('joomla_fieldtype_core_organisation', $organisation);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Joomla fieldtype init repos
|
||||||
|
*
|
||||||
|
* @return array The init repositories on Gitea
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getJoomlafieldtypeinitrepos(): array
|
||||||
|
{
|
||||||
|
// some defaults repos we need by JCB
|
||||||
|
$repos = [];
|
||||||
|
// get the users own power repo (can overwrite all)
|
||||||
|
if (!empty($this->gitea_username))
|
||||||
|
{
|
||||||
|
$repos[$this->gitea_username . '.joomla-fieldtypes'] = (object) ['organisation' => $this->gitea_username, 'repository' => 'joomla-fieldtypes', 'read_branch' => 'master'];
|
||||||
|
}
|
||||||
|
$repos[$this->joomla_fieldtype_core_organisation . '.joomla-fieldtypes'] = (object) ['organisation' => $this->joomla_fieldtype_core_organisation, 'repository' => 'joomla-fieldtypes', 'read_branch' => 'master'];
|
||||||
|
|
||||||
|
return $repos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get joomla fieldtype approved paths
|
||||||
|
*
|
||||||
|
* @return array The approved paths to the repositories on Gitea
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getApprovedjoomlapaths(): array
|
||||||
|
{
|
||||||
|
// some defaults repos we need by JCB
|
||||||
|
$approved = $this->joomla_fieldtype_init_repos;
|
||||||
|
|
||||||
|
$paths = RepoHelper::get(3); // Joomla Field Type = 3
|
||||||
|
|
||||||
|
if ($paths !== null)
|
||||||
|
{
|
||||||
|
foreach ($paths as $path)
|
||||||
|
{
|
||||||
|
$owner = $path->organisation ?? null;
|
||||||
|
$repo = $path->repository ?? null;
|
||||||
|
if ($owner !== null && $repo !== null)
|
||||||
|
{
|
||||||
|
// we make sure to get only the objects
|
||||||
|
$approved = ["{$owner}.{$repo}" => $path] + $approved;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_values($approved);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,52 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\DI\Container;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Service\Fieldtype as Power;
|
||||||
|
use VDM\Joomla\Service\Database;
|
||||||
|
use VDM\Joomla\Service\Model;
|
||||||
|
use VDM\Joomla\Service\Data;
|
||||||
|
use VDM\Joomla\Componentbuilder\Service\Gitea;
|
||||||
|
use VDM\Joomla\Componentbuilder\Power\Service\Gitea as GiteaPower;
|
||||||
|
use VDM\Joomla\Gitea\Service\Utilities as GiteaUtilities;
|
||||||
|
use VDM\Joomla\Interfaces\FactoryInterface;
|
||||||
|
use VDM\Joomla\Abstraction\Factory as ExtendingFactory;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field Type Power Factory
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
abstract class Factory extends ExtendingFactory implements FactoryInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a container object
|
||||||
|
*
|
||||||
|
* @return Container
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected static function createContainer(): Container
|
||||||
|
{
|
||||||
|
return (new Container())
|
||||||
|
->registerServiceProvider(new Power())
|
||||||
|
->registerServiceProvider(new Database())
|
||||||
|
->registerServiceProvider(new Model())
|
||||||
|
->registerServiceProvider(new Data())
|
||||||
|
->registerServiceProvider(new Gitea())
|
||||||
|
->registerServiceProvider(new GiteaPower())
|
||||||
|
->registerServiceProvider(new GiteaUtilities());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,151 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use VDM\Joomla\Interfaces\GrepInterface;
|
||||||
|
use VDM\Joomla\Abstraction\Grep as ExtendingGrep;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Global Resource Empowerment Platform
|
||||||
|
*
|
||||||
|
* The Grep feature will try to find your joomla power in the repositories listed in the global
|
||||||
|
* Options of JCB in the super powers tab, and if it can't be found there will try the global core
|
||||||
|
* Super powers of JCB. All searches are performed according the [algorithm:cascading]
|
||||||
|
* See documentation for more details: https://git.vdm.dev/joomla/super-powers/wiki
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
final class Grep extends ExtendingGrep implements GrepInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Order of global search
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.3
|
||||||
|
**/
|
||||||
|
protected array $order = ['remote'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search for a remote item
|
||||||
|
*
|
||||||
|
* @param string $guid The global unique id of the item
|
||||||
|
*
|
||||||
|
* @return object|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function searchRemote(string $guid): ?object
|
||||||
|
{
|
||||||
|
// check if it exists remotely
|
||||||
|
if (($path = $this->existsRemotely($guid)) !== null)
|
||||||
|
{
|
||||||
|
return $this->getRemote($path, $guid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a remote joomla power
|
||||||
|
*
|
||||||
|
* @param object $path The repository path details
|
||||||
|
* @param string $guid The global unique id of the power
|
||||||
|
*
|
||||||
|
* @return object|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getRemote(object $path, string $guid): ?object
|
||||||
|
{
|
||||||
|
$power = null;
|
||||||
|
if (empty($path->index->{$guid}->path))
|
||||||
|
{
|
||||||
|
return $power;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get the branch name
|
||||||
|
$branch = $this->getBranchName($path);
|
||||||
|
|
||||||
|
// load the base and token if set
|
||||||
|
$this->contents->load_($path->base ?? null, $path->token ?? null);
|
||||||
|
|
||||||
|
// get the settings
|
||||||
|
if (($power = $this->loadRemoteFile($path->organisation, $path->repository, $path->index->{$guid}->path . '/item.json', $branch)) !== null &&
|
||||||
|
isset($power->guid))
|
||||||
|
{
|
||||||
|
// set the git details in params
|
||||||
|
$path_guid = $path->guid ?? null;
|
||||||
|
if ($path_guid !== null)
|
||||||
|
{
|
||||||
|
// get the Settings meta
|
||||||
|
if (($meta = $this->contents->metadata($path->organisation, $path->repository, $path->index->{$guid}->path . '/item.json', $branch)) !== null &&
|
||||||
|
isset($meta->sha))
|
||||||
|
{
|
||||||
|
if (isset($power->params) && is_object($power->params) &&
|
||||||
|
isset($power->params->source) && is_array($power->params->source))
|
||||||
|
{
|
||||||
|
$power->params->source[$path_guid . '-settings'] = $meta->sha;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power->params = (object) [
|
||||||
|
'source' => [$path_guid . '-settings' => $meta->sha]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get the README meta
|
||||||
|
if (($meta = $this->contents->metadata($path->organisation, $path->repository, $path->index->{$guid}->path . '/README.md', $branch)) !== null &&
|
||||||
|
isset($meta->sha))
|
||||||
|
{
|
||||||
|
if (isset($power->params) && is_object($power->params) &&
|
||||||
|
isset($power->params->source) && is_array($power->params->source))
|
||||||
|
{
|
||||||
|
$power->params->source[$path_guid . '-readme'] = $meta->sha;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power->params = (object) [
|
||||||
|
'source' => [$path_guid . '-readme' => $meta->sha]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset back to the global base and token
|
||||||
|
$this->contents->reset_();
|
||||||
|
|
||||||
|
return $power;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set repository messages and errors based on given conditions.
|
||||||
|
*
|
||||||
|
* @param string $message The message to set (if error)
|
||||||
|
* @param string $path Path value
|
||||||
|
* @param string $repository Repository name
|
||||||
|
* @param string $organisation Organisation name
|
||||||
|
* @param string|null $base Base URL
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function setRemoteIndexMessage(string $message, string $path, string $repository, string $organisation, ?string $base): void
|
||||||
|
{
|
||||||
|
$this->app->enqueueMessage(
|
||||||
|
Text::sprintf('COM_COMPONENTBUILDER_PJOOMLA_FIELD_TYPEB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP', $this->contents->api(), $path, $message),
|
||||||
|
'Error'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype\Readme;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\Readme\ItemInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Field Type Item Readme
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
final class Item implements ItemInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get an item readme
|
||||||
|
*
|
||||||
|
* @param object $item An item details.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.2
|
||||||
|
*/
|
||||||
|
public function get(object $item): string
|
||||||
|
{
|
||||||
|
// build readme
|
||||||
|
$readme = ["```
|
||||||
|
██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗ ███████╗██╗███████╗██╗ ██████╗ ████████╗██╗ ██╗██████╗ ███████╗
|
||||||
|
██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗ ██╔════╝██║██╔════╝██║ ██╔══██╗ ╚══██╔══╝╚██╗ ██╔╝██╔══██╗██╔════╝
|
||||||
|
██║██║ ██║██║ ██║██╔████╔██║██║ ███████║ █████╗ ██║█████╗ ██║ ██║ ██║ ██║ ╚████╔╝ ██████╔╝█████╗
|
||||||
|
██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║ ██╔══╝ ██║██╔══╝ ██║ ██║ ██║ ██║ ╚██╔╝ ██╔═══╝ ██╔══╝
|
||||||
|
╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║ ██║ ██║███████╗███████╗██████╔╝ ██║ ██║ ██║ ███████╗
|
||||||
|
╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝
|
||||||
|
```"];
|
||||||
|
// system name
|
||||||
|
$readme[] = "# " . $item->name;
|
||||||
|
|
||||||
|
if (!empty($item->description))
|
||||||
|
{
|
||||||
|
$readme[] = "\n" . $item->description;
|
||||||
|
}
|
||||||
|
elseif (!empty($item->short_description))
|
||||||
|
{
|
||||||
|
$readme[] = "\n" . $item->short_description;
|
||||||
|
}
|
||||||
|
|
||||||
|
$readme[] = "\nThe Joomla! field types within this repository provide an essential mechanism for integrating Joomla-related field type into the Joomla Component Builder (JCB). Each field type is meticulously designed to ensure compatibility and ease of use within the JCB framework, allowing developers to effortlessly incorporate and manage custom fields in their components. By utilizing the reset functionality, users can seamlessly update individual field types to align with the latest versions maintained in our core repository, ensuring that their projects benefit from the most up-to-date features and fixes. Additionally, for those who prefer a more personalized approach, the repository can be forked, enabling developers to maintain and distribute their customized field types independently from the broader JCB community. This level of flexibility underscores the open-source nature of JCB, offering you the freedom to adapt and extend your components according to your specific needs, while still benefiting from a robust, community-driven ecosystem.";
|
||||||
|
|
||||||
|
// yes you can remove this, but why?
|
||||||
|
$readme[] = "\n---\n```
|
||||||
|
██╗ ██████╗██████╗
|
||||||
|
██║██╔════╝██╔══██╗
|
||||||
|
██║██║ ██████╔╝
|
||||||
|
██ ██║██║ ██╔══██╗
|
||||||
|
╚█████╔╝╚██████╗██████╔╝
|
||||||
|
╚════╝ ╚═════╝╚═════╝
|
||||||
|
```\n> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)\n\n";
|
||||||
|
|
||||||
|
return implode("\n", $readme);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,234 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype\Readme;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\Readme\MainInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field Type Main Readme
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
final class Main implements MainInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Get Main Readme
|
||||||
|
*
|
||||||
|
* @param array $items All items of this repository.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function get(array $items): string
|
||||||
|
{
|
||||||
|
// build readme
|
||||||
|
$readme = ["```
|
||||||
|
██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗
|
||||||
|
██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗
|
||||||
|
██║██║ ██║██║ ██║██╔████╔██║██║ ███████║
|
||||||
|
██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║
|
||||||
|
╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║
|
||||||
|
╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||||
|
|
||||||
|
███████╗██╗███████╗██╗ ██████╗ ████████╗██╗ ██╗██████╗ ███████╗███████╗
|
||||||
|
██╔════╝██║██╔════╝██║ ██╔══██╗ ╚══██╔══╝╚██╗ ██╔╝██╔══██╗██╔════╝██╔════╝
|
||||||
|
█████╗ ██║█████╗ ██║ ██║ ██║ ██║ ╚████╔╝ ██████╔╝█████╗ ███████╗
|
||||||
|
██╔══╝ ██║██╔══╝ ██║ ██║ ██║ ██║ ╚██╔╝ ██╔═══╝ ██╔══╝ ╚════██║
|
||||||
|
██║ ██║███████╗███████╗██████╔╝ ██║ ██║ ██║ ███████╗███████║
|
||||||
|
╚═╝ ╚═╝╚══════╝╚══════╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝
|
||||||
|
```"];
|
||||||
|
|
||||||
|
// default description of super powers
|
||||||
|
$readme[] = "\n### What is JCB Joomla Field Types?\nThe Joomla field types provide a powerful way to map Joomla-related field types, enabling seamless integration with Joomla Component Builder (JCB). This repository serves as a centralized system for maintaining, updating, and distributing these field types throughout the JCB ecosystem.\n
|
||||||
|
\n
|
||||||
|
When you need to update any field type in JCB, simply select the desired field type and click the \"reset\" button. This action will automatically sync the selected field type with its corresponding version hosted in our core repository, ensuring you always have the latest updates.\n
|
||||||
|
\n
|
||||||
|
Moreover, if you wish to tailor the field types to your specific needs, you can fork the repository and point your JCB instance to your fork. This allows you to maintain and update field types independently from the main JCB community, offering the flexibility that is at the heart of open-source philosophy.\n
|
||||||
|
\n
|
||||||
|
We believe this approach empowers you to extend and customize JCB to fit your unique requirements, exemplifying the true spirit of freedom in software development. We trust you will find this capability both useful and aligned with the expectations of how open-source software should function.\n";
|
||||||
|
|
||||||
|
// get the readme body
|
||||||
|
$readme[] = $this->readmeBuilder($items);
|
||||||
|
|
||||||
|
// yes you can remove this, but why?
|
||||||
|
$readme[] = "\n---\n```
|
||||||
|
██╗ ██████╗ ██████╗ ███╗ ███╗██╗ █████╗
|
||||||
|
██║██╔═══██╗██╔═══██╗████╗ ████║██║ ██╔══██╗
|
||||||
|
██║██║ ██║██║ ██║██╔████╔██║██║ ███████║
|
||||||
|
██ ██║██║ ██║██║ ██║██║╚██╔╝██║██║ ██╔══██║
|
||||||
|
╚█████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║███████╗██║ ██║
|
||||||
|
╚════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
|
||||||
|
██████╗ ██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗███████╗███╗ ██╗████████╗
|
||||||
|
██╔════╝██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║██╔════╝████╗ ██║╚══██╔══╝
|
||||||
|
██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║█████╗ ██╔██╗ ██║ ██║
|
||||||
|
██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║╚██╗██║██╔══╝ ██║╚██╗██║ ██║
|
||||||
|
╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚██████╔╝██║ ╚████║███████╗██║ ╚████║ ██║
|
||||||
|
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═══╝ ╚═╝
|
||||||
|
██████╗ ██╗ ██╗██╗██╗ ██████╗ ███████╗██████╗
|
||||||
|
██╔══██╗██║ ██║██║██║ ██╔══██╗██╔════╝██╔══██╗
|
||||||
|
██████╔╝██║ ██║██║██║ ██║ ██║█████╗ ██████╔╝
|
||||||
|
██╔══██╗██║ ██║██║██║ ██║ ██║██╔══╝ ██╔══██╗
|
||||||
|
██████╔╝╚██████╔╝██║███████╗██████╔╝███████╗██║ ██║
|
||||||
|
╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═╝
|
||||||
|
```\n> Build with [Joomla Component Builder](https://git.vdm.dev/joomla/Component-Builder)\n\n";
|
||||||
|
|
||||||
|
return implode("\n", $readme);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The readme builder
|
||||||
|
*
|
||||||
|
* @param array $classes The powers.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function readmeBuilder(array &$items): string
|
||||||
|
{
|
||||||
|
$classes = [];
|
||||||
|
foreach ($items as $guid => $power)
|
||||||
|
{
|
||||||
|
// add to the sort bucket
|
||||||
|
$classes[] = [
|
||||||
|
'name' => $power['name'],
|
||||||
|
'link' => $this->indexLinkPower($power)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->readmeModel($classes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort and model the readme classes
|
||||||
|
*
|
||||||
|
* @param array $classes The powers.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function readmeModel(array &$classes): string
|
||||||
|
{
|
||||||
|
$this->sortClasses($classes);
|
||||||
|
|
||||||
|
return $this->generateIndex($classes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate the index string for classes
|
||||||
|
*
|
||||||
|
* @param array $classes The sorted classes
|
||||||
|
*
|
||||||
|
* @return string The index string
|
||||||
|
*/
|
||||||
|
private function generateIndex(array &$classes): string
|
||||||
|
{
|
||||||
|
$result = "# Index of Joomla! Field Types\n";
|
||||||
|
|
||||||
|
foreach ($classes as $class)
|
||||||
|
{
|
||||||
|
// Add the class details
|
||||||
|
$result .= "\n - " . $class['link'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort the flattened array using a single sorting function
|
||||||
|
*
|
||||||
|
* @param array $classes The classes to sort
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function sortClasses(array &$classes): void
|
||||||
|
{
|
||||||
|
usort($classes, function ($a, $b) {
|
||||||
|
return $this->compareName($a, $b);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compare the name of two classes
|
||||||
|
*
|
||||||
|
* @param array $a First class
|
||||||
|
* @param array $b Second class
|
||||||
|
*
|
||||||
|
* @return int Comparison result
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function compareName(array $a, array $b): int
|
||||||
|
{
|
||||||
|
return strcmp($a['name'], $b['name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the Link to the power in this repository
|
||||||
|
*
|
||||||
|
* @param array $power The power details.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function indexLinkPower(array &$power): string
|
||||||
|
{
|
||||||
|
$name = $power['name'] ?? 'error';
|
||||||
|
return '**' . $name . "** | "
|
||||||
|
. $this->linkPowerRepo($power) . ' | '
|
||||||
|
. $this->linkPowerSettings($power) . ' | '
|
||||||
|
. $this->linkPowerDesc($power);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the Link to the power in this repository
|
||||||
|
*
|
||||||
|
* @param array $power The power details.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function linkPowerRepo(array &$power): string
|
||||||
|
{
|
||||||
|
$path = $power['path'] ?? 'error';
|
||||||
|
return '[Details](' . $path . ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the Link to the power settings in this repository
|
||||||
|
*
|
||||||
|
* @param array $power The power details.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function linkPowerSettings(array &$power): string
|
||||||
|
{
|
||||||
|
$settings = $power['settings'] ?? 'error';
|
||||||
|
return '[Settings](' . $settings . ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the short description
|
||||||
|
*
|
||||||
|
* @param array $power The power details.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function linkPowerDesc(array &$power): string
|
||||||
|
{
|
||||||
|
$jpk = $power['desc'] ?? '';
|
||||||
|
return $jpk;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype\Remote;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\Remote\GetInterface;
|
||||||
|
use VDM\Joomla\Abstraction\Remote\Get as ExtendingGet;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remote Get Field Type of JCB
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
final class Get extends ExtendingGet implements GetInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Table Name
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $table = 'fieldtype';
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1,218 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype\Remote;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\Remote\SetInterface;
|
||||||
|
use VDM\Joomla\Abstraction\Remote\Set as ExtendingSet;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Field Type based on global unique ids to remote repository
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
final class Set extends ExtendingSet implements SetInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Table Name
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $table = 'fieldtype';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Area Name
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $area = 'Joomla Field Type';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix Key
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $prefix_key = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The item map
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected array $map = [
|
||||||
|
'name' => 'name',
|
||||||
|
'short_description' => 'short_description',
|
||||||
|
'description' => 'description',
|
||||||
|
'properties' => 'properties',
|
||||||
|
'has_defaults' => 'has_defaults',
|
||||||
|
'datatype' => 'datatype',
|
||||||
|
'datalenght' => 'datalenght',
|
||||||
|
'datalenght_other' => 'datalenght_other',
|
||||||
|
'datadefault' => 'datadefault',
|
||||||
|
'datadefault_other' => 'datadefault_other',
|
||||||
|
'indexes' => 'indexes',
|
||||||
|
'null_switch' => 'null_switch',
|
||||||
|
'store' => 'store',
|
||||||
|
'guid' => 'guid'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The index map
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected array $index_map = [
|
||||||
|
'name' => 'index_map_IndexName',
|
||||||
|
'desc' => 'index_map_ShortDescription',
|
||||||
|
'settings' => 'index_map_IndexSettingsPath',
|
||||||
|
'path' => 'index_map_IndexPath',
|
||||||
|
'guid' => 'index_map_IndexGUID'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update an existing item (if changed)
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $existing
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function updateItem(object $item, object $existing, object $repo): bool
|
||||||
|
{
|
||||||
|
// make sure there was a change
|
||||||
|
$sha = $existing->params->source[$repo->guid . '-settings'] ?? null;
|
||||||
|
$existing = $this->mapItem($existing);
|
||||||
|
if ($sha === null || $this->areObjectsEqual($item, $existing))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->git->update(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/' . $this->getSettingsPath(), // The file path.
|
||||||
|
json_encode($item, JSON_PRETTY_PRINT), // The file content.
|
||||||
|
'Update ' . $item->name, // The commit message.
|
||||||
|
$sha, // The blob SHA of the old file.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new item
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function createItem(object $item, object $repo): void
|
||||||
|
{
|
||||||
|
$this->git->create(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/' . $this->getSettingsPath(), // The file path.
|
||||||
|
json_encode($item, JSON_PRETTY_PRINT), // The file content.
|
||||||
|
'Create ' . $item->name, // The commit message.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update an existing item readme
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $existing
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function updateItemReadme(object $item, object $existing, object $repo): void
|
||||||
|
{
|
||||||
|
// make sure there was a change
|
||||||
|
$sha = $existing->params->source[$repo->guid . '-readme'] ?? null;
|
||||||
|
if ($sha === null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->git->update(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/README.md', // The file path.
|
||||||
|
$this->itemReadme->get($item), // The file content.
|
||||||
|
'Update ' . $item->name . ' readme file', // The commit message.
|
||||||
|
$sha, // The blob SHA of the old file.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new item readme
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function createItemReadme(object $item, object $repo): void
|
||||||
|
{
|
||||||
|
$this->git->create(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/README.md', // The file path.
|
||||||
|
$this->itemReadme->get($item), // The file content.
|
||||||
|
'Create ' . $item->name . ' readme file', // The commit message.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the item name for the index values
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function index_map_IndexName(object $item): ?string
|
||||||
|
{
|
||||||
|
return $item->name ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the item Short Description for the index values
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function index_map_ShortDescription(object $item): ?string
|
||||||
|
{
|
||||||
|
return $item->short_description ?? null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1,169 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Fieldtype\Service;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\DI\Container;
|
||||||
|
use Joomla\DI\ServiceProviderInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Table;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Grep;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Remote\Get;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Remote\Set;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Readme\Item as ItemReadme;
|
||||||
|
use VDM\Joomla\Componentbuilder\Fieldtype\Readme\Main as MainReadme;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field Type Service Provider
|
||||||
|
*
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
class Fieldtype implements ServiceProviderInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Registers the service provider with a DI container.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.1
|
||||||
|
*/
|
||||||
|
public function register(Container $container)
|
||||||
|
{
|
||||||
|
$container->alias(Config::class, 'Config')
|
||||||
|
->share('Config', [$this, 'getConfig'], true);
|
||||||
|
|
||||||
|
$container->alias(Table::class, 'Table')
|
||||||
|
->share('Table', [$this, 'getTable'], true);
|
||||||
|
|
||||||
|
$container->alias(Grep::class, 'Joomla.Fieldtype.Grep')
|
||||||
|
->share('Joomla.Fieldtype.Grep', [$this, 'getGrep'], true);
|
||||||
|
|
||||||
|
$container->alias(Get::class, 'Joomla.Fieldtype.Remote.Get')
|
||||||
|
->share('Joomla.Fieldtype.Remote.Get', [$this, 'getRemoteGet'], true);
|
||||||
|
|
||||||
|
$container->alias(Set::class, 'Joomla.Fieldtype.Remote.Set')
|
||||||
|
->share('Joomla.Fieldtype.Remote.Set', [$this, 'getRemoteSet'], true);
|
||||||
|
|
||||||
|
$container->alias(ItemReadme::class, 'Joomla.Fieldtype.Readme.Item')
|
||||||
|
->share('Joomla.Fieldtype.Readme.Item', [$this, 'getItemReadme'], true);
|
||||||
|
|
||||||
|
$container->alias(MainReadme::class, 'Joomla.Fieldtype.Readme.Main')
|
||||||
|
->share('Joomla.Fieldtype.Readme.Main', [$this, 'getMainReadme'], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Config Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Config
|
||||||
|
* @since 3.2.1
|
||||||
|
*/
|
||||||
|
public function getConfig(Container $container): Config
|
||||||
|
{
|
||||||
|
return new Config();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Table Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Table
|
||||||
|
* @since 3.2.1
|
||||||
|
*/
|
||||||
|
public function getTable(Container $container): Table
|
||||||
|
{
|
||||||
|
return new Table();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Grep Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Grep
|
||||||
|
* @since 3.2.1
|
||||||
|
*/
|
||||||
|
public function getGrep(Container $container): Grep
|
||||||
|
{
|
||||||
|
return new Grep(
|
||||||
|
$container->get('Gitea.Repository.Contents'),
|
||||||
|
$container->get('Config')->approved_joomla_paths
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Remote Get Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Get
|
||||||
|
* @since 3.2.1
|
||||||
|
*/
|
||||||
|
public function getRemoteGet(Container $container): Get
|
||||||
|
{
|
||||||
|
return new Get(
|
||||||
|
$container->get('Joomla.Fieldtype.Grep'),
|
||||||
|
$container->get('Data.Item')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Remote Set Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Set
|
||||||
|
* @since 3.2.2
|
||||||
|
*/
|
||||||
|
public function getRemoteSet(Container $container): Set
|
||||||
|
{
|
||||||
|
return new Set(
|
||||||
|
$container->get('Config')->approved_joomla_paths,
|
||||||
|
$container->get('Joomla.Fieldtype.Grep'),
|
||||||
|
$container->get('Data.Items'),
|
||||||
|
$container->get('Joomla.Fieldtype.Readme.Item'),
|
||||||
|
$container->get('Joomla.Fieldtype.Readme.Main'),
|
||||||
|
$container->get('Gitea.Repository.Contents')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Item Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return ItemReadme
|
||||||
|
* @since 3.2.1
|
||||||
|
*/
|
||||||
|
public function getItemReadme(Container $container): ItemReadme
|
||||||
|
{
|
||||||
|
return new ItemReadme();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Main Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return MainReadme
|
||||||
|
* @since 3.2.1
|
||||||
|
*/
|
||||||
|
public function getMainReadme(Container $container): MainReadme
|
||||||
|
{
|
||||||
|
return new MainReadme();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@@ -143,6 +143,60 @@ final class Grep extends ExtendingGrep implements GrepInterface
|
|||||||
// set the git details in params
|
// set the git details in params
|
||||||
$power->main_class_code = $code;
|
$power->main_class_code = $code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set the git details in params
|
||||||
|
$path_guid = $path->guid ?? null;
|
||||||
|
if ($path_guid !== null)
|
||||||
|
{
|
||||||
|
// get the Settings meta
|
||||||
|
if (($meta = $this->contents->metadata($path->organisation, $path->repository, $path->index->{$guid}->settings, $branch)) !== null &&
|
||||||
|
isset($meta->sha))
|
||||||
|
{
|
||||||
|
if (isset($power->params) && is_object($power->params) &&
|
||||||
|
isset($power->params->source) && is_array($power->params->source))
|
||||||
|
{
|
||||||
|
$power->params->source[$path_guid . '-settings'] = $meta->sha;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power->params = (object) [
|
||||||
|
'source' => [$path_guid . '-settings' => $meta->sha]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get the power meta
|
||||||
|
if (($meta = $this->contents->metadata($path->organisation, $path->repository, $path->index->{$guid}->power, $branch)) !== null &&
|
||||||
|
isset($meta->sha))
|
||||||
|
{
|
||||||
|
if (isset($power->params) && is_object($power->params) &&
|
||||||
|
isset($power->params->source) && is_array($power->params->source))
|
||||||
|
{
|
||||||
|
$power->params->source[$path_guid . '-power'] = $meta->sha;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power->params = (object) [
|
||||||
|
'source' => [$path_guid . '-power' => $meta->sha]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get the README meta
|
||||||
|
if (($meta = $this->contents->metadata($path->organisation, $path->repository, $path->index->{$guid}->path . '/README.md', $branch)) !== null &&
|
||||||
|
isset($meta->sha))
|
||||||
|
{
|
||||||
|
if (isset($power->params) && is_object($power->params) &&
|
||||||
|
isset($power->params->source) && is_array($power->params->source))
|
||||||
|
{
|
||||||
|
$power->params->source[$path_guid . '-readme'] = $meta->sha;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power->params = (object) [
|
||||||
|
'source' => [$path_guid . '-readme' => $meta->sha]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset back to the global base and token
|
// reset back to the global base and token
|
||||||
|
@@ -0,0 +1,794 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 4th September, 2022
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace VDM\Joomla\Componentbuilder\Power\Remote;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Interfaces\GrepInterface as Grep;
|
||||||
|
use VDM\Joomla\Interfaces\Data\ItemsInterface as Items;
|
||||||
|
use VDM\Joomla\Interfaces\Readme\ItemInterface as ItemReadme;
|
||||||
|
use VDM\Joomla\Interfaces\Readme\MainInterface as MainReadme;
|
||||||
|
use VDM\Joomla\Interfaces\Git\Repository\ContentsInterface as Git;
|
||||||
|
use VDM\Joomla\Componentbuilder\Power\Parser;
|
||||||
|
use VDM\Joomla\Utilities\String\NamespaceHelper;
|
||||||
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Utilities\String\ClassfunctionHelper;
|
||||||
|
use VDM\Joomla\Utilities\GuidHelper;
|
||||||
|
use VDM\Joomla\Interfaces\Remote\SetInterface;
|
||||||
|
use VDM\Joomla\Abstraction\Remote\Set as ExtendingSet;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Power based on global unique ids to remote repository
|
||||||
|
*
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
final class Set extends ExtendingSet implements SetInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Table Name
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $table = 'power';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Area Name
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $area = 'Super Power';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix Key
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $prefix_key = 'Super---';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The item map
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected array $map = [
|
||||||
|
'add_head' => 'add_head',
|
||||||
|
'description' => 'description',
|
||||||
|
'extends' => 'extends',
|
||||||
|
'extendsinterfaces' => 'extendsinterfaces',
|
||||||
|
'guid' => 'guid',
|
||||||
|
'head' => 'head',
|
||||||
|
'use_selection' => 'use_selection',
|
||||||
|
'implements' => 'implements',
|
||||||
|
'load_selection' => 'load_selection',
|
||||||
|
'name' => 'name',
|
||||||
|
'power_version' => 'power_version',
|
||||||
|
'system_name' => 'system_name',
|
||||||
|
'type' => 'type',
|
||||||
|
'namespace' => 'namespace',
|
||||||
|
'composer' => 'composer',
|
||||||
|
'add_licensing_template' => 'add_licensing_template',
|
||||||
|
'licensing_template' => 'licensing_template',
|
||||||
|
'main_class_code' => 'main_class_code'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The index map
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected array $index_map = [
|
||||||
|
'name' => 'index_map_IndexName',
|
||||||
|
'type' => 'index_map_TypeName',
|
||||||
|
'namespace' => 'index_map_NameSpace',
|
||||||
|
'code' => 'index_map_CodePath',
|
||||||
|
'power' => 'index_map_PowerPath',
|
||||||
|
'settings' => 'index_map_IndexSettingsPath',
|
||||||
|
'path' => 'index_map_IndexPath',
|
||||||
|
'spk' => 'index_map_IndexKey',
|
||||||
|
'guid' => 'index_map_IndexGUID'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The item settings file path
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $settings_path = 'settings.json';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The index settings file path
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected string $index_settings_path = 'super-powers.json';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Parser Class.
|
||||||
|
*
|
||||||
|
* @var Parser|null
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected ?Parser $parser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param array $repos The active repos
|
||||||
|
* @param Grep $grep The Grep Class.
|
||||||
|
* @param Items $items The Items Class.
|
||||||
|
* @param ItemReadme $itemReadme The Item Readme Class.
|
||||||
|
* @param MainReadme $mainReadme The Main Readme Class.
|
||||||
|
* @param Git $git The Contents Class.
|
||||||
|
* @param string|null $table The table name.
|
||||||
|
* @param string|null $settingsPath The settings path.
|
||||||
|
* @param string|null $settingsIndexPath The index settings path.
|
||||||
|
* @param Parser|null $parser The Parser Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.2
|
||||||
|
*/
|
||||||
|
public function __construct(array $repos, Grep $grep, Items $items,
|
||||||
|
ItemReadme $itemReadme, MainReadme $mainReadme, Git $git,
|
||||||
|
?string $table = null, ?string $settingsPath = null,
|
||||||
|
?string $settingsIndexPath = null, ?Parser $parser = null)
|
||||||
|
{
|
||||||
|
parent::__construct($repos, $grep, $items, $itemReadme, $mainReadme,
|
||||||
|
$git, $table, $settingsPath, $settingsIndexPath);
|
||||||
|
|
||||||
|
$this->parser = $parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map a single item value (extends)
|
||||||
|
*
|
||||||
|
* @param object $item The item to be mapped
|
||||||
|
* @param array $item The bucket to to place new values
|
||||||
|
* @param string $map The item map to be mapped
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function mapItemValue_extends(object &$item, array &$power): void
|
||||||
|
{
|
||||||
|
if ($item->type !== 'interface')
|
||||||
|
{
|
||||||
|
$value = $item->extends ?? '';
|
||||||
|
$extends_custom = $item->extends_custom ?? null;
|
||||||
|
if ($value == -1 && $extends_custom !== null)
|
||||||
|
{
|
||||||
|
$power['extends_name'] = ClassfunctionHelper::safe(
|
||||||
|
$this->updatePlaceholders((string) $extends_custom)
|
||||||
|
);
|
||||||
|
$power['extends_custom'] = $extends_custom;
|
||||||
|
$power['extends'] = -1;
|
||||||
|
}
|
||||||
|
elseif (GuidHelper::valid($value))
|
||||||
|
{
|
||||||
|
$name = GuidHelper::item($value, 'power', 'a.name', 'componentbuilder');
|
||||||
|
if ($name !== null)
|
||||||
|
{
|
||||||
|
$power['extends_name'] = ClassfunctionHelper::safe(
|
||||||
|
$this->updatePlaceholders($name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power['extends'] = '';
|
||||||
|
}
|
||||||
|
// always rest these for normal classes
|
||||||
|
$power['extendsinterfaces'] = null;
|
||||||
|
$power['extendsinterfaces_custom'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map a single item value (extendsinterfaces)
|
||||||
|
*
|
||||||
|
* @param object $item The item to be mapped
|
||||||
|
* @param array $item The bucket to to place new values
|
||||||
|
* @param string $map The item map to be mapped
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function mapItemValue_extendsinterfaces(object &$item, array &$power): void
|
||||||
|
{
|
||||||
|
if ($item->type === 'interface')
|
||||||
|
{
|
||||||
|
$values = $item->extendsinterfaces ?? null;
|
||||||
|
if (!empty($values))
|
||||||
|
{
|
||||||
|
$values = (array) $values;
|
||||||
|
$extends_names = [];
|
||||||
|
$extendsinterfaces_custom = $item->extendsinterfaces_custom ?? null;
|
||||||
|
|
||||||
|
foreach ($values as $value)
|
||||||
|
{
|
||||||
|
if ($value == -1 && StringHelper::check($extendsinterfaces_custom))
|
||||||
|
{
|
||||||
|
$extends_names[] = ClassfunctionHelper::safe(
|
||||||
|
$this->updatePlaceholders($extendsinterfaces_custom)
|
||||||
|
);
|
||||||
|
|
||||||
|
$power['extendsinterfaces_custom'] = $extendsinterfaces_custom;
|
||||||
|
$extendsinterfaces_custom = null;
|
||||||
|
}
|
||||||
|
elseif (GuidHelper::valid($value))
|
||||||
|
{
|
||||||
|
$name = GuidHelper::item($value, 'power', 'a.name', 'componentbuilder');
|
||||||
|
if ($name !== null)
|
||||||
|
{
|
||||||
|
$extends_names[] = ClassfunctionHelper::safe(
|
||||||
|
$this->updatePlaceholders($name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($extends_names !== [])
|
||||||
|
{
|
||||||
|
$power['extendsinterfaces'] = array_values($values);
|
||||||
|
$power['extends_name'] = implode(', ', $extends_names);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power['extendsinterfaces'] = null;
|
||||||
|
$power['extendsinterfaces_custom'] = '';
|
||||||
|
}
|
||||||
|
// always rest these for interfaces
|
||||||
|
$power['extends'] = '';
|
||||||
|
$power['extends_custom'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map a single item value (use_selection)
|
||||||
|
*
|
||||||
|
* @param object $item The item to be mapped
|
||||||
|
* @param array $item The bucket to to place new values
|
||||||
|
* @param string $map The item map to be mapped
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function mapItemValue_use_selection(object &$item, array &$power): void
|
||||||
|
{
|
||||||
|
$value = $item->use_selection ?? null;
|
||||||
|
if (!empty($value))
|
||||||
|
{
|
||||||
|
$value = (array) $value;
|
||||||
|
$power['use_selection'] = $value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power['use_selection'] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map a single item value (load_selection)
|
||||||
|
*
|
||||||
|
* @param object $item The item to be mapped
|
||||||
|
* @param array $item The bucket to to place new values
|
||||||
|
* @param string $map The item map to be mapped
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function mapItemValue_load_selection(object &$item, array &$power): void
|
||||||
|
{
|
||||||
|
$value = $item->load_selection ?? null;
|
||||||
|
if (!empty($value))
|
||||||
|
{
|
||||||
|
$value = (array) $value;
|
||||||
|
$power['load_selection'] = $value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power['load_selection'] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map a single item value (composer)
|
||||||
|
*
|
||||||
|
* @param object $item The item to be mapped
|
||||||
|
* @param array $item The bucket to to place new values
|
||||||
|
* @param string $map The item map to be mapped
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function mapItemValue_composer(object &$item, array &$power): void
|
||||||
|
{
|
||||||
|
$value = $item->composer ?? null;
|
||||||
|
if (!empty($value))
|
||||||
|
{
|
||||||
|
$value = (array) $value;
|
||||||
|
$power['composer'] = array_values($value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power['composer'] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map a single item value (implements)
|
||||||
|
*
|
||||||
|
* @param object $item The item to be mapped
|
||||||
|
* @param array $item The bucket to to place new values
|
||||||
|
* @param string $map The item map to be mapped
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.2
|
||||||
|
*/
|
||||||
|
protected function mapItemValue_implements(object &$item, array &$power): void
|
||||||
|
{
|
||||||
|
$values = $item->implements ?? '';
|
||||||
|
if (!empty($values))
|
||||||
|
{
|
||||||
|
$values = (array) $values;
|
||||||
|
$implement_names = [];
|
||||||
|
$implements_custom = $item->implements_custom ?? null;
|
||||||
|
|
||||||
|
foreach ($values as $value)
|
||||||
|
{
|
||||||
|
if ($value == -1 && StringHelper::check($implements_custom))
|
||||||
|
{
|
||||||
|
$implement_names[] = ClassfunctionHelper::safe(
|
||||||
|
$this->updatePlaceholders($implements_custom)
|
||||||
|
);
|
||||||
|
$implements_custom = null;
|
||||||
|
}
|
||||||
|
elseif (GuidHelper::valid($value))
|
||||||
|
{
|
||||||
|
$name = GuidHelper::item($value, 'power', 'a.name', 'componentbuilder');
|
||||||
|
if ($name !== null)
|
||||||
|
{
|
||||||
|
$implement_names[] = ClassfunctionHelper::safe(
|
||||||
|
$this->updatePlaceholders($name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($implement_names !== [])
|
||||||
|
{
|
||||||
|
$power['implements'] = array_values($values);
|
||||||
|
$power['implement_names'] = $implement_names;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$power['implements'] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update an existing item (if changed)
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $existing
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function updateItem(object $item, object $existing, object $repo): bool
|
||||||
|
{
|
||||||
|
// make sure there was a change
|
||||||
|
$sha = $existing->params->source[$repo->guid . '-settings'] ?? null;
|
||||||
|
$_existing = $this->mapItem($existing);
|
||||||
|
|
||||||
|
if ($sha === null || $this->areObjectsEqual($item, $_existing))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// strip these values form the settings
|
||||||
|
$code = (string) $item->main_class_code ?? '';
|
||||||
|
$extends_name = (string) $item->extends_name ?? '';
|
||||||
|
$implement_names = (string) $item->implement_names ?? '';
|
||||||
|
unset($item->main_class_code);
|
||||||
|
unset($item->extends_name);
|
||||||
|
unset($item->implement_names);
|
||||||
|
|
||||||
|
$this->git->update(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/' . $this->getSettingsPath(), // The file path.
|
||||||
|
json_encode($item, JSON_PRETTY_PRINT), // The file content.
|
||||||
|
'Update ' . $item->system_name . ' settings', // The commit message.
|
||||||
|
$sha, // The blob SHA of the old file.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
|
||||||
|
$item->main_class_code = $code;
|
||||||
|
$item->extends_name = $extends_name;
|
||||||
|
$item->implement_names = $implement_names;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->updatePower($item, $existing, $repo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update an existing power code (if changed)
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $existing
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function updatePower(object $item, object $existing, object $repo): bool
|
||||||
|
{
|
||||||
|
// make sure there was a change
|
||||||
|
$sha = $existing->params->source[$repo->guid . '-power'] ?? null;
|
||||||
|
|
||||||
|
if ($sha === null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate the new SHA from the current content
|
||||||
|
$power = $item->main_class_code ?? '';
|
||||||
|
$newSha = sha1("blob " . strlen($power) . "\0" . $power);
|
||||||
|
|
||||||
|
// Check if the new SHA matches the existing SHA
|
||||||
|
if ($sha === $newSha)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->git->update(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/code.power', // The file path.
|
||||||
|
$power, // The file content.
|
||||||
|
'Update ' . $item->system_name . ' code', // The commit message.
|
||||||
|
$sha, // The blob SHA of the old file.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new item
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function createItem(object $item, object $repo): void
|
||||||
|
{
|
||||||
|
// strip these values form the settings
|
||||||
|
$code = (string) $item->main_class_code ?? '';
|
||||||
|
$extends_name = (string) $item->extends_name ?? '';
|
||||||
|
$implement_names = (string) $item->implement_names ?? '';
|
||||||
|
unset($item->main_class_code);
|
||||||
|
unset($item->extends_name);
|
||||||
|
unset($item->implement_names);
|
||||||
|
|
||||||
|
$this->git->create(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/' . $this->getSettingsPath(), // The file path.
|
||||||
|
json_encode($item, JSON_PRETTY_PRINT), // The file content.
|
||||||
|
'Create ' . $item->system_name . ' settings', // The commit message.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
|
||||||
|
$item->main_class_code = $code;
|
||||||
|
$item->extends_name = $extends_name;
|
||||||
|
$item->implement_names = $implement_names;
|
||||||
|
|
||||||
|
$this->createPower($item, $repo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new power
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function createPower(object $item, object $repo): void
|
||||||
|
{
|
||||||
|
$this->git->create(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/code.power', // The file path.
|
||||||
|
$item->main_class_code, // The file content.
|
||||||
|
'Create ' . $item->system_name . ' code', // The commit message.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* update an existing item readme
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $existing
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function updateItemReadme(object $item, object $existing, object $repo): void
|
||||||
|
{
|
||||||
|
// make sure there was a change
|
||||||
|
$sha = $existing->params->source[$repo->guid . '-readme'] ?? null;
|
||||||
|
if ($sha === null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->parser !== null)
|
||||||
|
{
|
||||||
|
$item->parsed_class_code = $this->parser->code($item->main_class_code);
|
||||||
|
}
|
||||||
|
$item->code_name = $this->index_map_IndexName($item);
|
||||||
|
$item->_namespace = $this->index_map_NameSpace($item);
|
||||||
|
|
||||||
|
$readme = $this->itemReadme->get($item);
|
||||||
|
$newSha = sha1("blob " . strlen($readme) . "\0" . $readme);
|
||||||
|
|
||||||
|
// Check if the new SHA matches the existing SHA
|
||||||
|
if ($sha === $newSha)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->git->update(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/README.md', // The file path.
|
||||||
|
$readme, // The file content.
|
||||||
|
'Update ' . $item->system_name . ' readme file', // The commit message.
|
||||||
|
$sha, // The blob SHA of the old file.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* create a new item readme
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
* @param object $repo
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function createItemReadme(object $item, object $repo): void
|
||||||
|
{
|
||||||
|
if ($this->parser !== null)
|
||||||
|
{
|
||||||
|
$item->parsed_class_code = $this->parser->code($item->main_class_code);
|
||||||
|
}
|
||||||
|
$item->code_name = $this->index_map_IndexName($item);
|
||||||
|
$item->_namespace = $this->index_map_NameSpace($item);
|
||||||
|
|
||||||
|
$this->git->create(
|
||||||
|
$repo->organisation, // The owner name.
|
||||||
|
$repo->repository, // The repository name.
|
||||||
|
'src/' . $item->guid . '/README.md', // The file path.
|
||||||
|
$this->itemReadme->get($item), // The file content.
|
||||||
|
'Create ' . $item->system_name . ' readme file', // The commit message.
|
||||||
|
$repo->write_branch // The branch name.
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check that we have a target repo of this item
|
||||||
|
*
|
||||||
|
* @param object $item The item
|
||||||
|
* @param object $repo The current repo
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function targetRepo(object $item, object $repo): bool
|
||||||
|
{
|
||||||
|
if (!isset($item->approved) || $item->approved != 1 ||
|
||||||
|
!isset($item->approved_paths) || !is_array($item->approved_paths))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$repo_path = "{$repo->organisation}/{$repo->repository}";
|
||||||
|
|
||||||
|
foreach ($item->approved_paths as $approved_path)
|
||||||
|
{
|
||||||
|
if ($repo_path === $approved_path)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the item name for the index values
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function index_map_IndexName(object $item): ?string
|
||||||
|
{
|
||||||
|
$name = $item->name ?? null;
|
||||||
|
if ($name !== null)
|
||||||
|
{
|
||||||
|
return ClassfunctionHelper::safe(
|
||||||
|
$this->updatePlaceholders($name)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the item type for the index values
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function index_map_TypeName(object $item): ?string
|
||||||
|
{
|
||||||
|
return $item->type ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the item code path for the index values
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function index_map_CodePath(object $item): ?string
|
||||||
|
{
|
||||||
|
return $this->index_map_IndexPath($item) . '/code.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the item power path for the index values
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function index_map_PowerPath(object $item): ?string
|
||||||
|
{
|
||||||
|
return $this->index_map_IndexPath($item) . '/code.power';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the item namespace for the index values
|
||||||
|
*
|
||||||
|
* @param object $item
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function index_map_NameSpace(object $item): ?string
|
||||||
|
{
|
||||||
|
return $this->getNamespace($item->namespace ?? '', $item->name ?? '');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the namespace for this power
|
||||||
|
*
|
||||||
|
* @param string $namespace The raw namespace
|
||||||
|
* @param string $className The class name
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getNamespace(string $namespace, string $className): ?string
|
||||||
|
{
|
||||||
|
// set namespace
|
||||||
|
$namespace = $this->updatePlaceholders($namespace);
|
||||||
|
|
||||||
|
// validate namespace
|
||||||
|
if (strpos($namespace, '\\') === false)
|
||||||
|
{
|
||||||
|
// we break out here
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup the path array
|
||||||
|
$path_array = (array) explode('\\', $namespace);
|
||||||
|
|
||||||
|
// make sure it has two or more
|
||||||
|
if (ArrayHelper::check($path_array) <= 1)
|
||||||
|
{
|
||||||
|
// we break out here
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get the file and class name (the last value in array)
|
||||||
|
$file_name = array_pop($path_array);
|
||||||
|
|
||||||
|
// do we have src folders
|
||||||
|
if (strpos($file_name, '.') !== false)
|
||||||
|
{
|
||||||
|
// we have src folders in the namespace
|
||||||
|
$src_array = (array) explode('.', $file_name);
|
||||||
|
|
||||||
|
// get the file and class name (the last value in array)
|
||||||
|
$file_name = array_pop($src_array);
|
||||||
|
|
||||||
|
// namespace array
|
||||||
|
$namespace_array = [...$path_array, ...$src_array];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// namespace array
|
||||||
|
$namespace_array = $path_array;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the last value is the same as the class name
|
||||||
|
if ($file_name !== $className)
|
||||||
|
{
|
||||||
|
// we break out here
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure the arrays are namespace safe
|
||||||
|
$namespace_array =
|
||||||
|
array_map(
|
||||||
|
fn($val) => $this->getCleanNamespace($val),
|
||||||
|
$namespace_array
|
||||||
|
);
|
||||||
|
|
||||||
|
// set the actual class namespace
|
||||||
|
return implode('\\', $namespace_array);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Clean Namespace without use or ; as part of the name space
|
||||||
|
*
|
||||||
|
* @param string $namespace The actual name space
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
protected function getCleanNamespace(string $namespace): string
|
||||||
|
{
|
||||||
|
// trim possible (use) or (;) or (starting or ending \) added to the namespace
|
||||||
|
return NamespaceHelper::safe(str_replace(['use ', ';'], '', $namespace));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@@ -18,7 +18,11 @@ use VDM\Joomla\Componentbuilder\Power\Config;
|
|||||||
use VDM\Joomla\Componentbuilder\Table;
|
use VDM\Joomla\Componentbuilder\Table;
|
||||||
use VDM\Joomla\Componentbuilder\Power\Grep;
|
use VDM\Joomla\Componentbuilder\Power\Grep;
|
||||||
use VDM\Joomla\Componentbuilder\Power\Remote\Get;
|
use VDM\Joomla\Componentbuilder\Power\Remote\Get;
|
||||||
|
use VDM\Joomla\Componentbuilder\Power\Remote\Set;
|
||||||
use VDM\Joomla\Componentbuilder\Power\Parser;
|
use VDM\Joomla\Componentbuilder\Power\Parser;
|
||||||
|
use VDM\Joomla\Componentbuilder\Power\Plantuml;
|
||||||
|
use VDM\Joomla\Componentbuilder\Power\Readme\Item as ItemReadme;
|
||||||
|
use VDM\Joomla\Componentbuilder\Power\Readme\Main as MainReadme;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,8 +54,20 @@ class Power implements ServiceProviderInterface
|
|||||||
$container->alias(Get::class, 'Power.Remote.Get')
|
$container->alias(Get::class, 'Power.Remote.Get')
|
||||||
->share('Power.Remote.Get', [$this, 'getRemoteGet'], true);
|
->share('Power.Remote.Get', [$this, 'getRemoteGet'], true);
|
||||||
|
|
||||||
|
$container->alias(Set::class, 'Power.Remote.Set')
|
||||||
|
->share('Power.Remote.Set', [$this, 'getRemoteSet'], true);
|
||||||
|
|
||||||
$container->alias(Parser::class, 'Power.Parser')
|
$container->alias(Parser::class, 'Power.Parser')
|
||||||
->share('Power.Parser', [$this, 'getParser'], true);
|
->share('Power.Parser', [$this, 'getParser'], true);
|
||||||
|
|
||||||
|
$container->alias(Plantuml::class, 'Power.Plantuml')
|
||||||
|
->share('Power.Plantuml', [$this, 'getPlantuml'], true);
|
||||||
|
|
||||||
|
$container->alias(ItemReadme::class, 'Power.Readme.Item')
|
||||||
|
->share('Power.Readme.Item', [$this, 'getItemReadme'], true);
|
||||||
|
|
||||||
|
$container->alias(MainReadme::class, 'Power.Readme.Main')
|
||||||
|
->share('Power.Readme.Main', [$this, 'getMainReadme'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,6 +129,55 @@ class Power implements ServiceProviderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Remote Set Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Set
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getRemoteSet(Container $container): Set
|
||||||
|
{
|
||||||
|
return new Set(
|
||||||
|
$container->get('Config')->approved_paths,
|
||||||
|
$container->get('Power.Grep'),
|
||||||
|
$container->get('Data.Items'),
|
||||||
|
$container->get('Power.Readme.Item'),
|
||||||
|
$container->get('Power.Readme.Main'),
|
||||||
|
$container->get('Gitea.Repository.Contents'), null, null, null,
|
||||||
|
$container->get('Power.Parser')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Readme Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return ItemReadme
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getItemReadme(Container $container): ItemReadme
|
||||||
|
{
|
||||||
|
return new ItemReadme(
|
||||||
|
$container->get('Power.Plantuml')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Readme Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return MainReadme
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getMainReadme(Container $container): MainReadme
|
||||||
|
{
|
||||||
|
return new MainReadme();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The Parser Class.
|
* Get The Parser Class.
|
||||||
*
|
*
|
||||||
@@ -125,5 +190,18 @@ class Power implements ServiceProviderInterface
|
|||||||
{
|
{
|
||||||
return new Parser();
|
return new Parser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Plantuml Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return Plantuml
|
||||||
|
* @since 5.0.3
|
||||||
|
*/
|
||||||
|
public function getPlantuml(Container $container): Plantuml
|
||||||
|
{
|
||||||
|
return new Plantuml();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user