forked from joomla/Component-Builder
Stable release of v3.2.0-beta4
Add Preferred Joomla Version to Components.
This commit is contained in:
parent
0b0568299c
commit
5675f186cd
@ -1,3 +1,7 @@
|
|||||||
|
# v3.2.0-beta4
|
||||||
|
|
||||||
|
- Add Preferred Joomla Version to Components
|
||||||
|
|
||||||
# v3.2.0-beta3
|
# v3.2.0-beta3
|
||||||
|
|
||||||
- Move the old helper compiler files to powers
|
- Move the old helper compiler files to powers
|
||||||
@ -8,11 +12,11 @@
|
|||||||
- Move beta to main repo
|
- Move beta to main repo
|
||||||
- Fix #1053 so that the right and left tabs display correctly in Joomla 4&5
|
- Fix #1053 so that the right and left tabs display correctly in Joomla 4&5
|
||||||
|
|
||||||
# v3.1.42-beta
|
# v3.1.42
|
||||||
|
|
||||||
- Fix #1055 to add the style and scripts to all views.
|
- Fix #1055 to add the style and scripts to all views.
|
||||||
|
|
||||||
# v3.1.40-beta
|
# v3.1.40
|
||||||
|
|
||||||
- Fix #1052 so that tabs last opened is remembered and opened again on save, refresh or reopening of an item.
|
- Fix #1052 so that tabs last opened is remembered and opened again on save, refresh or reopening of an item.
|
||||||
- Fix #1057 so that the datetime fields will be set correctly in mysql.
|
- Fix #1057 so that the datetime fields will be set correctly in mysql.
|
||||||
|
14
README.md
14
README.md
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
|||||||
|
|
||||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
|
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.0-beta3) 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.0-beta4) 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*: 6th March, 2024
|
+ *Last Build*: 7th March, 2024
|
||||||
+ *Version*: 3.2.0-beta3
|
+ *Version*: 3.2.0-beta4
|
||||||
+ *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*: **729192**
|
+ *Line count*: **741812**
|
||||||
+ *Field count*: **2077**
|
+ *Field count*: **2078**
|
||||||
+ *File count*: **5132**
|
+ *File count*: **5204**
|
||||||
+ *Folder count*: **455**
|
+ *Folder count*: **462**
|
||||||
|
|
||||||
> 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)
|
||||||
|
@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
|||||||
|
|
||||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
|
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.0-beta3) 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.0-beta4) 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*: 6th March, 2024
|
+ *Last Build*: 7th March, 2024
|
||||||
+ *Version*: 3.2.0-beta3
|
+ *Version*: 3.2.0-beta4
|
||||||
+ *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*: **729192**
|
+ *Line count*: **741812**
|
||||||
+ *Field count*: **2077**
|
+ *Field count*: **2078**
|
||||||
+ *File count*: **5132**
|
+ *File count*: **5204**
|
||||||
+ *Folder count*: **455**
|
+ *Folder count*: **462**
|
||||||
|
|
||||||
> 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)
|
||||||
|
@ -371,7 +371,8 @@ class ComponentbuilderControllerJoomla_component extends FormController
|
|||||||
'component_dashboard' => 'joomla_component',
|
'component_dashboard' => 'joomla_component',
|
||||||
'component_files_folders' => 'joomla_component',
|
'component_files_folders' => 'joomla_component',
|
||||||
'component_placeholders' => 'joomla_component',
|
'component_placeholders' => 'joomla_component',
|
||||||
'custom_code' => 'component'
|
'custom_code' => 'component',
|
||||||
|
'component_router' => 'joomla_component'
|
||||||
);
|
);
|
||||||
foreach($_tablesArray as $_updateTable => $_key)
|
foreach($_tablesArray as $_updateTable => $_key)
|
||||||
{
|
{
|
||||||
|
@ -5899,6 +5899,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP scri
|
|||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL="PHP Preflight (update)"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL="PHP Preflight (update)"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_DESCRIPTION="PHP script for the global helper site event method."
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_DESCRIPTION="PHP script for the global helper site event method."
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL="Global Helper Site Event (method)"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL="Global Helper Site Event (method)"
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREFERRED_JOOMLA_VERSION_LABEL="Preferred Joomla Version"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUBLISHING="Publishing"
|
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"
|
||||||
@ -5979,7 +5980,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE="Error! Please add websi
|
|||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP"
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_FIELDS="Joomla fields"
|
COM_COMPONENTBUILDER_JOOMLA_FIELDS="Joomla fields"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_FOUR_AND_FIVE="Joomla 4 and 5"
|
COM_COMPONENTBUILDER_JOOMLA_FIVE="Joomla 5"
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_FOUR="Joomla 4"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_MODULE="Joomla Module"
|
COM_COMPONENTBUILDER_JOOMLA_MODULE="Joomla Module"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_MODULES="Joomla Modules"
|
COM_COMPONENTBUILDER_JOOMLA_MODULES="Joomla Modules"
|
||||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS="Joomla Modules Access"
|
COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS="Joomla Modules Access"
|
||||||
@ -9184,7 +9186,8 @@ COM_COMPONENTBUILDER_YES="Yes"
|
|||||||
COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL"
|
COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL"
|
||||||
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE="Your are about to update <b>ALL</b> values that can be found in the database."
|
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE="Your are about to update <b>ALL</b> values that can be found in the database."
|
||||||
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row"
|
COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row"
|
||||||
COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR_AND_JOOMLA_FIVE="Your component will be compiled to work in Joomla 4 and Joomla 5"
|
COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FIVE="Your component will be compiled to work in Joomla 5"
|
||||||
|
COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR="Your component will be compiled to work in Joomla 4"
|
||||||
COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE="Your component will be compiled to work in Joomla 3"
|
COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE="Your component will be compiled to work in Joomla 3"
|
||||||
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 256 bit encryption using the above 32 character key."
|
COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 256 bit encryption using the above 32 character key."
|
||||||
COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items."
|
COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items."
|
||||||
|
@ -27,6 +27,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
|
|||||||
// get the fields
|
// get the fields
|
||||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||||
'system_name',
|
'system_name',
|
||||||
|
'preferred_joomla_version',
|
||||||
'add_powers'
|
'add_powers'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ class ComponentbuilderModelAjax extends ListModel
|
|||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select($db->quoteName(array(
|
->select($db->quoteName(array(
|
||||||
'id','companyname','component_version','copyright','debug_linenr',
|
'id','companyname','component_version','copyright','debug_linenr',
|
||||||
'description','email','image','license','name',
|
'description','email','image','license','name','preferred_joomla_version',
|
||||||
'short_description','website','author','add_placeholders',
|
'short_description','website','author','add_placeholders',
|
||||||
'system_name','mvc_versiondate')))
|
'system_name','mvc_versiondate')))
|
||||||
->from($db->quoteName('#__componentbuilder_joomla_component'))
|
->from($db->quoteName('#__componentbuilder_joomla_component'))
|
||||||
@ -117,7 +117,9 @@ class ComponentbuilderModelAjax extends ListModel
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
if ($db->loadRowList())
|
if ($db->loadRowList())
|
||||||
{
|
{
|
||||||
return ['html' => $this->componentDetailsDisplay($db->loadObject())];
|
$object = $db->loadObject();
|
||||||
|
|
||||||
|
return ['html' => $this->componentDetailsDisplay($object), 'preferred_joomla_version' => $object->preferred_joomla_version ?? 0];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -157,36 +157,18 @@
|
|||||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_MESSAGE"
|
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_MESSAGE"
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_HINT"
|
||||||
/>
|
/>
|
||||||
<!-- Debug_linenr Field. Type: Radio. (joomla) -->
|
<!-- Buildcompsql Field. Type: Textarea. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="radio"
|
type="textarea"
|
||||||
name="debug_linenr"
|
name="buildcompsql"
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL"
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_DESCRIPTION"
|
|
||||||
class="btn-group btn-group-yesno"
|
|
||||||
default="0"
|
|
||||||
required="true">
|
|
||||||
<!-- Option Set. -->
|
|
||||||
<option value="1">
|
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
|
|
||||||
<option value="0">
|
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
|
||||||
</field>
|
|
||||||
<!-- Php_site_event Field. Type: Editor. (joomla) -->
|
|
||||||
<field
|
|
||||||
type="editor"
|
|
||||||
name="php_site_event"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_DESCRIPTION"
|
|
||||||
width="100%"
|
|
||||||
height="450px"
|
|
||||||
cols="15"
|
|
||||||
rows="30"
|
rows="30"
|
||||||
buttons="no"
|
cols="15"
|
||||||
syntax="php"
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_DESCRIPTION"
|
||||||
editor="codemirror|none"
|
class="text_area span12"
|
||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_HINT"
|
||||||
|
required="true"
|
||||||
/>
|
/>
|
||||||
<!-- Translation_tool Field. Type: List. (joomla) -->
|
<!-- Translation_tool Field. Type: List. (joomla) -->
|
||||||
<field
|
<field
|
||||||
@ -202,21 +184,6 @@
|
|||||||
<option value="1">
|
<option value="1">
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN</option>
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Buildcompsql Field. Type: Textarea. (joomla) -->
|
|
||||||
<field
|
|
||||||
type="textarea"
|
|
||||||
name="buildcompsql"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL"
|
|
||||||
rows="30"
|
|
||||||
cols="15"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_HINT"
|
|
||||||
required="true"
|
|
||||||
/>
|
|
||||||
<!-- Note_readme Field. Type: Note. A None Database Field. (joomla) -->
|
|
||||||
<field type="note" name="note_readme" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_DESCRIPTION" heading="h4" class="note_readme" />
|
|
||||||
<!-- Add_sales_server Field. Type: Radio. (joomla) -->
|
<!-- Add_sales_server Field. Type: Radio. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="radio"
|
type="radio"
|
||||||
@ -231,22 +198,8 @@
|
|||||||
<option value="0">
|
<option value="0">
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Php_preflight_install Field. Type: Editor. (joomla) -->
|
<!-- Note_readme Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
<field
|
<field type="note" name="note_readme" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_DESCRIPTION" heading="h4" class="note_readme" />
|
||||||
type="editor"
|
|
||||||
name="php_preflight_install"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_DESCRIPTION"
|
|
||||||
width="100%"
|
|
||||||
height="450px"
|
|
||||||
cols="15"
|
|
||||||
rows="30"
|
|
||||||
buttons="no"
|
|
||||||
syntax="php"
|
|
||||||
editor="codemirror|none"
|
|
||||||
filter="raw"
|
|
||||||
validate="code"
|
|
||||||
/>
|
|
||||||
<!-- Php_method_uninstall Field. Type: Editor. (joomla) -->
|
<!-- Php_method_uninstall Field. Type: Editor. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="editor"
|
type="editor"
|
||||||
@ -263,8 +216,22 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
validate="code"
|
||||||
/>
|
/>
|
||||||
<!-- Note_version_options_3 Field. Type: Note. A None Database Field. (joomla) -->
|
<!-- Php_preflight_install Field. Type: Editor. (joomla) -->
|
||||||
<field type="note" name="note_version_options_3" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_VERSION_OPTIONS_3_DESCRIPTION" class="alert alert-info note_version_options_3" showon="mvc_versiondate:3" />
|
<field
|
||||||
|
type="editor"
|
||||||
|
name="php_preflight_install"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_DESCRIPTION"
|
||||||
|
width="100%"
|
||||||
|
height="450px"
|
||||||
|
cols="15"
|
||||||
|
rows="30"
|
||||||
|
buttons="no"
|
||||||
|
syntax="php"
|
||||||
|
editor="codemirror|none"
|
||||||
|
filter="raw"
|
||||||
|
validate="code"
|
||||||
|
/>
|
||||||
<!-- Css_admin Field. Type: Editor. (joomla) -->
|
<!-- Css_admin Field. Type: Editor. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="editor"
|
type="editor"
|
||||||
@ -281,6 +248,8 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
validate="code"
|
||||||
/>
|
/>
|
||||||
|
<!-- Note_version_options_3 Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
|
<field type="note" name="note_version_options_3" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_VERSION_OPTIONS_3_DESCRIPTION" class="alert alert-info note_version_options_3" showon="mvc_versiondate:3" />
|
||||||
<!-- Note_version_options_2 Field. Type: Note. A None Database Field. (joomla) -->
|
<!-- Note_version_options_2 Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
<field type="note" name="note_version_options_2" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_VERSION_OPTIONS_2_DESCRIPTION" class="alert alert-info note_version_options_2" showon="mvc_versiondate:2" />
|
<field type="note" name="note_version_options_2" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_VERSION_OPTIONS_2_DESCRIPTION" class="alert alert-info note_version_options_2" showon="mvc_versiondate:2" />
|
||||||
<!-- Note_version_options_1 Field. Type: Note. A None Database Field. (joomla) -->
|
<!-- Note_version_options_1 Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
@ -336,8 +305,37 @@
|
|||||||
<option value="0">
|
<option value="0">
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Note_dynamic_dashboard Field. Type: Note. A None Database Field. (joomla) -->
|
<!-- Debug_linenr Field. Type: Radio. (joomla) -->
|
||||||
<field type="note" name="note_dynamic_dashboard" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DYNAMIC_DASHBOARD_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DYNAMIC_DASHBOARD_DESCRIPTION" heading="h4" class="alert alert-info note_dynamic_dashboard" />
|
<field
|
||||||
|
type="radio"
|
||||||
|
name="debug_linenr"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_DESCRIPTION"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
required="true">
|
||||||
|
<!-- Option Set. -->
|
||||||
|
<option value="1">
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
|
||||||
|
<option value="0">
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
||||||
|
</field>
|
||||||
|
<!-- Php_site_event Field. Type: Editor. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="editor"
|
||||||
|
name="php_site_event"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_DESCRIPTION"
|
||||||
|
width="100%"
|
||||||
|
height="450px"
|
||||||
|
cols="15"
|
||||||
|
rows="30"
|
||||||
|
buttons="no"
|
||||||
|
syntax="php"
|
||||||
|
editor="codemirror|none"
|
||||||
|
filter="raw"
|
||||||
|
validate="code"
|
||||||
|
/>
|
||||||
<!-- Description Field. Type: Textarea. (joomla) -->
|
<!-- Description Field. Type: Textarea. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@ -350,6 +348,24 @@
|
|||||||
filter="HTML"
|
filter="HTML"
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_HINT"
|
||||||
/>
|
/>
|
||||||
|
<!-- Note_dynamic_dashboard Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
|
<field type="note" name="note_dynamic_dashboard" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DYNAMIC_DASHBOARD_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DYNAMIC_DASHBOARD_DESCRIPTION" heading="h4" class="alert alert-info note_dynamic_dashboard" />
|
||||||
|
<!-- Author Field. Type: Text. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="text"
|
||||||
|
name="author"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL"
|
||||||
|
size="10"
|
||||||
|
maxlength="120"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_DESCRIPTION"
|
||||||
|
class="text_area"
|
||||||
|
readonly="false"
|
||||||
|
disabled="false"
|
||||||
|
required="true"
|
||||||
|
filter="HTML"
|
||||||
|
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_MESSAGE"
|
||||||
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_HINT"
|
||||||
|
/>
|
||||||
<!-- Php_postflight_install Field. Type: Editor. (joomla) -->
|
<!-- Php_postflight_install Field. Type: Editor. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="editor"
|
type="editor"
|
||||||
@ -366,35 +382,6 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
validate="code"
|
||||||
/>
|
/>
|
||||||
<!-- Author Field. Type: Text. (joomla) -->
|
|
||||||
<field
|
|
||||||
type="text"
|
|
||||||
name="author"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL"
|
|
||||||
size="10"
|
|
||||||
maxlength="120"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_DESCRIPTION"
|
|
||||||
class="text_area"
|
|
||||||
readonly="false"
|
|
||||||
disabled="false"
|
|
||||||
required="true"
|
|
||||||
filter="HTML"
|
|
||||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_MESSAGE"
|
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_HINT"
|
|
||||||
/>
|
|
||||||
<!-- Sql_uninstall Field. Type: Textarea. (joomla) -->
|
|
||||||
<field
|
|
||||||
type="textarea"
|
|
||||||
name="sql_uninstall"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_LABEL"
|
|
||||||
rows="30"
|
|
||||||
cols="15"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_DESCRIPTION"
|
|
||||||
class="text_area span12"
|
|
||||||
filter="raw"
|
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_HINT"
|
|
||||||
required="true"
|
|
||||||
/>
|
|
||||||
<!-- Email Field. Type: Text. (joomla) -->
|
<!-- Email Field. Type: Text. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="text"
|
type="text"
|
||||||
@ -410,8 +397,19 @@
|
|||||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_MESSAGE"
|
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_MESSAGE"
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_HINT"
|
||||||
/>
|
/>
|
||||||
<!-- Note_update_server_note_ftp Field. Type: Note. A None Database Field. (joomla) -->
|
<!-- Sql_uninstall Field. Type: Textarea. (joomla) -->
|
||||||
<field type="note" name="note_update_server_note_ftp" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_DESCRIPTION" heading="h4" class="alert alert-success note_update_server_note_ftp" />
|
<field
|
||||||
|
type="textarea"
|
||||||
|
name="sql_uninstall"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_LABEL"
|
||||||
|
rows="30"
|
||||||
|
cols="15"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="raw"
|
||||||
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_UNINSTALL_HINT"
|
||||||
|
required="true"
|
||||||
|
/>
|
||||||
<!-- Website Field. Type: Url. (joomla) -->
|
<!-- Website Field. Type: Url. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="url"
|
type="url"
|
||||||
@ -428,6 +426,23 @@
|
|||||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_MESSAGE"
|
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_MESSAGE"
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_HINT"
|
||||||
/>
|
/>
|
||||||
|
<!-- Note_update_server_note_ftp Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
|
<field type="note" name="note_update_server_note_ftp" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_DESCRIPTION" heading="h4" class="alert alert-success note_update_server_note_ftp" />
|
||||||
|
<!-- Add_license Field. Type: Radio. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="radio"
|
||||||
|
name="add_license"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_DESCRIPTION"
|
||||||
|
class="btn-group btn-group-yesno"
|
||||||
|
default="0"
|
||||||
|
required="true">
|
||||||
|
<!-- Option Set. -->
|
||||||
|
<option value="1">
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
|
||||||
|
<option value="0">
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
||||||
|
</field>
|
||||||
<!-- Backup_folder_path Field. Type: Text. (joomla) -->
|
<!-- Backup_folder_path Field. Type: Text. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="text"
|
type="text"
|
||||||
@ -492,20 +507,26 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
validate="code"
|
||||||
/>
|
/>
|
||||||
<!-- Add_license Field. Type: Radio. (joomla) -->
|
<!-- License_type Field. Type: List. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="radio"
|
type="list"
|
||||||
name="add_license"
|
name="license_type"
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL"
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_DESCRIPTION"
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_DESCRIPTION"
|
||||||
class="btn-group btn-group-yesno"
|
class="list_class"
|
||||||
default="0"
|
multiple="false"
|
||||||
required="true">
|
filter="int"
|
||||||
|
required="true"
|
||||||
|
default="1">
|
||||||
<!-- Option Set. -->
|
<!-- Option Set. -->
|
||||||
<option value="1">
|
<option value="1">
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES</option>
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_ENCRYPTION_ONLY_TO_LOCK_DATAFIELDS</option>
|
||||||
<option value="0">
|
<option value="2">
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATES_NOT_READY</option>
|
||||||
|
<option value="3">
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LOCK_DOWN_USE_USED_TO_VERIFY_OWNERSHIP</option>
|
||||||
|
<option value="4">
|
||||||
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CUSTOM_USED_IN_CUSTOM_CODE</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Component_version Field. Type: Text. (joomla) -->
|
<!-- Component_version Field. Type: Text. (joomla) -->
|
||||||
<field
|
<field
|
||||||
@ -538,27 +559,8 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
validate="code"
|
||||||
/>
|
/>
|
||||||
<!-- License_type Field. Type: List. (joomla) -->
|
<!-- Note_whmcs_lisencing_note Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
<field
|
<field type="note" name="note_whmcs_lisencing_note" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_WHMCS_LISENCING_NOTE_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_WHMCS_LISENCING_NOTE_DESCRIPTION" heading="h4" class="alert alert-success note_whmcs_lisencing_note" />
|
||||||
type="list"
|
|
||||||
name="license_type"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_DESCRIPTION"
|
|
||||||
class="list_class"
|
|
||||||
multiple="false"
|
|
||||||
filter="int"
|
|
||||||
required="true"
|
|
||||||
default="1">
|
|
||||||
<!-- Option Set. -->
|
|
||||||
<option value="1">
|
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_ENCRYPTION_ONLY_TO_LOCK_DATAFIELDS</option>
|
|
||||||
<option value="2">
|
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATES_NOT_READY</option>
|
|
||||||
<option value="3">
|
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LOCK_DOWN_USE_USED_TO_VERIFY_OWNERSHIP</option>
|
|
||||||
<option value="4">
|
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CUSTOM_USED_IN_CUSTOM_CODE</option>
|
|
||||||
</field>
|
|
||||||
<!-- Php_helper_site Field. Type: Editor. (joomla) -->
|
<!-- Php_helper_site Field. Type: Editor. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="editor"
|
type="editor"
|
||||||
@ -575,24 +577,6 @@
|
|||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
validate="code"
|
||||||
/>
|
/>
|
||||||
<!-- Note_whmcs_lisencing_note Field. Type: Note. A None Database Field. (joomla) -->
|
|
||||||
<field type="note" name="note_whmcs_lisencing_note" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_WHMCS_LISENCING_NOTE_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_WHMCS_LISENCING_NOTE_DESCRIPTION" heading="h4" class="alert alert-success note_whmcs_lisencing_note" />
|
|
||||||
<!-- Javascript Field. Type: Editor. (joomla) -->
|
|
||||||
<field
|
|
||||||
type="editor"
|
|
||||||
name="javascript"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_DESCRIPTION"
|
|
||||||
width="100%"
|
|
||||||
height="450px"
|
|
||||||
cols="15"
|
|
||||||
rows="30"
|
|
||||||
buttons="no"
|
|
||||||
syntax="javascript"
|
|
||||||
editor="codemirror|none"
|
|
||||||
filter="raw"
|
|
||||||
validate="code"
|
|
||||||
/>
|
|
||||||
<!-- Whmcs_key Field. Type: Text. (joomla) -->
|
<!-- Whmcs_key Field. Type: Text. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="text"
|
type="text"
|
||||||
@ -606,18 +590,18 @@
|
|||||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_MESSAGE"
|
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_MESSAGE"
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_HINT"
|
||||||
/>
|
/>
|
||||||
<!-- Css_site Field. Type: Editor. (joomla) -->
|
<!-- Javascript Field. Type: Editor. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="editor"
|
type="editor"
|
||||||
name="css_site"
|
name="javascript"
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL"
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_DESCRIPTION"
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_DESCRIPTION"
|
||||||
width="100%"
|
width="100%"
|
||||||
height="450px"
|
height="450px"
|
||||||
cols="15"
|
cols="15"
|
||||||
rows="30"
|
rows="30"
|
||||||
buttons="no"
|
buttons="no"
|
||||||
syntax="css"
|
syntax="javascript"
|
||||||
editor="codemirror|none"
|
editor="codemirror|none"
|
||||||
filter="raw"
|
filter="raw"
|
||||||
validate="code"
|
validate="code"
|
||||||
@ -637,8 +621,22 @@
|
|||||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE"
|
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE"
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_HINT"
|
||||||
/>
|
/>
|
||||||
<!-- Note_botton_component_dashboard Field. Type: Note. A None Database Field. (joomla) -->
|
<!-- Css_site Field. Type: Editor. (joomla) -->
|
||||||
<field type="note" name="note_botton_component_dashboard" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BOTTON_COMPONENT_DASHBOARD_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BOTTON_COMPONENT_DASHBOARD_DESCRIPTION" heading="h4" class="alert alert-info note_botton_component_dashboard" />
|
<field
|
||||||
|
type="editor"
|
||||||
|
name="css_site"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_DESCRIPTION"
|
||||||
|
width="100%"
|
||||||
|
height="450px"
|
||||||
|
cols="15"
|
||||||
|
rows="30"
|
||||||
|
buttons="no"
|
||||||
|
syntax="css"
|
||||||
|
editor="codemirror|none"
|
||||||
|
filter="raw"
|
||||||
|
validate="code"
|
||||||
|
/>
|
||||||
<!-- Whmcs_buy_link Field. Type: Url. (joomla) -->
|
<!-- Whmcs_buy_link Field. Type: Url. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="url"
|
type="url"
|
||||||
@ -654,22 +652,8 @@
|
|||||||
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_MESSAGE"
|
message="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_MESSAGE"
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_HINT"
|
||||||
/>
|
/>
|
||||||
<!-- Php_preflight_update Field. Type: Editor. (joomla) -->
|
<!-- Note_botton_component_dashboard Field. Type: Note. A None Database Field. (joomla) -->
|
||||||
<field
|
<field type="note" name="note_botton_component_dashboard" label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BOTTON_COMPONENT_DASHBOARD_LABEL" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BOTTON_COMPONENT_DASHBOARD_DESCRIPTION" heading="h4" class="alert alert-info note_botton_component_dashboard" />
|
||||||
type="editor"
|
|
||||||
name="php_preflight_update"
|
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL"
|
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_DESCRIPTION"
|
|
||||||
width="100%"
|
|
||||||
height="450px"
|
|
||||||
cols="15"
|
|
||||||
rows="30"
|
|
||||||
buttons="no"
|
|
||||||
syntax="php"
|
|
||||||
editor="codemirror|none"
|
|
||||||
filter="raw"
|
|
||||||
validate="code"
|
|
||||||
/>
|
|
||||||
<!-- License Field. Type: Textarea. (joomla) -->
|
<!-- License Field. Type: Textarea. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@ -684,12 +668,12 @@
|
|||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_HINT"
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
<!-- Php_postflight_update Field. Type: Editor. (joomla) -->
|
<!-- Php_preflight_update Field. Type: Editor. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="editor"
|
type="editor"
|
||||||
name="php_postflight_update"
|
name="php_preflight_update"
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL"
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_DESCRIPTION"
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_DESCRIPTION"
|
||||||
width="100%"
|
width="100%"
|
||||||
height="450px"
|
height="450px"
|
||||||
cols="15"
|
cols="15"
|
||||||
@ -712,6 +696,30 @@
|
|||||||
hide_none="true"
|
hide_none="true"
|
||||||
hide_default="true"
|
hide_default="true"
|
||||||
/>
|
/>
|
||||||
|
<!-- Php_postflight_update Field. Type: Editor. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="editor"
|
||||||
|
name="php_postflight_update"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_DESCRIPTION"
|
||||||
|
width="100%"
|
||||||
|
height="450px"
|
||||||
|
cols="15"
|
||||||
|
rows="30"
|
||||||
|
buttons="no"
|
||||||
|
syntax="php"
|
||||||
|
editor="codemirror|none"
|
||||||
|
filter="raw"
|
||||||
|
validate="code"
|
||||||
|
/>
|
||||||
|
<!-- Image Field. Type: Media. (joomla) -->
|
||||||
|
<field
|
||||||
|
type="media"
|
||||||
|
name="image"
|
||||||
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_DESCRIPTION"
|
||||||
|
directory=""
|
||||||
|
/>
|
||||||
<!-- Sql Field. Type: Textarea. (joomla) -->
|
<!-- Sql Field. Type: Textarea. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@ -725,13 +733,19 @@
|
|||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_HINT"
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_HINT"
|
||||||
required="true"
|
required="true"
|
||||||
/>
|
/>
|
||||||
<!-- Image Field. Type: Media. (joomla) -->
|
<!-- Copyright Field. Type: Textarea. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="media"
|
type="textarea"
|
||||||
name="image"
|
name="copyright"
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL"
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL"
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_DESCRIPTION"
|
rows="7"
|
||||||
directory=""
|
cols="10"
|
||||||
|
default="Copyright (C) 2015. All Rights Reserved"
|
||||||
|
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_DESCRIPTION"
|
||||||
|
class="text_area span12"
|
||||||
|
filter="SAFEHTML"
|
||||||
|
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_HINT"
|
||||||
|
required="true"
|
||||||
/>
|
/>
|
||||||
<!-- Addreadme Field. Type: Radio. (joomla) -->
|
<!-- Addreadme Field. Type: Radio. (joomla) -->
|
||||||
<field
|
<field
|
||||||
@ -746,19 +760,16 @@
|
|||||||
<option value="0">
|
<option value="0">
|
||||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NO</option>
|
||||||
</field>
|
</field>
|
||||||
<!-- Copyright Field. Type: Textarea. (joomla) -->
|
<!-- Preferred_joomla_version Field. Type: Number. (joomla) -->
|
||||||
<field
|
<field
|
||||||
type="textarea"
|
type="number"
|
||||||
name="copyright"
|
name="preferred_joomla_version"
|
||||||
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL"
|
label="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREFERRED_JOOMLA_VERSION_LABEL"
|
||||||
rows="7"
|
default="3"
|
||||||
cols="10"
|
class="text_area"
|
||||||
default="Copyright (C) 2015. All Rights Reserved"
|
min="3"
|
||||||
description="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_DESCRIPTION"
|
max="5"
|
||||||
class="text_area span12"
|
step="1"
|
||||||
filter="SAFEHTML"
|
|
||||||
hint="COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_HINT"
|
|
||||||
required="true"
|
|
||||||
/>
|
/>
|
||||||
<!-- Update_server_url Field. Type: Url. (joomla) -->
|
<!-- Update_server_url Field. Type: Url. (joomla) -->
|
||||||
<field
|
<field
|
||||||
|
@ -76,34 +76,18 @@ class ComponentbuilderModelJoomla_component extends AdminModel
|
|||||||
),
|
),
|
||||||
'above' => array(
|
'above' => array(
|
||||||
'system_name',
|
'system_name',
|
||||||
|
'preferred_joomla_version',
|
||||||
'add_powers'
|
'add_powers'
|
||||||
),
|
),
|
||||||
'under' => array(
|
'under' => array(
|
||||||
'not_required'
|
'not_required'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'libs_helpers' => array(
|
'dynamic_build_beta' => array(
|
||||||
'fullwidth' => array(
|
'fullwidth' => array(
|
||||||
'creatuserhelper',
|
'note_buildcomp_dynamic_mysql',
|
||||||
'adduikit',
|
'buildcomp',
|
||||||
'addfootable',
|
'buildcompsql'
|
||||||
'add_email_helper',
|
|
||||||
'add_php_helper_both',
|
|
||||||
'php_helper_both',
|
|
||||||
'add_php_helper_admin',
|
|
||||||
'php_helper_admin',
|
|
||||||
'add_admin_event',
|
|
||||||
'php_admin_event',
|
|
||||||
'add_php_helper_site',
|
|
||||||
'php_helper_site',
|
|
||||||
'add_site_event',
|
|
||||||
'php_site_event',
|
|
||||||
'add_javascript',
|
|
||||||
'javascript',
|
|
||||||
'add_css_admin',
|
|
||||||
'css_admin',
|
|
||||||
'add_css_site',
|
|
||||||
'css_site'
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dynamic_integration' => array(
|
'dynamic_integration' => array(
|
||||||
@ -133,13 +117,6 @@ class ComponentbuilderModelJoomla_component extends AdminModel
|
|||||||
'crowdin_account_api_key'
|
'crowdin_account_api_key'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'dynamic_build_beta' => array(
|
|
||||||
'fullwidth' => array(
|
|
||||||
'note_buildcomp_dynamic_mysql',
|
|
||||||
'buildcomp',
|
|
||||||
'buildcompsql'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'readme' => array(
|
'readme' => array(
|
||||||
'left' => array(
|
'left' => array(
|
||||||
'addreadme',
|
'addreadme',
|
||||||
@ -171,6 +148,30 @@ class ComponentbuilderModelJoomla_component extends AdminModel
|
|||||||
'php_method_uninstall'
|
'php_method_uninstall'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
'libs_helpers' => array(
|
||||||
|
'fullwidth' => array(
|
||||||
|
'creatuserhelper',
|
||||||
|
'adduikit',
|
||||||
|
'addfootable',
|
||||||
|
'add_email_helper',
|
||||||
|
'add_php_helper_both',
|
||||||
|
'php_helper_both',
|
||||||
|
'add_php_helper_admin',
|
||||||
|
'php_helper_admin',
|
||||||
|
'add_admin_event',
|
||||||
|
'php_admin_event',
|
||||||
|
'add_php_helper_site',
|
||||||
|
'php_helper_site',
|
||||||
|
'add_site_event',
|
||||||
|
'php_site_event',
|
||||||
|
'add_javascript',
|
||||||
|
'javascript',
|
||||||
|
'add_css_admin',
|
||||||
|
'css_admin',
|
||||||
|
'add_css_site',
|
||||||
|
'css_site'
|
||||||
|
)
|
||||||
|
),
|
||||||
'mysql' => array(
|
'mysql' => array(
|
||||||
'fullwidth' => array(
|
'fullwidth' => array(
|
||||||
'add_sql',
|
'add_sql',
|
||||||
@ -365,36 +366,36 @@ class ComponentbuilderModelJoomla_component extends AdminModel
|
|||||||
$item->metadata = $registry->toArray();
|
$item->metadata = $registry->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($item->php_site_event))
|
|
||||||
{
|
|
||||||
// base64 Decode php_site_event.
|
|
||||||
$item->php_site_event = base64_decode($item->php_site_event);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($item->buildcompsql))
|
if (!empty($item->buildcompsql))
|
||||||
{
|
{
|
||||||
// base64 Decode buildcompsql.
|
// base64 Decode buildcompsql.
|
||||||
$item->buildcompsql = base64_decode($item->buildcompsql);
|
$item->buildcompsql = base64_decode($item->buildcompsql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($item->php_preflight_install))
|
|
||||||
{
|
|
||||||
// base64 Decode php_preflight_install.
|
|
||||||
$item->php_preflight_install = base64_decode($item->php_preflight_install);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($item->php_method_uninstall))
|
if (!empty($item->php_method_uninstall))
|
||||||
{
|
{
|
||||||
// base64 Decode php_method_uninstall.
|
// base64 Decode php_method_uninstall.
|
||||||
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
|
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($item->php_preflight_install))
|
||||||
|
{
|
||||||
|
// base64 Decode php_preflight_install.
|
||||||
|
$item->php_preflight_install = base64_decode($item->php_preflight_install);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($item->css_admin))
|
if (!empty($item->css_admin))
|
||||||
{
|
{
|
||||||
// base64 Decode css_admin.
|
// base64 Decode css_admin.
|
||||||
$item->css_admin = base64_decode($item->css_admin);
|
$item->css_admin = base64_decode($item->css_admin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($item->php_site_event))
|
||||||
|
{
|
||||||
|
// base64 Decode php_site_event.
|
||||||
|
$item->php_site_event = base64_decode($item->php_site_event);
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($item->php_postflight_install))
|
if (!empty($item->php_postflight_install))
|
||||||
{
|
{
|
||||||
// base64 Decode php_postflight_install.
|
// base64 Decode php_postflight_install.
|
||||||
@ -1430,36 +1431,36 @@ class ComponentbuilderModelJoomla_component extends AdminModel
|
|||||||
$data['addcontributors'] = '';
|
$data['addcontributors'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the php_site_event string to base64 string.
|
|
||||||
if (isset($data['php_site_event']))
|
|
||||||
{
|
|
||||||
$data['php_site_event'] = base64_encode($data['php_site_event']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the buildcompsql string to base64 string.
|
// Set the buildcompsql string to base64 string.
|
||||||
if (isset($data['buildcompsql']))
|
if (isset($data['buildcompsql']))
|
||||||
{
|
{
|
||||||
$data['buildcompsql'] = base64_encode($data['buildcompsql']);
|
$data['buildcompsql'] = base64_encode($data['buildcompsql']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the php_preflight_install string to base64 string.
|
|
||||||
if (isset($data['php_preflight_install']))
|
|
||||||
{
|
|
||||||
$data['php_preflight_install'] = base64_encode($data['php_preflight_install']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the php_method_uninstall string to base64 string.
|
// Set the php_method_uninstall string to base64 string.
|
||||||
if (isset($data['php_method_uninstall']))
|
if (isset($data['php_method_uninstall']))
|
||||||
{
|
{
|
||||||
$data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']);
|
$data['php_method_uninstall'] = base64_encode($data['php_method_uninstall']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the php_preflight_install string to base64 string.
|
||||||
|
if (isset($data['php_preflight_install']))
|
||||||
|
{
|
||||||
|
$data['php_preflight_install'] = base64_encode($data['php_preflight_install']);
|
||||||
|
}
|
||||||
|
|
||||||
// Set the css_admin string to base64 string.
|
// Set the css_admin string to base64 string.
|
||||||
if (isset($data['css_admin']))
|
if (isset($data['css_admin']))
|
||||||
{
|
{
|
||||||
$data['css_admin'] = base64_encode($data['css_admin']);
|
$data['css_admin'] = base64_encode($data['css_admin']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the php_site_event string to base64 string.
|
||||||
|
if (isset($data['php_site_event']))
|
||||||
|
{
|
||||||
|
$data['php_site_event'] = base64_encode($data['php_site_event']);
|
||||||
|
}
|
||||||
|
|
||||||
// Set the php_postflight_install string to base64 string.
|
// Set the php_postflight_install string to base64 string.
|
||||||
if (isset($data['php_postflight_install']))
|
if (isset($data['php_postflight_install']))
|
||||||
{
|
{
|
||||||
|
@ -2694,16 +2694,16 @@ class ComponentbuilderModelJoomla_components extends ListModel
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// decode php_site_event
|
|
||||||
$item->php_site_event = base64_decode($item->php_site_event);
|
|
||||||
// decode buildcompsql
|
// decode buildcompsql
|
||||||
$item->buildcompsql = base64_decode($item->buildcompsql);
|
$item->buildcompsql = base64_decode($item->buildcompsql);
|
||||||
// decode php_preflight_install
|
|
||||||
$item->php_preflight_install = base64_decode($item->php_preflight_install);
|
|
||||||
// decode php_method_uninstall
|
// decode php_method_uninstall
|
||||||
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
|
$item->php_method_uninstall = base64_decode($item->php_method_uninstall);
|
||||||
|
// decode php_preflight_install
|
||||||
|
$item->php_preflight_install = base64_decode($item->php_preflight_install);
|
||||||
// decode css_admin
|
// decode css_admin
|
||||||
$item->css_admin = base64_decode($item->css_admin);
|
$item->css_admin = base64_decode($item->css_admin);
|
||||||
|
// decode php_site_event
|
||||||
|
$item->php_site_event = base64_decode($item->php_site_event);
|
||||||
// decode php_postflight_install
|
// decode php_postflight_install
|
||||||
$item->php_postflight_install = base64_decode($item->php_postflight_install);
|
$item->php_postflight_install = base64_decode($item->php_postflight_install);
|
||||||
// decode sql_uninstall
|
// decode sql_uninstall
|
||||||
@ -2721,13 +2721,13 @@ class ComponentbuilderModelJoomla_components extends ListModel
|
|||||||
$item->php_helper_admin = base64_decode($item->php_helper_admin);
|
$item->php_helper_admin = base64_decode($item->php_helper_admin);
|
||||||
// decode php_helper_site
|
// decode php_helper_site
|
||||||
$item->php_helper_site = base64_decode($item->php_helper_site);
|
$item->php_helper_site = base64_decode($item->php_helper_site);
|
||||||
// decode javascript
|
|
||||||
$item->javascript = base64_decode($item->javascript);
|
|
||||||
if ($basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
|
if ($basickey && !is_numeric($item->whmcs_key) && $item->whmcs_key === base64_encode(base64_decode($item->whmcs_key, true)))
|
||||||
{
|
{
|
||||||
// decrypt whmcs_key
|
// decrypt whmcs_key
|
||||||
$item->whmcs_key = $basic->decryptString($item->whmcs_key);
|
$item->whmcs_key = $basic->decryptString($item->whmcs_key);
|
||||||
}
|
}
|
||||||
|
// decode javascript
|
||||||
|
$item->javascript = base64_decode($item->javascript);
|
||||||
// decode css_site
|
// decode css_site
|
||||||
$item->css_site = base64_decode($item->css_site);
|
$item->css_site = base64_decode($item->css_site);
|
||||||
// decode php_preflight_update
|
// decode php_preflight_update
|
||||||
|
@ -50,7 +50,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
|
|||||||
`dashboard` VARCHAR(64) NOT NULL DEFAULT '',
|
`dashboard` VARCHAR(64) NOT NULL DEFAULT '',
|
||||||
`dashboard_type` TINYINT(1) NOT NULL DEFAULT 1,
|
`dashboard_type` TINYINT(1) NOT NULL DEFAULT 1,
|
||||||
`debug_linenr` TINYINT(1) NOT NULL DEFAULT 0,
|
`debug_linenr` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`description` TEXT NOT NULL,
|
`description` TEXT NULL,
|
||||||
`email` VARCHAR(255) NOT NULL DEFAULT '',
|
`email` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`emptycontributors` TINYINT(1) NOT NULL DEFAULT 0,
|
`emptycontributors` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`export_buy_link` VARCHAR(255) NOT NULL DEFAULT '',
|
`export_buy_link` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
@ -79,6 +79,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
|
|||||||
`php_preflight_install` MEDIUMTEXT NOT NULL,
|
`php_preflight_install` MEDIUMTEXT NOT NULL,
|
||||||
`php_preflight_update` MEDIUMTEXT NOT NULL,
|
`php_preflight_update` MEDIUMTEXT NOT NULL,
|
||||||
`php_site_event` MEDIUMTEXT NOT NULL,
|
`php_site_event` MEDIUMTEXT NOT NULL,
|
||||||
|
`preferred_joomla_version` INT(11) NOT NULL DEFAULT 3,
|
||||||
`readme` TEXT NOT NULL,
|
`readme` TEXT NOT NULL,
|
||||||
`remove_line_breaks` TINYINT(1) NOT NULL DEFAULT 0,
|
`remove_line_breaks` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`sales_server` INT(11) NOT NULL DEFAULT 0,
|
`sales_server` INT(11) NOT NULL DEFAULT 0,
|
||||||
@ -111,12 +112,12 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_component` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `idx_system_name` (`system_name`),
|
KEY `idx_system_name` (`system_name`),
|
||||||
KEY `idx_name_code` (`name_code`),
|
KEY `idx_name_code` (`name_code`),
|
||||||
KEY `idx_debug_linenr` (`debug_linenr`),
|
|
||||||
KEY `idx_translation_tool` (`translation_tool`),
|
KEY `idx_translation_tool` (`translation_tool`),
|
||||||
KEY `idx_add_sales_server` (`add_sales_server`),
|
KEY `idx_add_sales_server` (`add_sales_server`),
|
||||||
KEY `idx_mvc_versiondate` (`mvc_versiondate`),
|
KEY `idx_mvc_versiondate` (`mvc_versiondate`),
|
||||||
KEY `idx_remove_line_breaks` (`remove_line_breaks`),
|
KEY `idx_remove_line_breaks` (`remove_line_breaks`),
|
||||||
KEY `idx_add_placeholders` (`add_placeholders`),
|
KEY `idx_add_placeholders` (`add_placeholders`),
|
||||||
|
KEY `idx_debug_linenr` (`debug_linenr`),
|
||||||
KEY `idx_add_license` (`add_license`),
|
KEY `idx_add_license` (`add_license`),
|
||||||
KEY `idx_license_type` (`license_type`),
|
KEY `idx_license_type` (`license_type`),
|
||||||
KEY `idx_addreadme` (`addreadme`),
|
KEY `idx_addreadme` (`addreadme`),
|
||||||
@ -179,7 +180,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_module` (
|
|||||||
`class_helper_header` TEXT NOT NULL,
|
`class_helper_header` TEXT NOT NULL,
|
||||||
`custom_get` TEXT NOT NULL,
|
`custom_get` TEXT NOT NULL,
|
||||||
`default` MEDIUMTEXT NOT NULL,
|
`default` MEDIUMTEXT NOT NULL,
|
||||||
`description` TEXT NOT NULL,
|
`description` TEXT NULL,
|
||||||
`fields` TEXT NOT NULL,
|
`fields` TEXT NOT NULL,
|
||||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||||
`libraries` TEXT NOT NULL,
|
`libraries` TEXT NOT NULL,
|
||||||
@ -256,10 +257,10 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_joomla_plugin` (
|
|||||||
`add_update_server` TINYINT(1) NOT NULL DEFAULT 0,
|
`add_update_server` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`addreadme` TINYINT(1) NOT NULL DEFAULT 0,
|
`addreadme` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`class_extends` INT(11) NOT NULL DEFAULT 0,
|
`class_extends` INT(11) NOT NULL DEFAULT 0,
|
||||||
`description` TEXT NOT NULL,
|
`description` TEXT NULL,
|
||||||
`fields` TEXT NOT NULL,
|
`fields` TEXT NOT NULL,
|
||||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||||
`head` TEXT NOT NULL,
|
`head` TEXT NULL,
|
||||||
`joomla_plugin_group` INT(11) NOT NULL DEFAULT 0,
|
`joomla_plugin_group` INT(11) NOT NULL DEFAULT 0,
|
||||||
`main_class_code` MEDIUMTEXT NOT NULL,
|
`main_class_code` MEDIUMTEXT NOT NULL,
|
||||||
`method_selection` TEXT NOT NULL,
|
`method_selection` TEXT NOT NULL,
|
||||||
@ -326,25 +327,25 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_power` (
|
|||||||
`add_licensing_template` TINYINT(1) NOT NULL DEFAULT 1,
|
`add_licensing_template` TINYINT(1) NOT NULL DEFAULT 1,
|
||||||
`approved` TINYINT(1) NOT NULL DEFAULT 0,
|
`approved` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`approved_paths` TEXT NOT NULL,
|
`approved_paths` TEXT NOT NULL,
|
||||||
`composer` TEXT NOT NULL,
|
`composer` TEXT NULL,
|
||||||
`description` TEXT NOT NULL,
|
`description` TEXT NULL,
|
||||||
`extends` VARCHAR(36) NOT NULL DEFAULT '',
|
`extends` VARCHAR(36) NOT NULL DEFAULT '',
|
||||||
`extends_custom` VARCHAR(64) NOT NULL DEFAULT '',
|
`extends_custom` VARCHAR(64) NULL DEFAULT '',
|
||||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||||
`head` TEXT NOT NULL,
|
`head` TEXT NULL,
|
||||||
`implements` TEXT NULL,
|
`implements` TEXT NULL,
|
||||||
`implements_custom` VARCHAR(1024) NOT NULL DEFAULT '',
|
`implements_custom` VARCHAR(1024) NOT NULL DEFAULT '',
|
||||||
`licensing_template` TEXT NOT NULL,
|
`licensing_template` TEXT NULL,
|
||||||
`load_selection` TEXT NOT NULL,
|
`load_selection` TEXT NULL,
|
||||||
`main_class_code` MEDIUMTEXT NOT NULL,
|
`main_class_code` MEDIUMTEXT NOT NULL,
|
||||||
`method_selection` TEXT NOT NULL,
|
`method_selection` TEXT NULL,
|
||||||
`name` VARCHAR(255) NOT NULL DEFAULT '',
|
`name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`namespace` VARCHAR(255) NOT NULL DEFAULT '',
|
`namespace` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`power_version` CHAR(64) NOT NULL DEFAULT '',
|
`power_version` CHAR(64) NOT NULL DEFAULT '',
|
||||||
`property_selection` TEXT NOT NULL,
|
`property_selection` TEXT NULL,
|
||||||
`system_name` VARCHAR(255) NOT NULL DEFAULT '',
|
`system_name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`type` VARCHAR(64) NOT NULL DEFAULT '',
|
`type` VARCHAR(64) NOT NULL DEFAULT '',
|
||||||
`use_selection` TEXT NOT NULL,
|
`use_selection` TEXT NULL,
|
||||||
`params` text NULL,
|
`params` text NULL,
|
||||||
`published` TINYINT(3) NOT NULL DEFAULT 1,
|
`published` TINYINT(3) NOT NULL DEFAULT 1,
|
||||||
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
|
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
|
||||||
@ -417,7 +418,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_admin_view` (
|
|||||||
`css_view` TEXT NOT NULL,
|
`css_view` TEXT NOT NULL,
|
||||||
`css_views` TEXT NOT NULL,
|
`css_views` TEXT NOT NULL,
|
||||||
`custom_button` TEXT NOT NULL,
|
`custom_button` TEXT NOT NULL,
|
||||||
`description` TEXT NOT NULL,
|
`description` TEXT NULL,
|
||||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||||
`html_import_view` MEDIUMTEXT NOT NULL,
|
`html_import_view` MEDIUMTEXT NOT NULL,
|
||||||
`icon` CHAR(64) NOT NULL DEFAULT '',
|
`icon` CHAR(64) NOT NULL DEFAULT '',
|
||||||
@ -1000,7 +1001,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_snippet` (
|
|||||||
`contributor_email` VARCHAR(255) NOT NULL DEFAULT '',
|
`contributor_email` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`contributor_name` VARCHAR(255) NOT NULL DEFAULT '',
|
`contributor_name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`contributor_website` VARCHAR(255) NOT NULL DEFAULT '',
|
`contributor_website` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`description` TEXT NOT NULL,
|
`description` TEXT NULL,
|
||||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||||
`heading` VARCHAR(255) NOT NULL DEFAULT '',
|
`heading` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`library` INT(11) NOT NULL DEFAULT 0,
|
`library` INT(11) NOT NULL DEFAULT 0,
|
||||||
@ -1133,7 +1134,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_fieldtype` (
|
|||||||
`datalenght` CHAR(64) NOT NULL DEFAULT '',
|
`datalenght` CHAR(64) NOT NULL DEFAULT '',
|
||||||
`datalenght_other` CHAR(64) NOT NULL DEFAULT '',
|
`datalenght_other` CHAR(64) NOT NULL DEFAULT '',
|
||||||
`datatype` CHAR(64) NOT NULL DEFAULT '',
|
`datatype` CHAR(64) NOT NULL DEFAULT '',
|
||||||
`description` TEXT NOT NULL,
|
`description` TEXT NULL,
|
||||||
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
`guid` VARCHAR(36) NOT NULL DEFAULT '',
|
||||||
`has_defaults` TINYINT(1) NOT NULL DEFAULT 0,
|
`has_defaults` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`indexes` CHAR(64) NOT NULL DEFAULT '',
|
`indexes` CHAR(64) NOT NULL DEFAULT '',
|
||||||
@ -1842,7 +1843,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_class_extends` (
|
|||||||
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
|
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
|
||||||
`comment` TEXT NOT NULL,
|
`comment` TEXT NOT NULL,
|
||||||
`extension_type` VARCHAR(64) NOT NULL DEFAULT '',
|
`extension_type` VARCHAR(64) NOT NULL DEFAULT '',
|
||||||
`head` TEXT NOT NULL,
|
`head` TEXT NULL,
|
||||||
`name` VARCHAR(255) NOT NULL DEFAULT '',
|
`name` VARCHAR(255) NOT NULL DEFAULT '',
|
||||||
`params` text NULL,
|
`params` text NULL,
|
||||||
`published` TINYINT(3) NOT NULL DEFAULT 1,
|
`published` TINYINT(3) NOT NULL DEFAULT 1,
|
||||||
@ -2221,7 +2222,7 @@ INSERT INTO `#__componentbuilder_validation_rule` (`id`, `name`, `php`, `short_d
|
|||||||
|
|
||||||
INSERT INTO `#__componentbuilder_field` (`id`, `add_css_view`, `add_css_views`, `add_javascript_view_footer`, `add_javascript_views_footer`, `css_view`, `css_views`, `datadefault`, `datadefault_other`, `datalenght`, `datalenght_other`, `datatype`, `indexes`, `javascript_view_footer`, `javascript_views_footer`, `name`, `null_switch`, `store`, `fieldtype`, `xml`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `guid`, `on_get_model_field`, `on_save_model_field`, `initiator_on_get_model`, `initiator_on_save_model`, `params`) VALUES
|
INSERT INTO `#__componentbuilder_field` (`id`, `add_css_view`, `add_css_views`, `add_javascript_view_footer`, `add_javascript_views_footer`, `css_view`, `css_views`, `datadefault`, `datadefault_other`, `datalenght`, `datalenght_other`, `datatype`, `indexes`, `javascript_view_footer`, `javascript_views_footer`, `name`, `null_switch`, `store`, `fieldtype`, `xml`, `published`, `created`, `modified`, `version`, `hits`, `ordering`, `guid`, `on_get_model_field`, `on_save_model_field`, `initiator_on_get_model`, `initiator_on_save_model`, `params`) VALUES
|
||||||
(23, '', '', '', '', '', '', '', '', 64, '', 'CHAR', 2, '', '', 'Alias', 'NOT NULL', '', 24, '\"<field\\n\\ttype=\\\"text\\\"\\n\\tname=\\\"alias\\\"\\n\\tlabel=\\\"Alias\\\"\\n\\tfilter=\\\"STRING\\\"\\n\\thint=\\\"Auto-generated from name\\\"\\n\\/>\"', 1, '2015-04-09 13:46:04', '2023-06-27 23:46:54', 3, '', 216, '335866ce-b81b-4329-901d-c20254135c9c', '', '', '', '', ''),
|
(23, '', '', '', '', '', '', '', '', 64, '', 'CHAR', 2, '', '', 'Alias', 'NOT NULL', '', 24, '\"<field\\n\\ttype=\\\"text\\\"\\n\\tname=\\\"alias\\\"\\n\\tlabel=\\\"Alias\\\"\\n\\tfilter=\\\"STRING\\\"\\n\\thint=\\\"Auto-generated from name\\\"\\n\\/>\"', 1, '2015-04-09 13:46:04', '2023-06-27 23:46:54', 3, '', 216, '335866ce-b81b-4329-901d-c20254135c9c', '', '', '', '', ''),
|
||||||
(84, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'Description (full width)', 'NOT NULL', '', 25, '\"<field \\r\\n\\ttype=\\\"textarea\\\" \\r\\n\\tname=\\\"description\\\" \\r\\n\\tlabel=\\\"Description\\\" \\r\\n\\trows=\\\"11\\\" \\r\\n\\tcols=\\\"10\\\" \\r\\n\\tdescription=\\\"Add Description Here\\\" \\r\\n\\tclass=\\\"text_area span12\\\" \\r\\n\\tfilter=\\\"HTML\\\" \\r\\n\\thint=\\\"Add Description Here\\\" \\r\\n\\/>\"', 1, '2015-03-19 18:20:49', '2022-09-21 10:17:10', 4, '', 265, '749a9917-90c3-49c4-9e72-aa33b0683a87', '', '', '', '', ''),
|
(84, '', '', '', '', '', '', '', '', '', '', 'TEXT', '', '', '', 'Description (full width)', 'NULL', '', 25, '\"<field\\n\\ttype=\\\"textarea\\\"\\n\\tname=\\\"description\\\"\\n\\tlabel=\\\"Description\\\"\\n\\trows=\\\"11\\\"\\n\\tcols=\\\"10\\\"\\n\\tdescription=\\\"Add Description Here\\\"\\n\\tclass=\\\"text_area span12\\\"\\n\\tfilter=\\\"HTML\\\"\\n\\thint=\\\"Add Description Here\\\"\\n\\/>\"', 1, '2015-03-19 18:20:49', '2024-03-06 15:53:48', 5, '', 265, '749a9917-90c3-49c4-9e72-aa33b0683a87', '', '', '', '', ''),
|
||||||
(100, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Email (required)', 'NOT NULL', '', 24, '\"<field \\r\\n\\ttype=\\\"text\\\" \\r\\n\\tname=\\\"email\\\" \\r\\n\\tlabel=\\\"Email\\\" \\r\\n\\tsize=\\\"10\\\" \\r\\n\\tmaxlength=\\\"50\\\" \\r\\n\\tdescription=\\\"Enter Email\\\" \\r\\n\\tclass=\\\"text_area\\\"\\r\\n\\tfilter=\\\"STRING\\\" \\r\\n\\tvalidate=\\\"email\\\" \\r\\n\\trequired=\\\"true\\\"\\r\\n\\tmessage=\\\"Error! Please add email address here.\\\" \\r\\n\\thint=\\\"demo@example.com\\\" \\r\\n\\/>\"', 1, '2015-05-05 23:44:32', '2016-02-07 22:43:18', 4, '', 285, '10c1eccb-b3c3-4325-a056-45a72d116fd8', '', '', '', '', ''),
|
(100, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Email (required)', 'NOT NULL', '', 24, '\"<field \\r\\n\\ttype=\\\"text\\\" \\r\\n\\tname=\\\"email\\\" \\r\\n\\tlabel=\\\"Email\\\" \\r\\n\\tsize=\\\"10\\\" \\r\\n\\tmaxlength=\\\"50\\\" \\r\\n\\tdescription=\\\"Enter Email\\\" \\r\\n\\tclass=\\\"text_area\\\"\\r\\n\\tfilter=\\\"STRING\\\" \\r\\n\\tvalidate=\\\"email\\\" \\r\\n\\trequired=\\\"true\\\"\\r\\n\\tmessage=\\\"Error! Please add email address here.\\\" \\r\\n\\thint=\\\"demo@example.com\\\" \\r\\n\\/>\"', 1, '2015-05-05 23:44:32', '2016-02-07 22:43:18', 4, '', 285, '10c1eccb-b3c3-4325-a056-45a72d116fd8', '', '', '', '', ''),
|
||||||
(158, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Image', 'NOT NULL', '', 12, '\"<field\\n\\ttype=\\\"media\\\"\\n\\tname=\\\"image\\\"\\n\\tlabel=\\\"Image\\\"\\n\\/>\"', 1, '2015-04-29 14:00:56', '2020-06-07 02:17:46', 2, '', 45, '0d6970af-b361-4f65-84f6-0eb0c5f09bad', '', '', '', '', ''),
|
(158, '', '', '', '', '', '', '', '', 255, '', 'VARCHAR', '', '', '', 'Image', 'NOT NULL', '', 12, '\"<field\\n\\ttype=\\\"media\\\"\\n\\tname=\\\"image\\\"\\n\\tlabel=\\\"Image\\\"\\n\\/>\"', 1, '2015-04-29 14:00:56', '2020-06-07 02:17:46', 2, '', 45, '0d6970af-b361-4f65-84f6-0eb0c5f09bad', '', '', '', '', ''),
|
||||||
(196, '', '', '', '', '', '', '', '', 64, '', 'VARCHAR', '', '', '', 'Mobile Phone', 'NOT NULL', '', 23, '\"<field type=\\\"text\\\" \\r\\nname=\\\"mobile_phone\\\" \\r\\nlabel=\\\"Mobile Phone\\\" \\r\\nsize=\\\"10\\\" \\r\\nmaxlength=\\\"50\\\" \\r\\ndefault=\\\"\\\" \\r\\ndescription=\\\"Enter Mobile Phone Number\\\" \\r\\nclass=\\\"text_area\\\" \\r\\nfilter=\\\"STRING\\\" \\r\\nvalidated=\\\"tel\\\" \\r\\nrequired=\\\"true\\\" \\r\\nmessage=\\\"Error! Please add mobile phone number here.\\\" \\r\\nhint=\\\"Mobile Phone Here\\\" \\/>\"', 1, '2015-04-07 22:12:58', '2016-03-28 14:00:02', 2, '', 7, '65933a19-243a-48b2-aae9-34e2da710051', '', '', '', '', ''),
|
(196, '', '', '', '', '', '', '', '', 64, '', 'VARCHAR', '', '', '', 'Mobile Phone', 'NOT NULL', '', 23, '\"<field type=\\\"text\\\" \\r\\nname=\\\"mobile_phone\\\" \\r\\nlabel=\\\"Mobile Phone\\\" \\r\\nsize=\\\"10\\\" \\r\\nmaxlength=\\\"50\\\" \\r\\ndefault=\\\"\\\" \\r\\ndescription=\\\"Enter Mobile Phone Number\\\" \\r\\nclass=\\\"text_area\\\" \\r\\nfilter=\\\"STRING\\\" \\r\\nvalidated=\\\"tel\\\" \\r\\nrequired=\\\"true\\\" \\r\\nmessage=\\\"Error! Please add mobile phone number here.\\\" \\r\\nhint=\\\"Mobile Phone Here\\\" \\/>\"', 1, '2015-04-07 22:12:58', '2016-03-28 14:00:02', 2, '', 7, '65933a19-243a-48b2-aae9-34e2da710051', '', '', '', '', ''),
|
||||||
|
@ -299,7 +299,8 @@ class ComponentbuilderViewCompiler extends HtmlView
|
|||||||
// start the joomla versions options
|
// start the joomla versions options
|
||||||
$options = [
|
$options = [
|
||||||
'3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE',
|
'3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE',
|
||||||
'4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR_AND_FIVE'
|
'4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR',
|
||||||
|
'5' => 'COM_COMPONENTBUILDER_JOOMLA_FIVE'
|
||||||
];
|
];
|
||||||
|
|
||||||
// add to form
|
// add to form
|
||||||
@ -327,8 +328,8 @@ class ComponentbuilderViewCompiler extends HtmlView
|
|||||||
// Joomla Version 4 and five attributes
|
// Joomla Version 4 and five attributes
|
||||||
$attributes = [
|
$attributes = [
|
||||||
'type' => 'note',
|
'type' => 'note',
|
||||||
'name' => 'joomla_version_note_four_five',
|
'name' => 'joomla_version_note_four',
|
||||||
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR_AND_JOOMLA_FIVE',
|
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR',
|
||||||
'class' => 'alert alert-success',
|
'class' => 'alert alert-success',
|
||||||
'showon' => 'joomla_version:4'];
|
'showon' => 'joomla_version:4'];
|
||||||
|
|
||||||
@ -339,6 +340,21 @@ class ComponentbuilderViewCompiler extends HtmlView
|
|||||||
$form->setField($xml, null, true, 'builder');
|
$form->setField($xml, null, true, 'builder');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Joomla Version 5 and five attributes
|
||||||
|
$attributes = [
|
||||||
|
'type' => 'note',
|
||||||
|
'name' => 'joomla_version_note_five',
|
||||||
|
'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FIVE',
|
||||||
|
'class' => 'alert alert-success',
|
||||||
|
'showon' => 'joomla_version:5'];
|
||||||
|
|
||||||
|
// add to form
|
||||||
|
$xml = FormHelper::xml($attributes);
|
||||||
|
if ($xml instanceof SimpleXMLElement)
|
||||||
|
{
|
||||||
|
$form->setField($xml, null, true, 'builder');
|
||||||
|
}
|
||||||
|
|
||||||
// Advanced Options
|
// Advanced Options
|
||||||
$attributes = [
|
$attributes = [
|
||||||
'type' => 'radio',
|
'type' => 'radio',
|
||||||
@ -556,7 +572,6 @@ class ComponentbuilderViewCompiler extends HtmlView
|
|||||||
return LayoutHelper::render('jcbsupportmessage', []);
|
return LayoutHelper::render('jcbsupportmessage', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepares the document
|
* Prepares the document
|
||||||
*/
|
*/
|
||||||
@ -661,6 +676,11 @@ class ComponentbuilderViewCompiler extends HtmlView
|
|||||||
getComponentDetails_server(id).then(function(result) {
|
getComponentDetails_server(id).then(function(result) {
|
||||||
if (result.html) {
|
if (result.html) {
|
||||||
document.getElementById('component-details').innerHTML = result.html;
|
document.getElementById('component-details').innerHTML = result.html;
|
||||||
|
if (result.preferred_joomla_version) {
|
||||||
|
jQuery('#joomla_version').val(result.preferred_joomla_version);
|
||||||
|
jQuery('#joomla_version').trigger('liszt:updated');
|
||||||
|
jQuery('#joomla_version').trigger('change');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -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>6th March, 2024</creationDate>
|
<creationDate>7th March, 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.0-beta3</version>
|
<version>3.2.0-beta4</version>
|
||||||
<description><![CDATA[
|
<description><![CDATA[
|
||||||
<h1>Component Builder (v.3.2.0-beta3)</h1>
|
<h1>Component Builder (v.3.2.0-beta4)</h1>
|
||||||
<div style="clear: both;"></div>
|
<div style="clear: both;"></div>
|
||||||
<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.
|
<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.
|
||||||
|
|
||||||
@ -122,6 +122,6 @@ Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/compo
|
|||||||
|
|
||||||
</administration>
|
</administration>
|
||||||
<updateservers>
|
<updateservers>
|
||||||
<server type="extension" enabled="1" element="com_componentbuilder" name="Component Builder">https://git.vdm.dev/joomla/Component-Builder/raw/branch/3.10/componentbuilder_update_server.xml</server>
|
<server type="extension" enabled="1" element="com_componentbuilder" name="Component Builder">https://git.vdm.dev/joomla/Component-Builder/raw/branch/3.x/componentbuilder_update_server.xml</server>
|
||||||
</updateservers>
|
</updateservers>
|
||||||
</extension>
|
</extension>
|
@ -1529,7 +1529,7 @@
|
|||||||
<element>pkg_component_builder</element>
|
<element>pkg_component_builder</element>
|
||||||
<type>package</type>
|
<type>package</type>
|
||||||
<client>site</client>
|
<client>site</client>
|
||||||
<version>3.2.01</version>
|
<version>3.2.0-beta1</version>
|
||||||
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
||||||
<downloads>
|
<downloads>
|
||||||
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta2.zip</downloadurl>
|
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta2.zip</downloadurl>
|
||||||
@ -1547,13 +1547,13 @@
|
|||||||
<element>pkg_component_builder</element>
|
<element>pkg_component_builder</element>
|
||||||
<type>package</type>
|
<type>package</type>
|
||||||
<client>site</client>
|
<client>site</client>
|
||||||
<version>3.2.02</version>
|
<version>3.2.0-beta2</version>
|
||||||
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
||||||
<downloads>
|
<downloads>
|
||||||
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta2.zip</downloadurl>
|
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta2.zip</downloadurl>
|
||||||
</downloads>
|
</downloads>
|
||||||
<tags>
|
<tags>
|
||||||
<tag>stable</tag>
|
<tag>beta</tag>
|
||||||
</tags>
|
</tags>
|
||||||
<maintainer>Llewellyn van der Merwe</maintainer>
|
<maintainer>Llewellyn van der Merwe</maintainer>
|
||||||
<maintainerurl>https://dev.vdm.io</maintainerurl>
|
<maintainerurl>https://dev.vdm.io</maintainerurl>
|
||||||
@ -1565,7 +1565,7 @@
|
|||||||
<element>pkg_component_builder</element>
|
<element>pkg_component_builder</element>
|
||||||
<type>package</type>
|
<type>package</type>
|
||||||
<client>site</client>
|
<client>site</client>
|
||||||
<version>3.2.03</version>
|
<version>3.2.0-beta3</version>
|
||||||
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
|
||||||
<downloads>
|
<downloads>
|
||||||
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta3.zip</downloadurl>
|
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta3.zip</downloadurl>
|
||||||
@ -1577,4 +1577,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.0-beta4</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.0-beta4.zip</downloadurl>
|
||||||
|
</downloads>
|
||||||
|
<tags>
|
||||||
|
<tag>beta</tag>
|
||||||
|
</tags>
|
||||||
|
<maintainer>Llewellyn van der Merwe</maintainer>
|
||||||
|
<maintainerurl>https://dev.vdm.io</maintainerurl>
|
||||||
|
<targetplatform name="joomla" version="3.*"/>
|
||||||
|
</update>
|
||||||
</updates>
|
</updates>
|
@ -0,0 +1,129 @@
|
|||||||
|
<?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\Controller;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controller Allow Add Class for Joomla 5
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class AllowAdd implements AllowAddInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Component code name.
|
||||||
|
*
|
||||||
|
* @var String
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected String $component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Permission Class.
|
||||||
|
*
|
||||||
|
* @var Permission
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Permission $permission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Dispenser Class.
|
||||||
|
*
|
||||||
|
* @var Dispenser
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Dispenser $dispenser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Config $config The Config Class.
|
||||||
|
* @param Permission $permission The Permission Class.
|
||||||
|
* @param Dispenser $dispenser The Dispenser Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config, Permission $permission,
|
||||||
|
Dispenser $dispenser)
|
||||||
|
{
|
||||||
|
$this->component = $config->component_code_name;
|
||||||
|
$this->permission = $permission;
|
||||||
|
$this->dispenser = $dispenser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Allow Add Function Code
|
||||||
|
*
|
||||||
|
* @param string $nameSingleCode The single code name of the view.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
* @return string The allow add method code
|
||||||
|
*/
|
||||||
|
public function get(string $nameSingleCode): string
|
||||||
|
{
|
||||||
|
$allow = [];
|
||||||
|
|
||||||
|
// prepare custom permission script
|
||||||
|
$custom_allow = $this->dispenser->get(
|
||||||
|
'php_allowadd', $nameSingleCode, '', null, true
|
||||||
|
);
|
||||||
|
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Get user object.";
|
||||||
|
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||||
|
// check if the item has permissions.
|
||||||
|
if ($this->permission->globalExist($nameSingleCode, 'core.access'))
|
||||||
|
{
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Access check.";
|
||||||
|
$allow[] = Indent::_(2) . "\$access = \$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($nameSingleCode, 'core.access')
|
||||||
|
. "', 'com_" . $this->component . "');";
|
||||||
|
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||||
|
$allow[] = Indent::_(2) . "{";
|
||||||
|
$allow[] = Indent::_(3) . "return false;";
|
||||||
|
$allow[] = Indent::_(2) . "}";
|
||||||
|
}
|
||||||
|
|
||||||
|
// load custom permission script
|
||||||
|
$allow[] = $custom_allow;
|
||||||
|
|
||||||
|
// check if the item has permissions.
|
||||||
|
if ($this->permission->globalExist($nameSingleCode, 'core.create'))
|
||||||
|
{
|
||||||
|
// setup the default script
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " In the absence of better information, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($nameSingleCode, 'core.create')
|
||||||
|
. "', \$this->option);";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// setup the default script
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " In the absence of better information, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2) . "return parent::allowAdd(\$data);";
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode(PHP_EOL, $allow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,300 @@
|
|||||||
|
<?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\Controller;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controller Allow Edit Class for Joomla 5
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class AllowEdit implements AllowEditInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Component code name.
|
||||||
|
*
|
||||||
|
* @var String
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected String $component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Permission Class.
|
||||||
|
*
|
||||||
|
* @var Permission
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Permission $permission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Dispenser Class.
|
||||||
|
*
|
||||||
|
* @var Dispenser
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Dispenser $dispenser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Category Class.
|
||||||
|
*
|
||||||
|
* @var Category
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Category $category;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The CategoryOtherName Class.
|
||||||
|
*
|
||||||
|
* @var CategoryOtherName
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected CategoryOtherName $categoryothername;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Config $config The Config Class.
|
||||||
|
* @param Permission $permission The Permission Class.
|
||||||
|
* @param Dispenser $dispenser The Dispenser Class.
|
||||||
|
* @param Category $category The Category Class.
|
||||||
|
* @param CategoryOtherName $categoryothername The CategoryOtherName Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config, Permission $permission,
|
||||||
|
Dispenser $dispenser, Category $category,
|
||||||
|
CategoryOtherName $categoryothername)
|
||||||
|
{
|
||||||
|
$this->component = $config->component_code_name;
|
||||||
|
$this->permission = $permission;
|
||||||
|
$this->dispenser = $dispenser;
|
||||||
|
$this->category = $category;
|
||||||
|
$this->categoryothername = $categoryothername;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Allow Edit Function Code
|
||||||
|
*
|
||||||
|
* @param string $nameSingleCode The single code name of the view.
|
||||||
|
* @param string $nameListCode The list code name of the view.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
* @return string The allow edit method code
|
||||||
|
*/
|
||||||
|
public function get(string $nameSingleCode, string $nameListCode): string
|
||||||
|
{
|
||||||
|
$allow = [];
|
||||||
|
|
||||||
|
// prepare custom permission script
|
||||||
|
$customAllow = $this->dispenser->get(
|
||||||
|
'php_allowedit', $nameSingleCode, '', null, true
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($this->category->exists("{$nameListCode}"))
|
||||||
|
{
|
||||||
|
// check if category has another name
|
||||||
|
$otherViews = $this->categoryothername->
|
||||||
|
get($nameListCode . '.views', $nameListCode);
|
||||||
|
$otherView = $this->categoryothername->
|
||||||
|
get($nameListCode . '.view', $nameSingleCode);
|
||||||
|
// setup the category script
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get user object.";
|
||||||
|
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get record id.";
|
||||||
|
$allow[] = Indent::_(2)
|
||||||
|
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||||
|
// load custom permission script
|
||||||
|
$allow[] = $customAllow;
|
||||||
|
// check if the item has permissions.
|
||||||
|
if ($this->permission->globalExist($otherView, 'core.access'))
|
||||||
|
{
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||||
|
__LINE__,__CLASS__
|
||||||
|
) . " Access check.";
|
||||||
|
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($otherView, 'core.access')
|
||||||
|
. "', 'com_" . $this->component . "." . $otherView
|
||||||
|
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($otherView, 'core.access')
|
||||||
|
. "', 'com_" . $this->component . "'));";
|
||||||
|
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||||
|
$allow[] = Indent::_(2) . "{";
|
||||||
|
$allow[] = Indent::_(3) . "return false;";
|
||||||
|
$allow[] = Indent::_(2) . "}";
|
||||||
|
}
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||||
|
$allow[] = Indent::_(2) . "{";
|
||||||
|
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " The record has been set. Check the record permissions.";
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||||
|
. $this->permission->getAction($otherView, 'core.edit') . "', 'com_" . $this->component . "."
|
||||||
|
. $otherView . ".' . (int) \$recordId);";
|
||||||
|
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||||
|
$allow[] = Indent::_(3) . "{";
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||||
|
. $this->permission->getAction($otherView, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||||
|
. $otherView . ".' . \$recordId))";
|
||||||
|
$allow[] = Indent::_(4) . "{";
|
||||||
|
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Fallback on edit.own. Now test the owner is the user.";
|
||||||
|
$allow[] = Indent::_(5)
|
||||||
|
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||||
|
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||||
|
$allow[] = Indent::_(5) . "{";
|
||||||
|
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Need to do a lookup from the model.";
|
||||||
|
$allow[] = Indent::_(6)
|
||||||
|
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||||
|
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||||
|
$allow[] = Indent::_(6) . "{";
|
||||||
|
$allow[] = Indent::_(7) . "return false;";
|
||||||
|
$allow[] = Indent::_(6) . "}";
|
||||||
|
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||||
|
$allow[] = Indent::_(5) . "}";
|
||||||
|
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " If the owner matches 'me' then do the test.";
|
||||||
|
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||||
|
$allow[] = Indent::_(5) . "{";
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($otherView, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||||
|
$allow[] = Indent::_(6) . "{";
|
||||||
|
$allow[] = Indent::_(7) . "return true;";
|
||||||
|
$allow[] = Indent::_(6) . "}";
|
||||||
|
$allow[] = Indent::_(5) . "}";
|
||||||
|
$allow[] = Indent::_(4) . "}";
|
||||||
|
$allow[] = Indent::_(4) . "return false;";
|
||||||
|
$allow[] = Indent::_(3) . "}";
|
||||||
|
$allow[] = Indent::_(2) . "}";
|
||||||
|
if ($this->permission->globalExist($otherView, 'core.edit'))
|
||||||
|
{
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Since there is no permission, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($otherView, 'core.edit') . "', \$this->option);";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Since there is no permission, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2)
|
||||||
|
. "return parent::allowEdit(\$data, \$key);";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// setup the category script
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get user object.";
|
||||||
|
$allow[] = Indent::_(2) . "\$user = \$this->app->getIdentity();";
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get record id.";
|
||||||
|
$allow[] = Indent::_(2)
|
||||||
|
. "\$recordId = (int) isset(\$data[\$key]) ? \$data[\$key] : 0;";
|
||||||
|
// load custom permission script
|
||||||
|
$allow[] = $customAllow;
|
||||||
|
// check if the item has permissions.
|
||||||
|
if ($this->permission->actionExist($nameSingleCode, 'core.access'))
|
||||||
|
{
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "//" . Line::_(
|
||||||
|
__LINE__,__CLASS__
|
||||||
|
) . " Access check.";
|
||||||
|
$allow[] = Indent::_(2) . "\$access = (\$user->authorise('"
|
||||||
|
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "."
|
||||||
|
. $nameSingleCode
|
||||||
|
. ".' . (int) \$recordId) && \$user->authorise('"
|
||||||
|
. $this->permission->getAction($nameSingleCode, 'core.access') . "', 'com_" . $this->component . "'));";
|
||||||
|
$allow[] = Indent::_(2) . "if (!\$access)";
|
||||||
|
$allow[] = Indent::_(2) . "{";
|
||||||
|
$allow[] = Indent::_(3) . "return false;";
|
||||||
|
$allow[] = Indent::_(2) . "}";
|
||||||
|
}
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||||
|
$allow[] = Indent::_(2) . "{";
|
||||||
|
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " The record has been set. Check the record permissions.";
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||||
|
. $this->permission->getAction($nameSingleCode, 'core.edit') . "', 'com_" . $this->component . "."
|
||||||
|
. $nameSingleCode . ".' . (int) \$recordId);";
|
||||||
|
$allow[] = Indent::_(3) . "if (!\$permission)";
|
||||||
|
$allow[] = Indent::_(3) . "{";
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(4) . "if (\$user->authorise('"
|
||||||
|
. $this->permission->getAction($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "."
|
||||||
|
. $nameSingleCode . ".' . \$recordId))";
|
||||||
|
$allow[] = Indent::_(4) . "{";
|
||||||
|
$allow[] = Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Now test the owner is the user.";
|
||||||
|
$allow[] = Indent::_(5)
|
||||||
|
. "\$ownerId = (int) isset(\$data['created_by']) ? \$data['created_by'] : 0;";
|
||||||
|
$allow[] = Indent::_(5) . "if (empty(\$ownerId))";
|
||||||
|
$allow[] = Indent::_(5) . "{";
|
||||||
|
$allow[] = Indent::_(6) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Need to do a lookup from the model.";
|
||||||
|
$allow[] = Indent::_(6)
|
||||||
|
. "\$record = \$this->getModel()->getItem(\$recordId);";
|
||||||
|
$allow[] = PHP_EOL . Indent::_(6) . "if (empty(\$record))";
|
||||||
|
$allow[] = Indent::_(6) . "{";
|
||||||
|
$allow[] = Indent::_(7) . "return false;";
|
||||||
|
$allow[] = Indent::_(6) . "}";
|
||||||
|
$allow[] = Indent::_(6) . "\$ownerId = \$record->created_by;";
|
||||||
|
$allow[] = Indent::_(5) . "}";
|
||||||
|
$allow[] = PHP_EOL . Indent::_(5) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " If the owner matches 'me' then allow.";
|
||||||
|
$allow[] = Indent::_(5) . "if (\$ownerId == \$user->id)";
|
||||||
|
$allow[] = Indent::_(5) . "{";
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(6) . "if (\$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($nameSingleCode, 'core.edit.own') . "', 'com_" . $this->component . "'))";
|
||||||
|
$allow[] = Indent::_(6) . "{";
|
||||||
|
$allow[] = Indent::_(7) . "return true;";
|
||||||
|
$allow[] = Indent::_(6) . "}";
|
||||||
|
$allow[] = Indent::_(5) . "}";
|
||||||
|
$allow[] = Indent::_(4) . "}";
|
||||||
|
$allow[] = Indent::_(4) . "return false;";
|
||||||
|
$allow[] = Indent::_(3) . "}";
|
||||||
|
$allow[] = Indent::_(2) . "}";
|
||||||
|
if ($this->permission->globalExist($nameSingleCode, 'core.edit'))
|
||||||
|
{
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Since there is no permission, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($nameSingleCode, 'core.edit') . "', \$this->option);";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Since there is no permission, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2)
|
||||||
|
. "return parent::allowEdit(\$data, \$key);";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode(PHP_EOL, $allow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -0,0 +1,87 @@
|
|||||||
|
<?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\Model;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model Can Delete Class for Joomla 5
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class CanDelete implements CanDeleteInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Component code name.
|
||||||
|
*
|
||||||
|
* @var String
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected String $component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Permission Class.
|
||||||
|
*
|
||||||
|
* @var Permission
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Permission $permission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Config $config The Config Class.
|
||||||
|
* @param Permission $permission The Permission Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config, Permission $permission)
|
||||||
|
{
|
||||||
|
$this->component = $config->component_code_name;
|
||||||
|
$this->permission = $permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Can Delete Function Code
|
||||||
|
*
|
||||||
|
* @param string $nameSingleCode The single code name of the view.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
* @return string The can delete method code
|
||||||
|
*/
|
||||||
|
public function get(string $nameSingleCode): string
|
||||||
|
{
|
||||||
|
$allow = [];
|
||||||
|
|
||||||
|
// setup the default script
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "if (empty(\$record->id) || (\$record->published != -2))";
|
||||||
|
$allow[] = Indent::_(2) . "{";
|
||||||
|
$allow[] = Indent::_(3) . "return false;";
|
||||||
|
$allow[] = Indent::_(2) . "}" . PHP_EOL;
|
||||||
|
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " The record has been set. Check the record permissions.";
|
||||||
|
$allow[] = Indent::_(2) . "return \$this->getCurrentUser()->authorise('"
|
||||||
|
. $this->permission->getAction($nameSingleCode, 'core.delete') . "', 'com_" . $this->component . "."
|
||||||
|
. $nameSingleCode . ".' . (int) \$record->id);";
|
||||||
|
|
||||||
|
return implode(PHP_EOL, $allow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,108 @@
|
|||||||
|
<?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\Model;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model Can Edit State Class for Joomla 5
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class CanEditState implements CanEditStateInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Component code name.
|
||||||
|
*
|
||||||
|
* @var String
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected String $component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Permission Class.
|
||||||
|
*
|
||||||
|
* @var Permission
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Permission $permission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Config $config The Config Class.
|
||||||
|
* @param Permission $permission The Permission Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config, Permission $permission)
|
||||||
|
{
|
||||||
|
$this->component = $config->component_code_name;
|
||||||
|
$this->permission = $permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Can Edit State Function Code
|
||||||
|
*
|
||||||
|
* @param string $nameSingleCode The single code name of the view.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
* @return string The can edit state method code
|
||||||
|
*/
|
||||||
|
public function get(string $nameSingleCode): string
|
||||||
|
{
|
||||||
|
$allow = [];
|
||||||
|
|
||||||
|
// setup the default script
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "\$user = \$this->getCurrentUser();";
|
||||||
|
$allow[] = Indent::_(2)
|
||||||
|
. "\$recordId = \$record->id ?? 0;";
|
||||||
|
$allow[] = PHP_EOL . Indent::_(2) . "if (\$recordId)";
|
||||||
|
$allow[] = Indent::_(2) . "{";
|
||||||
|
$allow[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " The record has been set. Check the record permissions.";
|
||||||
|
// check if the item has permissions.
|
||||||
|
$allow[] = Indent::_(3) . "\$permission = \$user->authorise('"
|
||||||
|
. $this->permission->getAction($nameSingleCode, 'core.edit.state')
|
||||||
|
. "', 'com_" . $this->component . "." . $nameSingleCode . ".' . (int) \$recordId);";
|
||||||
|
$allow[] = Indent::_(3)
|
||||||
|
. "if (!\$permission && !is_null(\$permission))";
|
||||||
|
$allow[] = Indent::_(3) . "{";
|
||||||
|
$allow[] = Indent::_(4) . "return false;";
|
||||||
|
$allow[] = Indent::_(3) . "}";
|
||||||
|
$allow[] = Indent::_(2) . "}";
|
||||||
|
if ($this->permission->globalExist($nameSingleCode, 'core.edit.state'))
|
||||||
|
{
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " In the absence of better information, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2) . "return \$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($nameSingleCode, 'core.edit.state') . "', 'com_" . $this->component
|
||||||
|
. "');";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$allow[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " In the absence of better information, revert to the component permissions.";
|
||||||
|
$allow[] = Indent::_(2)
|
||||||
|
. "return parent::canEditState(\$record);";
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode(PHP_EOL, $allow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -45,7 +45,7 @@ final class Component extends BaseRegistry
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
public function __get(string $path)
|
public function __get($path)
|
||||||
{
|
{
|
||||||
// check if it has been set
|
// check if it has been set
|
||||||
if (($value = $this->get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_')
|
if (($value = $this->get($path, '__N0T_S3T_Y3T_')) !== '__N0T_S3T_Y3T_')
|
||||||
|
@ -400,7 +400,7 @@ final class Data
|
|||||||
|
|
||||||
// ensure version naming is correct
|
// ensure version naming is correct
|
||||||
$this->config->set('component_version', preg_replace(
|
$this->config->set('component_version', preg_replace(
|
||||||
'/[^0-9.]+/', '', (string) $component->component_version
|
'/^v/i', '', (string) $component->component_version
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -0,0 +1,748 @@
|
|||||||
|
<?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\Component\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Registry;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Component;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Dynamicpath;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Pathfix;
|
||||||
|
use VDM\Joomla\Utilities\FileHelper;
|
||||||
|
use VDM\Joomla\Utilities\JsonHelper;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Component (Joomla Version) Settings
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class Settings implements SettingsInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The standard folders
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $standardFolders = [
|
||||||
|
'site',
|
||||||
|
'admin',
|
||||||
|
'media'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The standard root files
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $standardRootFiles = [
|
||||||
|
'access.xml',
|
||||||
|
'config.xml',
|
||||||
|
'controller.php',
|
||||||
|
'index.html',
|
||||||
|
'README.txt'
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Joomla Version Data
|
||||||
|
*
|
||||||
|
* @var object|null
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected ?object $data = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Config
|
||||||
|
*
|
||||||
|
* @var Config
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Config $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The compiler registry
|
||||||
|
*
|
||||||
|
* @var Registry
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Registry $registry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Event
|
||||||
|
*
|
||||||
|
* @var EventInterface
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected EventInterface $event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Placeholder
|
||||||
|
*
|
||||||
|
* @var Placeholder
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Placeholder $placeholder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Component
|
||||||
|
*
|
||||||
|
* @var Component
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
protected Component $component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Utilities Paths
|
||||||
|
*
|
||||||
|
* @var Paths
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Paths $paths;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Component Dynamic Path
|
||||||
|
*
|
||||||
|
* @var Dynamicpath
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
protected Dynamicpath $dynamicpath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Component Pathfix
|
||||||
|
*
|
||||||
|
* @var Pathfix
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
protected Pathfix $pathfix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param Config|null $config The compiler config object.
|
||||||
|
* @param Registry|null $registry The compiler registry object.
|
||||||
|
* @param EventInterface|null $event The compiler event api object.
|
||||||
|
* @param Placeholder|null $placeholder The compiler placeholder object.
|
||||||
|
* @param Component|null $component The component class.
|
||||||
|
* @param Paths|null $paths The compiler paths object.
|
||||||
|
* @param Dynamicpath|null $dynamicpath The compiler dynamic path object.
|
||||||
|
* @param Pathfix|null $pathfix The compiler path fixing object.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(?Config $config = null, ?Registry $registry = null,
|
||||||
|
?EventInterface $event = null, ?Placeholder $placeholder = null,
|
||||||
|
?Component $component = null, ?Paths $paths = null,
|
||||||
|
?Dynamicpath $dynamicpath = null, ?Pathfix $pathfix = null)
|
||||||
|
{
|
||||||
|
$this->config = $config ?: Compiler::_('Config');
|
||||||
|
$this->registry = $registry ?: Compiler::_('Registry');
|
||||||
|
$this->event = $event ?: Compiler::_('Event');
|
||||||
|
$this->placeholder = $placeholder ?: Compiler::_('Placeholder');
|
||||||
|
$this->component = $component ?: Compiler::_('Component');
|
||||||
|
$this->paths = $paths ?: Compiler::_('Utilities.Paths');
|
||||||
|
$this->dynamicpath = $dynamicpath ?: Compiler::_('Utilities.Dynamicpath');
|
||||||
|
$this->pathfix = $pathfix ?: Compiler::_('Utilities.Pathfix');
|
||||||
|
|
||||||
|
// add component endpoint file to stander list of root files
|
||||||
|
$this->standardRootFiles[] = $this->component->get('name_code') . '.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if data set is loaded
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function exists(): bool
|
||||||
|
{
|
||||||
|
if (!$this->isSet())
|
||||||
|
{
|
||||||
|
// load the data
|
||||||
|
$this->data = $this->get();
|
||||||
|
|
||||||
|
if (!$this->isSet())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Joomla - Folder Structure to Create
|
||||||
|
*
|
||||||
|
* @return object The version related structure
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function structure(): object
|
||||||
|
{
|
||||||
|
return $this->data->create;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Joomla - Move Multiple Structure
|
||||||
|
*
|
||||||
|
* @return object The version related multiple structure
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function multiple(): object
|
||||||
|
{
|
||||||
|
return $this->data->move->dynamic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Joomla - Move Single Structure
|
||||||
|
*
|
||||||
|
* @return object The version related single structure
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function single(): object
|
||||||
|
{
|
||||||
|
return $this->data->move->static;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if Folder is a Standard Folder
|
||||||
|
*
|
||||||
|
* @param string $folder The folder name
|
||||||
|
*
|
||||||
|
* @return bool true if the folder exists
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function standardFolder(string $folder): bool
|
||||||
|
{
|
||||||
|
return in_array($folder, $this->standardFolders);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if File is a Standard Root File
|
||||||
|
*
|
||||||
|
* @param string $file The file name
|
||||||
|
*
|
||||||
|
* @return bool true if the file exists
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function standardRootFile(string $file): bool
|
||||||
|
{
|
||||||
|
return in_array($file, $this->standardRootFiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if Data is Set
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function isSet(): bool
|
||||||
|
{
|
||||||
|
return is_object($this->data) &&
|
||||||
|
isset($this->data->create) &&
|
||||||
|
isset($this->data->move) &&
|
||||||
|
isset($this->data->move->static) &&
|
||||||
|
isset($this->data->move->dynamic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the Joomla Version Data
|
||||||
|
*
|
||||||
|
* @return object|null The version data
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function get(): ?object
|
||||||
|
{
|
||||||
|
// override option
|
||||||
|
$customSettings = $this->paths->template_path . '/settings_' .
|
||||||
|
$this->config->component_code_name . '.json';
|
||||||
|
|
||||||
|
// get the data
|
||||||
|
$version_data = $this->readJsonFile($customSettings);
|
||||||
|
|
||||||
|
if (is_null($version_data) || !$this->isValidData($version_data))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->loadExtraFolders();
|
||||||
|
$this->loadExtraFiles();
|
||||||
|
|
||||||
|
$this->addFolders($version_data);
|
||||||
|
$this->addFiles($version_data);
|
||||||
|
|
||||||
|
// Trigger Event: jcb_ce_onAfterSetJoomlaVersionData
|
||||||
|
$this->event->trigger(
|
||||||
|
'jcb_ce_onAfterSetJoomlaVersionData', [&$version_data]
|
||||||
|
);
|
||||||
|
|
||||||
|
return $version_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the Json file data
|
||||||
|
*
|
||||||
|
* @param string $filePath
|
||||||
|
*
|
||||||
|
* @return object|null The version data
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function readJsonFile(string $filePath): ?object
|
||||||
|
{
|
||||||
|
if (FileHelper::exists($filePath))
|
||||||
|
{
|
||||||
|
$jsonContent = FileHelper::getContent($filePath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$jsonContent = FileHelper::getContent($this->paths->template_path . '/settings.json');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (JsonHelper::check($jsonContent))
|
||||||
|
{
|
||||||
|
return json_decode((string) $jsonContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if this is valid data
|
||||||
|
*
|
||||||
|
* @param object $versionData
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function isValidData(object $versionData): bool
|
||||||
|
{
|
||||||
|
return isset($versionData->create) &&
|
||||||
|
isset($versionData->move) &&
|
||||||
|
isset($versionData->move->static) &&
|
||||||
|
isset($versionData->move->dynamic);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Extra/Dynamic folders
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function loadExtraFolders()
|
||||||
|
{
|
||||||
|
if ($this->component->isArray('folders') ||
|
||||||
|
$this->config->get('add_eximport', false) ||
|
||||||
|
$this->config->get('uikit', 0) ||
|
||||||
|
$this->config->get('footable', false))
|
||||||
|
{
|
||||||
|
$this->addImportViewFolder();
|
||||||
|
$this->addPhpSpreadsheetFolder();
|
||||||
|
$this->addUikitFolder();
|
||||||
|
$this->addFooTableFolder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Import and Export Folder
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function addImportViewFolder()
|
||||||
|
{
|
||||||
|
if ($this->config->get('add_eximport', false))
|
||||||
|
{
|
||||||
|
// soon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Php Spreadsheet Folder
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function addPhpSpreadsheetFolder()
|
||||||
|
{
|
||||||
|
// move the phpspreadsheet Folder (TODO we must move this to a library package)
|
||||||
|
if ($this->config->get('add_eximport', false))
|
||||||
|
{
|
||||||
|
$this->component->appendArray('folders', [
|
||||||
|
'folderpath' => 'JPATH_LIBRARIES/phpspreadsheet/vendor',
|
||||||
|
'path' => '/libraries/phpspreadsheet/',
|
||||||
|
'rename' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Uikit Folders
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function addUikitFolder()
|
||||||
|
{
|
||||||
|
$uikit = $this->config->get('uikit', 0);
|
||||||
|
if (2 == $uikit || 1 == $uikit)
|
||||||
|
{
|
||||||
|
// move the UIKIT Folder into place
|
||||||
|
$this->component->appendArray('folders', [
|
||||||
|
'folder' => 'uikit-v2',
|
||||||
|
'path' => 'media',
|
||||||
|
'rename' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
if (2 == $uikit || 3 == $uikit)
|
||||||
|
{
|
||||||
|
// move the UIKIT-3 Folder into place
|
||||||
|
$this->component->appendArray('folders', [
|
||||||
|
'folder' => 'uikit-v3',
|
||||||
|
'path' => 'media',
|
||||||
|
'rename' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Foo Table Folder
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function addFooTableFolder()
|
||||||
|
{
|
||||||
|
if (!$this->config->get('footable', false))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$footable_version = $this->config->get('footable_version', 2);
|
||||||
|
|
||||||
|
if (2 == $footable_version)
|
||||||
|
{
|
||||||
|
// move the footable folder into place
|
||||||
|
$this->component->appendArray('folders', [
|
||||||
|
'folder' => 'footable-v2',
|
||||||
|
'path' => 'media',
|
||||||
|
'rename' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
elseif (3 == $footable_version)
|
||||||
|
{
|
||||||
|
// move the footable folder into place
|
||||||
|
$this->component->appendArray('folders', [
|
||||||
|
'folder' => 'footable-v3',
|
||||||
|
'path' => 'media',
|
||||||
|
'rename' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Extra/Dynamic files
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function loadExtraFiles()
|
||||||
|
{
|
||||||
|
if ($this->component->isArray('files') ||
|
||||||
|
$this->config->get('google_chart', false))
|
||||||
|
{
|
||||||
|
$this->addGoogleChartFiles();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Google Chart Files
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function addGoogleChartFiles()
|
||||||
|
{
|
||||||
|
if ($this->config->get('google_chart', false))
|
||||||
|
{
|
||||||
|
// move the google chart files
|
||||||
|
$this->component->appendArray('files', [
|
||||||
|
'file' => 'google.jsapi.js',
|
||||||
|
'path' => 'media/js',
|
||||||
|
'rename' => 0
|
||||||
|
]);
|
||||||
|
$this->component->appendArray('files', [
|
||||||
|
'file' => 'chartbuilder.php',
|
||||||
|
'path' => 'admin/helpers',
|
||||||
|
'rename' => 0
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Folders
|
||||||
|
*
|
||||||
|
* @param object $versionData
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function addFolders(object &$versionData)
|
||||||
|
{
|
||||||
|
if (!$this->component->isArray('folders'))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// pointer tracker
|
||||||
|
$pointer_tracker = 'h';
|
||||||
|
foreach ($this->component->get('folders') as $custom)
|
||||||
|
{
|
||||||
|
// check type of target type
|
||||||
|
$_target_type = 'c0mp0n3nt';
|
||||||
|
if (isset($custom['target_type']))
|
||||||
|
{
|
||||||
|
$_target_type = $custom['target_type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// for good practice
|
||||||
|
$this->pathfix->set(
|
||||||
|
$custom, ['path', 'folder', 'folderpath']
|
||||||
|
);
|
||||||
|
|
||||||
|
// fix custom path
|
||||||
|
if (isset($custom['path'])
|
||||||
|
&& StringHelper::check($custom['path']))
|
||||||
|
{
|
||||||
|
$custom['path'] = trim((string) $custom['path'], '/');
|
||||||
|
}
|
||||||
|
|
||||||
|
// by default custom path is true
|
||||||
|
$customPath = 'custom';
|
||||||
|
|
||||||
|
// set full path if this is a full path folder
|
||||||
|
if (!isset($custom['folder']) && isset($custom['folderpath']))
|
||||||
|
{
|
||||||
|
// update the dynamic path
|
||||||
|
$custom['folderpath'] = $this->dynamicpath->update(
|
||||||
|
$custom['folderpath']
|
||||||
|
);
|
||||||
|
|
||||||
|
// set the folder path with / if does not have a drive/windows full path
|
||||||
|
$custom['folder'] = (preg_match(
|
||||||
|
'/^[a-z]:/i', $custom['folderpath']
|
||||||
|
)) ? trim($custom['folderpath'], '/')
|
||||||
|
: '/' . trim($custom['folderpath'], '/');
|
||||||
|
|
||||||
|
// remove the file path
|
||||||
|
unset($custom['folderpath']);
|
||||||
|
|
||||||
|
// triget fullpath
|
||||||
|
$customPath = 'full';
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure we use the correct name
|
||||||
|
$pathArray = (array) explode('/', (string) $custom['path']);
|
||||||
|
$lastFolder = end($pathArray);
|
||||||
|
|
||||||
|
// only rename folder if last has folder name
|
||||||
|
if (isset($custom['rename']) && $custom['rename'] == 1)
|
||||||
|
{
|
||||||
|
$custom['path'] = str_replace(
|
||||||
|
'/' . $lastFolder, '', (string) $custom['path']
|
||||||
|
);
|
||||||
|
$rename = 'new';
|
||||||
|
$newname = $lastFolder;
|
||||||
|
}
|
||||||
|
elseif ('full' === $customPath)
|
||||||
|
{
|
||||||
|
// make sure we use the correct name
|
||||||
|
$folderArray = (array) explode('/', (string) $custom['folder']);
|
||||||
|
$lastFolder = end($folderArray);
|
||||||
|
$rename = 'new';
|
||||||
|
$newname = $lastFolder;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$rename = false;
|
||||||
|
$newname = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// insure we have no duplicates
|
||||||
|
$key_pointer = StringHelper::safe(
|
||||||
|
$custom['folder']
|
||||||
|
) . '_f' . $pointer_tracker;
|
||||||
|
|
||||||
|
$pointer_tracker++;
|
||||||
|
|
||||||
|
// fix custom path
|
||||||
|
$custom['path'] = ltrim((string) $custom['path'], '/');
|
||||||
|
|
||||||
|
// set new folder to object
|
||||||
|
$versionData->move->static->{$key_pointer} = new \stdClass();
|
||||||
|
$versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['folder']);
|
||||||
|
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path'];
|
||||||
|
$versionData->move->static->{$key_pointer}->rename = $rename;
|
||||||
|
$versionData->move->static->{$key_pointer}->newName = $newname;
|
||||||
|
$versionData->move->static->{$key_pointer}->type = 'folder';
|
||||||
|
$versionData->move->static->{$key_pointer}->custom = $customPath;
|
||||||
|
|
||||||
|
// set the target if type and id is found
|
||||||
|
if (isset($custom['target_id']) && isset($custom['target_type']))
|
||||||
|
{
|
||||||
|
$versionData->move->static->{$key_pointer}->_target = [
|
||||||
|
'key' => $custom['target_id'] . '_' . $custom['target_type'],
|
||||||
|
'type' => $custom['target_type']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->component->remove('folders');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add Files
|
||||||
|
*
|
||||||
|
* @param object $versionData
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function addFiles(object &$versionData)
|
||||||
|
{
|
||||||
|
if (!$this->component->isArray('files')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// pointer tracker
|
||||||
|
$pointer_tracker = 'h';
|
||||||
|
foreach ($this->component->get('files') as $custom)
|
||||||
|
{
|
||||||
|
// check type of target type
|
||||||
|
$_target_type = 'c0mp0n3nt';
|
||||||
|
if (isset($custom['target_type']))
|
||||||
|
{
|
||||||
|
$_target_type = $custom['target_type'];
|
||||||
|
}
|
||||||
|
|
||||||
|
// for good practice
|
||||||
|
$this->pathfix->set(
|
||||||
|
$custom, ['path', 'file', 'filepath']
|
||||||
|
);
|
||||||
|
|
||||||
|
// by default custom path is true
|
||||||
|
$customPath = 'custom';
|
||||||
|
|
||||||
|
// set full path if this is a full path file
|
||||||
|
if (!isset($custom['file']) && isset($custom['filepath']))
|
||||||
|
{
|
||||||
|
// update the dynamic path
|
||||||
|
$custom['filepath'] = $this->dynamicpath->update(
|
||||||
|
$custom['filepath']
|
||||||
|
);
|
||||||
|
|
||||||
|
// set the file path with / if does not have a drive/windows full path
|
||||||
|
$custom['file'] = (preg_match('/^[a-z]:/i', $custom['filepath']))
|
||||||
|
? trim($custom['filepath'], '/') : '/' . trim($custom['filepath'], '/');
|
||||||
|
|
||||||
|
// remove the file path
|
||||||
|
unset($custom['filepath']);
|
||||||
|
|
||||||
|
// triget fullpath
|
||||||
|
$customPath = 'full';
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure we have not duplicates
|
||||||
|
$key_pointer = StringHelper::safe(
|
||||||
|
$custom['file']
|
||||||
|
) . '_g' . $pointer_tracker;
|
||||||
|
|
||||||
|
$pointer_tracker++;
|
||||||
|
|
||||||
|
// set new file to object
|
||||||
|
$versionData->move->static->{$key_pointer} = new \stdClass();
|
||||||
|
$versionData->move->static->{$key_pointer}->naam = str_replace('//', '/', (string) $custom['file']);
|
||||||
|
|
||||||
|
// update the dynamic component name placholders in file names
|
||||||
|
$custom['path'] = $this->placeholder->update_(
|
||||||
|
$custom['path']
|
||||||
|
);
|
||||||
|
|
||||||
|
// get the path info
|
||||||
|
$pathInfo = pathinfo((string) $custom['path']);
|
||||||
|
if (isset($pathInfo['extension']) && $pathInfo['extension'])
|
||||||
|
{
|
||||||
|
$pathInfo['dirname'] = trim($pathInfo['dirname'], '/');
|
||||||
|
|
||||||
|
// set the info
|
||||||
|
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $pathInfo['dirname'];
|
||||||
|
$versionData->move->static->{$key_pointer}->rename = 'new';
|
||||||
|
$versionData->move->static->{$key_pointer}->newName = $pathInfo['basename'];
|
||||||
|
}
|
||||||
|
elseif ('full' === $customPath)
|
||||||
|
{
|
||||||
|
// fix custom path
|
||||||
|
$custom['path'] = ltrim((string) $custom['path'], '/');
|
||||||
|
|
||||||
|
// get file array
|
||||||
|
$fileArray = (array) explode('/', (string) $custom['file']);
|
||||||
|
|
||||||
|
// set the info
|
||||||
|
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path'];
|
||||||
|
$versionData->move->static->{$key_pointer}->rename = 'new';
|
||||||
|
$versionData->move->static->{$key_pointer}->newName = end($fileArray);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// fix custom path
|
||||||
|
$custom['path'] = ltrim((string) $custom['path'], '/');
|
||||||
|
|
||||||
|
// set the info
|
||||||
|
$versionData->move->static->{$key_pointer}->path = $_target_type . '/' . $custom['path'];
|
||||||
|
$versionData->move->static->{$key_pointer}->rename = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$versionData->move->static->{$key_pointer}->type = 'file';
|
||||||
|
$versionData->move->static->{$key_pointer}->custom = $customPath;
|
||||||
|
|
||||||
|
// set the target if type and id is found
|
||||||
|
if (isset($custom['target_id'])
|
||||||
|
&& isset($custom['target_type']))
|
||||||
|
{
|
||||||
|
$versionData->move->static->{$key_pointer}->_target = [
|
||||||
|
'key' => $custom['target_id'] . '_' . $custom['target_type'],
|
||||||
|
'type' => $custom['target_type']
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if file should be updated
|
||||||
|
if (!isset($custom['notnew']) || $custom['notnew'] == 0
|
||||||
|
|| $custom['notnew'] != 1)
|
||||||
|
{
|
||||||
|
$this->registry->appendArray('files.not.new', $key_pointer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// update the file content
|
||||||
|
$this->registry->set('update.file.content.' . $key_pointer, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->component->remove('files');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -350,7 +350,8 @@ class Config extends BaseConfig
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
3 => ['folder_key' => 3, 'xml_version' => '3.10'],
|
3 => ['folder_key' => 3, 'xml_version' => '3.10'],
|
||||||
4 => ['folder_key' => 4, 'xml_version' => '4.0']
|
4 => ['folder_key' => 4, 'xml_version' => '4.0'],
|
||||||
|
5 => ['folder_key' => 4, 'xml_version' => '5.0'] // for now we build 4 and 5 from same templates ;)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -542,8 +542,8 @@ final class CustomFieldTypeFile
|
|||||||
$placeholders[Placefix::_('view')] = $this->getViewName();
|
$placeholders[Placefix::_('view')] = $this->getViewName();
|
||||||
$placeholders[Placefix::_('views')] = $this->getViewsName();
|
$placeholders[Placefix::_('views')] = $this->getViewsName();
|
||||||
|
|
||||||
// Gymnastics to help with transition to Joomla 4
|
// Gymnastics to help with transition to Joomla 4 and above
|
||||||
if ($this->config->get('joomla_version', 3) == 4)
|
if ($this->config->get('joomla_version', 3) != 3)
|
||||||
{
|
{
|
||||||
$placeholders['JFactory::getUser()'] = 'Factory::getApplication()->getIdentity()';
|
$placeholders['JFactory::getUser()'] = 'Factory::getApplication()->getIdentity()';
|
||||||
$placeholders['Factory::getUser()'] = 'Factory::getApplication()->getIdentity()';
|
$placeholders['Factory::getUser()'] = 'Factory::getApplication()->getIdentity()';
|
||||||
|
@ -0,0 +1,374 @@
|
|||||||
|
<?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\Extension\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension\InstallInterface;
|
||||||
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loading the Extension Installation Script Class
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class InstallScript implements GetScriptInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The extension
|
||||||
|
*
|
||||||
|
* @var InstallInterface|Object
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected object $extension;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $methods = ['php_script', 'php_preflight', 'php_postflight', 'php_method'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The types
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $types = ['construct', 'install', 'update', 'uninstall', 'discover_install'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The construct bucket
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $construct = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The install bucket
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $install = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The update bucket
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $update = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The uninstall bucket
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $uninstall = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The preflight switch
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected bool $preflightActive = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The preflight bucket
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $preflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The postflight switch
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected bool $postflightActive = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The postflight bucket
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $postflightBucket = ['install' => [], 'uninstall' => [], 'discover_install' => [], 'update' => []];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get install script
|
||||||
|
*
|
||||||
|
* @param Object $extension The extension object
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function get(object $extension): string
|
||||||
|
{
|
||||||
|
// loop over methods and types
|
||||||
|
foreach ($this->methods as $method)
|
||||||
|
{
|
||||||
|
foreach ($this->types as $type)
|
||||||
|
{
|
||||||
|
if (isset($extension->{'add_' . $method . '_' . $type})
|
||||||
|
&& $extension->{'add_' . $method . '_' . $type} == 1
|
||||||
|
&& StringHelper::check(
|
||||||
|
$extension->{$method . '_' . $type}
|
||||||
|
))
|
||||||
|
{
|
||||||
|
// add to the main methods
|
||||||
|
if ('php_method' === $method || 'php_script' === $method)
|
||||||
|
{
|
||||||
|
$this->{$type}[] = $extension->{$method . '_' . $type};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get the flight key
|
||||||
|
$flight = str_replace('php_', '', (string) $method);
|
||||||
|
// load the script to our bucket
|
||||||
|
$this->{$flight . 'Bucket'}[$type][] = $extension->{$method . '_' . $type};
|
||||||
|
// show that the method is active
|
||||||
|
$this->{$flight . 'Active'} = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->extension = $extension;
|
||||||
|
|
||||||
|
// return the class
|
||||||
|
return $this->build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build the install class
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function build(): string
|
||||||
|
{
|
||||||
|
// start build
|
||||||
|
$script = $this->head();
|
||||||
|
|
||||||
|
// load constructor if set
|
||||||
|
$script .= $this->construct();
|
||||||
|
|
||||||
|
// load install method if set
|
||||||
|
$script .= $this->main('install');
|
||||||
|
|
||||||
|
// load update method if set
|
||||||
|
$script .= $this->main('update');
|
||||||
|
|
||||||
|
// load uninstall method if set
|
||||||
|
$script .= $this->main('uninstall');
|
||||||
|
|
||||||
|
// load preflight method if set
|
||||||
|
$script .= $this->flight('preflight');
|
||||||
|
|
||||||
|
// load postflight method if set
|
||||||
|
$script .= $this->flight('postflight');
|
||||||
|
|
||||||
|
// close the class
|
||||||
|
$script .= PHP_EOL . '}' . PHP_EOL;
|
||||||
|
|
||||||
|
return $script;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get install script head
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function head(): string
|
||||||
|
{
|
||||||
|
// get the extension
|
||||||
|
$extension = $this->extension;
|
||||||
|
|
||||||
|
// start build
|
||||||
|
$script = PHP_EOL . 'use Joomla\CMS\Factory;';
|
||||||
|
$script .= PHP_EOL . 'use Joomla\CMS\Language\Text;';
|
||||||
|
$script .= PHP_EOL . 'use Joomla\CMS\Filesystem\File;';
|
||||||
|
$script .= PHP_EOL . 'use Joomla\CMS\Filesystem\Folder;' . PHP_EOL;
|
||||||
|
$script .= PHP_EOL . '/**';
|
||||||
|
$script .= PHP_EOL . ' * ' . $extension->official_name
|
||||||
|
. ' script file.';
|
||||||
|
$script .= PHP_EOL . ' *';
|
||||||
|
$script .= PHP_EOL . ' * @package ' . $extension->class_name;
|
||||||
|
$script .= PHP_EOL . ' */';
|
||||||
|
$script .= PHP_EOL . 'class ' . $extension->installer_class_name;
|
||||||
|
$script .= PHP_EOL . '{';
|
||||||
|
|
||||||
|
return $script;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get constructor
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function construct(): string
|
||||||
|
{
|
||||||
|
// return empty string if not set
|
||||||
|
if (!ArrayHelper::check($this->construct))
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// the __construct script
|
||||||
|
$script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' * Constructor';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' *';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' */';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. 'public function __construct($adapter)';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . '{';
|
||||||
|
$script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->construct);
|
||||||
|
// close the function
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . '}';
|
||||||
|
|
||||||
|
return $script;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build main methods
|
||||||
|
*
|
||||||
|
* @param string $name the method being called
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function main(string $name): string
|
||||||
|
{
|
||||||
|
// return empty string if not set
|
||||||
|
if (!ArrayHelper::check($this->{$name}))
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
// load the install method
|
||||||
|
$script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . " * Called on $name";
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' *';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' *';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. ' * @return boolean True on success';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' */';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . 'public function '
|
||||||
|
. $name . '($adapter)';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . '{';
|
||||||
|
$script .= PHP_EOL . implode(PHP_EOL . PHP_EOL, $this->{$name});
|
||||||
|
// return true
|
||||||
|
if ('uninstall' !== $name)
|
||||||
|
{
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . 'return true;';
|
||||||
|
}
|
||||||
|
// close the function
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . '}';
|
||||||
|
|
||||||
|
return $script;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* build flight methods
|
||||||
|
*
|
||||||
|
* @param string $name the method being called
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function flight(string $name): string
|
||||||
|
{
|
||||||
|
// return empty string if not set
|
||||||
|
if (empty($this->{$name . 'Active'}))
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// the pre/post function types
|
||||||
|
$script = PHP_EOL . PHP_EOL . Indent::_(1) . '/**';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. ' * Called before any type of action';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' *';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. ' * @param string $route Which action is happening (install|uninstall|discover_install|update)';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. ' * @param Joomla\CMS\Installer\InstallerAdapter $adapter The object responsible for running this script';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' *';
|
||||||
|
$script .= PHP_EOL . Indent::_(1)
|
||||||
|
. ' * @return boolean True on success';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . ' */';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . 'public function '
|
||||||
|
. $name . '($route, $adapter)';
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . '{';
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__)
|
||||||
|
. ' get application';
|
||||||
|
$script .= PHP_EOL . Indent::_(2)
|
||||||
|
. '$app = Factory::getApplication();' . PHP_EOL;
|
||||||
|
|
||||||
|
// add the default version check (TODO) must make this dynamic
|
||||||
|
if ('preflight' === $name)
|
||||||
|
{
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . '//' . Line::_(__Line__, __Class__)
|
||||||
|
.' the default for both install and update';
|
||||||
|
$script .= PHP_EOL . Indent::_(2)
|
||||||
|
. '$jversion = new JVersion();';
|
||||||
|
$script .= PHP_EOL . Indent::_(2)
|
||||||
|
. "if (!\$jversion->isCompatible('3.8.0'))";
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . '{';
|
||||||
|
$script .= PHP_EOL . Indent::_(3)
|
||||||
|
. "\$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');";
|
||||||
|
$script .= PHP_EOL . Indent::_(3) . 'return false;';
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// now add the scripts
|
||||||
|
foreach ($this->{$name . 'Bucket'} as $route => $_script)
|
||||||
|
{
|
||||||
|
if (ArrayHelper::check($_script))
|
||||||
|
{
|
||||||
|
// set the if and script
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . "if ('" . $route
|
||||||
|
. "' === \$route)";
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . '{';
|
||||||
|
$script .= PHP_EOL . implode(
|
||||||
|
PHP_EOL . PHP_EOL, $_script
|
||||||
|
);
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . '}' . PHP_EOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return true
|
||||||
|
$script .= PHP_EOL . Indent::_(2) . 'return true;';
|
||||||
|
// close the function
|
||||||
|
$script .= PHP_EOL . Indent::_(1) . '}';
|
||||||
|
|
||||||
|
return $script;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -25,7 +25,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class InstallScript implements GetScriptInterface
|
final class InstallScript implements GetScriptInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The extension
|
* The extension
|
||||||
|
@ -25,7 +25,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class InstallScript implements GetScriptInterface
|
final class InstallScript implements GetScriptInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The extension
|
* The extension
|
||||||
|
@ -0,0 +1,129 @@
|
|||||||
|
<?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\Field\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\CMS\Filesystem\Folder;
|
||||||
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Core Joomla Fields
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class CoreField implements CoreFieldInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Local Core Joomla Fields
|
||||||
|
*
|
||||||
|
* @var array|null
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
protected array $fields = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Local Core Joomla Fields Path
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
protected array $paths = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
// set the path to the form validation fields
|
||||||
|
$this->paths[] = JPATH_LIBRARIES . '/src/Form/Field';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Array of Existing Validation Field Names
|
||||||
|
*
|
||||||
|
* @param bool $lowercase Switch to set fields lowercase
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function get(bool $lowercase = false): array
|
||||||
|
{
|
||||||
|
if ($this->fields === [])
|
||||||
|
{
|
||||||
|
// check if the path exist
|
||||||
|
foreach ($this->paths as $path)
|
||||||
|
{
|
||||||
|
$this->set($path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return fields if found
|
||||||
|
if ($this->fields !== [])
|
||||||
|
{
|
||||||
|
// check if the names should be all lowercase
|
||||||
|
if ($lowercase)
|
||||||
|
{
|
||||||
|
return array_map(
|
||||||
|
fn($item): string => strtolower((string) $item),
|
||||||
|
$this->fields
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return empty array
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the fields found in a path
|
||||||
|
*
|
||||||
|
* @param string $path The path to load fields from
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function set(string $path): void
|
||||||
|
{
|
||||||
|
// Check if the path exists
|
||||||
|
if (!Folder::exists($path))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load all PHP files in this path
|
||||||
|
$fields = Folder::files($path, '\.php$', true, true);
|
||||||
|
|
||||||
|
// Process the files to extract field names
|
||||||
|
$processedFields = array_map(function ($name) {
|
||||||
|
$fileName = basename($name);
|
||||||
|
|
||||||
|
// Remove 'Field.php' if it exists or just '.php' otherwise
|
||||||
|
if (substr($fileName, -9) === 'Field.php')
|
||||||
|
{
|
||||||
|
return str_replace('Field.php', '', $fileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return str_replace('.php', '', $fileName);
|
||||||
|
}
|
||||||
|
}, $fields);
|
||||||
|
|
||||||
|
// Merge with existing fields and remove duplicates
|
||||||
|
$this->fields = array_unique(array_merge($processedFields, $this->fields));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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\Field\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\CMS\Filesystem\Folder;
|
||||||
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Core Joomla Field Rules
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class CoreRule implements CoreRuleInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Local Core Joomla Rules
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
protected array $rules = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Local Core Joomla Rules Path
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 3.2.0
|
||||||
|
**/
|
||||||
|
protected string $path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
// set the path to the form validation rules
|
||||||
|
$this->path = JPATH_LIBRARIES . '/src/Form/Rule';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Array of Existing Validation Rule Names
|
||||||
|
*
|
||||||
|
* @param bool $lowercase Switch to set rules lowercase
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function get(bool $lowercase = false): array
|
||||||
|
{
|
||||||
|
if ($this->rules === [])
|
||||||
|
{
|
||||||
|
$this->set($this->path);
|
||||||
|
}
|
||||||
|
|
||||||
|
// return rules if found
|
||||||
|
if ($this->rules !== [])
|
||||||
|
{
|
||||||
|
// check if the names should be all lowercase
|
||||||
|
if ($lowercase)
|
||||||
|
{
|
||||||
|
return array_map(
|
||||||
|
fn($item): string => strtolower((string) $item),
|
||||||
|
$this->rules
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->rules;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return empty array
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the rules found in a path
|
||||||
|
*
|
||||||
|
* @param string $path The path to load rules from
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
private function set(string $path): void
|
||||||
|
{
|
||||||
|
// Check if the path exists
|
||||||
|
if (!Folder::exists($path))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load all PHP files in this path
|
||||||
|
$rules = Folder::files($path, '\.php$', true, true);
|
||||||
|
|
||||||
|
// Process the files to extract rule names
|
||||||
|
$processedRules = array_map(function ($name) {
|
||||||
|
$fileName = basename($name);
|
||||||
|
|
||||||
|
// Remove 'Rule.php' if it exists or just '.php' otherwise
|
||||||
|
if (substr($fileName, -8) === 'Rule.php')
|
||||||
|
{
|
||||||
|
return str_replace('Rule.php', '', $fileName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return str_replace('.php', '', $fileName);
|
||||||
|
}
|
||||||
|
}, $rules);
|
||||||
|
|
||||||
|
// Merge with existing rules and remove duplicates
|
||||||
|
$this->rules = array_unique(array_merge($processedRules, $this->rules));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,345 @@
|
|||||||
|
<?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\Field\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Line;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Field Input Button
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class InputButton implements InputButtonInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Config Class.
|
||||||
|
*
|
||||||
|
* @var Config
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Config $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Placeholder Class.
|
||||||
|
*
|
||||||
|
* @var Placeholder
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Placeholder $placeholder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Permission Class.
|
||||||
|
*
|
||||||
|
* @var Permission
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Permission $permission;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Config $config The Config Class.
|
||||||
|
* @param Placeholder $placeholder The Placeholder Class.
|
||||||
|
* @param Permission $permission The Permission Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config, Placeholder $placeholder,
|
||||||
|
Permission $permission)
|
||||||
|
{
|
||||||
|
$this->config = $config;
|
||||||
|
$this->placeholder = $placeholder;
|
||||||
|
$this->permission = $permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get Add Button To List Field Input (getInput tweak)
|
||||||
|
*
|
||||||
|
* @param array $fieldData The field custom data
|
||||||
|
*
|
||||||
|
* @return string of getInput class on success empty string otherwise
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function get(array $fieldData): string
|
||||||
|
{
|
||||||
|
// make sure hte view values are set
|
||||||
|
if (isset($fieldData['add_button'])
|
||||||
|
&& ($fieldData['add_button'] === 'true'
|
||||||
|
|| 1 == $fieldData['add_button'])
|
||||||
|
&& isset($fieldData['view'])
|
||||||
|
&& isset($fieldData['views'])
|
||||||
|
&& StringHelper::check($fieldData['view'])
|
||||||
|
&& StringHelper::check($fieldData['views']))
|
||||||
|
{
|
||||||
|
// set local component
|
||||||
|
$local_component = "com_" . $this->config->component_code_name;
|
||||||
|
// check that the component value is set
|
||||||
|
if (!isset($fieldData['component'])
|
||||||
|
|| !StringHelper::check(
|
||||||
|
$fieldData['component']
|
||||||
|
))
|
||||||
|
{
|
||||||
|
$fieldData['component'] = $local_component;
|
||||||
|
}
|
||||||
|
// check that the component has the com_ value in it
|
||||||
|
if (strpos((string) $fieldData['component'], 'com_') === false
|
||||||
|
|| strpos((string) $fieldData['component'], '=') !== false)
|
||||||
|
{
|
||||||
|
$fieldData['component'] = "com_" . $fieldData['component'];
|
||||||
|
}
|
||||||
|
// make sure the component is update if # # # or [ [ [ component placeholder is used
|
||||||
|
if (strpos((string) $fieldData['component'], (string) Placefix::h()) !== false
|
||||||
|
|| strpos((string) $fieldData['component'], (string) Placefix::b()) !== false) // should not be needed... but
|
||||||
|
{
|
||||||
|
$fieldData['component'] = $this->placeholder->update_(
|
||||||
|
$fieldData['component']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// get core permissions
|
||||||
|
$coreLoad = false;
|
||||||
|
// add ref tags
|
||||||
|
$refLoad = true;
|
||||||
|
// fall back on the field component
|
||||||
|
$component = $fieldData['component'];
|
||||||
|
// check if we should add ref tags (since it only works well on local views)
|
||||||
|
if ($local_component !== $component)
|
||||||
|
{
|
||||||
|
// do not add ref tags
|
||||||
|
$refLoad = false;
|
||||||
|
}
|
||||||
|
// start building the add buttons/s
|
||||||
|
$addButton = array();
|
||||||
|
$addButton[] = PHP_EOL . PHP_EOL . Indent::_(1) . "/**";
|
||||||
|
$addButton[] = Indent::_(1) . " * Override to add new button";
|
||||||
|
$addButton[] = Indent::_(1) . " *";
|
||||||
|
$addButton[] = Indent::_(1)
|
||||||
|
. " * @return string The field input markup.";
|
||||||
|
$addButton[] = Indent::_(1) . " *";
|
||||||
|
$addButton[] = Indent::_(1) . " * @since 3.2";
|
||||||
|
$addButton[] = Indent::_(1) . " */";
|
||||||
|
$addButton[] = Indent::_(1) . "protected function getInput()";
|
||||||
|
$addButton[] = Indent::_(1) . "{";
|
||||||
|
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " see if we should add buttons";
|
||||||
|
$addButton[] = Indent::_(2)
|
||||||
|
. "\$set_button = \$this->getAttribute('button');";
|
||||||
|
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get html";
|
||||||
|
$addButton[] = Indent::_(2) . "\$html = parent::getInput();";
|
||||||
|
$addButton[] = Indent::_(2) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " if true set button";
|
||||||
|
$addButton[] = Indent::_(2) . "if (\$set_button === 'true')";
|
||||||
|
$addButton[] = Indent::_(2) . "{";
|
||||||
|
$addButton[] = Indent::_(3) . "\$button = array();";
|
||||||
|
$addButton[] = Indent::_(3) . "\$script = array();";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "\$button_code_name = \$this->getAttribute('name');";
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get the input from url";
|
||||||
|
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
|
||||||
|
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get the view name & id";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "\$values = \$jinput->getArray(array(";
|
||||||
|
$addButton[] = Indent::_(4) . "'id' => 'int',";
|
||||||
|
$addButton[] = Indent::_(4) . "'view' => 'word'";
|
||||||
|
$addButton[] = Indent::_(3) . "));";
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " check if new item";
|
||||||
|
$addButton[] = Indent::_(3) . "\$ref = '';";
|
||||||
|
$addButton[] = Indent::_(3) . "\$refJ = '';";
|
||||||
|
if ($refLoad)
|
||||||
|
{
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
|
||||||
|
$addButton[] = Indent::_(3) . "{";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " only load referral if not new item.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$ref = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$refJ = '&ref=' . \$values['view'] . '&refid=' . \$values['id'];";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get the return value.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$_return = urlencode(base64_encode(\$_uri));";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " load return value.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$ref .= '&return=' . \$_return;";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$refJ .= '&return=' . \$_return;";
|
||||||
|
$addButton[] = Indent::_(3) . "}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "if (!is_null(\$values['id']) && strlen(\$values['view']))";
|
||||||
|
$addButton[] = Indent::_(3) . "{";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " only load field details if not new item.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$ref = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$refJ = '&field=' . \$values['view'] . '&field_id=' . \$values['id'];";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get the return value.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$_return = urlencode(base64_encode(\$_uri));";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " load return value.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$ref = '&return=' . \$_return;";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$refJ = '&return=' . \$_return;";
|
||||||
|
$addButton[] = Indent::_(3) . "}";
|
||||||
|
}
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get button label";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "\$button_label = trim(\$button_code_name);";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "\$button_label = preg_replace('/_+/', ' ', \$button_label);";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "\$button_label = preg_replace('/\s+/', ' ', \$button_label);";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "\$button_label = preg_replace(\"/[^A-Za-z ]/\", '', \$button_label);";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "\$button_label = ucfirst(strtolower(\$button_label));";
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " get user object";
|
||||||
|
$addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();";
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " only add if user allowed to create " . $fieldData['view'];
|
||||||
|
// check if the item has permissions.
|
||||||
|
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($fieldData['view'], 'core.create')
|
||||||
|
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||||
|
$addButton[] = Indent::_(3) . "{";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " build Create button";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$button[] = '<a id=\"'.\$button_code_name.'Create\" class=\"btn btn-small btn-success hasTooltip\" title=\"'.Text:"
|
||||||
|
. ":sprintf('" . $this->config->lang_prefix
|
||||||
|
. "_CREATE_NEW_S', \$button_label).'\" style=\"border-radius: 0px 4px 4px 0px;\"";
|
||||||
|
$addButton[] = Indent::_(5) . "href=\"index.php?option="
|
||||||
|
. $fieldData['component'] . "&view=" . $fieldData['view']
|
||||||
|
. "&layout=edit'.\$ref.'\" >";
|
||||||
|
$addButton[] = Indent::_(5)
|
||||||
|
. "<span class=\"icon-new icon-white\"></span></a>';";
|
||||||
|
$addButton[] = Indent::_(3) . "}";
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " only add if user allowed to edit " . $fieldData['view'];
|
||||||
|
// check if the item has permissions.
|
||||||
|
$addButton[] = Indent::_(3) . "if (\$user->authorise('"
|
||||||
|
. $this->permission->getGlobal($fieldData['view'], 'core.edit')
|
||||||
|
. "', '" . $component . "') && \$app->isClient('administrator')) // TODO for now only in admin area.";
|
||||||
|
$addButton[] = Indent::_(3) . "{";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " build edit button";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$button[] = '<a id=\"'.\$button_code_name.'Edit\" class=\"btn btn-small hasTooltip\" title=\"'.Text:"
|
||||||
|
. ":sprintf('" . $this->config->lang_prefix
|
||||||
|
. "_EDIT_S', \$button_label).'\" style=\"display: none; border-radius: 0px 4px 4px 0px;\" href=\"#\" >";
|
||||||
|
$addButton[] = Indent::_(5)
|
||||||
|
. "<span class=\"icon-edit\"></span></a>';";
|
||||||
|
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " build script";
|
||||||
|
$addButton[] = Indent::_(4) . "\$script[] = \"";
|
||||||
|
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
|
||||||
|
$addButton[] = Indent::_(7) . "e.preventDefault();";
|
||||||
|
$addButton[] = Indent::_(7)
|
||||||
|
. "let \".\$button_code_name.\"Value = this.value;";
|
||||||
|
$addButton[] = Indent::_(7)
|
||||||
|
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||||
|
$addButton[] = Indent::_(6) . "});";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
|
||||||
|
$addButton[] = Indent::_(5) . "});";
|
||||||
|
$addButton[] = Indent::_(5)
|
||||||
|
. "function \".\$button_code_name.\"Button(value) {";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "var createButton = document.getElementById('\".\$button_code_name.\"Create');";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "var editButton = document.getElementById('\".\$button_code_name.\"Edit');";
|
||||||
|
$addButton[] = Indent::_(6)
|
||||||
|
. "if (value > 0) {"; // TODO not ideal since value may not be an (int)
|
||||||
|
$addButton[] = Indent::_(7) . "// hide the create button";
|
||||||
|
$addButton[] = Indent::_(7)
|
||||||
|
. "createButton.style.display = 'none';";
|
||||||
|
$addButton[] = Indent::_(7) . "// show edit button";
|
||||||
|
$addButton[] = Indent::_(7)
|
||||||
|
. "editButton.style.display = 'block';";
|
||||||
|
$addButton[] = Indent::_(7) . "let url = 'index.php?option="
|
||||||
|
. $fieldData['component'] . "&view=" . $fieldData['views']
|
||||||
|
. "&task=" . $fieldData['view']
|
||||||
|
. ".edit&id='+value+'\".\$refJ.\"';"; // TODO this value may not be the ID
|
||||||
|
$addButton[] = Indent::_(7)
|
||||||
|
. "editButton.setAttribute('href', url);";
|
||||||
|
$addButton[] = Indent::_(6) . "} else {";
|
||||||
|
$addButton[] = Indent::_(7) . "// show the create button";
|
||||||
|
$addButton[] = Indent::_(7)
|
||||||
|
. "createButton.style.display = 'block';";
|
||||||
|
$addButton[] = Indent::_(7) . "// hide edit button";
|
||||||
|
$addButton[] = Indent::_(7)
|
||||||
|
. "editButton.style.display = 'none';";
|
||||||
|
$addButton[] = Indent::_(6) . "}";
|
||||||
|
$addButton[] = Indent::_(5) . "}\";";
|
||||||
|
|
||||||
|
$addButton[] = Indent::_(3) . "}";
|
||||||
|
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " check if button was created for " . $fieldData['view']
|
||||||
|
. " field.";
|
||||||
|
$addButton[] = Indent::_(3)
|
||||||
|
. "if (is_array(\$button) && count(\$button) > 0)";
|
||||||
|
$addButton[] = Indent::_(3) . "{";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " Load the needed script.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$document = Factory::getApplication()->getDocument();";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "\$document->addScriptDeclaration(implode(' ',\$script));";
|
||||||
|
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
|
||||||
|
. " return the button attached to input field.";
|
||||||
|
$addButton[] = Indent::_(4)
|
||||||
|
. "return '<div class=\"input-group\">' .\$html . implode('',\$button).'</div>';";
|
||||||
|
$addButton[] = Indent::_(3) . "}";
|
||||||
|
$addButton[] = Indent::_(2) . "}";
|
||||||
|
$addButton[] = Indent::_(2) . "return \$html;";
|
||||||
|
$addButton[] = Indent::_(1) . "}";
|
||||||
|
|
||||||
|
return implode(PHP_EOL, $addButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class CoreField implements CoreFieldInterface
|
final class CoreField implements CoreFieldInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Local Core Joomla Fields
|
* Local Core Joomla Fields
|
||||||
|
@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class CoreRule implements CoreRuleInterface
|
final class CoreRule implements CoreRuleInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Local Core Joomla Rules
|
* Local Core Joomla Rules
|
||||||
|
@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class CoreField implements CoreFieldInterface
|
final class CoreField implements CoreFieldInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Local Core Joomla Fields
|
* Local Core Joomla Fields
|
||||||
|
@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class CoreRule implements CoreRuleInterface
|
final class CoreRule implements CoreRuleInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Local Core Joomla Rules
|
* Local Core Joomla Rules
|
||||||
|
@ -1259,7 +1259,7 @@ class Interpretation extends Fields
|
|||||||
public function setUpdateXMLSQL(&$update, &$updateXML, &$addDynamicSQL)
|
public function setUpdateXMLSQL(&$update, &$updateXML, &$addDynamicSQL)
|
||||||
{
|
{
|
||||||
// ensure version naming is correct
|
// ensure version naming is correct
|
||||||
$update['version'] = preg_replace('/[^0-9\.]+/', '', (string) $update['version']);
|
$update['version'] = preg_replace('/^v/i', '', (string) $update['version']);
|
||||||
// setup SQL
|
// setup SQL
|
||||||
if (StringHelper::check($update['mysql']))
|
if (StringHelper::check($update['mysql']))
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,100 @@
|
|||||||
|
<?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\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\Registry\Registry;
|
||||||
|
use Joomla\CMS\Plugin\PluginHelper;
|
||||||
|
use VDM\Joomla\Utilities\Component\Helper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Events
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
class Event implements EventInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* event plugin trigger switch
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected $activePlugins = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param Registry|null $params The component parameters
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(?Registry $params = null)
|
||||||
|
{
|
||||||
|
// Set the params
|
||||||
|
$params = $params ?: Helper::getParams('com_componentbuilder');
|
||||||
|
// get active plugins
|
||||||
|
if (($plugins = $params->get('compiler_plugin', false))
|
||||||
|
!== false)
|
||||||
|
{
|
||||||
|
foreach ($plugins as $plugin)
|
||||||
|
{
|
||||||
|
// get possible plugins
|
||||||
|
if (PluginHelper::isEnabled('extension', $plugin))
|
||||||
|
{
|
||||||
|
// Import the appropriate plugin group.
|
||||||
|
PluginHelper::importPlugin('extension', $plugin);
|
||||||
|
// activate events
|
||||||
|
$this->activePlugins = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trigger an event
|
||||||
|
*
|
||||||
|
* @param string $event The event to trigger
|
||||||
|
* @param mixed $data The values to pass to the event/plugin
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @throws \Exception
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function trigger(string $event, $data = null)
|
||||||
|
{
|
||||||
|
// only execute if plugins were loaded (active)
|
||||||
|
if ($this->activePlugins)
|
||||||
|
{
|
||||||
|
// Get the dispatcher.
|
||||||
|
$dispatcher = \JEventDispatcher::getInstance();
|
||||||
|
|
||||||
|
// Trigger this compiler event.
|
||||||
|
$results = $dispatcher->trigger($event, $data);
|
||||||
|
|
||||||
|
// Check for errors encountered while trigger the event
|
||||||
|
if (count((array) $results) && in_array(false, $results, true))
|
||||||
|
{
|
||||||
|
// Get the last error.
|
||||||
|
$error = $dispatcher->getError();
|
||||||
|
|
||||||
|
if (!($error instanceof \Exception))
|
||||||
|
{
|
||||||
|
throw new \Exception($error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,584 @@
|
|||||||
|
<?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\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface as Event;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Language;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\Category;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\Tags;
|
||||||
|
use VDM\Joomla\Utilities\String\NamespaceHelper;
|
||||||
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build headers for all Joomla 5 files
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class Header implements HeaderInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Config Class.
|
||||||
|
*
|
||||||
|
* @var Config
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Config $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The EventInterface Class.
|
||||||
|
*
|
||||||
|
* @var Event
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Event $event;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Placeholder Class.
|
||||||
|
*
|
||||||
|
* @var Placeholder
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Placeholder $placeholder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Language Class.
|
||||||
|
*
|
||||||
|
* @var Language
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Language $language;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The UikitComp Class.
|
||||||
|
*
|
||||||
|
* @var UikitComp
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected UikitComp $uikitcomp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AdminFilterType Class.
|
||||||
|
*
|
||||||
|
* @var AdminFilterType
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected AdminFilterType $adminfiltertype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Category Class.
|
||||||
|
*
|
||||||
|
* @var Category
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Category $category;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AccessSwitchList Class.
|
||||||
|
*
|
||||||
|
* @var AccessSwitchList
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected AccessSwitchList $accessswitchlist;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Filter Class.
|
||||||
|
*
|
||||||
|
* @var Filter
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Filter $filter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Tags Class.
|
||||||
|
*
|
||||||
|
* @var Tags
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Tags $tags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Header Context array
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected array $headers = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Namespace Prefix
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected string $NamespacePrefix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Component Name (in code)
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected string $ComponentName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Component Namespace (in code)
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected string $ComponentNameSpace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Config $config The Config Class.
|
||||||
|
* @param Event $event The EventInterface Class.
|
||||||
|
* @param Placeholder $placeholder The Placeholder Class.
|
||||||
|
* @param Language $language The Language Class.
|
||||||
|
* @param UikitComp $uikitcomp The UikitComp Class.
|
||||||
|
* @param AdminFilterType $adminfiltertype The AdminFilterType Class.
|
||||||
|
* @param Category $category The Category Class.
|
||||||
|
* @param AccessSwitchList $accessswitchlist The AccessSwitchList Class.
|
||||||
|
* @param Filter $filter The Filter Class.
|
||||||
|
* @param Tags $tags The Tags Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config, Event $event, Placeholder $placeholder,
|
||||||
|
Language $language, UikitComp $uikitcomp,
|
||||||
|
AdminFilterType $adminfiltertype, Category $category,
|
||||||
|
AccessSwitchList $accessswitchlist, Filter $filter,
|
||||||
|
Tags $tags)
|
||||||
|
{
|
||||||
|
$this->config = $config;
|
||||||
|
$this->event = $event;
|
||||||
|
$this->placeholder = $placeholder;
|
||||||
|
$this->language = $language;
|
||||||
|
$this->uikitcomp = $uikitcomp;
|
||||||
|
$this->adminfiltertype = $adminfiltertype;
|
||||||
|
$this->category = $category;
|
||||||
|
$this->accessswitchlist = $accessswitchlist;
|
||||||
|
$this->filter = $filter;
|
||||||
|
$this->tags = $tags;
|
||||||
|
|
||||||
|
// set some global values
|
||||||
|
$this->NamespacePrefix = $this->config->get('namespace_prefix');
|
||||||
|
$this->ComponentName = $this->placeholder->get('Component');
|
||||||
|
$this->ComponentNameSpace = NamespaceHelper::safeSegment($this->ComponentName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the headers for a file
|
||||||
|
*
|
||||||
|
* @param string $context The name of the context
|
||||||
|
* @param string $codeName The view, views, or layout code name
|
||||||
|
*
|
||||||
|
* @return string The header string to place in the header of the file
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function get(string $context, string $codeName): string
|
||||||
|
{
|
||||||
|
// get static headers
|
||||||
|
$headers = $this->getHeaders($context);
|
||||||
|
|
||||||
|
// add to all except the helper classes
|
||||||
|
if ('admin.helper' !== $context && 'site.helper' !== $context)
|
||||||
|
{
|
||||||
|
$target = 'Administrator';
|
||||||
|
if ($this->config->get('build_target', 'admin') === 'site')
|
||||||
|
{
|
||||||
|
$target = 'Site';
|
||||||
|
}
|
||||||
|
|
||||||
|
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\{$this->ComponentName}Helper;";
|
||||||
|
|
||||||
|
// we will add more as needed
|
||||||
|
switch ($context)
|
||||||
|
{
|
||||||
|
case 'site.view.model':
|
||||||
|
case 'site.views.model':
|
||||||
|
case 'site.view.html':
|
||||||
|
case 'site.views.html':
|
||||||
|
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\RouteHelper;";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// get dynamic headers
|
||||||
|
switch ($context)
|
||||||
|
{
|
||||||
|
case 'admin.helper':
|
||||||
|
case 'site.helper':
|
||||||
|
$this->setHelperClassHeader($headers, $codeName);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.view.html':
|
||||||
|
case 'admin.views.html':
|
||||||
|
case 'custom.admin.view.html':
|
||||||
|
case 'custom.admin.views.html':
|
||||||
|
case 'site.admin.view.html':
|
||||||
|
case 'site.view.html':
|
||||||
|
case 'site.views.html':
|
||||||
|
if ((2 == $this->config->uikit || 1 == $this->config->uikit)
|
||||||
|
&& $this->uikitcomp->exists($codeName))
|
||||||
|
{
|
||||||
|
$headers[] = 'use Joomla\CMS\Filesystem\File;';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.view':
|
||||||
|
case 'custom.admin.view':
|
||||||
|
case 'custom.admin.views':
|
||||||
|
case 'site.admin.view':
|
||||||
|
$headers[] = '';
|
||||||
|
$headers[] = '/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */';
|
||||||
|
$headers[] = '$wa = $this->getDocument()->getWebAssetManager();';
|
||||||
|
$headers[] = '$wa->useScript(\'keepalive\')->useScript(\'form.validate\');';
|
||||||
|
$headers[] = 'Html::_(\'bootstrap.tooltip\');';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.view.model':
|
||||||
|
case 'site.admin.view.model':
|
||||||
|
case 'custom.admin.view.model':
|
||||||
|
case 'site.view.model':
|
||||||
|
case 'admin.views.model':
|
||||||
|
case 'site.views.model':
|
||||||
|
$headers[] = 'use Joomla\CMS\Helper\TagsHelper;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger Event: jcb_ce_setClassHeader
|
||||||
|
$this->event->trigger(
|
||||||
|
'jcb_ce_setClassHeader', [&$context, &$codeName, &$headers]
|
||||||
|
);
|
||||||
|
|
||||||
|
// return the headers
|
||||||
|
return $this->placeholder->update_(implode(PHP_EOL, $headers));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the headers for a file
|
||||||
|
*
|
||||||
|
* @param string $context The name of the context
|
||||||
|
*
|
||||||
|
* @return array The header string to place in the header of the file
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function getHeaders(string $context): array
|
||||||
|
{
|
||||||
|
if (isset($this->headers[$context]))
|
||||||
|
{
|
||||||
|
return $this->headers[$context];
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the defaults
|
||||||
|
$headers = [];
|
||||||
|
$headers[] = 'use Joomla\CMS\Factory;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Language\Text;';
|
||||||
|
|
||||||
|
switch ($context)
|
||||||
|
{
|
||||||
|
case 'admin.component':
|
||||||
|
$headers[] = 'use Joomla\CMS\Access\Exception\NotAllowed;';
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.helper':
|
||||||
|
case 'site.helper':
|
||||||
|
$headers[] = 'use Joomla\CMS\Access\Access;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Access\Rules as AccessRules;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Filesystem\File;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Language\Language;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Object\CMSObject;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Session\Session;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Table\Table;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Uri\Uri;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Version;';
|
||||||
|
$headers[] = 'use Joomla\Database\DatabaseInterface;';
|
||||||
|
$headers[] = 'use Joomla\Registry\Registry;';
|
||||||
|
$headers[] = 'use Joomla\String\StringHelper;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.layout':
|
||||||
|
case 'site.layout':
|
||||||
|
case 'custom.admin.layout':
|
||||||
|
case 'override.layout':
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.view':
|
||||||
|
case 'custom.admin.view':
|
||||||
|
case 'custom.admin.views':
|
||||||
|
case 'site.admin.view':
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.view.controller':
|
||||||
|
$headers[] = 'use Joomla\CMS\Form\FormFactoryInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Application\CMSApplication;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
|
||||||
|
$headers[] = 'use Joomla\Input\Input;';
|
||||||
|
case 'site.admin.view.controller':
|
||||||
|
$headers[] = 'use Joomla\CMS\Versioning\VersionableControllerTrait;';
|
||||||
|
case 'site.view.controller':
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Controller\FormController;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Session\Session;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Uri\Uri;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.view.html':
|
||||||
|
case 'admin.views.html':
|
||||||
|
case 'site.admin.view.html':
|
||||||
|
$headers[] = 'use Joomla\CMS\Toolbar\Toolbar;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Form\FormHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Session\Session;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Uri\Uri;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\FileLayout;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Document\Document;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'site.view.html':
|
||||||
|
case 'site.views.html':
|
||||||
|
$headers[] = 'use Joomla\CMS\Toolbar\Toolbar;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\FileLayout;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Document\Document;';
|
||||||
|
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\Site\\Helper\\HeaderCheck;";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'custom.admin.view.html':
|
||||||
|
case 'custom.admin.views.html':
|
||||||
|
$target = 'Administrator';
|
||||||
|
if ($this->config->get('build_target', 'admin') === 'site')
|
||||||
|
{
|
||||||
|
$target = 'Site';
|
||||||
|
}
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\FileLayout;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Document\Document;';
|
||||||
|
$headers[] = "use {$this->NamespacePrefix}\\Component\\{$this->ComponentNameSpace}\\{$target}\\Helper\\HeaderCheck;";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.view.model':
|
||||||
|
case 'site.admin.view.model':
|
||||||
|
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Form\Form;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Filter\InputFilter;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Filter\OutputFilter;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Model\AdminModel;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Table\Table;';
|
||||||
|
$headers[] = 'use Joomla\CMS\UCM\UCMType;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Versioning\VersionableModelTrait;';
|
||||||
|
$headers[] = 'use Joomla\CMS\User\User;';
|
||||||
|
$headers[] = 'use Joomla\Registry\Registry;';
|
||||||
|
$headers[] = 'use Joomla\String\StringHelper;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
$headers[] = 'use Joomla\Input\Input;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.views':
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'admin.views.controller':
|
||||||
|
case 'custom.admin.views.controller':
|
||||||
|
case 'dashboard.controller':
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Controller\AdminController;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Session\Session;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'ajax.admin.model':
|
||||||
|
case 'ajax.site.model':
|
||||||
|
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Model\ListModel;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\User\User;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
$headers[] = 'use Joomla\Input\Input;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Session\Session;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Uri\Uri;';
|
||||||
|
$headers[] = 'use Joomla\Registry\Registry;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'dashboard.model':
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Session\Session;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Uri\Uri;';
|
||||||
|
case 'admin.views.model':
|
||||||
|
case 'custom.admin.views.model':
|
||||||
|
case 'site.views.model':
|
||||||
|
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Model\ListModel;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
$headers[] = 'use Joomla\CMS\User\User;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
$headers[] = 'use Joomla\Input\Input;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'custom.admin.view.controller':
|
||||||
|
case 'import.controller':
|
||||||
|
case 'import.custom.controller':
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Controller\BaseController;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Session\Session;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'custom.admin.view.model':
|
||||||
|
case 'site.view.model':
|
||||||
|
$headers[] = 'use Joomla\CMS\Application\CMSApplicationInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Model\ItemModel;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Factory\MVCFactoryInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Plugin\PluginHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Uri\Uri;';
|
||||||
|
$headers[] = 'use Joomla\CMS\User\User;';
|
||||||
|
$headers[] = 'use Joomla\Input\Input;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 'import.custom.model':
|
||||||
|
case 'import.model':
|
||||||
|
$headers[] = 'use Joomla\CMS\Filesystem\File;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Filesystem\Folder;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Filesystem\Path;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Filter\OutputFilter;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Installer\InstallerHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\Model\BaseDatabaseModel;';
|
||||||
|
$headers[] = 'use Joomla\String\StringHelper;';
|
||||||
|
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
|
||||||
|
$headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'dashboard.view':
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'dashboard.view.html':
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Toolbar\ToolbarHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Document\Document;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'site.router':
|
||||||
|
$headers[] = 'use Joomla\CMS\Application\SiteApplication;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Categories\CategoryFactoryInterface;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\Router\RouterView;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\Router\RouterViewConfiguration;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\Router\Rules\MenuRules;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\Router\Rules\NomenuRules;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\Router\Rules\StandardRules;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Menu\AbstractMenu;';
|
||||||
|
$headers[] = 'use Joomla\Database\DatabaseInterface;';
|
||||||
|
$headers[] = 'use Joomla\Database\ParameterType;';
|
||||||
|
$headers[] = 'use Joomla\Registry\Registry;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'site.view':
|
||||||
|
case 'site.views':
|
||||||
|
$headers[] = 'use Joomla\CMS\Router\Route;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Layout\LayoutHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'form.custom.field':
|
||||||
|
$headers[] = 'use Joomla\CMS\HTML\HTMLHelper as Html;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Component\ComponentHelper;';
|
||||||
|
$headers[] = 'use Joomla\CMS\Form\Field\###FORM_EXTENDS###;';
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->headers[$context] = $headers;
|
||||||
|
|
||||||
|
return $headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set Helper Dynamic Headers
|
||||||
|
*
|
||||||
|
* @param array $headers The headers array
|
||||||
|
* @param string $target_client
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function setHelperClassHeader(&$headers, $target_client)
|
||||||
|
{
|
||||||
|
// add only to admin client
|
||||||
|
if ('admin' === $target_client && $this->config->get('add_eximport', false))
|
||||||
|
{
|
||||||
|
$headers[] = 'use PhpOffice\PhpSpreadsheet\IOFactory;';
|
||||||
|
$headers[] = 'use PhpOffice\PhpSpreadsheet\Spreadsheet;';
|
||||||
|
$headers[] = 'use PhpOffice\PhpSpreadsheet\Writer\Xlsx;';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,211 @@
|
|||||||
|
<?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\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler;
|
||||||
|
use VDM\Joomla\Utilities\JsonHelper;
|
||||||
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler History
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class History implements HistoryInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* History Item Object
|
||||||
|
*
|
||||||
|
* @var object|null
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected ?object $tmp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compiler Config
|
||||||
|
*
|
||||||
|
* @var Config
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Config $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database object to query local DB
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected $db;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param Config|null $config The compiler config object.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(?Config $config = null)
|
||||||
|
{
|
||||||
|
$this->config = $config ?: Compiler::_('Config');
|
||||||
|
$this->db = Factory::getDbo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Item History object
|
||||||
|
*
|
||||||
|
* @param string $type The type of item
|
||||||
|
* @param int $id The item ID
|
||||||
|
*
|
||||||
|
* @return ?object The history
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function get(string $type, int $id): ?object
|
||||||
|
{
|
||||||
|
// quick class object to store old history object
|
||||||
|
$this->tmp = null;
|
||||||
|
// Create a new query object.
|
||||||
|
$query = $this->db->getQuery(true);
|
||||||
|
|
||||||
|
$query->select('h.*');
|
||||||
|
$query->from('#__history AS h');
|
||||||
|
$query->where(
|
||||||
|
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
|
||||||
|
);
|
||||||
|
$query->order('h.save_date DESC');
|
||||||
|
$this->db->setQuery($query, 0, 1);
|
||||||
|
$this->db->execute();
|
||||||
|
if ($this->db->getNumRows())
|
||||||
|
{
|
||||||
|
// new version of this item found
|
||||||
|
// so we need to mark it as the last compiled version
|
||||||
|
$newActive = $this->db->loadObject();
|
||||||
|
// set the new version watch
|
||||||
|
$this->set($newActive, 1);
|
||||||
|
}
|
||||||
|
// Get last compiled verion
|
||||||
|
$query = $this->db->getQuery(true);
|
||||||
|
|
||||||
|
$query->select('h.*');
|
||||||
|
$query->from('#__history AS h');
|
||||||
|
$query->where(
|
||||||
|
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
|
||||||
|
);
|
||||||
|
$query->where('h.keep_forever = 1');
|
||||||
|
$query->where('h.version_note LIKE ' . $this->db->quote('%component%'));
|
||||||
|
// make sure it does not return the active version
|
||||||
|
if (isset($newActive) && isset($newActive->version_id))
|
||||||
|
{
|
||||||
|
$query->where('h.version_id != ' . (int) $newActive->version_id);
|
||||||
|
}
|
||||||
|
$query->order('h.save_date DESC');
|
||||||
|
$this->db->setQuery($query);
|
||||||
|
$this->db->execute();
|
||||||
|
if ($this->db->getNumRows())
|
||||||
|
{
|
||||||
|
// the old active version was found
|
||||||
|
// so we may need to do an SQL update
|
||||||
|
// and unmark the old compiled version
|
||||||
|
$oldActives = $this->db->loadObjectList();
|
||||||
|
foreach ($oldActives as $oldActive)
|
||||||
|
{
|
||||||
|
// remove old version watch
|
||||||
|
$this->set($oldActive, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// return the last used history record or null.
|
||||||
|
return $this->tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Item History Watch
|
||||||
|
*
|
||||||
|
* @param Object $object The history object
|
||||||
|
* @param int $action The action to take
|
||||||
|
* 0 = remove watch
|
||||||
|
* 1 = add watch
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected function set(object $object, int $action): bool
|
||||||
|
{
|
||||||
|
// check the note
|
||||||
|
if (JsonHelper::check($object->version_note))
|
||||||
|
{
|
||||||
|
$version_note = json_decode((string) $object->version_note, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$version_note = array('component' => []);
|
||||||
|
}
|
||||||
|
// set watch
|
||||||
|
switch ($action)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
// remove watch
|
||||||
|
if (isset($version_note['component'])
|
||||||
|
&& ($key = array_search(
|
||||||
|
$this->config->component_id, $version_note['component']
|
||||||
|
)) !== false)
|
||||||
|
{
|
||||||
|
// last version that was used to build/compile
|
||||||
|
$this->tmp = json_decode((string) $object->version_data);
|
||||||
|
// remove it from this component
|
||||||
|
unset($version_note['component'][$key]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// since it was not found, no need to update anything
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// add watch
|
||||||
|
if (!in_array($this->config->component_id, $version_note['component']))
|
||||||
|
{
|
||||||
|
$version_note['component'][] = $this->config->component_id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// since it is there already, no need to update anything
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// check if we need to still keep this locked
|
||||||
|
if (isset($version_note['component'])
|
||||||
|
&& ArrayHelper::check($version_note['component']))
|
||||||
|
{
|
||||||
|
// insure component ids are only added once per item
|
||||||
|
$version_note['component'] = array_unique(
|
||||||
|
$version_note['component']
|
||||||
|
);
|
||||||
|
// we may change this, little risky (but since JCB does not have history notes it should be okay for now)
|
||||||
|
$object->version_note = json_encode($version_note);
|
||||||
|
$object->keep_forever = '1';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$object->version_note = '';
|
||||||
|
$object->keep_forever = '0';
|
||||||
|
}
|
||||||
|
|
||||||
|
// run the update
|
||||||
|
return $this->db->updateObject('#__history', $object, 'version_id');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -23,7 +23,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class Event implements EventInterface
|
final class Event implements EventInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* event plugin trigger switch
|
* event plugin trigger switch
|
||||||
@ -63,7 +63,7 @@ class Event implements EventInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger and event
|
* Trigger an event
|
||||||
*
|
*
|
||||||
* @param string $event The event to trigger
|
* @param string $event The event to trigger
|
||||||
* @param mixed $data The values to pass to the event/plugin
|
* @param mixed $data The values to pass to the event/plugin
|
||||||
|
@ -25,7 +25,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class History implements HistoryInterface
|
final class History implements HistoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* History Item Object
|
* History Item Object
|
||||||
@ -80,18 +80,9 @@ class History implements HistoryInterface
|
|||||||
$query = $this->db->getQuery(true);
|
$query = $this->db->getQuery(true);
|
||||||
|
|
||||||
$query->select('h.*');
|
$query->select('h.*');
|
||||||
$query->from('#__ucm_history AS h');
|
$query->from('#__history AS h');
|
||||||
$query->where(
|
$query->where(
|
||||||
$this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id
|
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
|
||||||
);
|
|
||||||
// Join over the content type for the type id
|
|
||||||
$query->join(
|
|
||||||
'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'
|
|
||||||
);
|
|
||||||
$query->where(
|
|
||||||
'ct.type_alias = ' . $this->db->quote(
|
|
||||||
'com_componentbuilder.' . $type
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
$query->order('h.save_date DESC');
|
$query->order('h.save_date DESC');
|
||||||
$this->db->setQuery($query, 0, 1);
|
$this->db->setQuery($query, 0, 1);
|
||||||
@ -108,9 +99,9 @@ class History implements HistoryInterface
|
|||||||
$query = $this->db->getQuery(true);
|
$query = $this->db->getQuery(true);
|
||||||
|
|
||||||
$query->select('h.*');
|
$query->select('h.*');
|
||||||
$query->from('#__ucm_history AS h');
|
$query->from('#__history AS h');
|
||||||
$query->where(
|
$query->where(
|
||||||
$this->db->quoteName('h.ucm_item_id') . ' = ' . (int) $id
|
$this->db->quoteName('h.item_id') . ' = ' . $this->db->quote('com_componentbuilder.' . $type . '.' . (int) $id)
|
||||||
);
|
);
|
||||||
$query->where('h.keep_forever = 1');
|
$query->where('h.keep_forever = 1');
|
||||||
$query->where('h.version_note LIKE ' . $this->db->quote('%component%'));
|
$query->where('h.version_note LIKE ' . $this->db->quote('%component%'));
|
||||||
@ -119,15 +110,6 @@ class History implements HistoryInterface
|
|||||||
{
|
{
|
||||||
$query->where('h.version_id != ' . (int) $newActive->version_id);
|
$query->where('h.version_id != ' . (int) $newActive->version_id);
|
||||||
}
|
}
|
||||||
// Join over the content type for the type id
|
|
||||||
$query->join(
|
|
||||||
'LEFT', '#__content_types AS ct ON ct.type_id = h.ucm_type_id'
|
|
||||||
);
|
|
||||||
$query->where(
|
|
||||||
'ct.type_alias = ' . $this->db->quote(
|
|
||||||
'com_componentbuilder.' . $type
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$query->order('h.save_date DESC');
|
$query->order('h.save_date DESC');
|
||||||
$this->db->setQuery($query);
|
$this->db->setQuery($query);
|
||||||
$this->db->execute();
|
$this->db->execute();
|
||||||
@ -223,8 +205,7 @@ class History implements HistoryInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
// run the update
|
// run the update
|
||||||
return $this->db->updateObject('#__ucm_history', $object, 'version_id');
|
return $this->db->updateObject('#__history', $object, 'version_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class Event implements EventInterface
|
final class Event implements EventInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* event plugin trigger switch
|
* event plugin trigger switch
|
||||||
@ -62,7 +62,7 @@ class Event implements EventInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger and event
|
* Trigger an event
|
||||||
*
|
*
|
||||||
* @param string $event The event to trigger
|
* @param string $event The event to trigger
|
||||||
* @param mixed $data The values to pass to the event/plugin
|
* @param mixed $data The values to pass to the event/plugin
|
||||||
|
@ -25,7 +25,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
|
|||||||
*
|
*
|
||||||
* @since 3.2.0
|
* @since 3.2.0
|
||||||
*/
|
*/
|
||||||
class History implements HistoryInterface
|
final class History implements HistoryInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* History Item Object
|
* History Item Object
|
||||||
|
@ -142,7 +142,7 @@ class Historycomponent
|
|||||||
if ($old_component && ObjectHelper::check($old_component))
|
if ($old_component && ObjectHelper::check($old_component))
|
||||||
{
|
{
|
||||||
$old_component_version = preg_replace(
|
$old_component_version = preg_replace(
|
||||||
'/[^0-9.]+/', '', (string) $old_component->component_version
|
'/^v/i', '', (string) $old_component->component_version
|
||||||
);
|
);
|
||||||
if ($old_component_version != $this->config->component_version)
|
if ($old_component_version != $this->config->component_version)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,240 @@
|
|||||||
|
<?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\Model\JoomlaFive;
|
||||||
|
|
||||||
|
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Config;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs as BuilderCustomTabs;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Language;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Placeholder;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Customcode;
|
||||||
|
use VDM\Joomla\Utilities\JsonHelper;
|
||||||
|
use VDM\Joomla\Utilities\ArrayHelper;
|
||||||
|
use VDM\Joomla\Utilities\StringHelper;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Utilities\Indent;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Model Custom Tabs Class
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
final class Customtabs implements CustomtabsInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The Config Class.
|
||||||
|
*
|
||||||
|
* @var Config
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Config $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The CustomTabs Class.
|
||||||
|
*
|
||||||
|
* @var BuilderCustomTabs
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected BuilderCustomTabs $buildercustomtabs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Language Class.
|
||||||
|
*
|
||||||
|
* @var Language
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Language $language;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Placeholder Class.
|
||||||
|
*
|
||||||
|
* @var Placeholder
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Placeholder $placeholder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Customcode Class.
|
||||||
|
*
|
||||||
|
* @var Customcode
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
protected Customcode $customcode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param Config $config The Config Class.
|
||||||
|
* @param BuilderCustomTabs $buildercustomtabs The CustomTabs Class.
|
||||||
|
* @param Language $language The Language Class.
|
||||||
|
* @param Placeholder $placeholder The Placeholder Class.
|
||||||
|
* @param Customcode $customcode The Customcode Class.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function __construct(Config $config, BuilderCustomTabs $buildercustomtabs, Language $language, Placeholder $placeholder, Customcode $customcode)
|
||||||
|
{
|
||||||
|
$this->config = $config;
|
||||||
|
$this->buildercustomtabs = $buildercustomtabs;
|
||||||
|
$this->language = $language;
|
||||||
|
$this->placeholder = $placeholder;
|
||||||
|
$this->customcode = $customcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set custom tabs
|
||||||
|
*
|
||||||
|
* @param object $item The view data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function set(object &$item)
|
||||||
|
{
|
||||||
|
$item->customtabs = (isset($item->customtabs)
|
||||||
|
&& JsonHelper::check($item->customtabs))
|
||||||
|
? json_decode((string) $item->customtabs, true) : null;
|
||||||
|
|
||||||
|
if (ArrayHelper::check($item->customtabs))
|
||||||
|
{
|
||||||
|
// get the name
|
||||||
|
$name = $item->name_single_code;
|
||||||
|
|
||||||
|
// setup custom tabs to global data sets
|
||||||
|
$this->buildercustomtabs->set($name,
|
||||||
|
array_map(
|
||||||
|
function ($tab) use (&$name) {
|
||||||
|
|
||||||
|
// set the view name
|
||||||
|
$tab['view'] = $name;
|
||||||
|
|
||||||
|
// load the dynamic data
|
||||||
|
$tab['html'] = $this->placeholder->update_(
|
||||||
|
$this->customcode->update($tab['html'])
|
||||||
|
);
|
||||||
|
|
||||||
|
// set the tab name
|
||||||
|
$tab['name'] = (isset($tab['name'])
|
||||||
|
&& StringHelper::check(
|
||||||
|
$tab['name']
|
||||||
|
)) ? $tab['name'] : 'Tab';
|
||||||
|
|
||||||
|
// set lang
|
||||||
|
$tab['lang'] = $this->config->lang_prefix . '_'
|
||||||
|
. StringHelper::safe(
|
||||||
|
$tab['view'], 'U'
|
||||||
|
) . '_' . StringHelper::safe(
|
||||||
|
$tab['name'], 'U'
|
||||||
|
);
|
||||||
|
$this->language->set(
|
||||||
|
'both', $tab['lang'], $tab['name']
|
||||||
|
);
|
||||||
|
|
||||||
|
// set code name
|
||||||
|
$tab['code'] = StringHelper::safe(
|
||||||
|
$tab['name']
|
||||||
|
);
|
||||||
|
|
||||||
|
// check if the permissions for the tab should be added
|
||||||
|
$_tab = '';
|
||||||
|
if (isset($tab['permission'])
|
||||||
|
&& $tab['permission'] == 1)
|
||||||
|
{
|
||||||
|
$_tab = Indent::_(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if the php of the tab is set, if not load it now
|
||||||
|
if (strpos((string) $tab['html'], 'uitab.addTab') === false
|
||||||
|
&& strpos((string) $tab['html'], 'uitab.endTab')
|
||||||
|
=== false)
|
||||||
|
{
|
||||||
|
// add the tab
|
||||||
|
$tmp = PHP_EOL . $_tab . Indent::_(1)
|
||||||
|
. "<?php echo Html::_('uitab.addTab', '"
|
||||||
|
. $tab['view'] . "Tab', '" . $tab['code']
|
||||||
|
. "', JT" . "ext::_('" . $tab['lang']
|
||||||
|
. "', true)); ?>";
|
||||||
|
$tmp .= PHP_EOL . $_tab . Indent::_(2)
|
||||||
|
. '<div class="row">';
|
||||||
|
$tmp .= PHP_EOL . $_tab . Indent::_(3)
|
||||||
|
. '<div class="col-md-12">';
|
||||||
|
$tmp .= PHP_EOL . $_tab . Indent::_(4) . implode(
|
||||||
|
PHP_EOL . $_tab . Indent::_(4),
|
||||||
|
(array) explode(PHP_EOL, trim((string) $tab['html']))
|
||||||
|
);
|
||||||
|
$tmp .= PHP_EOL . $_tab . Indent::_(3) . '</div>';
|
||||||
|
$tmp .= PHP_EOL . $_tab . Indent::_(2) . '</div>';
|
||||||
|
$tmp .= PHP_EOL . $_tab . Indent::_(1)
|
||||||
|
. "<?php echo Html::_('uitab.endTab'); ?>";
|
||||||
|
|
||||||
|
// update html
|
||||||
|
$tab['html'] = $tmp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tab['html'] = PHP_EOL . $_tab . Indent::_(1)
|
||||||
|
. implode(
|
||||||
|
PHP_EOL . $_tab . Indent::_(1),
|
||||||
|
(array) explode(PHP_EOL, trim((string) $tab['html']))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// add the permissions if needed
|
||||||
|
if (isset($tab['permission'])
|
||||||
|
&& $tab['permission'] == 1)
|
||||||
|
{
|
||||||
|
$tmp = PHP_EOL . Indent::_(1)
|
||||||
|
. "<?php if (\$this->canDo->get('"
|
||||||
|
. $tab['view'] . "." . $tab['code']
|
||||||
|
. ".viewtab')) : ?>";
|
||||||
|
$tmp .= $tab['html'];
|
||||||
|
$tmp .= PHP_EOL . Indent::_(1) . "<?php endif; ?>";
|
||||||
|
// update html
|
||||||
|
$tab['html'] = $tmp;
|
||||||
|
// set lang for permissions
|
||||||
|
$tab['lang_permission'] = $tab['lang']
|
||||||
|
. '_TAB_PERMISSION';
|
||||||
|
$tab['lang_permission_desc'] = $tab['lang']
|
||||||
|
. '_TAB_PERMISSION_DESC';
|
||||||
|
$tab['lang_permission_title']
|
||||||
|
= $this->placeholder->get('Views') . ' View '
|
||||||
|
. $tab['name'] . ' Tab';
|
||||||
|
$this->language->set(
|
||||||
|
'both', $tab['lang_permission'],
|
||||||
|
$tab['lang_permission_title']
|
||||||
|
);
|
||||||
|
$this->language->set(
|
||||||
|
'both', $tab['lang_permission_desc'],
|
||||||
|
'Allow the users in this group to view '
|
||||||
|
. $tab['name'] . ' Tab of '
|
||||||
|
. $this->placeholder->get('views')
|
||||||
|
);
|
||||||
|
// set the sort key
|
||||||
|
$tab['sortKey']
|
||||||
|
= StringHelper::safe(
|
||||||
|
$tab['lang_permission_title']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// return tab
|
||||||
|
return $tab;
|
||||||
|
|
||||||
|
}, array_values($item->customtabs)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
unset($item->customtabs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -15,9 +15,11 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service;
|
|||||||
use Joomla\DI\Container;
|
use Joomla\DI\Container;
|
||||||
use Joomla\DI\ServiceProviderInterface;
|
use Joomla\DI\ServiceProviderInterface;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller\AllowAdd as J5ControllerAllowAdd;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowAdd as J4ControllerAllowAdd;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowAdd as J4ControllerAllowAdd;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowAdd as J3ControllerAllowAdd;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowAdd as J3ControllerAllowAdd;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller\AllowEdit as J5ControllerAllowEdit;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowEdit as J4ControllerAllowEdit;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowEdit as J4ControllerAllowEdit;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowEdit as J3ControllerAllowEdit;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowEdit as J3ControllerAllowEdit;
|
||||||
|
|
||||||
@ -50,6 +52,9 @@ class ArchitectureController implements ServiceProviderInterface
|
|||||||
$container->alias(AllowAddInterface::class, 'Architecture.Controller.AllowAdd')
|
$container->alias(AllowAddInterface::class, 'Architecture.Controller.AllowAdd')
|
||||||
->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true);
|
->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true);
|
||||||
|
|
||||||
|
$container->alias(J5ControllerAllowAdd::class, 'Architecture.Controller.J5.AllowAdd')
|
||||||
|
->share('Architecture.Controller.J5.AllowAdd', [$this, 'getJ5ControllerAllowAdd'], true);
|
||||||
|
|
||||||
$container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd')
|
$container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd')
|
||||||
->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true);
|
->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true);
|
||||||
|
|
||||||
@ -59,6 +64,9 @@ class ArchitectureController implements ServiceProviderInterface
|
|||||||
$container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit')
|
$container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit')
|
||||||
->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true);
|
->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true);
|
||||||
|
|
||||||
|
$container->alias(J5ControllerAllowEdit::class, 'Architecture.Controller.J5.AllowEdit')
|
||||||
|
->share('Architecture.Controller.J5.AllowEdit', [$this, 'getJ5ControllerAllowEdit'], true);
|
||||||
|
|
||||||
$container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit')
|
$container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit')
|
||||||
->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true);
|
->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true);
|
||||||
|
|
||||||
@ -84,6 +92,23 @@ class ArchitectureController implements ServiceProviderInterface
|
|||||||
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd');
|
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The AllowAdd Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5ControllerAllowAdd
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5ControllerAllowAdd(Container $container): J5ControllerAllowAdd
|
||||||
|
{
|
||||||
|
return new J5ControllerAllowAdd(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Compiler.Creator.Permission'),
|
||||||
|
$container->get('Customcode.Dispenser')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The AllowAdd Class.
|
* Get The AllowAdd Class.
|
||||||
*
|
*
|
||||||
@ -136,6 +161,25 @@ class ArchitectureController implements ServiceProviderInterface
|
|||||||
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit');
|
return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The AllowEdit Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5ControllerAllowEdit
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5ControllerAllowEdit(Container $container): J5ControllerAllowEdit
|
||||||
|
{
|
||||||
|
return new J5ControllerAllowEdit(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Compiler.Creator.Permission'),
|
||||||
|
$container->get('Customcode.Dispenser'),
|
||||||
|
$container->get('Compiler.Builder.Category'),
|
||||||
|
$container->get('Compiler.Builder.Category.Other.Name')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The AllowEdit Class.
|
* Get The AllowEdit Class.
|
||||||
*
|
*
|
||||||
|
@ -15,9 +15,11 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service;
|
|||||||
use Joomla\DI\Container;
|
use Joomla\DI\Container;
|
||||||
use Joomla\DI\ServiceProviderInterface;
|
use Joomla\DI\ServiceProviderInterface;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model\CanDelete as J5ModelCanDelete;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanDelete as J4ModelCanDelete;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanDelete as J4ModelCanDelete;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanDelete as J3ModelCanDelete;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanDelete as J3ModelCanDelete;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model\CanEditState as J5ModelCanEditState;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanEditState as J4ModelCanEditState;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanEditState as J4ModelCanEditState;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanEditState as J3ModelCanEditState;
|
use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanEditState as J3ModelCanEditState;
|
||||||
|
|
||||||
@ -53,6 +55,9 @@ class ArchitectureModel implements ServiceProviderInterface
|
|||||||
$container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete')
|
$container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete')
|
||||||
->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true);
|
->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true);
|
||||||
|
|
||||||
|
$container->alias(J5ModelCanDelete::class, 'Architecture.Model.J5.CanDelete')
|
||||||
|
->share('Architecture.Model.J5.CanDelete', [$this, 'getJ5ModelCanDelete'], true);
|
||||||
|
|
||||||
$container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete')
|
$container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete')
|
||||||
->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true);
|
->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true);
|
||||||
|
|
||||||
@ -62,6 +67,9 @@ class ArchitectureModel implements ServiceProviderInterface
|
|||||||
$container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState')
|
$container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState')
|
||||||
->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true);
|
->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true);
|
||||||
|
|
||||||
|
$container->alias(J5ModelCanEditState::class, 'Architecture.Model.J5.CanEditState')
|
||||||
|
->share('Architecture.Model.J5.CanEditState', [$this, 'getJ5ModelCanEditState'], true);
|
||||||
|
|
||||||
$container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState')
|
$container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState')
|
||||||
->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true);
|
->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true);
|
||||||
}
|
}
|
||||||
@ -84,6 +92,22 @@ class ArchitectureModel implements ServiceProviderInterface
|
|||||||
return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete');
|
return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Model CanDelete Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5ModelCanDelete
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5ModelCanDelete(Container $container): J5ModelCanDelete
|
||||||
|
{
|
||||||
|
return new J5ModelCanDelete(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Compiler.Creator.Permission')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The Model CanDelete Class.
|
* Get The Model CanDelete Class.
|
||||||
*
|
*
|
||||||
@ -134,6 +158,22 @@ class ArchitectureModel implements ServiceProviderInterface
|
|||||||
return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState');
|
return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Model Can Edit State Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5ModelCanEditState
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5ModelCanEditState(Container $container): J5ModelCanEditState
|
||||||
|
{
|
||||||
|
return new J5ModelCanEditState(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Compiler.Creator.Permission')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The Model Can Edit State Class.
|
* Get The Model Can Edit State Class.
|
||||||
*
|
*
|
||||||
|
@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Component as CompilerComponent;
|
use VDM\Joomla\Componentbuilder\Compiler\Component as CompilerComponent;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree\Settings as J3Settings;
|
use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree\Settings as J3Settings;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour\Settings as J4Settings;
|
use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour\Settings as J4Settings;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFive\Settings as J5Settings;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Component\Dashboard;
|
use VDM\Joomla\Componentbuilder\Compiler\Component\Dashboard;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder;
|
use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Component\Data;
|
use VDM\Joomla\Componentbuilder\Compiler\Component\Data;
|
||||||
@ -60,6 +61,9 @@ class Component implements ServiceProviderInterface
|
|||||||
$container->alias(J4Settings::class, 'Component.J4.Settings')
|
$container->alias(J4Settings::class, 'Component.J4.Settings')
|
||||||
->share('Component.J4.Settings', [$this, 'getJ4Settings'], true);
|
->share('Component.J4.Settings', [$this, 'getJ4Settings'], true);
|
||||||
|
|
||||||
|
$container->alias(J5Settings::class, 'Component.J5.Settings')
|
||||||
|
->share('Component.J5.Settings', [$this, 'getJ5Settings'], true);
|
||||||
|
|
||||||
$container->alias(Dashboard::class, 'Component.Dashboard')
|
$container->alias(Dashboard::class, 'Component.Dashboard')
|
||||||
->share('Component.Dashboard', [$this, 'getDashboard'], true);
|
->share('Component.Dashboard', [$this, 'getDashboard'], true);
|
||||||
|
|
||||||
@ -141,6 +145,28 @@ class Component implements ServiceProviderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Settings Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5Settings
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5Settings(Container $container): J5Settings
|
||||||
|
{
|
||||||
|
return new J5Settings(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Registry'),
|
||||||
|
$container->get('Event'),
|
||||||
|
$container->get('Placeholder'),
|
||||||
|
$container->get('Component'),
|
||||||
|
$container->get('Utilities.Paths'),
|
||||||
|
$container->get('Utilities.Dynamicpath'),
|
||||||
|
$container->get('Utilities.Pathfix')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The Dashboard Class.
|
* Get The Dashboard Class.
|
||||||
*
|
*
|
||||||
|
@ -18,6 +18,7 @@ use Joomla\CMS\Version;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event;
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Event as J4Event;
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Event as J4Event;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\Event as J5Event;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,6 +52,9 @@ class Event implements ServiceProviderInterface
|
|||||||
$container->alias(J4Event::class, 'J4.Event')
|
$container->alias(J4Event::class, 'J4.Event')
|
||||||
->share('J4.Event', [$this, 'getJ4Event'], true);
|
->share('J4.Event', [$this, 'getJ4Event'], true);
|
||||||
|
|
||||||
|
$container->alias(J5Event::class, 'J5.Event')
|
||||||
|
->share('J5.Event', [$this, 'getJ5Event'], true);
|
||||||
|
|
||||||
$container->alias(EventInterface::class, 'Event')
|
$container->alias(EventInterface::class, 'Event')
|
||||||
->share('Event', [$this, 'getEvent'], true);
|
->share('Event', [$this, 'getEvent'], true);
|
||||||
}
|
}
|
||||||
@ -98,5 +102,18 @@ class Event implements ServiceProviderInterface
|
|||||||
{
|
{
|
||||||
return new J4Event();
|
return new J4Event();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Joomla 5 Event
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5Event
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5Event(Container $container): J5Event
|
||||||
|
{
|
||||||
|
return new J5Event();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as J3InstallScript;
|
use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as J3InstallScript;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour\InstallScript as J4InstallScript;
|
use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour\InstallScript as J4InstallScript;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFive\InstallScript as J5InstallScript;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,6 +53,9 @@ class Extension implements ServiceProviderInterface
|
|||||||
|
|
||||||
$container->alias(J4InstallScript::class, 'J4.Extension.InstallScript')
|
$container->alias(J4InstallScript::class, 'J4.Extension.InstallScript')
|
||||||
->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true);
|
->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true);
|
||||||
|
|
||||||
|
$container->alias(J5InstallScript::class, 'J5.Extension.InstallScript')
|
||||||
|
->share('J5.Extension.InstallScript', [$this, 'getJ5ExtensionInstallScript'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,6 +84,19 @@ class Extension implements ServiceProviderInterface
|
|||||||
return new J4InstallScript();
|
return new J4InstallScript();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Joomla 5 Extension Install Script
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5InstallScript
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5ExtensionInstallScript(Container $container): J5InstallScript
|
||||||
|
{
|
||||||
|
return new J5InstallScript();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the Joomla Extension Install Script
|
* Get the Joomla Extension Install Script
|
||||||
*
|
*
|
||||||
|
@ -27,10 +27,13 @@ use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName;
|
use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreRule as J3CoreRule;
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreRule as J3CoreRule;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreRule as J4CoreRule;
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreRule as J4CoreRule;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\CoreRule as J5CoreRule;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreField as J3CoreField;
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreField as J3CoreField;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreField as J4CoreField;
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreField as J4CoreField;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\CoreField as J5CoreField;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\InputButton as J3InputButton;
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\InputButton as J3InputButton;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\InputButton as J4InputButton;
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\InputButton as J4InputButton;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\InputButton as J5InputButton;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface as CoreField;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface as CoreField;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface as CoreRule;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface as CoreRule;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface as InputButton;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface as InputButton;
|
||||||
@ -105,18 +108,27 @@ class Field implements ServiceProviderInterface
|
|||||||
$container->alias(J4CoreRule::class, 'J4.Field.Core.Rule')
|
$container->alias(J4CoreRule::class, 'J4.Field.Core.Rule')
|
||||||
->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true);
|
->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true);
|
||||||
|
|
||||||
|
$container->alias(J5CoreRule::class, 'J5.Field.Core.Rule')
|
||||||
|
->share('J5.Field.Core.Rule', [$this, 'getJ5CoreRule'], true);
|
||||||
|
|
||||||
$container->alias(J3CoreField::class, 'J3.Field.Core.Field')
|
$container->alias(J3CoreField::class, 'J3.Field.Core.Field')
|
||||||
->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true);
|
->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true);
|
||||||
|
|
||||||
$container->alias(J4CoreField::class, 'J4.Field.Core.Field')
|
$container->alias(J4CoreField::class, 'J4.Field.Core.Field')
|
||||||
->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true);
|
->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true);
|
||||||
|
|
||||||
|
$container->alias(J5CoreField::class, 'J5.Field.Core.Field')
|
||||||
|
->share('J5.Field.Core.Field', [$this, 'getJ5CoreField'], true);
|
||||||
|
|
||||||
$container->alias(J3InputButton::class, 'J3.Field.Input.Button')
|
$container->alias(J3InputButton::class, 'J3.Field.Input.Button')
|
||||||
->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true);
|
->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true);
|
||||||
|
|
||||||
$container->alias(J4InputButton::class, 'J4.Field.Input.Button')
|
$container->alias(J4InputButton::class, 'J4.Field.Input.Button')
|
||||||
->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true);
|
->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true);
|
||||||
|
|
||||||
|
$container->alias(J5InputButton::class, 'J5.Field.Input.Button')
|
||||||
|
->share('J5.Field.Input.Button', [$this, 'getJ5InputButton'], true);
|
||||||
|
|
||||||
$container->alias(CoreField::class, 'Field.Core.Field')
|
$container->alias(CoreField::class, 'Field.Core.Field')
|
||||||
->share('Field.Core.Field', [$this, 'getCoreField'], true);
|
->share('Field.Core.Field', [$this, 'getCoreField'], true);
|
||||||
|
|
||||||
@ -322,6 +334,19 @@ class Field implements ServiceProviderInterface
|
|||||||
return new J4CoreRule();
|
return new J4CoreRule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The CoreRule Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5CoreRule
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5CoreRule(Container $container): J5CoreRule
|
||||||
|
{
|
||||||
|
return new J5CoreRule();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The CoreField Class.
|
* Get The CoreField Class.
|
||||||
*
|
*
|
||||||
@ -348,6 +373,19 @@ class Field implements ServiceProviderInterface
|
|||||||
return new J4CoreField();
|
return new J4CoreField();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The CoreField Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5CoreField
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5CoreField(Container $container): J5CoreField
|
||||||
|
{
|
||||||
|
return new J5CoreField();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The J3InputButton Class.
|
* Get The J3InputButton Class.
|
||||||
*
|
*
|
||||||
@ -382,6 +420,23 @@ class Field implements ServiceProviderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The J5InputButton Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5InputButton
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5InputButton(Container $container): J5InputButton
|
||||||
|
{
|
||||||
|
return new J5InputButton(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Placeholder'),
|
||||||
|
$container->get('Compiler.Creator.Permission')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The CoreFieldInterface Class.
|
* Get The CoreFieldInterface Class.
|
||||||
*
|
*
|
||||||
|
@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Header as J3Header;
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Header as J3Header;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Header as J4Header;
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Header as J4Header;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\Header as J5Header;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,6 +51,9 @@ class Header implements ServiceProviderInterface
|
|||||||
$container->alias(J4Header::class, 'J4.Header')
|
$container->alias(J4Header::class, 'J4.Header')
|
||||||
->share('J4.Header', [$this, 'getJ4Header'], true);
|
->share('J4.Header', [$this, 'getJ4Header'], true);
|
||||||
|
|
||||||
|
$container->alias(J5Header::class, 'J5.Header')
|
||||||
|
->share('J5.Header', [$this, 'getJ5Header'], true);
|
||||||
|
|
||||||
$container->alias(HeaderInterface::class, 'Header')
|
$container->alias(HeaderInterface::class, 'Header')
|
||||||
->share('Header', [$this, 'getHeader'], true);
|
->share('Header', [$this, 'getHeader'], true);
|
||||||
}
|
}
|
||||||
@ -119,5 +123,29 @@ class Header implements ServiceProviderInterface
|
|||||||
$container->get('Compiler.Builder.Tags')
|
$container->get('Compiler.Builder.Tags')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The Header Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5Header
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5Header(Container $container): J5Header
|
||||||
|
{
|
||||||
|
return new J5Header(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Event'),
|
||||||
|
$container->get('Placeholder'),
|
||||||
|
$container->get('Language'),
|
||||||
|
$container->get('Compiler.Builder.Uikit.Comp'),
|
||||||
|
$container->get('Compiler.Builder.Admin.Filter.Type'),
|
||||||
|
$container->get('Compiler.Builder.Category'),
|
||||||
|
$container->get('Compiler.Builder.Access.Switch.List'),
|
||||||
|
$container->get('Compiler.Builder.Filter'),
|
||||||
|
$container->get('Compiler.Builder.Tags')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ use Joomla\CMS\Version;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History;
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\History as J4History;
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\History as J4History;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\History as J5History;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,6 +52,9 @@ class History implements ServiceProviderInterface
|
|||||||
$container->alias(J4History::class, 'J4.History')
|
$container->alias(J4History::class, 'J4.History')
|
||||||
->share('J4.History', [$this, 'getJ4History'], true);
|
->share('J4.History', [$this, 'getJ4History'], true);
|
||||||
|
|
||||||
|
$container->alias(J5History::class, 'J5.History')
|
||||||
|
->share('J5.History', [$this, 'getJ5History'], true);
|
||||||
|
|
||||||
$container->alias(HistoryInterface::class, 'History')
|
$container->alias(HistoryInterface::class, 'History')
|
||||||
->share('History', [$this, 'getHistory'], true);
|
->share('History', [$this, 'getHistory'], true);
|
||||||
}
|
}
|
||||||
@ -102,5 +106,20 @@ class History implements ServiceProviderInterface
|
|||||||
$container->get('Config')
|
$container->get('Config')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Joomla 5 History
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return J5History
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getJ5History(Container $container): J5History
|
||||||
|
{
|
||||||
|
return new J5History(
|
||||||
|
$container->get('Config')
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs;
|
|||||||
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface as Customtabs;
|
use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface as Customtabs;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree\Customtabs as CustomtabsJ3;
|
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree\Customtabs as CustomtabsJ3;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour\Customtabs as CustomtabsJ4;
|
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour\Customtabs as CustomtabsJ4;
|
||||||
|
use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFive\Customtabs as CustomtabsJ5;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews;
|
use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking;
|
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking;
|
||||||
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump;
|
use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump;
|
||||||
@ -182,6 +183,9 @@ class Model implements ServiceProviderInterface
|
|||||||
$container->alias(CustomtabsJ4::class, 'Model.J4.Customtabs')
|
$container->alias(CustomtabsJ4::class, 'Model.J4.Customtabs')
|
||||||
->share('Model.J4.Customtabs', [$this, 'getCustomtabsJ4'], true);
|
->share('Model.J4.Customtabs', [$this, 'getCustomtabsJ4'], true);
|
||||||
|
|
||||||
|
$container->alias(CustomtabsJ5::class, 'Model.J5.Customtabs')
|
||||||
|
->share('Model.J5.Customtabs', [$this, 'getCustomtabsJ5'], true);
|
||||||
|
|
||||||
$container->alias(Adminviews::class, 'Model.Adminviews')
|
$container->alias(Adminviews::class, 'Model.Adminviews')
|
||||||
->share('Model.Adminviews', [$this, 'getAdminviews'], true);
|
->share('Model.Adminviews', [$this, 'getAdminviews'], true);
|
||||||
|
|
||||||
@ -758,6 +762,25 @@ class Model implements ServiceProviderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get The CustomtabsJ5 Class.
|
||||||
|
*
|
||||||
|
* @param Container $container The DI container.
|
||||||
|
*
|
||||||
|
* @return CustomtabsJ5
|
||||||
|
* @since 3.2.0
|
||||||
|
*/
|
||||||
|
public function getCustomtabsJ5(Container $container): CustomtabsJ5
|
||||||
|
{
|
||||||
|
return new CustomtabsJ5(
|
||||||
|
$container->get('Config'),
|
||||||
|
$container->get('Compiler.Builder.Custom.Tabs'),
|
||||||
|
$container->get('Language'),
|
||||||
|
$container->get('Placeholder'),
|
||||||
|
$container->get('Customcode')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get The Adminviews Class.
|
* Get The Adminviews Class.
|
||||||
*
|
*
|
||||||
|
@ -67,23 +67,14 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
'debug_linenr' => [
|
'buildcompsql' => [
|
||||||
'name' => 'debug_linenr',
|
'name' => 'buildcompsql',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL',
|
||||||
'type' => 'radio',
|
'type' => 'textarea',
|
||||||
'title' => false,
|
|
||||||
'list' => 'joomla_components',
|
|
||||||
'store' => NULL,
|
|
||||||
'tab_name' => 'Details',
|
|
||||||
],
|
|
||||||
'php_site_event' => [
|
|
||||||
'name' => 'php_site_event',
|
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL',
|
|
||||||
'type' => 'editor',
|
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'Libs & Helpers',
|
'tab_name' => 'Dynamic Build (beta)',
|
||||||
],
|
],
|
||||||
'translation_tool' => [
|
'translation_tool' => [
|
||||||
'name' => 'translation_tool',
|
'name' => 'translation_tool',
|
||||||
@ -94,15 +85,6 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Dynamic Integration',
|
'tab_name' => 'Dynamic Integration',
|
||||||
],
|
],
|
||||||
'buildcompsql' => [
|
|
||||||
'name' => 'buildcompsql',
|
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL',
|
|
||||||
'type' => 'textarea',
|
|
||||||
'title' => false,
|
|
||||||
'list' => 'joomla_components',
|
|
||||||
'store' => 'base64',
|
|
||||||
'tab_name' => 'Dynamic Build (beta)',
|
|
||||||
],
|
|
||||||
'add_sales_server' => [
|
'add_sales_server' => [
|
||||||
'name' => 'add_sales_server',
|
'name' => 'add_sales_server',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL',
|
||||||
@ -112,18 +94,18 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Dynamic Integration',
|
'tab_name' => 'Dynamic Integration',
|
||||||
],
|
],
|
||||||
'php_preflight_install' => [
|
'php_method_uninstall' => [
|
||||||
'name' => 'php_preflight_install',
|
'name' => 'php_method_uninstall',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL',
|
||||||
'type' => 'editor',
|
'type' => 'editor',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'Dash & Install',
|
'tab_name' => 'Dash & Install',
|
||||||
],
|
],
|
||||||
'php_method_uninstall' => [
|
'php_preflight_install' => [
|
||||||
'name' => 'php_method_uninstall',
|
'name' => 'php_preflight_install',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL',
|
||||||
'type' => 'editor',
|
'type' => 'editor',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
@ -166,6 +148,24 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
|
'debug_linenr' => [
|
||||||
|
'name' => 'debug_linenr',
|
||||||
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL',
|
||||||
|
'type' => 'radio',
|
||||||
|
'title' => false,
|
||||||
|
'list' => 'joomla_components',
|
||||||
|
'store' => NULL,
|
||||||
|
'tab_name' => 'Details',
|
||||||
|
],
|
||||||
|
'php_site_event' => [
|
||||||
|
'name' => 'php_site_event',
|
||||||
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL',
|
||||||
|
'type' => 'editor',
|
||||||
|
'title' => false,
|
||||||
|
'list' => 'joomla_components',
|
||||||
|
'store' => 'base64',
|
||||||
|
'tab_name' => 'Libs & Helpers',
|
||||||
|
],
|
||||||
'description' => [
|
'description' => [
|
||||||
'name' => 'description',
|
'name' => 'description',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL',
|
||||||
@ -175,6 +175,15 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
|
'author' => [
|
||||||
|
'name' => 'author',
|
||||||
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL',
|
||||||
|
'type' => 'text',
|
||||||
|
'title' => false,
|
||||||
|
'list' => 'joomla_components',
|
||||||
|
'store' => NULL,
|
||||||
|
'tab_name' => 'Details',
|
||||||
|
],
|
||||||
'php_postflight_install' => [
|
'php_postflight_install' => [
|
||||||
'name' => 'php_postflight_install',
|
'name' => 'php_postflight_install',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_INSTALL_LABEL',
|
||||||
@ -184,9 +193,9 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'Dash & Install',
|
'tab_name' => 'Dash & Install',
|
||||||
],
|
],
|
||||||
'author' => [
|
'email' => [
|
||||||
'name' => 'author',
|
'name' => 'email',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL',
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
@ -202,19 +211,19 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'MySQL',
|
'tab_name' => 'MySQL',
|
||||||
],
|
],
|
||||||
'email' => [
|
'website' => [
|
||||||
'name' => 'email',
|
'name' => 'website',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_LABEL',
|
||||||
'type' => 'text',
|
'type' => 'url',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
'website' => [
|
'add_license' => [
|
||||||
'name' => 'website',
|
'name' => 'add_license',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL',
|
||||||
'type' => 'url',
|
'type' => 'radio',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
@ -256,10 +265,10 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'Libs & Helpers',
|
'tab_name' => 'Libs & Helpers',
|
||||||
],
|
],
|
||||||
'add_license' => [
|
'license_type' => [
|
||||||
'name' => 'add_license',
|
'name' => 'license_type',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_LABEL',
|
||||||
'type' => 'radio',
|
'type' => 'list',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
@ -283,15 +292,6 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'Libs & Helpers',
|
'tab_name' => 'Libs & Helpers',
|
||||||
],
|
],
|
||||||
'license_type' => [
|
|
||||||
'name' => 'license_type',
|
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_TYPE_LABEL',
|
|
||||||
'type' => 'list',
|
|
||||||
'title' => false,
|
|
||||||
'list' => 'joomla_components',
|
|
||||||
'store' => NULL,
|
|
||||||
'tab_name' => 'Details',
|
|
||||||
],
|
|
||||||
'php_helper_site' => [
|
'php_helper_site' => [
|
||||||
'name' => 'php_helper_site',
|
'name' => 'php_helper_site',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL',
|
||||||
@ -301,15 +301,6 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'Libs & Helpers',
|
'tab_name' => 'Libs & Helpers',
|
||||||
],
|
],
|
||||||
'javascript' => [
|
|
||||||
'name' => 'javascript',
|
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL',
|
|
||||||
'type' => 'editor',
|
|
||||||
'title' => false,
|
|
||||||
'list' => 'joomla_components',
|
|
||||||
'store' => 'base64',
|
|
||||||
'tab_name' => 'Libs & Helpers',
|
|
||||||
],
|
|
||||||
'whmcs_key' => [
|
'whmcs_key' => [
|
||||||
'name' => 'whmcs_key',
|
'name' => 'whmcs_key',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_KEY_LABEL',
|
||||||
@ -319,9 +310,9 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => 'basic_encryption',
|
'store' => 'basic_encryption',
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
'css_site' => [
|
'javascript' => [
|
||||||
'name' => 'css_site',
|
'name' => 'javascript',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL',
|
||||||
'type' => 'editor',
|
'type' => 'editor',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
@ -337,6 +328,15 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
|
'css_site' => [
|
||||||
|
'name' => 'css_site',
|
||||||
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL',
|
||||||
|
'type' => 'editor',
|
||||||
|
'title' => false,
|
||||||
|
'list' => 'joomla_components',
|
||||||
|
'store' => 'base64',
|
||||||
|
'tab_name' => 'Libs & Helpers',
|
||||||
|
],
|
||||||
'whmcs_buy_link' => [
|
'whmcs_buy_link' => [
|
||||||
'name' => 'whmcs_buy_link',
|
'name' => 'whmcs_buy_link',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_LABEL',
|
||||||
@ -346,15 +346,6 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
'php_preflight_update' => [
|
|
||||||
'name' => 'php_preflight_update',
|
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL',
|
|
||||||
'type' => 'editor',
|
|
||||||
'title' => false,
|
|
||||||
'list' => 'joomla_components',
|
|
||||||
'store' => 'base64',
|
|
||||||
'tab_name' => 'Dash & Install',
|
|
||||||
],
|
|
||||||
'license' => [
|
'license' => [
|
||||||
'name' => 'license',
|
'name' => 'license',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_LABEL',
|
||||||
@ -364,9 +355,9 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
'php_postflight_update' => [
|
'php_preflight_update' => [
|
||||||
'name' => 'php_postflight_update',
|
'name' => 'php_preflight_update',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL',
|
||||||
'type' => 'editor',
|
'type' => 'editor',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
@ -382,6 +373,24 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Details',
|
'tab_name' => 'Details',
|
||||||
],
|
],
|
||||||
|
'php_postflight_update' => [
|
||||||
|
'name' => 'php_postflight_update',
|
||||||
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL',
|
||||||
|
'type' => 'editor',
|
||||||
|
'title' => false,
|
||||||
|
'list' => 'joomla_components',
|
||||||
|
'store' => 'base64',
|
||||||
|
'tab_name' => 'Dash & Install',
|
||||||
|
],
|
||||||
|
'image' => [
|
||||||
|
'name' => 'image',
|
||||||
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL',
|
||||||
|
'type' => 'media',
|
||||||
|
'title' => false,
|
||||||
|
'list' => 'joomla_components',
|
||||||
|
'store' => NULL,
|
||||||
|
'tab_name' => 'Details',
|
||||||
|
],
|
||||||
'sql' => [
|
'sql' => [
|
||||||
'name' => 'sql',
|
'name' => 'sql',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_LABEL',
|
||||||
@ -391,10 +400,10 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => 'base64',
|
'store' => 'base64',
|
||||||
'tab_name' => 'MySQL',
|
'tab_name' => 'MySQL',
|
||||||
],
|
],
|
||||||
'image' => [
|
'copyright' => [
|
||||||
'name' => 'image',
|
'name' => 'copyright',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL',
|
||||||
'type' => 'media',
|
'type' => 'textarea',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
@ -409,10 +418,10 @@ class Table extends BaseTable implements Tableinterface
|
|||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
'tab_name' => 'Readme',
|
'tab_name' => 'Readme',
|
||||||
],
|
],
|
||||||
'copyright' => [
|
'preferred_joomla_version' => [
|
||||||
'name' => 'copyright',
|
'name' => 'preferred_joomla_version',
|
||||||
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL',
|
'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREFERRED_JOOMLA_VERSION_LABEL',
|
||||||
'type' => 'textarea',
|
'type' => 'number',
|
||||||
'title' => false,
|
'title' => false,
|
||||||
'list' => 'joomla_components',
|
'list' => 'joomla_components',
|
||||||
'store' => NULL,
|
'store' => NULL,
|
||||||
|
10
script.php
10
script.php
@ -6266,9 +6266,9 @@ class Com_ComponentbuilderInstallerScript
|
|||||||
$joomla_component->type_title = 'Componentbuilder Joomla_component';
|
$joomla_component->type_title = 'Componentbuilder Joomla_component';
|
||||||
$joomla_component->type_alias = 'com_componentbuilder.joomla_component';
|
$joomla_component->type_alias = 'com_componentbuilder.joomla_component';
|
||||||
$joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
|
$joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
|
||||||
$joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_site_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","debug_linenr":"debug_linenr","php_site_event":"php_site_event","translation_tool":"translation_tool","buildcompsql":"buildcompsql","add_sales_server":"add_sales_server","php_preflight_install":"php_preflight_install","php_method_uninstall":"php_method_uninstall","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","description":"description","php_postflight_install":"php_postflight_install","author":"author","sql_uninstall":"sql_uninstall","email":"email","website":"website","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","add_license":"add_license","component_version":"component_version","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}';
|
$joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_method_uninstall","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","buildcompsql":"buildcompsql","translation_tool":"translation_tool","add_sales_server":"add_sales_server","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","debug_linenr":"debug_linenr","php_site_event":"php_site_event","description":"description","author":"author","php_postflight_install":"php_postflight_install","email":"email","sql_uninstall":"sql_uninstall","website":"website","add_license":"add_license","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","license_type":"license_type","component_version":"component_version","php_helper_admin":"php_helper_admin","php_helper_site":"php_helper_site","whmcs_key":"whmcs_key","javascript":"javascript","whmcs_url":"whmcs_url","css_site":"css_site","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_update":"php_preflight_update","bom":"bom","php_postflight_update":"php_postflight_update","image":"image","sql":"sql","copyright":"copyright","addreadme":"addreadme","preferred_joomla_version":"preferred_joomla_version","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}';
|
||||||
$joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute';
|
$joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute';
|
||||||
$joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","debug_linenr","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}';
|
$joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","debug_linenr","add_license","license_type","addreadme","preferred_joomla_version","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}';
|
||||||
|
|
||||||
// Set the object into the content types table.
|
// Set the object into the content types table.
|
||||||
$joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component);
|
$joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component);
|
||||||
@ -7767,9 +7767,9 @@ class Com_ComponentbuilderInstallerScript
|
|||||||
$joomla_component->type_title = 'Componentbuilder Joomla_component';
|
$joomla_component->type_title = 'Componentbuilder Joomla_component';
|
||||||
$joomla_component->type_alias = 'com_componentbuilder.joomla_component';
|
$joomla_component->type_alias = 'com_componentbuilder.joomla_component';
|
||||||
$joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
|
$joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
|
||||||
$joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_site_event","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","debug_linenr":"debug_linenr","php_site_event":"php_site_event","translation_tool":"translation_tool","buildcompsql":"buildcompsql","add_sales_server":"add_sales_server","php_preflight_install":"php_preflight_install","php_method_uninstall":"php_method_uninstall","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","description":"description","php_postflight_install":"php_postflight_install","author":"author","sql_uninstall":"sql_uninstall","email":"email","website":"website","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","add_license":"add_license","component_version":"component_version","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}';
|
$joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_method_uninstall","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","buildcompsql":"buildcompsql","translation_tool":"translation_tool","add_sales_server":"add_sales_server","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","debug_linenr":"debug_linenr","php_site_event":"php_site_event","description":"description","author":"author","php_postflight_install":"php_postflight_install","email":"email","sql_uninstall":"sql_uninstall","website":"website","add_license":"add_license","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","license_type":"license_type","component_version":"component_version","php_helper_admin":"php_helper_admin","php_helper_site":"php_helper_site","whmcs_key":"whmcs_key","javascript":"javascript","whmcs_url":"whmcs_url","css_site":"css_site","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_update":"php_preflight_update","bom":"bom","php_postflight_update":"php_postflight_update","image":"image","sql":"sql","copyright":"copyright","addreadme":"addreadme","preferred_joomla_version":"preferred_joomla_version","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}';
|
||||||
$joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute';
|
$joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute';
|
||||||
$joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","debug_linenr","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}';
|
$joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","debug_linenr","add_license","license_type","addreadme","preferred_joomla_version","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}';
|
||||||
|
|
||||||
// Check if joomla_component type is already in content_type DB.
|
// Check if joomla_component type is already in content_type DB.
|
||||||
$joomla_component_id = null;
|
$joomla_component_id = null;
|
||||||
@ -9618,7 +9618,7 @@ class Com_ComponentbuilderInstallerScript
|
|||||||
echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://dev.vdm.io" title="Component Builder">
|
echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://dev.vdm.io" title="Component Builder">
|
||||||
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
|
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
|
||||||
</a>
|
</a>
|
||||||
<h3>Upgrade to Version 3.2.0-beta3 Was Successful! Let us know if anything is not working as expected.</h3></div>';
|
<h3>Upgrade to Version 3.2.0-beta4 Was Successful! Let us know if anything is not working as expected.</h3></div>';
|
||||||
|
|
||||||
// Set db if not set already.
|
// Set db if not set already.
|
||||||
if (!isset($db))
|
if (!isset($db))
|
||||||
|
Loading…
Reference in New Issue
Block a user