forked from joomla/Component-Builder
Stable release of v3.2.0-beta1
Move beta to main repo. Fix #1053 so that the right and left tabs display correctly in Joomla 4&5.
This commit is contained in:
parent
3c91a5cdbb
commit
d1e1a56671
72
CHANGELOG.md
72
CHANGELOG.md
@ -1,3 +1,73 @@
|
|||||||
|
# v3.2.0-beta1
|
||||||
|
|
||||||
|
- Move beta to main repo
|
||||||
|
- Fix #1053 so that the right and left tabs display correctly in Joomla 4&5
|
||||||
|
|
||||||
|
# v3.1.42-beta
|
||||||
|
|
||||||
|
- Fix #1055 to add the style and scripts to all views.
|
||||||
|
|
||||||
|
# v3.1.40-beta
|
||||||
|
|
||||||
|
- 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.
|
||||||
|
|
||||||
|
# v3.1.39
|
||||||
|
|
||||||
|
- Fix #1051 making sure the list view is lowercase.
|
||||||
|
|
||||||
|
# v3.1.38
|
||||||
|
|
||||||
|
- Fix #1046 so that the version restore function will work.
|
||||||
|
|
||||||
|
# v3.1.37
|
||||||
|
|
||||||
|
- Fix #1041 so that custom tabs are build correctly.
|
||||||
|
- Fix #1043 so that delete function in Joomla 4 and 5 will work.
|
||||||
|
- Fix #1045 so that plug-in Structure::setMainXmlFile method will except an object.
|
||||||
|
- Fix #1042 so that it will remove line breaks and new lines from other languages as well.
|
||||||
|
|
||||||
|
# v3.1.36
|
||||||
|
|
||||||
|
- Move the defined or die below use statements.
|
||||||
|
- Add the new router view
|
||||||
|
|
||||||
|
# v3.1.35
|
||||||
|
|
||||||
|
- Improve the Joomla 4 Templates.
|
||||||
|
- Fix #1033 the response class issue for the gitea classes.
|
||||||
|
- Remove the JRegistry class to resolve #1036, #1035
|
||||||
|
|
||||||
|
# v3.1.34
|
||||||
|
|
||||||
|
- Fix the AjaxController contructor class.
|
||||||
|
- Improved the getModel calls from the AxajController class.
|
||||||
|
|
||||||
|
# v3.1.33
|
||||||
|
|
||||||
|
- Fix #1026 by adding the correct layout to the filter views.
|
||||||
|
- Fix #1026 by adding the class to the filter views.
|
||||||
|
- Fix #1026 by adding a hint to the filters that are having multiple selection.
|
||||||
|
- Fix the directional bog where a field in the filters are also called direction.
|
||||||
|
- Fix the getModel helper method fot J4+.
|
||||||
|
|
||||||
|
# v3.1.32
|
||||||
|
|
||||||
|
- Fix #1026 by removing chosen everywhere.
|
||||||
|
- Resolve #1028 by adding in line helper toggle integration to all admin views.
|
||||||
|
- Remove the import and export buttons until the area is fixed.
|
||||||
|
- Add emptystate list template to all admin list views.
|
||||||
|
|
||||||
|
# v3.1.31
|
||||||
|
|
||||||
|
- Add joomla_version to custom code.
|
||||||
|
- Add Joomla 4 and 5 correct build files.
|
||||||
|
|
||||||
|
# v3.1.30
|
||||||
|
|
||||||
|
- Add namspace prefix to both global, and component override level.
|
||||||
|
- Add Joomla 4 and 5 build option
|
||||||
|
|
||||||
# v3.1.28
|
# v3.1.28
|
||||||
|
|
||||||
- Updates PHPSecLib.
|
- Updates PHPSecLib.
|
||||||
@ -23,7 +93,7 @@
|
|||||||
- Adds option to add additional templates to a module.
|
- Adds option to add additional templates to a module.
|
||||||
- Resolves #1002 by adding STRING instead of WORD.
|
- Resolves #1002 by adding STRING instead of WORD.
|
||||||
- Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof
|
- Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof
|
||||||
- Changed all CSS and JS to use `JHtml::_(` instead of `$this->document->` in compiler code.
|
- Changed all CSS and JS to use `Html::_(` instead of `$this->document->` in compiler code.
|
||||||
- Adds option to turn jQuery off if UIKIT 3 is added.
|
- Adds option to turn jQuery off if UIKIT 3 is added.
|
||||||
- Adds option to auto write injection boilerplate code in Powers area.
|
- Adds option to auto write injection boilerplate code in Powers area.
|
||||||
- Adds option to auto write service provider boilerplate code in the Powers area.
|
- Adds option to auto write service provider boilerplate code in the Powers area.
|
||||||
|
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.1.28) 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-beta1) 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*: 24th October, 2023
|
+ *Last Build*: 2nd March, 2024
|
||||||
+ *Version*: 3.1.28
|
+ *Version*: 3.2.0-beta1
|
||||||
+ *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*: **635155**
|
+ *Line count*: **694660**
|
||||||
+ *Field count*: **2047**
|
+ *Field count*: **2077**
|
||||||
+ *File count*: **4731**
|
+ *File count*: **5121**
|
||||||
+ *Folder count*: **436**
|
+ *Folder count*: **455**
|
||||||
|
|
||||||
> 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.1.28) 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-beta1) 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*: 24th October, 2023
|
+ *Last Build*: 2nd March, 2024
|
||||||
+ *Version*: 3.1.28
|
+ *Version*: 3.2.0-beta1
|
||||||
+ *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*: **635155**
|
+ *Line count*: **694660**
|
||||||
+ *Field count*: **2047**
|
+ *Field count*: **2077**
|
||||||
+ *File count*: **4731**
|
+ *File count*: **5121**
|
||||||
+ *Folder count*: **436**
|
+ *Folder count*: **455**
|
||||||
|
|
||||||
> 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)
|
||||||
|
@ -211,6 +211,16 @@
|
|||||||
<action name="component_plugins.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_OWN_DESC" />
|
<action name="component_plugins.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_OWN_DESC" />
|
||||||
<action name="component_plugins.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE_DESC" />
|
<action name="component_plugins.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE_DESC" />
|
||||||
<action name="component_plugins.version" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION_DESC" />
|
<action name="component_plugins.version" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION_DESC" />
|
||||||
|
<action name="component_router.access" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS_DESC" />
|
||||||
|
<action name="component_router.batch" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE_DESC" />
|
||||||
|
<action name="component_router.create" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE_DESC" />
|
||||||
|
<action name="component_router.delete" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE_DESC" />
|
||||||
|
<action name="component_router.edit" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_DESC" />
|
||||||
|
<action name="component_router.edit.created_by" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY_DESC" />
|
||||||
|
<action name="component_router.edit.created" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE_DESC" />
|
||||||
|
<action name="component_router.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN_DESC" />
|
||||||
|
<action name="component_router.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE_DESC" />
|
||||||
|
<action name="component_router.version" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION_DESC" />
|
||||||
<action name="component_site_views.access" title="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS_DESC" />
|
<action name="component_site_views.access" title="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS_DESC" />
|
||||||
<action name="component_site_views.batch" title="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE" description="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE_DESC" />
|
<action name="component_site_views.batch" title="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE" description="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE_DESC" />
|
||||||
<action name="component_site_views.create" title="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_CREATE" description="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_CREATE_DESC" />
|
<action name="component_site_views.create" title="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_CREATE" description="COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_CREATE_DESC" />
|
||||||
@ -899,6 +909,17 @@
|
|||||||
<action name="component_custom_admin_menus.access" title="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_ACCESS_DESC" />
|
<action name="component_custom_admin_menus.access" title="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_ACCESS_DESC" />
|
||||||
<action name="component_custom_admin_menus.version" title="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_VERSION_DESC" />
|
<action name="component_custom_admin_menus.version" title="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_VERSION_DESC" />
|
||||||
</section>
|
</section>
|
||||||
|
<section name="component_router">
|
||||||
|
<action name="component_router.edit" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_DESC" />
|
||||||
|
<action name="component_router.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN_DESC" />
|
||||||
|
<action name="component_router.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE_DESC" />
|
||||||
|
<action name="component_router.edit.created_by" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY_DESC" />
|
||||||
|
<action name="component_router.edit.created" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE_DESC" />
|
||||||
|
<action name="component_router.create" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE_DESC" />
|
||||||
|
<action name="component_router.delete" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE_DESC" />
|
||||||
|
<action name="component_router.access" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS_DESC" />
|
||||||
|
<action name="component_router.version" title="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION_DESC" />
|
||||||
|
</section>
|
||||||
<section name="component_config">
|
<section name="component_config">
|
||||||
<action name="component_config.edit" title="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_DESC" />
|
<action name="component_config.edit" title="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_DESC" />
|
||||||
<action name="component_config.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_OWN_DESC" />
|
<action name="component_config.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_OWN_DESC" />
|
||||||
|
13
admin/assets/css/component_router.css
Normal file
13
admin/assets/css/component_router.css
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 30th April, 2015
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* CSS Document */
|
||||||
|
|
||||||
|
|
13
admin/assets/css/components_routers.css
Normal file
13
admin/assets/css/components_routers.css
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* @package Joomla.Component.Builder
|
||||||
|
*
|
||||||
|
* @created 30th April, 2015
|
||||||
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* CSS Document */
|
||||||
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 65 KiB |
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -36,7 +36,7 @@ class ###Component###Controller###SViews### extends AdminController
|
|||||||
* Proxy for getModel.
|
* Proxy for getModel.
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
*/
|
*/
|
||||||
public function getModel($name = '###SView###', $prefix = '###Component###Model', $config = array())
|
public function getModel($name = '###SView###', $prefix = '###Component###Model', $config = [])
|
||||||
{
|
{
|
||||||
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ class ###Component###Controller###SViews### extends AdminController
|
|||||||
|
|
||||||
public function dashboard()
|
public function dashboard()
|
||||||
{
|
{
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###', false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###', false));
|
||||||
return;
|
return;
|
||||||
}###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER###
|
}###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER###
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -52,16 +52,16 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
* @param string $prefix A prefix for the table class name. Optional.
|
* @param string $prefix A prefix for the table class name. Optional.
|
||||||
* @param array $config Configuration array for model. Optional.
|
* @param array $config Configuration array for model. Optional.
|
||||||
*
|
*
|
||||||
* @return JTable A database object
|
* @return Table A database object
|
||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array())
|
public function getTable($type = '###view###', $prefix = '###Component###Table', $config = [])
|
||||||
{
|
{
|
||||||
// add table path for when model gets used from other component
|
// add table path for when model gets used from other component
|
||||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables');
|
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables');
|
||||||
// get instance of the table
|
// get instance of the table
|
||||||
return JTable::getInstance($type, $prefix, $config);
|
return Table::getInstance($type, $prefix, $config);
|
||||||
}###ADMIN_CUSTOM_BUTTONS_METHOD###
|
}###ADMIN_CUSTOM_BUTTONS_METHOD###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,7 +108,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
public function getForm($data = [], $loadData = true, $options = array('control' => 'jform'))
|
||||||
{
|
{
|
||||||
// set load data option
|
// set load data option
|
||||||
$options['load_data'] = $loadData;###JMODELADMIN_GETFORM###
|
$options['load_data'] = $loadData;###JMODELADMIN_GETFORM###
|
||||||
@ -159,14 +159,14 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
*/
|
*/
|
||||||
protected function allowEdit($data = array(), $key = 'id')
|
protected function allowEdit($data = [], $key = 'id')
|
||||||
{###JMODELADMIN_ALLOWEDIT###
|
{###JMODELADMIN_ALLOWEDIT###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare and sanitise the table data prior to saving.
|
* Prepare and sanitise the table data prior to saving.
|
||||||
*
|
*
|
||||||
* @param JTable $table A JTable object.
|
* @param Table $table A Table object.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
@ -174,8 +174,8 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*/
|
*/
|
||||||
protected function prepareTable($table)
|
protected function prepareTable($table)
|
||||||
{###LICENSE_TABLE_LOCKED_CHECK###
|
{###LICENSE_TABLE_LOCKED_CHECK###
|
||||||
$date = JFactory::getDate();
|
$date = Factory::getDate();
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
|
|
||||||
if (isset($table->name))
|
if (isset($table->name))
|
||||||
{
|
{
|
||||||
@ -198,7 +198,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
// Set ordering to the last item if not set
|
// Set ordering to the last item if not set
|
||||||
if (empty($table->ordering))
|
if (empty($table->ordering))
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select('MAX(ordering)')
|
->select('MAX(ordering)')
|
||||||
->from($db->quoteName('#__###component###_###view###'));
|
->from($db->quoteName('#__###component###_###view###'));
|
||||||
@ -231,7 +231,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
protected function loadFormData()
|
protected function loadFormData()
|
||||||
{
|
{
|
||||||
// Check the session for previously entered form data.
|
// Check the session for previously entered form data.
|
||||||
$data = JFactory::getApplication()->getUserState('com_###component###.edit.###view###.data', array());
|
$data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []);
|
||||||
|
|
||||||
if (empty($data))
|
if (empty($data))
|
||||||
{
|
{
|
||||||
@ -307,30 +307,30 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
|
|
||||||
if (empty($pks))
|
if (empty($pks))
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
|
$this->setError(Text::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$done = false;
|
$done = false;
|
||||||
|
|
||||||
// Set some needed variables.
|
// Set some needed variables.
|
||||||
$this->user = JFactory::getUser();
|
$this->user = Factory::getUser();
|
||||||
$this->table = $this->getTable();
|
$this->table = $this->getTable();
|
||||||
$this->tableClassName = get_class($this->table);
|
$this->tableClassName = get_class($this->table);
|
||||||
$this->contentType = new JUcmType;
|
$this->contentType = new UCMType;
|
||||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###');
|
$this->canDo = ###Component###Helper::getActions('###view###');
|
||||||
$this->batchSet = true;
|
$this->batchSet = true;
|
||||||
|
|
||||||
if (!$this->canDo->get('core.batch'))
|
if (!$this->canDo->get('core.batch'))
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
$this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->type == false)
|
if ($this->type == false)
|
||||||
{
|
{
|
||||||
$type = new JUcmType;
|
$type = new UCMType;
|
||||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,8 +367,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
|
|
||||||
if (!$done)
|
if (!$done)
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
$this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,15 +388,15 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*/
|
*/
|
||||||
public function save($data)
|
public function save($data)
|
||||||
{
|
{
|
||||||
$input = JFactory::getApplication()->input;
|
$input = Factory::getApplication()->input;
|
||||||
$filter = JFilterInput::getInstance();
|
$filter = InputFilter::getInstance();
|
||||||
|
|
||||||
// set the metadata to the Item Data
|
// set the metadata to the Item Data
|
||||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||||
{
|
{
|
||||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||||
|
|
||||||
$metadata = new JRegistry;
|
$metadata = new Registry;
|
||||||
$metadata->loadArray($data['metadata']);
|
$metadata->loadArray($data['metadata']);
|
||||||
$data['metadata'] = (string) $metadata;
|
$data['metadata'] = (string) $metadata;
|
||||||
}###CHECKBOX_SAVE######METHOD_ITEM_SAVE###
|
}###CHECKBOX_SAVE######METHOD_ITEM_SAVE###
|
||||||
@ -405,7 +404,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
// Set the Params Items to data
|
// Set the Params Items to data
|
||||||
if (isset($data['params']) && is_array($data['params']))
|
if (isset($data['params']) && is_array($data['params']))
|
||||||
{
|
{
|
||||||
$params = new JRegistry;
|
$params = new Registry;
|
||||||
$params->loadArray($data['params']);
|
$params->loadArray($data['params']);
|
||||||
$data['params'] = (string) $params;
|
$data['params'] = (string) $params;
|
||||||
}###TITLEALIASFIX###
|
}###TITLEALIASFIX###
|
||||||
@ -429,7 +428,6 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*/
|
*/
|
||||||
protected function generateUnique($field,$value)
|
protected function generateUnique($field,$value)
|
||||||
{
|
{
|
||||||
|
|
||||||
// set field value unique
|
// set field value unique
|
||||||
$table = $this->getTable();
|
$table = $this->getTable();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -52,16 +52,16 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
* @param string $prefix A prefix for the table class name. Optional.
|
* @param string $prefix A prefix for the table class name. Optional.
|
||||||
* @param array $config Configuration array for model. Optional.
|
* @param array $config Configuration array for model. Optional.
|
||||||
*
|
*
|
||||||
* @return JTable A database object
|
* @return Table A database object
|
||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array())
|
public function getTable($type = '###view###', $prefix = '###Component###Table', $config = [])
|
||||||
{
|
{
|
||||||
// add table path for when model gets used from other component
|
// add table path for when model gets used from other component
|
||||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables');
|
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables');
|
||||||
// get instance of the table
|
// get instance of the table
|
||||||
return JTable::getInstance($type, $prefix, $config);
|
return Table::getInstance($type, $prefix, $config);
|
||||||
}###ADMIN_CUSTOM_BUTTONS_METHOD###
|
}###ADMIN_CUSTOM_BUTTONS_METHOD###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -108,7 +108,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
public function getForm($data = [], $loadData = true, $options = array('control' => 'jform'))
|
||||||
{
|
{
|
||||||
// set load data option
|
// set load data option
|
||||||
$options['load_data'] = $loadData;###JMODELADMIN_GETFORM###
|
$options['load_data'] = $loadData;###JMODELADMIN_GETFORM###
|
||||||
@ -159,14 +159,14 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
* @return boolean
|
* @return boolean
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
*/
|
*/
|
||||||
protected function allowEdit($data = array(), $key = 'id')
|
protected function allowEdit($data = [], $key = 'id')
|
||||||
{###JMODELADMIN_ALLOWEDIT###
|
{###JMODELADMIN_ALLOWEDIT###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare and sanitise the table data prior to saving.
|
* Prepare and sanitise the table data prior to saving.
|
||||||
*
|
*
|
||||||
* @param JTable $table A JTable object.
|
* @param Table $table A Table object.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
@ -174,8 +174,8 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*/
|
*/
|
||||||
protected function prepareTable($table)
|
protected function prepareTable($table)
|
||||||
{###LICENSE_TABLE_LOCKED_CHECK###
|
{###LICENSE_TABLE_LOCKED_CHECK###
|
||||||
$date = JFactory::getDate();
|
$date = Factory::getDate();
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
|
|
||||||
if (isset($table->name))
|
if (isset($table->name))
|
||||||
{
|
{
|
||||||
@ -198,7 +198,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
// Set ordering to the last item if not set
|
// Set ordering to the last item if not set
|
||||||
if (empty($table->ordering))
|
if (empty($table->ordering))
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select('MAX(ordering)')
|
->select('MAX(ordering)')
|
||||||
->from($db->quoteName('#__###component###_###view###'));
|
->from($db->quoteName('#__###component###_###view###'));
|
||||||
@ -231,7 +231,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
protected function loadFormData()
|
protected function loadFormData()
|
||||||
{
|
{
|
||||||
// Check the session for previously entered form data.
|
// Check the session for previously entered form data.
|
||||||
$data = JFactory::getApplication()->getUserState('com_###component###.edit.###view###.data', array());
|
$data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []);
|
||||||
|
|
||||||
if (empty($data))
|
if (empty($data))
|
||||||
{
|
{
|
||||||
@ -307,30 +307,30 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
|
|
||||||
if (empty($pks))
|
if (empty($pks))
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
|
$this->setError(Text::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$done = false;
|
$done = false;
|
||||||
|
|
||||||
// Set some needed variables.
|
// Set some needed variables.
|
||||||
$this->user = JFactory::getUser();
|
$this->user = Factory::getUser();
|
||||||
$this->table = $this->getTable();
|
$this->table = $this->getTable();
|
||||||
$this->tableClassName = get_class($this->table);
|
$this->tableClassName = get_class($this->table);
|
||||||
$this->contentType = new JUcmType;
|
$this->contentType = new UCMType;
|
||||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###');
|
$this->canDo = ###Component###Helper::getActions('###view###');
|
||||||
$this->batchSet = true;
|
$this->batchSet = true;
|
||||||
|
|
||||||
if (!$this->canDo->get('core.batch'))
|
if (!$this->canDo->get('core.batch'))
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
$this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->type == false)
|
if ($this->type == false)
|
||||||
{
|
{
|
||||||
$type = new JUcmType;
|
$type = new UCMType;
|
||||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,8 +367,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
|
|
||||||
if (!$done)
|
if (!$done)
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
$this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,15 +388,15 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*/
|
*/
|
||||||
public function save($data)
|
public function save($data)
|
||||||
{
|
{
|
||||||
$input = JFactory::getApplication()->input;
|
$input = Factory::getApplication()->input;
|
||||||
$filter = JFilterInput::getInstance();
|
$filter = InputFilter::getInstance();
|
||||||
|
|
||||||
// set the metadata to the Item Data
|
// set the metadata to the Item Data
|
||||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||||
{
|
{
|
||||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||||
|
|
||||||
$metadata = new JRegistry;
|
$metadata = new Registry;
|
||||||
$metadata->loadArray($data['metadata']);
|
$metadata->loadArray($data['metadata']);
|
||||||
$data['metadata'] = (string) $metadata;
|
$data['metadata'] = (string) $metadata;
|
||||||
}###CHECKBOX_SAVE######METHOD_ITEM_SAVE###
|
}###CHECKBOX_SAVE######METHOD_ITEM_SAVE###
|
||||||
@ -405,7 +404,7 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
// Set the Params Items to data
|
// Set the Params Items to data
|
||||||
if (isset($data['params']) && is_array($data['params']))
|
if (isset($data['params']) && is_array($data['params']))
|
||||||
{
|
{
|
||||||
$params = new JRegistry;
|
$params = new Registry;
|
||||||
$params->loadArray($data['params']);
|
$params->loadArray($data['params']);
|
||||||
$data['params'] = (string) $params;
|
$data['params'] = (string) $params;
|
||||||
}###TITLEALIASFIX###
|
}###TITLEALIASFIX###
|
||||||
@ -427,9 +426,8 @@ class ###Component###Model###View### extends AdminModel
|
|||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
protected function generateUnique($field,$value)
|
protected function generateUnique($field, $value)
|
||||||
{
|
{
|
||||||
|
|
||||||
// set field value unique
|
// set field value unique
|
||||||
$table = $this->getTable();
|
$table = $this->getTable();
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -19,6 +19,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
|
|
||||||
use Joomla\CMS\MVC\Controller\BaseController;
|
use Joomla\CMS\MVC\Controller\BaseController;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General Controller of ###Component### component
|
* General Controller of ###Component### component
|
||||||
@ -34,7 +36,7 @@ class ###Component###Controller extends BaseController
|
|||||||
*
|
*
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public function __construct($config = array())
|
public function __construct($config = [])
|
||||||
{
|
{
|
||||||
// set the default view
|
// set the default view
|
||||||
$config['default_view'] = '###DASHBOARDVIEW###';
|
$config['default_view'] = '###DASHBOARDVIEW###';
|
||||||
@ -56,32 +58,32 @@ class ###Component###Controller extends BaseController
|
|||||||
$id = $this->input->getInt('id');
|
$id = $this->input->getInt('id');
|
||||||
|
|
||||||
// Check for edit form.
|
// Check for edit form.
|
||||||
if(###Component###Helper::checkArray($data))
|
if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($data))
|
||||||
{
|
{
|
||||||
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id))
|
if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id))
|
||||||
{
|
{
|
||||||
// Somehow the person just went to the form - we don't allow that.
|
// Somehow the person just went to the form - we don't allow that.
|
||||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||||
$this->setMessage($this->getError(), 'error');
|
$this->setMessage($this->getError(), 'error');
|
||||||
// check if item was opend from other then its own list view
|
// check if item was opend from other then its own list view
|
||||||
$ref = $this->input->getCmd('ref', 0);
|
$ref = $this->input->getCmd('ref', 0);
|
||||||
$refid = $this->input->getInt('refid', 0);
|
$refid = $this->input->getInt('refid', 0);
|
||||||
// set redirect
|
// set redirect
|
||||||
if ($refid > 0 && ###Component###Helper::checkString($ref))
|
if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref))
|
||||||
{
|
{
|
||||||
// redirect to item of ref
|
// redirect to item of ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
||||||
}
|
}
|
||||||
elseif (###Component###Helper::checkString($ref))
|
elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref))
|
||||||
{
|
{
|
||||||
|
|
||||||
// redirect to ref
|
// redirect to ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// normal redirect back to the list view
|
// normal redirect back to the list view
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view='.$data['views'], false));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -94,7 +96,7 @@ class ###Component###Controller extends BaseController
|
|||||||
protected function getViewRelation($view)
|
protected function getViewRelation($view)
|
||||||
{
|
{
|
||||||
// check the we have a value
|
// check the we have a value
|
||||||
if (###Component###Helper::checkString($view))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view))
|
||||||
{
|
{
|
||||||
// the view relationships
|
// the view relationships
|
||||||
$views = array(###VIEWARRAY###
|
$views = array(###VIEWARRAY###
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\CMS\MVC\Controller\BaseController;
|
use Joomla\CMS\MVC\Controller\BaseController;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,9 +31,9 @@ class ###Component###ControllerAjax extends BaseController
|
|||||||
{
|
{
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
// make sure all json stuff are set
|
// make sure all json stuff are set
|
||||||
JFactory::getDocument()->setMimeEncoding( 'application/json' );
|
Factory::getDocument()->setMimeEncoding( 'application/json' );
|
||||||
// get the application
|
// get the application
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$app->setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
$app->setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
||||||
$app->setHeader('Access-Control-Allow-Origin', '*');
|
$app->setHeader('Access-Control-Allow-Origin', '*');
|
||||||
// load the tasks ###REGISTER_AJAX_TASK###
|
// load the tasks ###REGISTER_AJAX_TASK###
|
||||||
@ -40,15 +42,15 @@ class ###Component###ControllerAjax extends BaseController
|
|||||||
public function ajax()
|
public function ajax()
|
||||||
{
|
{
|
||||||
// get the user for later use
|
// get the user for later use
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
// get the input values
|
// get the input values
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
// check if we should return raw
|
// check if we should return raw
|
||||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||||
// return to a callback function
|
// return to a callback function
|
||||||
$callback = $jinput->get('callback', null, 'CMD');
|
$callback = $jinput->get('callback', null, 'CMD');
|
||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = Session::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
|
if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\CMS\MVC\Controller\BaseController;
|
use Joomla\CMS\MVC\Controller\BaseController;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,9 +31,9 @@ class ###Component###ControllerAjax extends BaseController
|
|||||||
{
|
{
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
// make sure all json stuff are set
|
// make sure all json stuff are set
|
||||||
JFactory::getDocument()->setMimeEncoding( 'application/json' );
|
Factory::getDocument()->setMimeEncoding( 'application/json' );
|
||||||
// get the application
|
// get the application
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$app->setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
$app->setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
||||||
$app->setHeader('Access-Control-Allow-Origin', '*');
|
$app->setHeader('Access-Control-Allow-Origin', '*');
|
||||||
// load the tasks ###REGISTER_SITE_AJAX_TASK###
|
// load the tasks ###REGISTER_SITE_AJAX_TASK###
|
||||||
@ -40,15 +42,15 @@ class ###Component###ControllerAjax extends BaseController
|
|||||||
public function ajax()
|
public function ajax()
|
||||||
{
|
{
|
||||||
// get the user for later use
|
// get the user for later use
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
// get the input values
|
// get the input values
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
// check if we should return raw
|
// check if we should return raw
|
||||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||||
// return to a callback function
|
// return to a callback function
|
||||||
$callback = $jinput->get('callback', null, 'CMD');
|
$callback = $jinput->get('callback', null, 'CMD');
|
||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = Session::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
|
if($jinput->get($token, 0, 'ALNUM') || $token === $call_token)
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\CMS\MVC\Controller\BaseController;
|
use Joomla\CMS\MVC\Controller\BaseController;
|
||||||
|
use Joomla\CMS\Uri\Uri;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,12 +37,12 @@ class ###Component###ControllerHelp extends BaseController
|
|||||||
|
|
||||||
public function help()
|
public function help()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = Session::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($user->id != 0 && $token == $call_token)
|
if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token))
|
||||||
{
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task){
|
switch($task){
|
||||||
@ -76,7 +79,7 @@ class ###Component###ControllerHelp extends BaseController
|
|||||||
|
|
||||||
protected function getHelpDocumentText($id)
|
protected function getHelpDocumentText($id)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select(array('a.title','a.content'));
|
$query->select(array('a.title','a.content'));
|
||||||
$query->from('#__###component###_help_document AS a');
|
$query->from('#__###component###_help_document AS a');
|
||||||
@ -86,21 +89,21 @@ class ###Component###ControllerHelp extends BaseController
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
if($db->getNumRows())
|
if($db->getNumRows())
|
||||||
{
|
{
|
||||||
$text = array();
|
$text = [];
|
||||||
$document = $db->loadObject();
|
$document = $db->loadObject();
|
||||||
// fix image issue
|
// fix image issue
|
||||||
$images['src="images'] = 'src="'.JURI::root().'images';
|
$images['src="images'] = 'src="'.Uri::root().'images';
|
||||||
$images["src='images"] = "src='".JURI::root()."images";
|
$images["src='images"] = "src='".Uri::root()."images";
|
||||||
$images['src="/images'] = 'src="'.JURI::root().'images';
|
$images['src="/images'] = 'src="'.Uri::root().'images';
|
||||||
$images["src='/images"] = "src='".JURI::root()."images";
|
$images["src='/images"] = "src='".Uri::root()."images";
|
||||||
// set document template
|
// set document template
|
||||||
$text[] = "<!doctype html>";
|
$text[] = "<!doctype html>";
|
||||||
$text[] = '<html>';
|
$text[] = '<html>';
|
||||||
$text[] = "<head>";
|
$text[] = "<head>";
|
||||||
$text[] = '<meta charset="utf-8">';
|
$text[] = '<meta charset="utf-8">';
|
||||||
$text[] = "<title>".$document->title."</title>";
|
$text[] = "<title>".$document->title."</title>";
|
||||||
$text[] = '<link type="text/css" href="'.JURI::root().'media/com_###component###/uikit/css/uikit.gradient.min.css" rel="stylesheet"></link>';
|
$text[] = '<link type="text/css" href="'.Uri::root().'media/com_###component###/uikit/css/uikit.gradient.min.css" rel="stylesheet"></link>';
|
||||||
$text[] = '<script type="text/javascript" src="'.JURI::root().'media/com_###component###/uikit/js/uikit.min.js"></script>';
|
$text[] = '<script type="text/javascript" src="'.Uri::root().'media/com_###component###/uikit/js/uikit.min.js"></script>';
|
||||||
$text[] = "</head>";
|
$text[] = "</head>";
|
||||||
$text[] = '<body><br />';
|
$text[] = '<body><br />';
|
||||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\CMS\MVC\Controller\BaseController;
|
use Joomla\CMS\MVC\Controller\BaseController;
|
||||||
|
use Joomla\CMS\Uri\Uri;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,12 +37,12 @@ class ###Component###ControllerHelp extends BaseController
|
|||||||
|
|
||||||
public function help()
|
public function help()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = Session::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($token == $call_token)
|
if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token))
|
||||||
{
|
{
|
||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
switch($task){
|
switch($task){
|
||||||
@ -76,7 +79,7 @@ class ###Component###ControllerHelp extends BaseController
|
|||||||
|
|
||||||
protected function getHelpDocumentText($id)
|
protected function getHelpDocumentText($id)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select(array('a.title','a.content'));
|
$query->select(array('a.title','a.content'));
|
||||||
$query->from('#__###component###_help_document AS a');
|
$query->from('#__###component###_help_document AS a');
|
||||||
@ -87,21 +90,21 @@ class ###Component###ControllerHelp extends BaseController
|
|||||||
$db->execute();
|
$db->execute();
|
||||||
if($db->getNumRows())
|
if($db->getNumRows())
|
||||||
{
|
{
|
||||||
$text = array();
|
$text = [];
|
||||||
$document = $db->loadObject();
|
$document = $db->loadObject();
|
||||||
// fix image issue
|
// fix image issue
|
||||||
$images['src="images'] = 'src="'.JURI::root().'images';
|
$images['src="images'] = 'src="'.Uri::root().'images';
|
||||||
$images["src='images"] = "src='".JURI::root()."images";
|
$images["src='images"] = "src='".Uri::root()."images";
|
||||||
$images['src="/images'] = 'src="'.JURI::root().'images';
|
$images['src="/images'] = 'src="'.Uri::root().'images';
|
||||||
$images["src='/images"] = "src='".JURI::root()."images";
|
$images["src='/images"] = "src='".Uri::root()."images";
|
||||||
// set document template
|
// set document template
|
||||||
$text[] = "<!doctype html>";
|
$text[] = "<!doctype html>";
|
||||||
$text[] = '<html>';
|
$text[] = '<html>';
|
||||||
$text[] = "<head>";
|
$text[] = "<head>";
|
||||||
$text[] = '<meta charset="utf-8">';
|
$text[] = '<meta charset="utf-8">';
|
||||||
$text[] = "<title>".$document->title."</title>";
|
$text[] = "<title>".$document->title."</title>";
|
||||||
$text[] = '<link type="text/css" href="'.JURI::root().'media/com_###component###/uikit/css/uikit.gradient.min.css" rel="stylesheet"></link>';
|
$text[] = '<link type="text/css" href="'.Uri::root().'media/com_###component###/uikit/css/uikit.gradient.min.css" rel="stylesheet"></link>';
|
||||||
$text[] = '<script type="text/javascript" src="'.JURI::root().'media/com_###component###/uikit/js/uikit.min.js"></script>';
|
$text[] = '<script type="text/javascript" src="'.Uri::root().'media/com_###component###/uikit/js/uikit.min.js"></script>';
|
||||||
$text[] = "</head>";
|
$text[] = "</head>";
|
||||||
$text[] = '<body><br />';
|
$text[] = '<body><br />';
|
||||||
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
$text[] = '<div class="uk-container uk-container-center uk-grid-collapse">';
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,8 +17,11 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\CMS\MVC\Controller\BaseController;
|
use Joomla\CMS\MVC\Controller\BaseController;
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Component Base Controller
|
* ###Component### Component Base Controller
|
||||||
@ -45,7 +48,7 @@ class ###Component###Controller extends BaseController
|
|||||||
// $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238)
|
// $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238)
|
||||||
|
|
||||||
// insure that the view is not cashable if edit view or if user is logged in
|
// insure that the view is not cashable if edit view or if user is logged in
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
if ($user->get('id') || $isEdit)
|
if ($user->get('id') || $isEdit)
|
||||||
{
|
{
|
||||||
$cachable = false;
|
$cachable = false;
|
||||||
@ -57,26 +60,26 @@ class ###Component###Controller extends BaseController
|
|||||||
if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id))
|
if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id))
|
||||||
{
|
{
|
||||||
// Somehow the person just went to the form - we don't allow that.
|
// Somehow the person just went to the form - we don't allow that.
|
||||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
$this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
|
||||||
$this->setMessage($this->getError(), 'error');
|
$this->setMessage($this->getError(), 'error');
|
||||||
// check if item was opend from other then its own list view
|
// check if item was opend from other then its own list view
|
||||||
$ref = $this->input->getCmd('ref', 0);
|
$ref = $this->input->getCmd('ref', 0);
|
||||||
$refid = $this->input->getInt('refid', 0);
|
$refid = $this->input->getInt('refid', 0);
|
||||||
// set redirect
|
// set redirect
|
||||||
if ($refid > 0 && ###Component###Helper::checkString($ref))
|
if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref))
|
||||||
{
|
{
|
||||||
// redirect to item of ref
|
// redirect to item of ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
|
||||||
}
|
}
|
||||||
elseif (###Component###Helper::checkString($ref))
|
elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref))
|
||||||
{
|
{
|
||||||
// redirect to ref
|
// redirect to ref
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// normal redirect back to the list default site view
|
// normal redirect back to the list default site view
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -102,9 +105,9 @@ class ###Component###Controller extends BaseController
|
|||||||
'Itemid' => 'INT');
|
'Itemid' => 'INT');
|
||||||
|
|
||||||
// should these not merge?
|
// should these not merge?
|
||||||
if (###Component###Helper::checkArray($urlparams))
|
if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($urlparams))
|
||||||
{
|
{
|
||||||
$safeurlparams = ###Component###Helper::mergeArrays(array($urlparams, $safeurlparams));
|
$safeurlparams = Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge(array($urlparams, $safeurlparams));
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::display($cachable, $safeurlparams);
|
return parent::display($cachable, $safeurlparams);
|
||||||
@ -112,7 +115,7 @@ class ###Component###Controller extends BaseController
|
|||||||
|
|
||||||
protected function checkEditView($view)
|
protected function checkEditView($view)
|
||||||
{
|
{
|
||||||
if (###Component###Helper::checkString($view))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view))
|
||||||
{
|
{
|
||||||
$views = array(###SITE_EDIT_VIEW_ARRAY###
|
$views = array(###SITE_EDIT_VIEW_ARRAY###
|
||||||
);
|
);
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -31,7 +31,7 @@ class ###Component###Controller###SView### extends BaseController
|
|||||||
|
|
||||||
public function dashboard()
|
public function dashboard()
|
||||||
{
|
{
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###', false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###', false));
|
||||||
return;
|
return;
|
||||||
}###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER###
|
}###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER###
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -32,21 +32,21 @@ class ###Component###ControllerImport extends BaseController
|
|||||||
public function import()
|
public function import()
|
||||||
{
|
{
|
||||||
// Check for request forgeries
|
// Check for request forgeries
|
||||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
$model = $this->getModel('import');
|
$model = $this->getModel('import');
|
||||||
if ($model->import())
|
if ($model->import())
|
||||||
{
|
{
|
||||||
$cache = JFactory::getCache('mod_menu');
|
$cache = Factory::getCache('mod_menu');
|
||||||
$cache->clean();
|
$cache->clean();
|
||||||
// TODO: Reset the users acl here as well to kill off any missing bits
|
// TODO: Reset the users acl here as well to kill off any missing bits
|
||||||
}
|
}
|
||||||
|
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$redirect_url = $app->getUserState('com_###component###.redirect_url');
|
$redirect_url = $app->getUserState('com_###component###.redirect_url');
|
||||||
if (empty($redirect_url))
|
if (empty($redirect_url))
|
||||||
{
|
{
|
||||||
$redirect_url = JRoute::_('index.php?option=com_###component###&view=import', false);
|
$redirect_url = Route::_('index.php?option=com_###component###&view=import', false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -32,21 +32,21 @@ class ###Component###Controller###View### extends BaseController
|
|||||||
public function import()
|
public function import()
|
||||||
{
|
{
|
||||||
// Check for request forgeries
|
// Check for request forgeries
|
||||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
$model = $this->getModel('###View###');
|
$model = $this->getModel('###View###');
|
||||||
if ($model->import())
|
if ($model->import())
|
||||||
{
|
{
|
||||||
$cache = JFactory::getCache('mod_menu');
|
$cache = Factory::getCache('mod_menu');
|
||||||
$cache->clean();
|
$cache->clean();
|
||||||
// TODO: Reset the users acl here as well to kill off any missing bits
|
// TODO: Reset the users acl here as well to kill off any missing bits
|
||||||
}
|
}
|
||||||
|
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$redirect_url = $app->getUserState('com_###component###.redirect_url');
|
$redirect_url = $app->getUserState('com_###component###.redirect_url');
|
||||||
if (empty($redirect_url))
|
if (empty($redirect_url))
|
||||||
{
|
{
|
||||||
$redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false);
|
$redirect_url = Route::_('index.php?option=com_###component###&view=###view###', false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -27,7 +27,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
// set uploading values
|
// set uploading values
|
||||||
protected $use_streams = false;
|
protected $use_streams = false;
|
||||||
protected $allow_unsafe = false;
|
protected $allow_unsafe = false;
|
||||||
protected $safeFileOptions = array();
|
protected $safeFileOptions = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var object JTable object
|
* @var object JTable object
|
||||||
@ -62,7 +62,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication('administrator');
|
$app = Factory::getApplication('administrator');
|
||||||
|
|
||||||
$this->setState('message', $app->getUserState('com_###component###.message'));
|
$this->setState('message', $app->getUserState('com_###component###.message'));
|
||||||
$app->setUserState('com_###component###.message', '');
|
$app->setUserState('com_###component###.message', '');
|
||||||
@ -82,8 +82,8 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
public function import()
|
public function import()
|
||||||
{
|
{
|
||||||
$this->setState('action', 'import');
|
$this->setState('action', 'import');
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$session = JFactory::getSession();
|
$session = Factory::getSession();
|
||||||
$package = null;
|
$package = null;
|
||||||
$continue = false;
|
$continue = false;
|
||||||
// get import type
|
// get import type
|
||||||
@ -120,7 +120,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND'));
|
$app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND'));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
@ -134,7 +134,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
$this->remove($package['packagename']);
|
$this->remove($package['packagename']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
|
$app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
if (!$this->setData($package,$this->dataType,$headerList))
|
if (!$this->setData($package,$this->dataType,$headerList))
|
||||||
{
|
{
|
||||||
// There was an error importing the package
|
// There was an error importing the package
|
||||||
$msg = JText::_('COM_###COMPONENT###_IMPORT_ERROR');
|
$msg = Text::_('COM_###COMPONENT###_IMPORT_ERROR');
|
||||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||||
if ($back)
|
if ($back)
|
||||||
{
|
{
|
||||||
@ -164,7 +164,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Package imported sucessfully
|
// Package imported sucessfully
|
||||||
$msg = JText::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']);
|
$msg = Text::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']);
|
||||||
$back = $session->get('backto_VDM_IMPORT', NULL);
|
$back = $session->get('backto_VDM_IMPORT', NULL);
|
||||||
if ($back)
|
if ($back)
|
||||||
{
|
{
|
||||||
@ -192,7 +192,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
protected function _getPackageFromUpload()
|
protected function _getPackageFromUpload()
|
||||||
{
|
{
|
||||||
// Get the uploaded file information
|
// Get the uploaded file information
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||||
@ -201,37 +201,36 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
// Make sure that file uploads are enabled in php
|
// Make sure that file uploads are enabled in php
|
||||||
if (!(bool) ini_get('file_uploads'))
|
if (!(bool) ini_get('file_uploads'))
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is no uploaded file, we have a problem...
|
// If there is no uploaded file, we have a problem...
|
||||||
if (!is_array($userfile))
|
if (!is_array($userfile))
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there was a problem uploading the file.
|
// Check if there was a problem uploading the file.
|
||||||
if ($userfile['error'] || $userfile['size'] < 1)
|
if ($userfile['error'] || $userfile['size'] < 1)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the appropriate paths
|
// Build the appropriate paths
|
||||||
$config = JFactory::getConfig();
|
$config = Factory::getConfig();
|
||||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||||
$tmp_src = $userfile['tmp_name'];
|
$tmp_src = $userfile['tmp_name'];
|
||||||
|
|
||||||
// Move uploaded file
|
// Move uploaded file
|
||||||
jimport('joomla.filesystem.file');
|
|
||||||
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
|
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
|
||||||
|
|
||||||
// Was the package downloaded?
|
// Was the package downloaded?
|
||||||
if (!$p_file)
|
if (!$p_file)
|
||||||
{
|
{
|
||||||
$session = JFactory::getSession();
|
$session = Factory::getSession();
|
||||||
$session->clear('package');
|
$session->clear('package');
|
||||||
$session->clear('dataType');
|
$session->clear('dataType');
|
||||||
$session->clear('hasPackage');
|
$session->clear('hasPackage');
|
||||||
@ -253,16 +252,16 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromFolder()
|
protected function _getPackageFromFolder()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the path to the package to import
|
// Get the path to the package to import
|
||||||
$p_dir = $input->getString('import_directory');
|
$p_dir = $input->getString('import_directory');
|
||||||
$p_dir = JPath::clean($p_dir);
|
$p_dir = Path::clean($p_dir);
|
||||||
// Did you give us a valid path?
|
// Did you give us a valid path?
|
||||||
if (!file_exists($p_dir))
|
if (!file_exists($p_dir))
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,14 +271,14 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
// Did you give us a valid package?
|
// Did you give us a valid package?
|
||||||
if (!$type)
|
if (!$type)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the extention
|
// check the extention
|
||||||
if(!$this->checkExtension($p_dir))
|
if(!$this->checkExtension($p_dir))
|
||||||
{
|
{
|
||||||
// set error message
|
// set error message
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +297,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromUrl()
|
protected function _getPackageFromUrl()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the URL of the package to import
|
// Get the URL of the package to import
|
||||||
@ -307,17 +306,17 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
// Did you give us a URL?
|
// Did you give us a URL?
|
||||||
if (!$url)
|
if (!$url)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download the package at the URL given
|
// Download the package at the URL given
|
||||||
$p_file = JInstallerHelper::downloadPackage($url);
|
$p_file = InstallerHelper::downloadPackage($url);
|
||||||
|
|
||||||
// Was the package downloaded?
|
// Was the package downloaded?
|
||||||
if (!$p_file)
|
if (!$p_file)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,20 +337,20 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function check($archivename)
|
protected function check($archivename)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
// Clean the name
|
// Clean the name
|
||||||
$archivename = JPath::clean($archivename);
|
$archivename = Path::clean($archivename);
|
||||||
|
|
||||||
// check the extention
|
// check the extention
|
||||||
if(!$this->checkExtension($archivename))
|
if(!$this->checkExtension($archivename))
|
||||||
{
|
{
|
||||||
// Cleanup the import files
|
// Cleanup the import files
|
||||||
$this->remove($archivename);
|
$this->remove($archivename);
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
$config = Factory::getConfig();
|
||||||
// set Package Name
|
// set Package Name
|
||||||
$check['packagename'] = $archivename;
|
$check['packagename'] = $archivename;
|
||||||
|
|
||||||
@ -376,7 +375,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
{
|
{
|
||||||
jimport('joomla.filesystem.file');
|
jimport('joomla.filesystem.file');
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
$config = Factory::getConfig();
|
||||||
$package = $config->get('tmp_path'). '/' .$package;
|
$package = $config->get('tmp_path'). '/' .$package;
|
||||||
|
|
||||||
// Is the package file a valid file?
|
// Is the package file a valid file?
|
||||||
@ -384,23 +383,23 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
{
|
{
|
||||||
File::delete($package);
|
File::delete($package);
|
||||||
}
|
}
|
||||||
elseif (is_file(JPath::clean($package)))
|
elseif (is_file(Path::clean($package)))
|
||||||
{
|
{
|
||||||
// It might also be just a base filename
|
// It might also be just a base filename
|
||||||
File::delete(JPath::clean($package));
|
File::delete(Path::clean($package));
|
||||||
}
|
}
|
||||||
}###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD###
|
}###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD###
|
||||||
|
|
||||||
protected function getAlias($name,$type = false)
|
protected function getAlias($name,$type = false)
|
||||||
{
|
{
|
||||||
// sanitize the name to an alias
|
// sanitize the name to an alias
|
||||||
if (JFactory::getConfig()->get('unicodeslugs') == 1)
|
if (Factory::getConfig()->get('unicodeslugs') == 1)
|
||||||
{
|
{
|
||||||
$alias = JFilterOutput::stringURLUnicodeSlug($name);
|
$alias = OutputFilter::stringURLUnicodeSlug($name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$alias = JFilterOutput::stringURLSafe($name);
|
$alias = OutputFilter::stringURLSafe($name);
|
||||||
}
|
}
|
||||||
// must be a uniqe alias
|
// must be a uniqe alias
|
||||||
if ($type)
|
if ($type)
|
||||||
@ -424,7 +423,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
// insure the filed is always uniqe
|
// insure the filed is always uniqe
|
||||||
while (isset($this->uniqeValueArray[$type][$field][$value]))
|
while (isset($this->uniqeValueArray[$type][$field][$value]))
|
||||||
{
|
{
|
||||||
$value = JString::increment($value, 'dash');
|
$value = StringHelper::increment($value, 'dash');
|
||||||
}
|
}
|
||||||
$this->uniqeValueArray[$type][$field][$value] = $value;
|
$this->uniqeValueArray[$type][$field][$value] = $value;
|
||||||
return $value;
|
return $value;
|
||||||
@ -433,7 +432,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
|
|||||||
protected function getAliasesUsed($table)
|
protected function getAliasesUsed($table)
|
||||||
{
|
{
|
||||||
// Get a db connection.
|
// Get a db connection.
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
// first we check if there is a alias column
|
// first we check if there is a alias column
|
||||||
$columns = $db->getTableColumns('#__###component###_'.$table);
|
$columns = $db->getTableColumns('#__###component###_'.$table);
|
||||||
if(isset($columns['alias'])){
|
if(isset($columns['alias'])){
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -27,7 +27,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
// set uploading values
|
// set uploading values
|
||||||
protected $use_streams = false;
|
protected $use_streams = false;
|
||||||
protected $allow_unsafe = false;
|
protected $allow_unsafe = false;
|
||||||
protected $safeFileOptions = array();
|
protected $safeFileOptions = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var object JTable object
|
* @var object JTable object
|
||||||
@ -62,7 +62,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication('administrator');
|
$app = Factory::getApplication('administrator');
|
||||||
|
|
||||||
$this->setState('message', $app->getUserState('com_###component###.message'));
|
$this->setState('message', $app->getUserState('com_###component###.message'));
|
||||||
$app->setUserState('com_###component###.message', '');
|
$app->setUserState('com_###component###.message', '');
|
||||||
@ -82,7 +82,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
protected function _getPackageFromUpload()
|
protected function _getPackageFromUpload()
|
||||||
{
|
{
|
||||||
// Get the uploaded file information
|
// Get the uploaded file information
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||||
@ -91,26 +91,26 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
// Make sure that file uploads are enabled in php
|
// Make sure that file uploads are enabled in php
|
||||||
if (!(bool) ini_get('file_uploads'))
|
if (!(bool) ini_get('file_uploads'))
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is no uploaded file, we have a problem...
|
// If there is no uploaded file, we have a problem...
|
||||||
if (!is_array($userfile))
|
if (!is_array($userfile))
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there was a problem uploading the file.
|
// Check if there was a problem uploading the file.
|
||||||
if ($userfile['error'] || $userfile['size'] < 1)
|
if ($userfile['error'] || $userfile['size'] < 1)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the appropriate paths
|
// Build the appropriate paths
|
||||||
$config = JFactory::getConfig();
|
$config = Factory::getConfig();
|
||||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||||
$tmp_src = $userfile['tmp_name'];
|
$tmp_src = $userfile['tmp_name'];
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
// Was the package downloaded?
|
// Was the package downloaded?
|
||||||
if (!$p_file)
|
if (!$p_file)
|
||||||
{
|
{
|
||||||
$session = JFactory::getSession();
|
$session = Factory::getSession();
|
||||||
$session->clear('package');
|
$session->clear('package');
|
||||||
$session->clear('dataType');
|
$session->clear('dataType');
|
||||||
$session->clear('hasPackage');
|
$session->clear('hasPackage');
|
||||||
@ -142,16 +142,16 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromFolder()
|
protected function _getPackageFromFolder()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the path to the package to import
|
// Get the path to the package to import
|
||||||
$p_dir = $input->getString('import_directory');
|
$p_dir = $input->getString('import_directory');
|
||||||
$p_dir = JPath::clean($p_dir);
|
$p_dir = Path::clean($p_dir);
|
||||||
// Did you give us a valid path?
|
// Did you give us a valid path?
|
||||||
if (!file_exists($p_dir))
|
if (!file_exists($p_dir))
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,14 +161,14 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
// Did you give us a valid package?
|
// Did you give us a valid package?
|
||||||
if (!$type)
|
if (!$type)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the extention
|
// check the extention
|
||||||
if(!$this->checkExtension($p_dir))
|
if(!$this->checkExtension($p_dir))
|
||||||
{
|
{
|
||||||
// set error message
|
// set error message
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function _getPackageFromUrl()
|
protected function _getPackageFromUrl()
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$input = $app->input;
|
$input = $app->input;
|
||||||
|
|
||||||
// Get the URL of the package to import
|
// Get the URL of the package to import
|
||||||
@ -196,17 +196,17 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
// Did you give us a URL?
|
// Did you give us a URL?
|
||||||
if (!$url)
|
if (!$url)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download the package at the URL given
|
// Download the package at the URL given
|
||||||
$p_file = JInstallerHelper::downloadPackage($url);
|
$p_file = InstallerHelper::downloadPackage($url);
|
||||||
|
|
||||||
// Was the package downloaded?
|
// Was the package downloaded?
|
||||||
if (!$p_file)
|
if (!$p_file)
|
||||||
{
|
{
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,20 +227,20 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function check($archivename)
|
protected function check($archivename)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
// Clean the name
|
// Clean the name
|
||||||
$archivename = JPath::clean($archivename);
|
$archivename = Path::clean($archivename);
|
||||||
|
|
||||||
// check the extention
|
// check the extention
|
||||||
if(!$this->checkExtension($archivename))
|
if(!$this->checkExtension($archivename))
|
||||||
{
|
{
|
||||||
// Cleanup the import files
|
// Cleanup the import files
|
||||||
$this->remove($archivename);
|
$this->remove($archivename);
|
||||||
$app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
$app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
$config = Factory::getConfig();
|
||||||
// set Package Name
|
// set Package Name
|
||||||
$check['packagename'] = $archivename;
|
$check['packagename'] = $archivename;
|
||||||
|
|
||||||
@ -264,9 +264,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
*/
|
*/
|
||||||
protected function remove($package)
|
protected function remove($package)
|
||||||
{
|
{
|
||||||
jimport('joomla.filesystem.file');
|
$config = Factory::getConfig();
|
||||||
|
|
||||||
$config = JFactory::getConfig();
|
|
||||||
$package = $config->get('tmp_path'). '/' .$package;
|
$package = $config->get('tmp_path'). '/' .$package;
|
||||||
|
|
||||||
// Is the package file a valid file?
|
// Is the package file a valid file?
|
||||||
@ -274,10 +272,10 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
{
|
{
|
||||||
File::delete($package);
|
File::delete($package);
|
||||||
}
|
}
|
||||||
elseif (is_file(JPath::clean($package)))
|
elseif (is_file(Path::clean($package)))
|
||||||
{
|
{
|
||||||
// It might also be just a base filename
|
// It might also be just a base filename
|
||||||
File::delete(JPath::clean($package));
|
File::delete(Path::clean($package));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
###IMPORT_SETDATA_METHOD###
|
###IMPORT_SETDATA_METHOD###
|
||||||
@ -286,13 +284,13 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
protected function getAlias($name,$type = false)
|
protected function getAlias($name,$type = false)
|
||||||
{
|
{
|
||||||
// sanitize the name to an alias
|
// sanitize the name to an alias
|
||||||
if (JFactory::getConfig()->get('unicodeslugs') == 1)
|
if (Factory::getConfig()->get('unicodeslugs') == 1)
|
||||||
{
|
{
|
||||||
$alias = JFilterOutput::stringURLUnicodeSlug($name);
|
$alias = OutputFilter::stringURLUnicodeSlug($name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$alias = JFilterOutput::stringURLSafe($name);
|
$alias = OutputFilter::stringURLSafe($name);
|
||||||
}
|
}
|
||||||
// must be a uniqe alias
|
// must be a uniqe alias
|
||||||
if ($type)
|
if ($type)
|
||||||
@ -316,7 +314,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
// insure the filed is always uniqe
|
// insure the filed is always uniqe
|
||||||
while (isset($this->uniqeValueArray[$type][$field][$value]))
|
while (isset($this->uniqeValueArray[$type][$field][$value]))
|
||||||
{
|
{
|
||||||
$value = JString::increment($value, 'dash');
|
$value = StringHelper::increment($value, 'dash');
|
||||||
}
|
}
|
||||||
$this->uniqeValueArray[$type][$field][$value] = $value;
|
$this->uniqeValueArray[$type][$field][$value] = $value;
|
||||||
return $value;
|
return $value;
|
||||||
@ -325,7 +323,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
|
|||||||
protected function getAliasesUsed($table)
|
protected function getAliasesUsed($table)
|
||||||
{
|
{
|
||||||
// Get a db connection.
|
// Get a db connection.
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
// first we check if there is a alias column
|
// first we check if there is a alias column
|
||||||
$columns = $db->getTableColumns('#__###component###_'.$table);
|
$columns = $db->getTableColumns('#__###component###_'.$table);
|
||||||
if(isset($columns['alias'])){
|
if(isset($columns['alias'])){
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -22,7 +22,7 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
/**
|
/**
|
||||||
* ###Component### View class
|
* ###Component### View class
|
||||||
*/
|
*/
|
||||||
class ###Component###View###Component### extends JViewLegacy
|
class ###Component###View###Component### extends HtmlView
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* View display method
|
* View display method
|
||||||
@ -59,18 +59,18 @@ class ###Component###View###Component### extends JViewLegacy
|
|||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
$canDo = ###Component###Helper::getActions('###component###');
|
$canDo = ###Component###Helper::getActions('###component###');
|
||||||
JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
|
ToolbarHelper::title(Text::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('###component###');
|
$this->help_url = ###Component###Helper::getHelpUrl('###component###');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
ToolbarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,15 +81,17 @@ class ###Component###View###Component### extends JViewLegacy
|
|||||||
*/
|
*/
|
||||||
protected function setDocument()
|
protected function setDocument()
|
||||||
{
|
{
|
||||||
$document = JFactory::getDocument();
|
if (!isset($this->document))
|
||||||
|
{
|
||||||
// add dashboard style sheets
|
$this->document = Factory::getDocument();
|
||||||
$document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/dashboard.css");
|
}
|
||||||
|
|
||||||
// set page title
|
// set page title
|
||||||
$document->setTitle(JText::_('COM_###COMPONENT###_DASHBOARD'));
|
$this->document->setTitle(Text::_('COM_###COMPONENT###_DASHBOARD'));
|
||||||
|
|
||||||
// add manifest to page JavaScript
|
// add manifest to page JavaScript
|
||||||
$document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript");
|
$this->document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript");
|
||||||
|
|
||||||
|
// add dashboard style sheets
|
||||||
|
Html::_('stylesheet', "administrator/components/com_###component###/assets/css/dashboard.css", ['version' => 'auto']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -40,7 +40,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function __construct($config = array())
|
public function __construct($config = [])
|
||||||
{
|
{
|
||||||
$this->view_list = '###Views###'; // safeguard for setting the return view listing to the main view.
|
$this->view_list = '###Views###'; // safeguard for setting the return view listing to the main view.
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function allowAdd($data = array())
|
protected function allowAdd($data = [])
|
||||||
{###JCONTROLLERFORM_ALLOWADD###
|
{###JCONTROLLERFORM_ALLOWADD###
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function allowEdit($data = array(), $key = 'id')
|
protected function allowEdit($data = [], $key = 'id')
|
||||||
{###JCONTROLLERFORM_ALLOWEDIT###
|
{###JCONTROLLERFORM_ALLOWEDIT###
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,11 +95,11 @@ class ###Component###Controller###View### extends FormController
|
|||||||
// set the referral options
|
// set the referral options
|
||||||
if ($refid && $ref)
|
if ($refid && $ref)
|
||||||
{
|
{
|
||||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
$append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append = '&ref='. (string)$ref . $append;
|
$append = '&ref='. (string) $ref . $append;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $append;
|
return $append;
|
||||||
@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*/
|
*/
|
||||||
public function batch($model = null)
|
public function batch($model = null)
|
||||||
{
|
{
|
||||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
// Set the model
|
// Set the model
|
||||||
$model = $this->getModel('###View###', '', array());
|
$model = $this->getModel('###View###', '', []);
|
||||||
|
|
||||||
// Preset the redirect
|
// Preset the redirect
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
|
||||||
|
|
||||||
return parent::batch($model);
|
return parent::batch($model);
|
||||||
}
|
}
|
||||||
@ -147,13 +147,13 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
$cancel = parent::cancel($key);
|
$cancel = parent::cancel($key);
|
||||||
|
|
||||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
if (!is_null($return) && Uri::isInternal(base64_decode($return)))
|
||||||
{
|
{
|
||||||
$redirect = base64_decode($return);
|
$redirect = base64_decode($return);
|
||||||
|
|
||||||
// Redirect to the return value.
|
// Redirect to the return value.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
$redirect, false
|
$redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -164,7 +164,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
// Redirect to the item screen.
|
// Redirect to the item screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -175,7 +175,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
// Redirect to the list screen.
|
// Redirect to the list screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
// Check if there is a return value
|
// Check if there is a return value
|
||||||
$return = $this->input->get('return', null, 'base64');
|
$return = $this->input->get('return', null, 'base64');
|
||||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
$canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
|
||||||
|
|
||||||
if ($this->ref || $this->refid || $canReturn)
|
if ($this->ref || $this->refid || $canReturn)
|
||||||
{
|
{
|
||||||
@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
// Redirect to the return value.
|
// Redirect to the return value.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
$redirect, false
|
$redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif ($this->refid && $this->ref)
|
elseif ($this->refid && $this->ref)
|
||||||
{
|
{
|
||||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
$redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
|
||||||
|
|
||||||
// Redirect to the item screen.
|
// Redirect to the item screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif ($this->ref)
|
elseif ($this->ref)
|
||||||
{
|
{
|
||||||
$redirect = '&view=' . (string)$this->ref;
|
$redirect = '&view=' . (string) $this->ref;
|
||||||
|
|
||||||
// Redirect to the list screen.
|
// Redirect to the list screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -253,15 +253,14 @@ class ###Component###Controller###View### extends FormController
|
|||||||
* Function that allows child controller access to model data
|
* Function that allows child controller access to model data
|
||||||
* after the data has been saved.
|
* after the data has been saved.
|
||||||
*
|
*
|
||||||
* @param JModel &$model The data model object.
|
* @param BaseDatabaseModel &$model The data model object.
|
||||||
* @param array $validData The validated data.
|
* @param array $validData The validated data.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 11.1
|
* @since 11.1
|
||||||
*/
|
*/
|
||||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
|
||||||
{###POSTSAVEHOOK###
|
{###POSTSAVEHOOK###
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -33,7 +33,7 @@ class ###Component###Controller###SView### extends FormController
|
|||||||
*/
|
*/
|
||||||
protected $task;
|
protected $task;
|
||||||
|
|
||||||
public function __construct($config = array())
|
public function __construct($config = [])
|
||||||
{
|
{
|
||||||
$this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view.
|
$this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view.
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
@ -51,7 +51,7 @@ class ###Component###Controller###SView### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 12.2
|
* @since 12.2
|
||||||
*/
|
*/
|
||||||
protected function allowEdit($data = array(), $key = 'id')
|
protected function allowEdit($data = [], $key = 'id')
|
||||||
{
|
{
|
||||||
// to insure no other tampering
|
// to insure no other tampering
|
||||||
return false;
|
return false;
|
||||||
@ -66,7 +66,7 @@ class ###Component###Controller###SView### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function allowAdd($data = array())
|
protected function allowAdd($data = [])
|
||||||
{
|
{
|
||||||
// to insure no other tampering
|
// to insure no other tampering
|
||||||
return false;
|
return false;
|
||||||
@ -101,7 +101,7 @@ class ###Component###Controller###SView### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 12.2
|
* @since 12.2
|
||||||
*/
|
*/
|
||||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
protected function postSaveHook(JModelLegacy $model, $validData = [])
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -40,7 +40,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
public function __construct($config = array())
|
public function __construct($config = [])
|
||||||
{
|
{
|
||||||
$this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view.
|
$this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view.
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function allowAdd($data = array())
|
protected function allowAdd($data = [])
|
||||||
{###JCONTROLLERFORM_ALLOWADD###
|
{###JCONTROLLERFORM_ALLOWADD###
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*
|
*
|
||||||
* @since 1.6
|
* @since 1.6
|
||||||
*/
|
*/
|
||||||
protected function allowEdit($data = array(), $key = 'id')
|
protected function allowEdit($data = [], $key = 'id')
|
||||||
{###JCONTROLLERFORM_ALLOWEDIT###
|
{###JCONTROLLERFORM_ALLOWEDIT###
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,11 +95,11 @@ class ###Component###Controller###View### extends FormController
|
|||||||
// set the referral options
|
// set the referral options
|
||||||
if ($refid && $ref)
|
if ($refid && $ref)
|
||||||
{
|
{
|
||||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
$append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
|
||||||
}
|
}
|
||||||
elseif ($ref)
|
elseif ($ref)
|
||||||
{
|
{
|
||||||
$append = '&ref='. (string)$ref . $append;
|
$append = '&ref='. (string) $ref . $append;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $append;
|
return $append;
|
||||||
@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController
|
|||||||
*/
|
*/
|
||||||
public function batch($model = null)
|
public function batch($model = null)
|
||||||
{
|
{
|
||||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
|
||||||
|
|
||||||
// Set the model
|
// Set the model
|
||||||
$model = $this->getModel('###View###', '', array());
|
$model = $this->getModel('###View###', '', []);
|
||||||
|
|
||||||
// Preset the redirect
|
// Preset the redirect
|
||||||
$this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
|
$this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
|
||||||
|
|
||||||
return parent::batch($model);
|
return parent::batch($model);
|
||||||
}
|
}
|
||||||
@ -147,35 +147,35 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
$cancel = parent::cancel($key);
|
$cancel = parent::cancel($key);
|
||||||
|
|
||||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
if (!is_null($return) && Uri::isInternal(base64_decode($return)))
|
||||||
{
|
{
|
||||||
$redirect = base64_decode($return);
|
$redirect = base64_decode($return);
|
||||||
|
|
||||||
// Redirect to the return value.
|
// Redirect to the return value.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
$redirect, false
|
$redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif ($this->refid && $this->ref)
|
elseif ($this->refid && $this->ref)
|
||||||
{
|
{
|
||||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
$redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
|
||||||
|
|
||||||
// Redirect to the item screen.
|
// Redirect to the item screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif ($this->ref)
|
elseif ($this->ref)
|
||||||
{
|
{
|
||||||
$redirect = '&view=' . (string)$this->ref;
|
$redirect = '&view=' . (string) $this->ref;
|
||||||
|
|
||||||
// Redirect to the list screen.
|
// Redirect to the list screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
// Check if there is a return value
|
// Check if there is a return value
|
||||||
$return = $this->input->get('return', null, 'base64');
|
$return = $this->input->get('return', null, 'base64');
|
||||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
$canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
|
||||||
|
|
||||||
if ($this->ref || $this->refid || $canReturn)
|
if ($this->ref || $this->refid || $canReturn)
|
||||||
{
|
{
|
||||||
@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController
|
|||||||
|
|
||||||
// Redirect to the return value.
|
// Redirect to the return value.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
$redirect, false
|
$redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif ($this->refid && $this->ref)
|
elseif ($this->refid && $this->ref)
|
||||||
{
|
{
|
||||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
$redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
|
||||||
|
|
||||||
// Redirect to the item screen.
|
// Redirect to the item screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif ($this->ref)
|
elseif ($this->ref)
|
||||||
{
|
{
|
||||||
$redirect = '&view=' . (string)$this->ref;
|
$redirect = '&view=' . (string) $this->ref;
|
||||||
|
|
||||||
// Redirect to the list screen.
|
// Redirect to the list screen.
|
||||||
$this->setRedirect(
|
$this->setRedirect(
|
||||||
JRoute::_(
|
Route::_(
|
||||||
'index.php?option=' . $this->option . $redirect, false
|
'index.php?option=' . $this->option . $redirect, false
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -253,14 +253,14 @@ class ###Component###Controller###View### extends FormController
|
|||||||
* Function that allows child controller access to model data
|
* Function that allows child controller access to model data
|
||||||
* after the data has been saved.
|
* after the data has been saved.
|
||||||
*
|
*
|
||||||
* @param JModel &$model The data model object.
|
* @param BaseDatabaseModel &$model The data model object.
|
||||||
* @param array $validData The validated data.
|
* @param array $validData The validated data.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 11.1
|
* @since 11.1
|
||||||
*/
|
*/
|
||||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
|
||||||
{###POSTSAVEHOOK###
|
{###POSTSAVEHOOK###
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -29,7 +29,7 @@ abstract class ###Component###Helper
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected static $composer = array();
|
protected static $composer = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Main Active Language
|
* The Main Active Language
|
||||||
@ -80,7 +80,7 @@ abstract class ###Component###Helper
|
|||||||
// check if set
|
// check if set
|
||||||
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
|
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
|
||||||
{
|
{
|
||||||
self::$JVersion = new JVersion();
|
self::$JVersion = new Version();
|
||||||
}
|
}
|
||||||
return self::$JVersion;
|
return self::$JVersion;
|
||||||
}
|
}
|
||||||
@ -91,9 +91,9 @@ abstract class ###Component###Helper
|
|||||||
public static function getContributors()
|
public static function getContributors()
|
||||||
{
|
{
|
||||||
// get params
|
// get params
|
||||||
$params = JComponentHelper::getParams('com_###component###');
|
$params = ComponentHelper::getParams('com_###component###');
|
||||||
// start contributors array
|
// start contributors array
|
||||||
$contributors = array();
|
$contributors = [];
|
||||||
// get all Contributors (max 20)
|
// get all Contributors (max 20)
|
||||||
$searchArray = range('0','20');
|
$searchArray = range('0','20');
|
||||||
foreach($searchArray as $nr)
|
foreach($searchArray as $nr)
|
||||||
@ -129,7 +129,7 @@ abstract class ###Component###Helper
|
|||||||
public static function addSubmenu($submenu)
|
public static function addSubmenu($submenu)
|
||||||
{
|
{
|
||||||
// load user for access menus
|
// load user for access menus
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
// load the submenus to sidebar
|
// load the submenus to sidebar
|
||||||
###SUBMENU###
|
###SUBMENU###
|
||||||
}###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL###
|
}###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL###
|
||||||
@ -211,7 +211,7 @@ abstract class ###Component###Helper
|
|||||||
{
|
{
|
||||||
$type = 'item';
|
$type = 'item';
|
||||||
}
|
}
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select(array('a.published'));
|
$query->select(array('a.published'));
|
||||||
$query->from('#__###component###_'.$type.' AS a');
|
$query->from('#__###component###_'.$type.' AS a');
|
||||||
@ -229,7 +229,7 @@ abstract class ###Component###Helper
|
|||||||
|
|
||||||
public static function getGroupName($id)
|
public static function getGroupName($id)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDBO();
|
$db = Factory::getDBO();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select(array('a.title'));
|
$query->select(array('a.title'));
|
||||||
$query->from('#__usergroups AS a');
|
$query->from('#__usergroups AS a');
|
||||||
@ -254,7 +254,7 @@ abstract class ###Component###Helper
|
|||||||
* @param string $component The target component
|
* @param string $component The target component
|
||||||
* @param object $user The user whose permissions we are loading
|
* @param object $user The user whose permissions we are loading
|
||||||
*
|
*
|
||||||
* @return object The JObject of permission/authorised actions
|
* @return object The CMSObject of permission/authorised actions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
||||||
@ -263,10 +263,10 @@ abstract class ###Component###Helper
|
|||||||
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
|
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
|
||||||
{
|
{
|
||||||
// get the user object
|
// get the user object
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
}
|
}
|
||||||
// load the JObject
|
// load the CMSObject
|
||||||
$result = new JObject;
|
$result = new CMSObject;
|
||||||
// make view name safe (just incase)
|
// make view name safe (just incase)
|
||||||
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
|
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
|
||||||
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
|
||||||
@ -274,11 +274,11 @@ abstract class ###Component###Helper
|
|||||||
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
|
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
|
||||||
}
|
}
|
||||||
// get all actions from component
|
// get all actions from component
|
||||||
$actions = JAccess::getActionsFromFile(
|
$actions = Access::getActionsFromFile(
|
||||||
JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml',
|
JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml',
|
||||||
"/access/section[@name='component']/"
|
"/access/section[@name='component']/"
|
||||||
);
|
);
|
||||||
// if non found then return empty JObject
|
// if non found then return empty CMSObject
|
||||||
if (empty($actions))
|
if (empty($actions))
|
||||||
{
|
{
|
||||||
return $result;
|
return $result;
|
||||||
@ -445,14 +445,14 @@ abstract class ###Component###Helper
|
|||||||
/**
|
/**
|
||||||
* Get any component's model
|
* Get any component's model
|
||||||
*/
|
*/
|
||||||
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array())
|
public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = [])
|
||||||
{
|
{
|
||||||
// fix the name
|
// fix the name
|
||||||
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
|
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
|
||||||
// full path to models
|
// full path to models
|
||||||
$fullPathModels = $path . '/models';
|
$fullPathModels = $path . '/models';
|
||||||
// load the model file
|
// load the model file
|
||||||
JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
|
BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model');
|
||||||
// make sure the table path is loaded
|
// make sure the table path is loaded
|
||||||
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
|
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
|
||||||
{
|
{
|
||||||
@ -460,7 +460,7 @@ abstract class ###Component###Helper
|
|||||||
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
|
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
|
||||||
}
|
}
|
||||||
// get instance
|
// get instance
|
||||||
$model = JModelLegacy::getInstance($name, $Component . 'Model', $config);
|
$model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config);
|
||||||
// if model not found (strange)
|
// if model not found (strange)
|
||||||
if ($model == false)
|
if ($model == false)
|
||||||
{
|
{
|
||||||
@ -495,14 +495,14 @@ abstract class ###Component###Helper
|
|||||||
*/
|
*/
|
||||||
public static function setAsset($id, $table, $inherit = true)
|
public static function setAsset($id, $table, $inherit = true)
|
||||||
{
|
{
|
||||||
$parent = JTable::getInstance('Asset');
|
$parent = Table::getInstance('Asset');
|
||||||
$parent->loadByName('com_###component###');
|
$parent->loadByName('com_###component###');
|
||||||
|
|
||||||
$parentId = $parent->id;
|
$parentId = $parent->id;
|
||||||
$name = 'com_###component###.'.$table.'.'.$id;
|
$name = 'com_###component###.'.$table.'.'.$id;
|
||||||
$title = '';
|
$title = '';
|
||||||
|
|
||||||
$asset = JTable::getInstance('Asset');
|
$asset = Table::getInstance('Asset');
|
||||||
$asset->loadByName($name);
|
$asset->loadByName($name);
|
||||||
|
|
||||||
// Check for an error.
|
// Check for an error.
|
||||||
@ -526,14 +526,14 @@ abstract class ###Component###Helper
|
|||||||
$asset->title = $title;
|
$asset->title = $title;
|
||||||
// get the default asset rules
|
// get the default asset rules
|
||||||
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
|
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
|
||||||
if ($rules instanceof JAccessRules)
|
if ($rules instanceof AccessRules)
|
||||||
{
|
{
|
||||||
$asset->rules = (string) $rules;
|
$asset->rules = (string) $rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$asset->check() || !$asset->store())
|
if (!$asset->check() || !$asset->store())
|
||||||
{
|
{
|
||||||
JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
|
Factory::getApplication()->enqueueMessage($asset->getError(), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -546,7 +546,7 @@ abstract class ###Component###Helper
|
|||||||
$object->asset_id = (int) $asset->id;
|
$object->asset_id = (int) $asset->id;
|
||||||
|
|
||||||
// Update their asset_id to link to the asset table.
|
// Update their asset_id to link to the asset table.
|
||||||
return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
|
return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -563,7 +563,7 @@ abstract class ###Component###Helper
|
|||||||
if (!$inherit)
|
if (!$inherit)
|
||||||
{
|
{
|
||||||
// Need to find the asset id by the name of the component.
|
// Need to find the asset id by the name of the component.
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select($db->quoteName('id'))
|
->select($db->quoteName('id'))
|
||||||
->from($db->quoteName('#__assets'))
|
->from($db->quoteName('#__assets'))
|
||||||
@ -578,8 +578,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get asset rules
|
// get asset rules
|
||||||
$result = JAccess::getAssetRules($assetId);
|
$result = Access::getAssetRules($assetId);
|
||||||
if ($result instanceof JAccessRules)
|
if ($result instanceof AccessRules)
|
||||||
{
|
{
|
||||||
$_result = (string) $result;
|
$_result = (string) $result;
|
||||||
$_result = json_decode($_result);
|
$_result = json_decode($_result);
|
||||||
@ -594,7 +594,7 @@ abstract class ###Component###Helper
|
|||||||
elseif ($inherit)
|
elseif ($inherit)
|
||||||
{
|
{
|
||||||
// clear the value since we inherit
|
// clear the value since we inherit
|
||||||
$rule = array();
|
$rule = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check if there are any view values remaining
|
// check if there are any view values remaining
|
||||||
@ -602,8 +602,8 @@ abstract class ###Component###Helper
|
|||||||
{
|
{
|
||||||
$_result = json_encode($_result);
|
$_result = json_encode($_result);
|
||||||
$_result = array($_result);
|
$_result = array($_result);
|
||||||
// Instantiate and return the JAccessRules object for the asset rules.
|
// Instantiate and return the AccessRules object for the asset rules.
|
||||||
$rules = new JAccessRules($_result);
|
$rules = new AccessRules($_result);
|
||||||
// return filtered rules
|
// return filtered rules
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
@ -648,7 +648,7 @@ abstract class ###Component###Helper
|
|||||||
* @return null
|
* @return null
|
||||||
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
||||||
*/
|
*/
|
||||||
public static function xmlAddAttributes(&$xml, $attributes = array())
|
public static function xmlAddAttributes(&$xml, $attributes = [])
|
||||||
{
|
{
|
||||||
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
||||||
}
|
}
|
||||||
@ -662,7 +662,7 @@ abstract class ###Component###Helper
|
|||||||
* @return void
|
* @return void
|
||||||
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
||||||
*/
|
*/
|
||||||
public static function xmlAddOptions(&$xml, $options = array())
|
public static function xmlAddOptions(&$xml, $options = [])
|
||||||
{
|
{
|
||||||
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -28,7 +28,7 @@ class ###Component######View###Categories extends JCategories
|
|||||||
* @param array $options Array of options
|
* @param array $options Array of options
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function __construct($options = array())
|
public function __construct($options = [])
|
||||||
{
|
{
|
||||||
$options['table'] = '#__###component###_###view###';
|
$options['table'] = '#__###component###_###view###';
|
||||||
$options['extension'] = 'com_###component###.###view###';
|
$options['extension'] = 'com_###component###.###view###';
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,11 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Component\ComponentHelper;
|
||||||
|
use Joomla\CMS\Mail\Mail;
|
||||||
|
use Joomla\Registry\Registry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### component email helper
|
* ###Component### component email helper
|
||||||
*/
|
*/
|
||||||
@ -27,28 +32,28 @@ abstract class ###Component###Email
|
|||||||
*
|
*
|
||||||
* @var activeRecipient (array)
|
* @var activeRecipient (array)
|
||||||
*/
|
*/
|
||||||
public static $active = array();
|
public static $active = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuraiton object
|
* Configuraiton object
|
||||||
*
|
*
|
||||||
* @var JConfig
|
* @var Registry
|
||||||
*/
|
*/
|
||||||
public static $config = null;
|
public static ?Registry $config = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mailer object
|
* Mailer object
|
||||||
*
|
*
|
||||||
* @var JMail
|
* @var Mail
|
||||||
*/
|
*/
|
||||||
public static $mailer = null;
|
public static ?Mail $mailer = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom Headers
|
* Custom Headers
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected static $header = array();
|
protected static array $header = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a configuration object
|
* Get a configuration object
|
||||||
@ -58,7 +63,7 @@ abstract class ###Component###Email
|
|||||||
{
|
{
|
||||||
if (!self::$config)
|
if (!self::$config)
|
||||||
{
|
{
|
||||||
self::$config = JComponentHelper::getParams('com_###component###');
|
self::$config = ComponentHelper::getParams('com_###component###');
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::$config;
|
return self::$config;
|
||||||
@ -97,7 +102,7 @@ abstract class ###Component###Email
|
|||||||
* @static
|
* @static
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public static function validateAddress($address, $patternselect = null)
|
public static function validateAddress($address, $patternselect = null): bool
|
||||||
{
|
{
|
||||||
return self::getMailerInstance()->validateAddress($address, $patternselect);
|
return self::getMailerInstance()->validateAddress($address, $patternselect);
|
||||||
}
|
}
|
||||||
@ -105,13 +110,13 @@ abstract class ###Component###Email
|
|||||||
/**
|
/**
|
||||||
* Get a mailer object.
|
* Get a mailer object.
|
||||||
*
|
*
|
||||||
* Returns the global {@link JMail} object, only creating it if it doesn't already exist.
|
* Returns the global {@link Mail} object, only creating it if it doesn't already exist.
|
||||||
*
|
*
|
||||||
* @return JMail object
|
* @return Mail object
|
||||||
*
|
*
|
||||||
* @see JMail
|
* @see Mail
|
||||||
*/
|
*/
|
||||||
public static function getMailer()
|
public static function getMailer(): Mail
|
||||||
{
|
{
|
||||||
if (!self::$mailer)
|
if (!self::$mailer)
|
||||||
{
|
{
|
||||||
@ -126,11 +131,11 @@ abstract class ###Component###Email
|
|||||||
/**
|
/**
|
||||||
* Create a mailer object
|
* Create a mailer object
|
||||||
*
|
*
|
||||||
* @return JMail object
|
* @return Mail object
|
||||||
*
|
*
|
||||||
* @see JMail
|
* @see Mail
|
||||||
*/
|
*/
|
||||||
protected static function createMailer()
|
protected static function createMailer(): Mail
|
||||||
{
|
{
|
||||||
// set component params
|
// set component params
|
||||||
$conf = self::getConfig();
|
$conf = self::getConfig();
|
||||||
@ -138,14 +143,14 @@ abstract class ###Component###Email
|
|||||||
// now load the mailer
|
// now load the mailer
|
||||||
$mailer = $conf->get('mailer', 'global');
|
$mailer = $conf->get('mailer', 'global');
|
||||||
|
|
||||||
// Create a JMail object
|
// Create a Mail object
|
||||||
$mail = JMail::getInstance();
|
$mail = Mail::getInstance();
|
||||||
|
|
||||||
// check if set to global
|
// check if set to global
|
||||||
if ('global' == $mailer)
|
if ('global' == $mailer)
|
||||||
{
|
{
|
||||||
// get the global details
|
// get the global details
|
||||||
$globalConf = JFactory::getConfig();
|
$globalConf = Factory::getConfig();
|
||||||
|
|
||||||
$mailer = $globalConf->get('mailer');
|
$mailer = $globalConf->get('mailer');
|
||||||
$smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1;
|
$smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1;
|
||||||
@ -226,7 +231,7 @@ abstract class ###Component###Email
|
|||||||
*/
|
*/
|
||||||
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
|
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
|
||||||
{
|
{
|
||||||
// Get a JMail instance
|
// Get a Mail instance
|
||||||
$mail = self::getMailer();
|
$mail = self::getMailer();
|
||||||
|
|
||||||
// set component params
|
// set component params
|
||||||
@ -273,7 +278,7 @@ abstract class ###Component###Email
|
|||||||
//embed images
|
//embed images
|
||||||
if ($embeded)
|
if ($embeded)
|
||||||
{
|
{
|
||||||
if(###Component###Helper::checkArray($embeds))
|
if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($embeds))
|
||||||
{
|
{
|
||||||
foreach($embeds as $embed)
|
foreach($embeds as $embed)
|
||||||
{
|
{
|
||||||
@ -360,7 +365,7 @@ abstract class ###Component###Email
|
|||||||
*/
|
*/
|
||||||
public static function setBasicBody($html, $subject)
|
public static function setBasicBody($html, $subject)
|
||||||
{
|
{
|
||||||
$body = array();
|
$body = [];
|
||||||
$body[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
|
$body[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
|
||||||
$body[] = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
|
$body[] = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
|
||||||
$body[] = "<head>";
|
$body[] = "<head>";
|
||||||
@ -406,7 +411,7 @@ abstract class ###Component###Email
|
|||||||
*/
|
*/
|
||||||
public static function setTableBody($html, $subject)
|
public static function setTableBody($html, $subject)
|
||||||
{
|
{
|
||||||
$body = array();
|
$body = [];
|
||||||
$body[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
|
$body[] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
|
||||||
$body[] = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
|
$body[] = "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
|
||||||
$body[] = "<head>";
|
$body[] = "<head>";
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -29,7 +29,7 @@ abstract class ###Component###Helper
|
|||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected static $composer = array();
|
protected static $composer = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Main Active Language
|
* The Main Active Language
|
||||||
@ -99,7 +99,7 @@ abstract class ###Component###Helper
|
|||||||
// check if set
|
// check if set
|
||||||
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
|
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
|
||||||
{
|
{
|
||||||
self::$JVersion = new JVersion();
|
self::$JVersion = new Version();
|
||||||
}
|
}
|
||||||
return self::$JVersion;
|
return self::$JVersion;
|
||||||
}
|
}
|
||||||
@ -110,9 +110,9 @@ abstract class ###Component###Helper
|
|||||||
public static function getContributors()
|
public static function getContributors()
|
||||||
{
|
{
|
||||||
// get params
|
// get params
|
||||||
$params = JComponentHelper::getParams('com_###component###');
|
$params = ComponentHelper::getParams('com_###component###');
|
||||||
// start contributors array
|
// start contributors array
|
||||||
$contributors = array();
|
$contributors = [];
|
||||||
// get all Contributors (max 20)
|
// get all Contributors (max 20)
|
||||||
$searchArray = range('0','20');
|
$searchArray = range('0','20');
|
||||||
foreach($searchArray as $nr)
|
foreach($searchArray as $nr)
|
||||||
@ -145,14 +145,14 @@ abstract class ###Component###Helper
|
|||||||
/**
|
/**
|
||||||
* Get any component's model
|
* Get any component's model
|
||||||
*/
|
*/
|
||||||
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array())
|
public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = [])
|
||||||
{
|
{
|
||||||
// fix the name
|
// fix the name
|
||||||
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
|
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
|
||||||
// full path to models
|
// full path to models
|
||||||
$fullPathModels = $path . '/models';
|
$fullPathModels = $path . '/models';
|
||||||
// load the model file
|
// load the model file
|
||||||
JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
|
BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model');
|
||||||
// make sure the table path is loaded
|
// make sure the table path is loaded
|
||||||
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
|
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
|
||||||
{
|
{
|
||||||
@ -160,7 +160,7 @@ abstract class ###Component###Helper
|
|||||||
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
|
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
|
||||||
}
|
}
|
||||||
// get instance
|
// get instance
|
||||||
$model = JModelLegacy::getInstance($name, $Component . 'Model', $config);
|
$model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config);
|
||||||
// if model not found (strange)
|
// if model not found (strange)
|
||||||
if ($model == false)
|
if ($model == false)
|
||||||
{
|
{
|
||||||
@ -195,14 +195,14 @@ abstract class ###Component###Helper
|
|||||||
*/
|
*/
|
||||||
public static function setAsset($id, $table, $inherit = true)
|
public static function setAsset($id, $table, $inherit = true)
|
||||||
{
|
{
|
||||||
$parent = JTable::getInstance('Asset');
|
$parent = Table::getInstance('Asset');
|
||||||
$parent->loadByName('com_###component###');
|
$parent->loadByName('com_###component###');
|
||||||
|
|
||||||
$parentId = $parent->id;
|
$parentId = $parent->id;
|
||||||
$name = 'com_###component###.'.$table.'.'.$id;
|
$name = 'com_###component###.'.$table.'.'.$id;
|
||||||
$title = '';
|
$title = '';
|
||||||
|
|
||||||
$asset = JTable::getInstance('Asset');
|
$asset = Table::getInstance('Asset');
|
||||||
$asset->loadByName($name);
|
$asset->loadByName($name);
|
||||||
|
|
||||||
// Check for an error.
|
// Check for an error.
|
||||||
@ -226,14 +226,14 @@ abstract class ###Component###Helper
|
|||||||
$asset->title = $title;
|
$asset->title = $title;
|
||||||
// get the default asset rules
|
// get the default asset rules
|
||||||
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
|
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
|
||||||
if ($rules instanceof JAccessRules)
|
if ($rules instanceof AccessRules)
|
||||||
{
|
{
|
||||||
$asset->rules = (string) $rules;
|
$asset->rules = (string) $rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$asset->check() || !$asset->store())
|
if (!$asset->check() || !$asset->store())
|
||||||
{
|
{
|
||||||
JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
|
Factory::getApplication()->enqueueMessage($asset->getError(), 'warning');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -246,7 +246,7 @@ abstract class ###Component###Helper
|
|||||||
$object->asset_id = (int) $asset->id;
|
$object->asset_id = (int) $asset->id;
|
||||||
|
|
||||||
// Update their asset_id to link to the asset table.
|
// Update their asset_id to link to the asset table.
|
||||||
return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
|
return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -263,7 +263,7 @@ abstract class ###Component###Helper
|
|||||||
if (!$inherit)
|
if (!$inherit)
|
||||||
{
|
{
|
||||||
// Need to find the asset id by the name of the component.
|
// Need to find the asset id by the name of the component.
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select($db->quoteName('id'))
|
->select($db->quoteName('id'))
|
||||||
->from($db->quoteName('#__assets'))
|
->from($db->quoteName('#__assets'))
|
||||||
@ -278,8 +278,8 @@ abstract class ###Component###Helper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get asset rules
|
// get asset rules
|
||||||
$result = JAccess::getAssetRules($assetId);
|
$result = Access::getAssetRules($assetId);
|
||||||
if ($result instanceof JAccessRules)
|
if ($result instanceof AccessRules)
|
||||||
{
|
{
|
||||||
$_result = (string) $result;
|
$_result = (string) $result;
|
||||||
$_result = json_decode($_result);
|
$_result = json_decode($_result);
|
||||||
@ -294,7 +294,7 @@ abstract class ###Component###Helper
|
|||||||
elseif ($inherit)
|
elseif ($inherit)
|
||||||
{
|
{
|
||||||
// clear the value since we inherit
|
// clear the value since we inherit
|
||||||
$rule = array();
|
$rule = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check if there are any view values remaining
|
// check if there are any view values remaining
|
||||||
@ -302,8 +302,8 @@ abstract class ###Component###Helper
|
|||||||
{
|
{
|
||||||
$_result = json_encode($_result);
|
$_result = json_encode($_result);
|
||||||
$_result = array($_result);
|
$_result = array($_result);
|
||||||
// Instantiate and return the JAccessRules object for the asset rules.
|
// Instantiate and return the AccessRules object for the asset rules.
|
||||||
$rules = new JAccessRules($_result);
|
$rules = new AccessRules($_result);
|
||||||
// return filtered rules
|
// return filtered rules
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
@ -348,7 +348,7 @@ abstract class ###Component###Helper
|
|||||||
* @return null
|
* @return null
|
||||||
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
||||||
*/
|
*/
|
||||||
public static function xmlAddAttributes(&$xml, $attributes = array())
|
public static function xmlAddAttributes(&$xml, $attributes = [])
|
||||||
{
|
{
|
||||||
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
|
||||||
}
|
}
|
||||||
@ -362,7 +362,7 @@ abstract class ###Component###Helper
|
|||||||
* @return void
|
* @return void
|
||||||
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
||||||
*/
|
*/
|
||||||
public static function xmlAddOptions(&$xml, $options = array())
|
public static function xmlAddOptions(&$xml, $options = [])
|
||||||
{
|
{
|
||||||
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
|
||||||
}
|
}
|
||||||
@ -488,7 +488,7 @@ abstract class ###Component###Helper
|
|||||||
{
|
{
|
||||||
$type = 'item';
|
$type = 'item';
|
||||||
}
|
}
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select(array('a.published'));
|
$query->select(array('a.published'));
|
||||||
$query->from('#__###component###_'.$type.' AS a');
|
$query->from('#__###component###_'.$type.' AS a');
|
||||||
@ -506,7 +506,7 @@ abstract class ###Component###Helper
|
|||||||
|
|
||||||
public static function getGroupName($id)
|
public static function getGroupName($id)
|
||||||
{
|
{
|
||||||
$db = JFactory::getDBO();
|
$db = Factory::getDBO();
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
$query->select(array('a.title'));
|
$query->select(array('a.title'));
|
||||||
$query->from('#__usergroups AS a');
|
$query->from('#__usergroups AS a');
|
||||||
@ -531,7 +531,7 @@ abstract class ###Component###Helper
|
|||||||
* @param string $component The target component
|
* @param string $component The target component
|
||||||
* @param object $user The user whose permissions we are loading
|
* @param object $user The user whose permissions we are loading
|
||||||
*
|
*
|
||||||
* @return object The JObject of permission/authorised actions
|
* @return object The CMSObject of permission/authorised actions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
|
||||||
@ -540,10 +540,10 @@ abstract class ###Component###Helper
|
|||||||
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
|
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
|
||||||
{
|
{
|
||||||
// get the user object
|
// get the user object
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
}
|
}
|
||||||
// load the JObject
|
// load the CMSObject
|
||||||
$result = new JObject;
|
$result = new CMSObject;
|
||||||
// make view name safe (just incase)
|
// make view name safe (just incase)
|
||||||
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
|
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
|
||||||
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
|
||||||
@ -551,11 +551,11 @@ abstract class ###Component###Helper
|
|||||||
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
|
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
|
||||||
}
|
}
|
||||||
// get all actions from component
|
// get all actions from component
|
||||||
$actions = JAccess::getActionsFromFile(
|
$actions = Access::getActionsFromFile(
|
||||||
JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml',
|
JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml',
|
||||||
"/access/section[@name='component']/"
|
"/access/section[@name='component']/"
|
||||||
);
|
);
|
||||||
// if non found then return empty JObject
|
// if non found then return empty CMSObject
|
||||||
if (empty($actions))
|
if (empty($actions))
|
||||||
{
|
{
|
||||||
return $result;
|
return $result;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
###BOM###
|
###BOM###
|
||||||
|
|
||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
|
defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
###CUSTOM_ADMIN_VIEW_HTML_HEADER###
|
###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Html View class for the ###SView###
|
* ###Component### Html View class for the ###SView###
|
||||||
@ -28,11 +28,11 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
function display($tpl = null)
|
function display($tpl = null)
|
||||||
{
|
{
|
||||||
// get component params
|
// get component params
|
||||||
$this->params = JComponentHelper::getParams('com_###component###');
|
$this->params = ComponentHelper::getParams('com_###component###');
|
||||||
// get the application
|
// get the application
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
// get the user object
|
// get the user object
|
||||||
$this->user = JFactory::getUser();
|
$this->user = Factory::getUser();
|
||||||
// get global action permissions
|
// get global action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
||||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||||
@ -43,7 +43,7 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
protected function setDocument()
|
protected function setDocument()
|
||||||
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
|
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
|
||||||
// add the document default css file
|
// add the document default css file
|
||||||
JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
|
Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,22 +59,22 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
// Check for empty title and add view name if param is set
|
// Check for empty title and add view name if param is set
|
||||||
if (empty($title))
|
if (empty($title))
|
||||||
{
|
{
|
||||||
$title = JText::_('COM_###COMPONENT###_###SVIEW###');
|
$title = Text::_('COM_###COMPONENT###_###SVIEW###');
|
||||||
}
|
}
|
||||||
// add title to the page
|
// add title to the page
|
||||||
JToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
ToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the options comp button
|
// add the options comp button
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
ToolbarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
}###CUSTOM_ADMIN_GET_MODULE###
|
}###CUSTOM_ADMIN_GET_MODULE###
|
||||||
|
|
||||||
@ -88,7 +88,17 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
public function escape($var)
|
public function escape($var)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Document (helper method toward Joomla 4 and 5)
|
||||||
|
*/
|
||||||
|
public function getDocument()
|
||||||
|
{
|
||||||
|
$this->document ??= JFactory::getDocument();
|
||||||
|
|
||||||
|
return $this->document;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView
|
|||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
// set params
|
// set params
|
||||||
$this->params = JComponentHelper::getParams('com_###component###');
|
$this->params = ComponentHelper::getParams('com_###component###');
|
||||||
// Assign the variables
|
// Assign the variables
|
||||||
$this->form = $this->get('Form');
|
$this->form = $this->get('Form');
|
||||||
$this->item = $this->get('Item');
|
$this->item = $this->get('Item');
|
||||||
@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView
|
|||||||
// get action permissions
|
// get action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###', $this->item);
|
$this->canDo = ###Component###Helper::getActions('###view###', $this->item);
|
||||||
// get input
|
// get input
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
$this->ref = $jinput->get('ref', 0, 'word');
|
$this->ref = $jinput->get('ref', 0, 'word');
|
||||||
$this->refid = $jinput->get('refid', 0, 'int');
|
$this->refid = $jinput->get('refid', 0, 'int');
|
||||||
$return = $jinput->get('return', null, 'base64');
|
$return = $jinput->get('return', null, 'base64');
|
||||||
@ -100,10 +100,10 @@ class ###Component###View###View### extends HtmlView
|
|||||||
if(strlen($var) > 30)
|
if(strlen($var) > 30)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead and shorten the string
|
// use the helper htmlEscape method instead and shorten the string
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30);
|
||||||
}
|
}
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -114,14 +114,20 @@ class ###Component###View###View### extends HtmlView
|
|||||||
protected function setDocument()
|
protected function setDocument()
|
||||||
{
|
{
|
||||||
$isNew = ($this->item->id < 1);
|
$isNew = ($this->item->id < 1);
|
||||||
if (!isset($this->document))
|
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
|
||||||
{
|
Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
|
||||||
$this->document = JFactory::getDocument();
|
Html::_('script', $this->script, ['version' => 'auto']);
|
||||||
|
Html::_('script', "administrator/components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP###
|
||||||
|
Text::script('view not acceptable. Error');
|
||||||
}
|
}
|
||||||
$this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
|
|
||||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
|
/**
|
||||||
$this->document->addScript(JURI::root() . $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
* Get the Document (helper method toward Joomla 4 and 5)
|
||||||
$this->document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP###
|
*/
|
||||||
JText::script('view not acceptable. Error');
|
public function getDocument()
|
||||||
|
{
|
||||||
|
$this->document ??= JFactory::getDocument();
|
||||||
|
|
||||||
|
return $this->document;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView
|
|||||||
public function display($tpl = null)
|
public function display($tpl = null)
|
||||||
{
|
{
|
||||||
// set params
|
// set params
|
||||||
$this->params = JComponentHelper::getParams('com_###component###');
|
$this->params = ComponentHelper::getParams('com_###component###');
|
||||||
// Assign the variables
|
// Assign the variables
|
||||||
$this->form = $this->get('Form');
|
$this->form = $this->get('Form');
|
||||||
$this->item = $this->get('Item');
|
$this->item = $this->get('Item');
|
||||||
@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView
|
|||||||
// get action permissions
|
// get action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###', $this->item);
|
$this->canDo = ###Component###Helper::getActions('###view###', $this->item);
|
||||||
// get input
|
// get input
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
$this->ref = $jinput->get('ref', 0, 'word');
|
$this->ref = $jinput->get('ref', 0, 'word');
|
||||||
$this->refid = $jinput->get('refid', 0, 'int');
|
$this->refid = $jinput->get('refid', 0, 'int');
|
||||||
$return = $jinput->get('return', null, 'base64');
|
$return = $jinput->get('return', null, 'base64');
|
||||||
@ -86,7 +86,7 @@ class ###Component###View###View### extends HtmlView
|
|||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{###ADDTOOLBAR###
|
{###ADDTOOLBAR###
|
||||||
// now initiate the toolbar
|
// now initiate the toolbar
|
||||||
$this->toolbar = JToolbar::getInstance();
|
$this->toolbar = Toolbar::getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,10 +101,10 @@ class ###Component###View###View### extends HtmlView
|
|||||||
if(strlen($var) > 30)
|
if(strlen($var) > 30)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead and shorten the string
|
// use the helper htmlEscape method instead and shorten the string
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30);
|
||||||
}
|
}
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,11 +115,7 @@ class ###Component###View###View### extends HtmlView
|
|||||||
protected function setDocument()
|
protected function setDocument()
|
||||||
{
|
{
|
||||||
$isNew = ($this->item->id < 1);
|
$isNew = ($this->item->id < 1);
|
||||||
if (!isset($this->document))
|
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
|
||||||
{
|
|
||||||
$this->document = JFactory::getDocument();
|
|
||||||
}
|
|
||||||
$this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
|
|
||||||
// only add the ISIS template css & js if needed (default is 1 = true)
|
// only add the ISIS template css & js if needed (default is 1 = true)
|
||||||
// you can override this in the global component options
|
// you can override this in the global component options
|
||||||
// just add a (radio yes/no field) with a name called add_isis_template
|
// just add a (radio yes/no field) with a name called add_isis_template
|
||||||
@ -127,14 +123,24 @@ class ###Component###View###View### extends HtmlView
|
|||||||
if ($this->params->get('add_isis_template', 1))
|
if ($this->params->get('add_isis_template', 1))
|
||||||
{
|
{
|
||||||
// we need this to fix the form display (TODO)
|
// we need this to fix the form display (TODO)
|
||||||
$this->document->addStyleSheet(JURI::root() . "administrator/templates/isis/css/template.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
|
Html::_('stylesheet', "administrator/templates/isis/css/template.css", ['version' => 'auto']);
|
||||||
$this->document->addScript(JURI::root() . "administrator/templates/isis/js/template.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
Html::_('script', "administrator/templates/isis/js/template.js", ['version' => 'auto']);
|
||||||
}
|
}
|
||||||
// the default style of this view
|
// the default style of this view
|
||||||
$this->document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
|
Html::_('stylesheet', "components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
|
||||||
// default javascript of this view
|
// default javascript of this view
|
||||||
$this->document->addScript(JURI::root(). $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
|
Html::_('script', $this->script, ['version' => 'auto']);
|
||||||
$this->document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP###
|
Html::_('script', "components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP###
|
||||||
JText::script('view not acceptable. Error');
|
Text::script('view not acceptable. Error');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Document (helper method toward Joomla 4 and 5)
|
||||||
|
*/
|
||||||
|
public function getDocument()
|
||||||
|
{
|
||||||
|
$this->document ??= JFactory::getDocument();
|
||||||
|
|
||||||
|
return $this->document;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
use Joomla\CMS\MVC\View\HtmlView;
|
use Joomla\CMS\MVC\View\HtmlView;
|
||||||
|
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Import Html View
|
* ###Component### Import Html View
|
||||||
@ -55,7 +58,7 @@ class ###Component###ViewImport extends HtmlView
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get the session object
|
// get the session object
|
||||||
$session = JFactory::getSession();
|
$session = Factory::getSession();
|
||||||
// check if it has package
|
// check if it has package
|
||||||
$this->hasPackage = $session->get('hasPackage', false);
|
$this->hasPackage = $session->get('hasPackage', false);
|
||||||
$this->dataType = $session->get('dataType', false);
|
$this->dataType = $session->get('dataType', false);
|
||||||
@ -82,19 +85,19 @@ class ###Component###ViewImport extends HtmlView
|
|||||||
*/
|
*/
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
|
ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
|
||||||
JHtmlSidebar::setAction('index.php?option=com_###component###&view=import');
|
JHtmlSidebar::setAction('index.php?option=com_###component###&view=import');
|
||||||
|
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
ToolbarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('import');
|
$this->help_url = ###Component###Helper::getHelpUrl('import');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,13 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Form\FormHelper;
|
||||||
use Joomla\CMS\MVC\View\HtmlView;
|
use Joomla\CMS\MVC\View\HtmlView;
|
||||||
|
use Joomla\CMS\Toolbar\ToolbarHelper;
|
||||||
|
use Joomla\CMS\Component\ComponentHelper;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### ###View### Html View
|
* ###Component### ###View### Html View
|
||||||
@ -30,19 +36,19 @@ class ###Component###View###View### extends HtmlView
|
|||||||
*/
|
*/
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
|
ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
|
||||||
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###view###');
|
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###view###');
|
||||||
|
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
ToolbarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('###view###');
|
$this->help_url = ###Component###Helper::getHelpUrl('###view###');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -40,10 +40,10 @@ class ###Component###View###Views### extends HtmlView
|
|||||||
$this->items = $this->get('Items');
|
$this->items = $this->get('Items');
|
||||||
$this->pagination = $this->get('Pagination');
|
$this->pagination = $this->get('Pagination');
|
||||||
$this->state = $this->get('State');
|
$this->state = $this->get('State');
|
||||||
$this->user = JFactory::getUser();###ADMIN_DIPLAY_METHOD###
|
$this->user = Factory::getUser();###ADMIN_DIPLAY_METHOD###
|
||||||
$this->saveOrder = $this->listOrder == 'a.ordering';
|
$this->saveOrder = $this->listOrder == 'a.ordering';
|
||||||
// set the return here value
|
// set the return here value
|
||||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
$this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
|
||||||
// get global action permissions
|
// get global action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO###
|
$this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO###
|
||||||
|
|
||||||
@ -77,32 +77,32 @@ class ###Component###View###Views### extends HtmlView
|
|||||||
*/
|
*/
|
||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{
|
{
|
||||||
JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###');
|
|
||||||
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###');
|
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###');
|
||||||
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
ToolbarHelper::title(Text::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###');
|
||||||
|
FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
|
||||||
|
|
||||||
if ($this->canCreate)
|
if ($this->canCreate)
|
||||||
{
|
{
|
||||||
JToolBarHelper::addNew('###view###.add');
|
ToolbarHelper::addNew('###view###.add');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only load if there are items
|
// Only load if there are items
|
||||||
if (###Component###Helper::checkArray($this->items))
|
if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->items))
|
||||||
{
|
{
|
||||||
if ($this->canEdit)
|
if ($this->canEdit)
|
||||||
{
|
{
|
||||||
JToolBarHelper::editList('###view###.edit');
|
ToolbarHelper::editList('###view###.edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->canState)
|
if ($this->canState)
|
||||||
{
|
{
|
||||||
JToolBarHelper::publishList('###views###.publish');
|
ToolbarHelper::publishList('###views###.publish');
|
||||||
JToolBarHelper::unpublishList('###views###.unpublish');
|
ToolbarHelper::unpublishList('###views###.unpublish');
|
||||||
JToolBarHelper::archiveList('###views###.archive');
|
ToolbarHelper::archiveList('###views###.archive');
|
||||||
|
|
||||||
if ($this->canDo->get('core.admin'))
|
if ($this->canDo->get('core.admin'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::checkin('###views###.checkin');
|
ToolbarHelper::checkin('###views###.checkin');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,11 +110,11 @@ class ###Component###View###Views### extends HtmlView
|
|||||||
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
|
||||||
{
|
{
|
||||||
// Get the toolbar object instance
|
// Get the toolbar object instance
|
||||||
$bar = JToolBar::getInstance('toolbar');
|
$bar = Toolbar::getInstance('toolbar');
|
||||||
// set the batch button name
|
// set the batch button name
|
||||||
$title = JText::_('JTOOLBAR_BATCH');
|
$title = Text::_('JTOOLBAR_BATCH');
|
||||||
// Instantiate a new JLayoutFile instance and render the batch button
|
// Instantiate a new JLayoutFile instance and render the batch button
|
||||||
$layout = new JLayoutFile('joomla.toolbar.batch');
|
$layout = new FileLayout('joomla.toolbar.batch');
|
||||||
// add the button to the page
|
// add the button to the page
|
||||||
$dhtml = $layout->render(array('title' => $title));
|
$dhtml = $layout->render(array('title' => $title));
|
||||||
$bar->appendButton('Custom', $dhtml, 'batch');
|
$bar->appendButton('Custom', $dhtml, 'batch');
|
||||||
@ -122,25 +122,25 @@ class ###Component###View###Views### extends HtmlView
|
|||||||
|
|
||||||
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
|
||||||
{
|
{
|
||||||
JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH');
|
ToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH');
|
||||||
}
|
}
|
||||||
elseif ($this->canState && $this->canDelete)
|
elseif ($this->canState && $this->canDelete)
|
||||||
{
|
{
|
||||||
JToolbarHelper::trash('###views###.trash');
|
ToolbarHelper::trash('###views###.trash');
|
||||||
}###EXPORTBUTTON###
|
}###EXPORTBUTTON###
|
||||||
}###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON###
|
}###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON###
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('###views###');
|
$this->help_url = ###Component###Helper::getHelpUrl('###views###');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the options comp button
|
// add the options comp button
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
ToolbarHelper::preferences('com_###component###');
|
||||||
}###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER###
|
}###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER###
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,10 +153,10 @@ class ###Component###View###Views### extends HtmlView
|
|||||||
{
|
{
|
||||||
if (!isset($this->document))
|
if (!isset($this->document))
|
||||||
{
|
{
|
||||||
$this->document = JFactory::getDocument();
|
$this->document = Factory::getDocument();
|
||||||
}
|
}
|
||||||
$this->document->setTitle(JText::_('COM_###COMPONENT###_###VIEWS###'));
|
$this->document->setTitle(Text::_('COM_###COMPONENT###_###VIEWS###'));
|
||||||
$this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###ADMIN_ADD_JAVASCRIPT_FILE###
|
Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###views###.css", ['version' => 'auto']);###ADMIN_ADD_JAVASCRIPT_FILE###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,10 +171,10 @@ class ###Component###View###Views### extends HtmlView
|
|||||||
if(strlen($var) > 50)
|
if(strlen($var) > 50)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead and shorten the string
|
// use the helper htmlEscape method instead and shorten the string
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset, true);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true);
|
||||||
}
|
}
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -185,5 +185,15 @@ class ###Component###View###Views### extends HtmlView
|
|||||||
protected function getSortFields()
|
protected function getSortFields()
|
||||||
{
|
{
|
||||||
###SORTFIELDS###
|
###SORTFIELDS###
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Document (helper method toward Joomla 4 and 5)
|
||||||
|
*/
|
||||||
|
public function getDocument()
|
||||||
|
{
|
||||||
|
$this->document ??= JFactory::getDocument();
|
||||||
|
|
||||||
|
return $this->document;
|
||||||
}###FILTERFUNCTIONS###
|
}###FILTERFUNCTIONS###
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
###BOM###
|
###BOM###
|
||||||
|
|
||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
###CUSTOM_ADMIN_VIEWS_HTML_HEADER###
|
###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Html View class for the ###SViews###
|
* ###Component### Html View class for the ###SViews###
|
||||||
@ -28,11 +28,11 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
function display($tpl = null)
|
function display($tpl = null)
|
||||||
{
|
{
|
||||||
// get component params
|
// get component params
|
||||||
$this->params = JComponentHelper::getParams('com_###component###');
|
$this->params = ComponentHelper::getParams('com_###component###');
|
||||||
// get the application
|
// get the application
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
// get the user object
|
// get the user object
|
||||||
$this->user = JFactory::getUser();
|
$this->user = Factory::getUser();
|
||||||
// get global action permissions
|
// get global action permissions
|
||||||
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
||||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||||
@ -43,7 +43,7 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
protected function setDocument()
|
protected function setDocument()
|
||||||
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
|
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
|
||||||
// add the document default css file
|
// add the document default css file
|
||||||
JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
|
Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,19 +52,19 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
protected function addToolBar()
|
protected function addToolBar()
|
||||||
{###HIDEMAINMENU###
|
{###HIDEMAINMENU###
|
||||||
// add title to the page
|
// add title to the page
|
||||||
JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
ToolbarHelper::title(Text::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
|
||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the options comp button
|
// add the options comp button
|
||||||
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
|
||||||
{
|
{
|
||||||
JToolBarHelper::preferences('com_###component###');
|
ToolbarHelper::preferences('com_###component###');
|
||||||
}
|
}
|
||||||
}###CUSTOM_ADMIN_GET_MODULE###
|
}###CUSTOM_ADMIN_GET_MODULE###
|
||||||
|
|
||||||
@ -78,6 +78,16 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
public function escape($var)
|
public function escape($var)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Document (helper method toward Joomla 4 and 5)
|
||||||
|
*/
|
||||||
|
public function getDocument()
|
||||||
|
{
|
||||||
|
$this->document ??= JFactory::getDocument();
|
||||||
|
|
||||||
|
return $this->document;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
###BOM###
|
###BOM###
|
||||||
|
|
||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
###SITE_VIEWS_HTML_HEADER###
|
###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Html View class for the ###SViews###
|
* ###Component### Html View class for the ###SViews###
|
||||||
@ -28,11 +28,11 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
function display($tpl = null)
|
function display($tpl = null)
|
||||||
{
|
{
|
||||||
// get combined params of both component and menu
|
// get combined params of both component and menu
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
$this->params = $this->app->getParams();
|
$this->params = $this->app->getParams();
|
||||||
$this->menu = $this->app->getMenu()->getActive();
|
$this->menu = $this->app->getMenu()->getActive();
|
||||||
// get the user object
|
// get the user object
|
||||||
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
|
$this->user = Factory::getUser();###SITE_DIPLAY_METHOD###
|
||||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,7 +41,7 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
protected function _prepareDocument()
|
protected function _prepareDocument()
|
||||||
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
|
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
|
||||||
// add the document default css file
|
// add the document default css file
|
||||||
JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
|
Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,12 +52,12 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
// now initiate the toolbar
|
// now initiate the toolbar
|
||||||
$this->toolbar = JToolbar::getInstance();
|
$this->toolbar = Toolbar::getInstance();
|
||||||
}###SITE_GET_MODULE###
|
}###SITE_GET_MODULE###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,6 +70,16 @@ class ###Component###View###SViews### extends HtmlView
|
|||||||
public function escape($var, $sorten = false, $length = 40)
|
public function escape($var, $sorten = false, $length = 40)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Document (helper method toward Joomla 4 and 5)
|
||||||
|
*/
|
||||||
|
public function getDocument()
|
||||||
|
{
|
||||||
|
$this->document ??= JFactory::getDocument();
|
||||||
|
|
||||||
|
return $this->document;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
###BOM###
|
###BOM###
|
||||||
|
|
||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
###SITE_VIEW_HTML_HEADER###
|
###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Html View class for the ###SView###
|
* ###Component### Html View class for the ###SView###
|
||||||
@ -28,11 +28,11 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
function display($tpl = null)
|
function display($tpl = null)
|
||||||
{
|
{
|
||||||
// get combined params of both component and menu
|
// get combined params of both component and menu
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
$this->params = $this->app->getParams();
|
$this->params = $this->app->getParams();
|
||||||
$this->menu = $this->app->getMenu()->getActive();
|
$this->menu = $this->app->getMenu()->getActive();
|
||||||
// get the user object
|
// get the user object
|
||||||
$this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
|
$this->user = Factory::getUser();###SITE_DIPLAY_METHOD###
|
||||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,7 +41,7 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
protected function _prepareDocument()
|
protected function _prepareDocument()
|
||||||
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
|
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
|
||||||
// add the document default css file
|
// add the document default css file
|
||||||
JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
|
Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,12 +52,12 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
|
|
||||||
// set help url for this view if found
|
// set help url for this view if found
|
||||||
$this->help_url = ###Component###Helper::getHelpUrl('###sview###');
|
$this->help_url = ###Component###Helper::getHelpUrl('###sview###');
|
||||||
if (###Component###Helper::checkString($this->help_url))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
||||||
{
|
{
|
||||||
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
||||||
}
|
}
|
||||||
// now initiate the toolbar
|
// now initiate the toolbar
|
||||||
$this->toolbar = JToolbar::getInstance();
|
$this->toolbar = Toolbar::getInstance();
|
||||||
}###SITE_GET_MODULE###
|
}###SITE_GET_MODULE###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,6 +70,16 @@ class ###Component###View###SView### extends HtmlView
|
|||||||
public function escape($var, $sorten = false, $length = 40)
|
public function escape($var, $sorten = false, $length = 40)
|
||||||
{
|
{
|
||||||
// use the helper htmlEscape method instead.
|
// use the helper htmlEscape method instead.
|
||||||
return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Document (helper method toward Joomla 4 and 5)
|
||||||
|
*/
|
||||||
|
public function getDocument()
|
||||||
|
{
|
||||||
|
$this->document ??= JFactory::getDocument();
|
||||||
|
|
||||||
|
return $this->document;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
{
|
{
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
// Get the item main id
|
// Get the item main id
|
||||||
$id = $this->input->getInt('id', null);
|
$id = $this->input->getInt('id', null);
|
||||||
@ -80,12 +80,12 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
*/
|
*/
|
||||||
public function getItem($pk = null)
|
public function getItem($pk = null)
|
||||||
{
|
{
|
||||||
$this->user = JFactory::getUser();
|
$this->user = Factory::getUser();
|
||||||
// check if this user has permission to access item
|
// check if this user has permission to access item
|
||||||
if (!$this->user->authorise('###sview###.access', 'com_###component###'))
|
if (!$this->user->authorise('###sview###.access', 'com_###component###'))
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
$app->enqueueMessage(Text::_('Not authorised!'), 'error');
|
||||||
// redirect away if not a correct to cPanel/default view
|
// redirect away if not a correct to cPanel/default view
|
||||||
$app->redirect('index.php?option=com_###component###');
|
$app->redirect('index.php?option=com_###component###');
|
||||||
return false;
|
return false;
|
||||||
@ -101,7 +101,7 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
|
|
||||||
if ($this->_item === null)
|
if ($this->_item === null)
|
||||||
{
|
{
|
||||||
$this->_item = array();
|
$this->_item = [];
|
||||||
}###LICENSE_LOCKED_CHECK###
|
}###LICENSE_LOCKED_CHECK###
|
||||||
|
|
||||||
if (!isset($this->_item[$pk]))
|
if (!isset($this->_item[$pk]))
|
||||||
@ -114,7 +114,7 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
if ($e->getCode() == 404)
|
if ($e->getCode() == 404)
|
||||||
{
|
{
|
||||||
// Need to go thru the error handler to allow Redirect to work.
|
// Need to go thru the error handler to allow Redirect to work.
|
||||||
JError::raiseWarning(404, $e->getMessage());
|
JError::raiseError(404, $e->getMessage());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
*/
|
*/
|
||||||
protected function populateState()
|
protected function populateState()
|
||||||
{
|
{
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
// Get the itme main id
|
// Get the itme main id
|
||||||
$id = $this->input->getInt('id', null);
|
$id = $this->input->getInt('id', null);
|
||||||
@ -82,7 +82,7 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
*/
|
*/
|
||||||
public function getItem($pk = null)
|
public function getItem($pk = null)
|
||||||
{
|
{
|
||||||
$this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS###
|
$this->user = Factory::getUser();###USER_PERMISSION_CHECK_ACCESS###
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
@ -94,7 +94,7 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
|
|
||||||
if ($this->_item === null)
|
if ($this->_item === null)
|
||||||
{
|
{
|
||||||
$this->_item = array();
|
$this->_item = [];
|
||||||
}###LICENSE_LOCKED_CHECK###
|
}###LICENSE_LOCKED_CHECK###
|
||||||
|
|
||||||
if (!isset($this->_item[$pk]))
|
if (!isset($this->_item[$pk]))
|
||||||
@ -107,7 +107,7 @@ class ###Component###Model###SView### extends ItemModel
|
|||||||
if ($e->getCode() == 404)
|
if ($e->getCode() == 404)
|
||||||
{
|
{
|
||||||
// Need to go thru the error handler to allow Redirect to work.
|
// Need to go thru the error handler to allow Redirect to work.
|
||||||
JError::raiseWarning(404, $e->getMessage());
|
JError::raiseError(404, $e->getMessage());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
// import the list field type
|
// import the list field type
|
||||||
jimport('joomla.form.helper');
|
jimport('joomla.form.helper');
|
||||||
JFormHelper::loadFieldClass('checkboxes');
|
JFormHelper::loadFieldClass('checkboxes');
|
||||||
@ -36,7 +40,7 @@ class ###JPREFIX###FormField###Type### extends JFormFieldCheckboxes
|
|||||||
/**
|
/**
|
||||||
* Method to get a list of options for a list input.
|
* Method to get a list of options for a list input.
|
||||||
*
|
*
|
||||||
* @return array An array of JHtml options.
|
* @return array An array of Html options.
|
||||||
*/
|
*/
|
||||||
protected function getOptions()
|
protected function getOptions()
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,7 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
###JFORM_TYPE_HEADER###
|
###FORM_CUSTOM_FIELD_HEADER###
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Type### Form Field class for the ###Component### component
|
* ###Type### Form Field class for the ###Component### component
|
||||||
@ -29,5 +29,5 @@ class ###JPREFIX###FormField###Type### extends JFormField###JFORM_EXTENDS###
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $type = '###type###';###JFORM_TYPE_PHP###
|
public $type = '###type###';###FORM_CUSTOM_FIELD_PHP###
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
// import the list field type
|
// import the list field type
|
||||||
jimport('joomla.form.helper');
|
jimport('joomla.form.helper');
|
||||||
JFormHelper::loadFieldClass('list');
|
JFormHelper::loadFieldClass('list');
|
||||||
@ -36,7 +40,7 @@ class ###JPREFIX###FormField###Type### extends JFormFieldList
|
|||||||
/**
|
/**
|
||||||
* Method to get a list of options for a list input.
|
* Method to get a list of options for a list input.
|
||||||
*
|
*
|
||||||
* @return array An array of JHtml options.
|
* @return array An array of Html options.
|
||||||
*/
|
*/
|
||||||
protected function getOptions()
|
protected function getOptions()
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
// import the list field type
|
// import the list field type
|
||||||
jimport('joomla.form.helper');
|
jimport('joomla.form.helper');
|
||||||
JFormHelper::loadFieldClass('radio');
|
JFormHelper::loadFieldClass('radio');
|
||||||
@ -36,7 +40,7 @@ class ###JPREFIX###FormField###Type### extends JFormFieldRadio
|
|||||||
/**
|
/**
|
||||||
* Method to get a list of options for a list input.
|
* Method to get a list of options for a list input.
|
||||||
*
|
*
|
||||||
* @return array An array of JHtml options.
|
* @return array An array of Html options.
|
||||||
*/
|
*/
|
||||||
protected function getOptions()
|
protected function getOptions()
|
||||||
{
|
{
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
// import the list field type
|
// import the list field type
|
||||||
jimport('joomla.form.helper');
|
jimport('joomla.form.helper');
|
||||||
JFormHelper::loadFieldClass('user');
|
JFormHelper::loadFieldClass('user');
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,9 +17,12 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('JPATH_PLATFORM') or die;
|
defined('JPATH_PLATFORM') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
use Joomla\CMS\Form\Form;
|
use Joomla\CMS\Form\Form;
|
||||||
use Joomla\CMS\Form\FormRule;
|
use Joomla\CMS\Form\FormRule;
|
||||||
use Joomla\Registry\Registry;
|
use Joomla\Registry\Registry;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form Rule (###Name###) class for the Joomla Platform.
|
* Form Rule (###Name###) class for the Joomla Platform.
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
*/
|
*/
|
||||||
class ###Component###Model###Views### extends ListModel
|
class ###Component###Model###Views### extends ListModel
|
||||||
{
|
{
|
||||||
public function __construct($config = array())
|
public function __construct($config = [])
|
||||||
{
|
{
|
||||||
if (empty($config['filter_fields']))
|
if (empty($config['filter_fields']))
|
||||||
{
|
{
|
||||||
@ -49,7 +49,7 @@ class ###Component###Model###Views### extends ListModel
|
|||||||
*/
|
*/
|
||||||
protected function populateState($ordering = null, $direction = null)
|
protected function populateState($ordering = null, $direction = null)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
|
|
||||||
// Adjust the context to support modal layouts.
|
// Adjust the context to support modal layouts.
|
||||||
if ($layout = $app->input->get('layout'))
|
if ($layout = $app->input->get('layout'))
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -30,7 +30,7 @@ class ###Component###ModelAjax extends ListModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// get params
|
// get params
|
||||||
$this->app_params = JComponentHelper::getParams('com_###component###');
|
$this->app_params = ComponentHelper::getParams('com_###component###');
|
||||||
|
|
||||||
}###AJAX_MODEL_METHODS###
|
}###AJAX_MODEL_METHODS###
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -30,7 +30,7 @@ class ###Component###ModelAjax extends ListModel
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// get params
|
// get params
|
||||||
$this->app_params = JComponentHelper::getParams('com_###component###');
|
$this->app_params = ComponentHelper::getParams('com_###component###');
|
||||||
|
|
||||||
}###AJAX_SITE_MODEL_METHODS###
|
}###AJAX_SITE_MODEL_METHODS###
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -27,9 +27,9 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
public function getIcons()
|
public function getIcons()
|
||||||
{
|
{
|
||||||
// load user for access menus
|
// load user for access menus
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
// reset icon array
|
// reset icon array
|
||||||
$icons = array();
|
$icons = [];
|
||||||
// view groups array
|
// view groups array
|
||||||
$viewGroups = array(
|
$viewGroups = array(
|
||||||
'main' => array(###DASHBOARDICONS###)
|
'main' => array(###DASHBOARDICONS###)
|
||||||
@ -38,7 +38,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
foreach($viewGroups as $group => $views)
|
foreach($viewGroups as $group => $views)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
if (###Component###Helper::checkArray($views))
|
if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($views))
|
||||||
{
|
{
|
||||||
foreach($views as $view)
|
foreach($views as $view)
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$alt = $name;
|
$alt = $name;
|
||||||
$url = $url;
|
$url = $url;
|
||||||
$image = $name . '.' . $type;
|
$image = $name . '.' . $type;
|
||||||
$name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U');
|
$name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// internal views
|
// internal views
|
||||||
@ -79,7 +79,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit';
|
$url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit';
|
||||||
$image = $name . '_' . $action. '.' . $type;
|
$image = $name . '_' . $action. '.' . $type;
|
||||||
$alt = $name . ' ' . $action;
|
$alt = $name . ' ' . $action;
|
||||||
$name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD';
|
$name = 'COM_###COMPONENT###_DASHBOARD_'.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U').'_ADD';
|
||||||
$add = true;
|
$add = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -96,7 +96,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
|
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
|
||||||
$image = $name . '_' . $action . '.' . $type;
|
$image = $name . '_' . $action . '.' . $type;
|
||||||
$alt = $viewName . ' ' . $action;
|
$alt = $viewName . ' ' . $action;
|
||||||
$name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U') . '_' . ###Component###Helper::safeString($action,'U');
|
$name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U') . '_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($action,'U');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -106,7 +106,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$alt = $name;
|
$alt = $name;
|
||||||
$url = 'index.php?option=com_###component###&view=' . $name;
|
$url = 'index.php?option=com_###component###&view=' . $name;
|
||||||
$image = $name . '.' . $type;
|
$image = $name . '.' . $type;
|
||||||
$name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U');
|
$name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U');
|
||||||
$hover = false;
|
$hover = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$hover = false;
|
$hover = false;
|
||||||
}
|
}
|
||||||
// first make sure the view access is set
|
// first make sure the view access is set
|
||||||
if (###Component###Helper::checkArray($viewAccess))
|
if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($viewAccess))
|
||||||
{
|
{
|
||||||
// setup some defaults
|
// setup some defaults
|
||||||
$dashboard_add = false;
|
$dashboard_add = false;
|
||||||
@ -128,11 +128,11 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$accessTo = '';
|
$accessTo = '';
|
||||||
$accessAdd = '';
|
$accessAdd = '';
|
||||||
// access checking start
|
// access checking start
|
||||||
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false;
|
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.create']):false;
|
||||||
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false;
|
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.access']):false;
|
||||||
// set main controllers
|
// set main controllers
|
||||||
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false;
|
$accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_add']):false;
|
||||||
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false;
|
$accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_list']):false;
|
||||||
// check for adding access
|
// check for adding access
|
||||||
if ($add && $accessCreate)
|
if ($add && $accessCreate)
|
||||||
{
|
{
|
||||||
@ -156,7 +156,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
{
|
{
|
||||||
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###');
|
$dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###');
|
||||||
}
|
}
|
||||||
if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add)
|
if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add)
|
||||||
@ -168,7 +168,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (###Component###Helper::checkString($accessTo))
|
elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessTo, 'com_###component###') && $dashboard_list)
|
if($user->authorise($accessTo, 'com_###component###') && $dashboard_list)
|
||||||
@ -180,7 +180,7 @@ class ###Component###Model###Component### extends ListModel
|
|||||||
$icons[$group][$i]->alt = $alt;
|
$icons[$group][$i]->alt = $alt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (###Component###Helper::checkString($accessAdd))
|
elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd))
|
||||||
{
|
{
|
||||||
// check access
|
// check access
|
||||||
if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add)
|
if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add)
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -46,15 +46,15 @@ class ###Component###Model###SViews### extends ListModel
|
|||||||
protected function getListQuery()
|
protected function getListQuery()
|
||||||
{
|
{
|
||||||
// Get the current user for authorisation checks
|
// Get the current user for authorisation checks
|
||||||
$this->user = JFactory::getUser();
|
$this->user = Factory::getUser();
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
$this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
|
$this->initSet = true;###CUSTOM_ADMIN_GET_LIST_QUERY###
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -64,12 +64,12 @@ class ###Component###Model###SViews### extends ListModel
|
|||||||
*/
|
*/
|
||||||
public function getItems()
|
public function getItems()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
// check if this user has permission to access items
|
// check if this user has permission to access items
|
||||||
if (!$user->authorise('###sviews###.access', 'com_###component###'))
|
if (!$user->authorise('###sviews###.access', 'com_###component###'))
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
$app->enqueueMessage(Text::_('Not authorised!'), 'error');
|
||||||
// redirect away if not a correct (TODO for now we go to default view)
|
// redirect away if not a correct (TODO for now we go to default view)
|
||||||
$app->redirect('index.php?option=com_###component###');
|
$app->redirect('index.php?option=com_###component###');
|
||||||
return false;
|
return false;
|
||||||
@ -78,7 +78,7 @@ class ###Component###Model###SViews### extends ListModel
|
|||||||
$items = parent::getItems();
|
$items = parent::getItems();
|
||||||
|
|
||||||
// Get the global params
|
// Get the global params
|
||||||
$globalParams = JComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS###
|
$globalParams = ComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS###
|
||||||
|
|
||||||
// return items
|
// return items
|
||||||
return $items;
|
return $items;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -46,13 +46,13 @@ class ###Component###Model###SViews### extends ListModel
|
|||||||
protected function getListQuery()
|
protected function getListQuery()
|
||||||
{
|
{
|
||||||
// Get the current user for authorisation checks
|
// Get the current user for authorisation checks
|
||||||
$this->user = JFactory::getUser();
|
$this->user = Factory::getUser();
|
||||||
$this->userId = $this->user->get('id');
|
$this->userId = $this->user->get('id');
|
||||||
$this->guest = $this->user->get('guest');
|
$this->guest = $this->user->get('guest');
|
||||||
$this->groups = $this->user->get('groups');
|
$this->groups = $this->user->get('groups');
|
||||||
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
||||||
$this->levels = $this->user->getAuthorisedViewLevels();
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
||||||
$this->app = JFactory::getApplication();
|
$this->app = Factory::getApplication();
|
||||||
$this->input = $this->app->input;
|
$this->input = $this->app->input;
|
||||||
$this->initSet = true; ###SITE_GET_LIST_QUERY###
|
$this->initSet = true; ###SITE_GET_LIST_QUERY###
|
||||||
}
|
}
|
||||||
@ -64,12 +64,12 @@ class ###Component###Model###SViews### extends ListModel
|
|||||||
*/
|
*/
|
||||||
public function getItems()
|
public function getItems()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS###
|
$user = Factory::getUser();###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS###
|
||||||
// load parent items
|
// load parent items
|
||||||
$items = parent::getItems();
|
$items = parent::getItems();
|
||||||
|
|
||||||
// Get the global params
|
// Get the global params
|
||||||
$globalParams = JComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS###
|
$globalParams = ComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS###
|
||||||
|
|
||||||
// return items
|
// return items
|
||||||
return $items;
|
return $items;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,10 +17,17 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
use Joomla\CMS\Table\Table;
|
use Joomla\CMS\Table\Table;
|
||||||
|
use Joomla\CMS\Access\Access as AccessRules;
|
||||||
|
use Joomla\CMS\Access\Rules;
|
||||||
use Joomla\Registry\Registry;
|
use Joomla\Registry\Registry;
|
||||||
use Joomla\String\StringHelper;
|
use Joomla\String\StringHelper;
|
||||||
use Joomla\Utilities\ArrayHelper;
|
use Joomla\Utilities\ArrayHelper;
|
||||||
|
use Joomla\CMS\String\PunycodeHelper;
|
||||||
|
use Joomla\CMS\Table\Observer\Tags as TableObserverTags;
|
||||||
|
use Joomla\CMS\Table\Observer\ContentHistory as TableObserverContenthistory;
|
||||||
|
use Joomla\CMS\Application\ApplicationHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Views### Table class
|
* ###Views### Table class
|
||||||
@ -50,14 +57,14 @@ class ###Component###Table###View### extends Table
|
|||||||
|
|
||||||
if (isset($array['params']) && is_array($array['params']))
|
if (isset($array['params']) && is_array($array['params']))
|
||||||
{
|
{
|
||||||
$registry = new JRegistry;
|
$registry = new Registry;
|
||||||
$registry->loadArray($array['params']);
|
$registry->loadArray($array['params']);
|
||||||
$array['params'] = (string) $registry;
|
$array['params'] = (string) $registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($array['metadata']) && is_array($array['metadata']))
|
if (isset($array['metadata']) && is_array($array['metadata']))
|
||||||
{
|
{
|
||||||
$registry = new JRegistry;
|
$registry = new Registry;
|
||||||
$registry->loadArray($array['metadata']);
|
$registry->loadArray($array['metadata']);
|
||||||
$array['metadata'] = (string) $registry;
|
$array['metadata'] = (string) $registry;
|
||||||
}
|
}
|
||||||
@ -65,7 +72,7 @@ class ###Component###Table###View### extends Table
|
|||||||
// Bind the rules.
|
// Bind the rules.
|
||||||
if (isset($array['rules']) && is_array($array['rules']))
|
if (isset($array['rules']) && is_array($array['rules']))
|
||||||
{
|
{
|
||||||
$rules = new JAccessRules($array['rules']);
|
$rules = new AccessRules($array['rules']);
|
||||||
$this->setRules($rules);
|
$this->setRules($rules);
|
||||||
}
|
}
|
||||||
return parent::bind($array, $ignore);
|
return parent::bind($array, $ignore);
|
||||||
@ -80,8 +87,8 @@ class ###Component###Table###View### extends Table
|
|||||||
*/
|
*/
|
||||||
public function store($updateNulls = false)
|
public function store($updateNulls = false)
|
||||||
{
|
{
|
||||||
$date = JFactory::getDate();
|
$date = Factory::getDate();
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
|
|
||||||
if ($this->id)
|
if ($this->id)
|
||||||
{
|
{
|
||||||
@ -106,11 +113,16 @@ class ###Component###Table###View### extends Table
|
|||||||
if (isset($this->alias))
|
if (isset($this->alias))
|
||||||
{
|
{
|
||||||
// Verify that the alias is unique
|
// Verify that the alias is unique
|
||||||
$table = JTable::getInstance('###view###', '###Component###Table');
|
$table = Table::getInstance('###view###', '###Component###Table');
|
||||||
|
|
||||||
if ($table->load(array('alias' => $this->alias###JTABLEALIASCATEGORY###)) && ($table->id != $this->id || $this->id == 0))
|
if ($table->load(array('alias' => $this->alias###JTABLEALIASCATEGORY###)) && ($table->id != $this->id || $this->id == 0))
|
||||||
{
|
{
|
||||||
$this->setError(JText::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS'));
|
$this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS'));
|
||||||
|
|
||||||
|
if ($table->published === -2)
|
||||||
|
{
|
||||||
|
$this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS_TRASHED'));
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -118,12 +130,12 @@ class ###Component###Table###View### extends Table
|
|||||||
if (isset($this->url))
|
if (isset($this->url))
|
||||||
{
|
{
|
||||||
// Convert IDN urls to punycode
|
// Convert IDN urls to punycode
|
||||||
$this->url = JStringPunycode::urlToPunycode($this->url);
|
$this->url = PunycodeHelper::urlToPunycode($this->url);
|
||||||
}
|
}
|
||||||
if (isset($this->website))
|
if (isset($this->website))
|
||||||
{
|
{
|
||||||
// Convert IDN urls to punycode
|
// Convert IDN urls to punycode
|
||||||
$this->website = JStringPunycode::urlToPunycode($this->website);
|
$this->website = PunycodeHelper::urlToPunycode($this->website);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent::store($updateNulls);
|
return parent::store($updateNulls);
|
||||||
@ -141,7 +153,7 @@ class ###Component###Table###View### extends Table
|
|||||||
// Generate a valid alias
|
// Generate a valid alias
|
||||||
$this->generateAlias();
|
$this->generateAlias();
|
||||||
|
|
||||||
$table = JTable::getInstance('###view###', '###component###Table');
|
$table = Table::getInstance('###view###', '###component###Table');
|
||||||
|
|
||||||
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0))
|
||||||
{
|
{
|
||||||
@ -164,7 +176,7 @@ class ###Component###Table###View### extends Table
|
|||||||
|
|
||||||
// Create array using commas as delimiter.
|
// Create array using commas as delimiter.
|
||||||
$keys = explode(',', $after_clean);
|
$keys = explode(',', $after_clean);
|
||||||
$clean_keys = array();
|
$clean_keys = [];
|
||||||
|
|
||||||
foreach ($keys as $key)
|
foreach ($keys as $key)
|
||||||
{
|
{
|
||||||
@ -187,7 +199,7 @@ class ###Component###Table###View### extends Table
|
|||||||
$this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc);
|
$this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we don't have any access rules set at this point just use an empty JAccessRules class
|
// If we don't have any access rules set at this point just use an empty AccessRules class
|
||||||
if (!$this->getRules())
|
if (!$this->getRules())
|
||||||
{
|
{
|
||||||
$rules = $this->getDefaultAssetValues('com_###component###.###view###.'.$this->id);
|
$rules = $this->getDefaultAssetValues('com_###component###.###view###.'.$this->id);
|
||||||
@ -209,12 +221,12 @@ class ###Component###Table###View### extends Table
|
|||||||
*
|
*
|
||||||
* @param $string $component The component asset name to search for
|
* @param $string $component The component asset name to search for
|
||||||
*
|
*
|
||||||
* @return JAccessRules The JAccessRules object for the asset
|
* @return AccessRules The AccessRules object for the asset
|
||||||
*/
|
*/
|
||||||
protected function getDefaultAssetValues($component, $try = true)
|
protected function getDefaultAssetValues($component, $try = true)
|
||||||
{
|
{
|
||||||
// Need to find the asset id by the name of the component.
|
// Need to find the asset id by the name of the component.
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select($db->quoteName('id'))
|
->select($db->quoteName('id'))
|
||||||
->from($db->quoteName('#__assets'))
|
->from($db->quoteName('#__assets'))
|
||||||
@ -225,14 +237,14 @@ class ###Component###Table###View### extends Table
|
|||||||
{
|
{
|
||||||
// asset already set so use saved rules
|
// asset already set so use saved rules
|
||||||
$assetId = (int) $db->loadResult();
|
$assetId = (int) $db->loadResult();
|
||||||
return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
return AccessRules::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed.
|
||||||
}
|
}
|
||||||
// try again
|
// try again
|
||||||
elseif ($try)
|
elseif ($try)
|
||||||
{
|
{
|
||||||
$try = explode('.',$component);
|
$try = explode('.',$component);
|
||||||
$result = $this->getDefaultAssetValues($try[0], false);
|
$result = $this->getDefaultAssetValues($try[0], false);
|
||||||
if ($result instanceof JAccessRules)
|
if ($result instanceof AccessRules)
|
||||||
{
|
{
|
||||||
if (isset($try[1]))
|
if (isset($try[1]))
|
||||||
{
|
{
|
||||||
@ -249,7 +261,7 @@ class ###Component###Table###View### extends Table
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// clear the value since we inherit
|
// clear the value since we inherit
|
||||||
$rule = array();
|
$rule = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check if there are any view values remaining
|
// check if there are any view values remaining
|
||||||
@ -257,8 +269,8 @@ class ###Component###Table###View### extends Table
|
|||||||
{
|
{
|
||||||
$_result = json_encode($_result);
|
$_result = json_encode($_result);
|
||||||
$_result = array($_result);
|
$_result = array($_result);
|
||||||
// Instantiate and return the JAccessRules object for the asset rules.
|
// Instantiate and return the AccessRules object for the asset rules.
|
||||||
$rules = new JAccessRules;
|
$rules = new AccessRules;
|
||||||
$rules->mergeCollection($_result);
|
$rules->mergeCollection($_result);
|
||||||
|
|
||||||
return $rules;
|
return $rules;
|
||||||
@ -267,7 +279,7 @@ class ###Component###Table###View### extends Table
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return JAccess::getAssetRules(0);
|
return AccessRules::getAssetRules(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -305,9 +317,9 @@ class ###Component###Table###View### extends Table
|
|||||||
* @return int
|
* @return int
|
||||||
* @since 2.5
|
* @since 2.5
|
||||||
*/
|
*/
|
||||||
protected function _getAssetParentId(JTable $table = NULL, $id = NULL)
|
protected function _getAssetParentId(?Table $table = null, $id = null)
|
||||||
{
|
{
|
||||||
$asset = JTable::getInstance('Asset');
|
$asset = Table::getInstance('Asset');
|
||||||
$asset->loadByName('com_###component###');
|
$asset->loadByName('com_###component###');
|
||||||
|
|
||||||
return $asset->id;
|
return $asset->id;
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Session\Session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Ajax Controller
|
* ###Component### Ajax Controller
|
||||||
*/
|
*/
|
||||||
@ -26,19 +29,19 @@ class ###Component###ControllerAjax extends JControllerLegacy
|
|||||||
{
|
{
|
||||||
parent::__construct($config);
|
parent::__construct($config);
|
||||||
// make sure all json stuff are set
|
// make sure all json stuff are set
|
||||||
JFactory::getDocument()->setMimeEncoding( 'application/json' );
|
Factory::getDocument()->setMimeEncoding( 'application/json' );
|
||||||
JFactory::getApplication()->setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
Factory::getApplication()->setHeader('Content-Disposition','attachment;filename="getajax.json"');
|
||||||
JFactory::getApplication()->setHeader("Access-Control-Allow-Origin", "*");
|
Factory::getApplication()->setHeader("Access-Control-Allow-Origin", "*");
|
||||||
// load the tasks
|
// load the tasks
|
||||||
$this->registerTask('fieldRequired', 'ajax');
|
$this->registerTask('fieldRequired', 'ajax');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ajax()
|
public function ajax()
|
||||||
{
|
{
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
$jinput = JFactory::getApplication()->input;
|
$jinput = Factory::getApplication()->input;
|
||||||
// Check Token!
|
// Check Token!
|
||||||
$token = JSession::getFormToken();
|
$token = Session::getFormToken();
|
||||||
$call_token = $jinput->get('token', 0, 'ALNUM');
|
$call_token = $jinput->get('token', 0, 'ALNUM');
|
||||||
if($user->id != 0 && $token == $call_token)
|
if($user->id != 0 && $token == $call_token)
|
||||||
{
|
{
|
||||||
@ -51,7 +54,7 @@ class ###Component###ControllerAjax extends JControllerLegacy
|
|||||||
$form = $jinput->get('form', NULL, 'WORD');
|
$form = $jinput->get('form', NULL, 'WORD');
|
||||||
$status = $jinput->get('status', NULL, 'INT');
|
$status = $jinput->get('status', NULL, 'INT');
|
||||||
|
|
||||||
if (###Component###Helper::checkString($name) && ###Component###Helper::checkString($form))
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($name) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($form))
|
||||||
{
|
{
|
||||||
$result = $this->getModel('ajax')->setFieldRequired($name,$form,$status);
|
$result = $this->getModel('ajax')->setFieldRequired($name,$form,$status);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,10 +17,15 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\MVC\Model\ListModel;
|
||||||
|
use Joomla\CMS\Component\ComponentHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Ajax Model
|
* ###Component### Ajax Model
|
||||||
*/
|
*/
|
||||||
class ###Component###ModelAjax extends JModelList
|
class ###Component###ModelAjax extends ListModel
|
||||||
{
|
{
|
||||||
protected $app_params;
|
protected $app_params;
|
||||||
|
|
||||||
@ -28,16 +33,16 @@ class ###Component###ModelAjax extends JModelList
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
// get params
|
// get params
|
||||||
$this->app_params = JComponentHelper::getParams('com_###component###');
|
$this->app_params = ComponentHelper::getParams('com_###component###');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setFieldRequired($name,$form,$status)
|
public function setFieldRequired($name,$form,$status)
|
||||||
{
|
{
|
||||||
// get the session
|
// get the session
|
||||||
$session = JFactory::getSession();
|
$session = Factory::getSession();
|
||||||
// get this forms set fields
|
// get this forms set fields
|
||||||
$fields = $session->get($form.'_requiredFieldFix');
|
$fields = $session->get($form.'_requiredFieldFix');
|
||||||
if(###Component###Helper::checkArray($fields))
|
if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($fields))
|
||||||
{
|
{
|
||||||
if ($status == 1)
|
if ($status == 1)
|
||||||
{
|
{
|
||||||
@ -61,7 +66,7 @@ class ###Component###ModelAjax extends JModelList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// load the remaining values to session
|
// load the remaining values to session
|
||||||
if(###Component###Helper::checkArray($fields))
|
if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($fields))
|
||||||
{
|
{
|
||||||
$session->set($form.'_requiredFieldFix', $fields);
|
$session->set($form.'_requiredFieldFix', $fields);
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -30,7 +30,7 @@ abstract class JHtmlBatch_
|
|||||||
* @var array
|
* @var array
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
protected static $ListSelection = array();
|
protected static $ListSelection = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render the batch selection options.
|
* Render the batch selection options.
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,7 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('JPATH_BASE') or die;
|
defined('JPATH_BASE') or die;
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
JHtmlBehavior::core();
|
JHtmlBehavior::core();
|
||||||
$divWrapper = range(1,120,2);
|
$divWrapper = range(1,120,2);
|
||||||
$counter = 0;
|
$counter = 0;
|
||||||
@ -45,9 +46,9 @@ $counter = 0;
|
|||||||
<div class="control-group radio" id="batch-move-copy">
|
<div class="control-group radio" id="batch-move-copy">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label class="radio" id="batch[move_copy]c-lbl" for="batch[move_copy]c">
|
<label class="radio" id="batch[move_copy]c-lbl" for="batch[move_copy]c">
|
||||||
<input type="radio" value="c" id="batch[move_copy]c" name="batch[move_copy]"><?php echo JText::_('Copy'); ?></label>
|
<input type="radio" value="c" id="batch[move_copy]c" name="batch[move_copy]"><?php echo Text::_('Copy'); ?></label>
|
||||||
<label class="radio" id="batch[move_copy]m-lbl" for="batch[move_copy]m">
|
<label class="radio" id="batch[move_copy]m-lbl" for="batch[move_copy]m">
|
||||||
<input type="radio" checked="checked" value="m" id="batch[move_copy]m" name="batch[move_copy]"><?php echo JText::_('Update'); ?></label>
|
<input type="radio" checked="checked" value="m" id="batch[move_copy]m" name="batch[move_copy]"><?php echo Text::_('Update'); ?></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -20,25 +20,24 @@ defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER###
|
|||||||
###ADMIN_COMPONENT_HEADER###
|
###ADMIN_COMPONENT_HEADER###
|
||||||
|
|
||||||
// Access check.
|
// Access check.
|
||||||
if (!JFactory::getUser()->authorise('core.manage', 'com_###component###'))
|
if (!Factory::getUser()->authorise('core.manage', 'com_###component###'))
|
||||||
{
|
{
|
||||||
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
|
throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Add CSS file for all pages
|
// Add CSS file for all pages
|
||||||
$document = JFactory::getDocument();
|
Html::_('stylesheet', 'components/com_###component###/assets/css/admin.css', ['version' => 'auto']);
|
||||||
$document->addStyleSheet('components/com_###component###/assets/css/admin.css');
|
Html::_('script', 'components/com_###component###/assets/js/admin.js', ['version' => 'auto']);
|
||||||
$document->addScript('components/com_###component###/assets/js/admin.js');
|
|
||||||
|
|
||||||
// require helper files
|
// require helper files
|
||||||
JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL###
|
JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL###
|
||||||
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT######ADMIN_GLOBAL_EVENT###
|
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT######ADMIN_GLOBAL_EVENT###
|
||||||
|
|
||||||
// Get an instance of the controller prefixed by ###Component###
|
// Get an instance of the controller prefixed by ###Component###
|
||||||
$controller = JControllerLegacy::getInstance('###Component###');
|
$controller = BaseController::getInstance('###Component###');
|
||||||
|
|
||||||
// Perform the Request task
|
// Perform the Request task
|
||||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
$controller->execute(Factory::getApplication()->input->get('task'));
|
||||||
|
|
||||||
// Redirect if set by the controller
|
// Redirect if set by the controller
|
||||||
$controller->redirect();
|
$controller->redirect();
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -20,19 +20,18 @@ defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER###
|
|||||||
###SITE_COMPONENT_HEADER###
|
###SITE_COMPONENT_HEADER###
|
||||||
|
|
||||||
// Set the component css/js
|
// Set the component css/js
|
||||||
$document = JFactory::getDocument();
|
Html::_('stylesheet', 'components/com_###component###/assets/css/site.css', ['version' => 'auto']);
|
||||||
$document->addStyleSheet('components/com_###component###/assets/css/site.css');
|
Html::_('script', 'components/com_###component###/assets/js/site.js', ['version' => 'auto']);
|
||||||
$document->addScript('components/com_###component###/assets/js/site.js');
|
|
||||||
|
|
||||||
// Require helper files
|
// Require helper files
|
||||||
JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL###
|
JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL###
|
||||||
JLoader::register('###Component###HelperRoute', __DIR__ . '/helpers/route.php');###LICENSE_LOCKED_INT######SITE_GLOBAL_EVENT###
|
JLoader::register('###Component###HelperRoute', __DIR__ . '/helpers/route.php');###LICENSE_LOCKED_INT######SITE_GLOBAL_EVENT###
|
||||||
|
|
||||||
// Get an instance of the controller prefixed by ###Component###
|
// Get an instance of the controller prefixed by ###Component###
|
||||||
$controller = JControllerLegacy::getInstance('###Component###');
|
$controller = BaseController::getInstance('###Component###');
|
||||||
|
|
||||||
// Perform the request task
|
// Perform the request task
|
||||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
$controller->execute(Factory::getApplication()->input->get('task'));
|
||||||
|
|
||||||
// Redirect if set by the controller
|
// Redirect if set by the controller
|
||||||
$controller->redirect();
|
$controller->redirect();
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
###ADMIN_VIEWS_HEADER###
|
###ADMIN_VIEWS_HEADER###
|
||||||
|
|
||||||
if ($this->saveOrder)
|
if ($this->saveOrder)
|
||||||
{
|
{
|
||||||
$saveOrderingUrl = 'index.php?option=com_###component###&task=###views###.saveOrderAjax&tmpl=component';
|
$saveOrderingUrl = 'index.php?option=com_###component###&task=###views###.saveOrderAjax&tmpl=component';
|
||||||
JHtml::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
|
Html::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT###
|
###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT###
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<p><?php echo JText::_('COM_###COMPONENT###_###VIEWS###_BATCH_TIP'); ?></p>
|
<p><?php echo Text::_('COM_###COMPONENT###_###VIEWS###_BATCH_TIP'); ?></p>
|
||||||
<?php echo $this->batchDisplay; ?>
|
<?php echo $this->batchDisplay; ?>
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,12 +17,14 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!-- clear the batch values if cancel -->
|
<!-- clear the batch values if cancel -->
|
||||||
<button class="btn" type="button" onclick="###BATCH_ONCLICK_CANCEL_SCRIPT###" data-dismiss="modal">
|
<button class="btn" type="button" onclick="###BATCH_ONCLICK_CANCEL_SCRIPT###" data-dismiss="modal">
|
||||||
<?php echo JText::_('JCANCEL'); ?>
|
<?php echo Text::_('JCANCEL'); ?>
|
||||||
</button>
|
</button>
|
||||||
<!-- post the batch values if process -->
|
<!-- post the batch values if process -->
|
||||||
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('###view###.batch');">
|
<button class="btn btn-success" type="submit" onclick="Joomla.submitbutton('###view###.batch');">
|
||||||
<?php echo JText::_('JGLOBAL_BATCH_PROCESS'); ?>
|
<?php echo Text::_('JGLOBAL_BATCH_PROCESS'); ?>
|
||||||
</button>
|
</button>
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
$edit = "index.php?option=com_###component###&view=###views###&task=###view###.edit";
|
$edit = "index.php?option=com_###component###&view=###views###&task=###view###.edit";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -18,11 +18,11 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
###CUSTOM_ADMIN_VIEW_HEADER######CUSTOM_ADMIN_CODE_BODY###
|
###CUSTOM_ADMIN_VIEW_HEADER######CUSTOM_ADMIN_CODE_BODY###
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
|
<?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
|
||||||
<?php $urlId = (isset($this->item->id)) ? '&id='. (int) $this->item->id : ''; ?>
|
<?php $urlId = (isset($this->item->id)) ? '&id='. (int) $this->item->id : ''; ?>
|
||||||
###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM###
|
###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM###
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<h1><?php echo JText::_('COM_###COMPONENT###_NO_ACCESS_GRANTED'); ?></h1>
|
<h1><?php echo Text::_('COM_###COMPONENT###_NO_ACCESS_GRANTED'); ?></h1>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -15,6 +15,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
###BOM###
|
###BOM###
|
||||||
|
|
||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_TEMPLATE_CODE_BODY###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Router\Route;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;###CUSTOM_ADMIN_TEMPLATE_CODE_BODY###
|
||||||
|
|
||||||
?>###CUSTOM_ADMIN_TEMPLATE_BODY###
|
?>###CUSTOM_ADMIN_TEMPLATE_BODY###
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,5 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
###LISTHEAD###
|
###LISTHEAD###
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,13 +17,17 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
JHtml::_('jquery.framework');
|
use Joomla\CMS\Language\Text;
|
||||||
JHtml::_('bootstrap.tooltip');
|
use Joomla\CMS\Router\Route;
|
||||||
JHtml::_('script', 'system/core.js', false, true);
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
JHtml::_('behavior.keepalive');
|
Html::_('jquery.framework');
|
||||||
|
Html::_('bootstrap.tooltip');
|
||||||
|
Html::_('script', 'system/core.js', false, true);
|
||||||
|
Html::_('behavior.keepalive');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<?php if ($this->hasPackage && ###Component###Helper::checkArray($this->headerList)) : ?>
|
<?php if ($this->hasPackage && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headerList)) : ?>
|
||||||
Joomla.continueImport = function()
|
Joomla.continueImport = function()
|
||||||
{
|
{
|
||||||
var form = document.getElementById('adminForm');
|
var form = document.getElementById('adminForm');
|
||||||
@ -40,7 +44,7 @@ JHtml::_('behavior.keepalive');
|
|||||||
// do field validation
|
// do field validation
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
alert("<?php echo JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', true); ?>");
|
alert("<?php echo Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_SELECT_ALL_COLUMNS', true); ?>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -58,7 +62,7 @@ JHtml::_('behavior.keepalive');
|
|||||||
// do field validation
|
// do field validation
|
||||||
if (form.import_package.value == "")
|
if (form.import_package.value == "")
|
||||||
{
|
{
|
||||||
alert("<?php echo JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>");
|
alert("<?php echo Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_SELECT_A_FILE', true); ?>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -75,7 +79,7 @@ JHtml::_('behavior.keepalive');
|
|||||||
|
|
||||||
// do field validation
|
// do field validation
|
||||||
if (form.import_directory.value == ""){
|
if (form.import_directory.value == ""){
|
||||||
alert("<?php echo JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', true); ?>");
|
alert("<?php echo Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_SELECT_A_DIRECTORY', true); ?>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -93,7 +97,7 @@ JHtml::_('behavior.keepalive');
|
|||||||
// do field validation
|
// do field validation
|
||||||
if (form.import_url.value == "" || form.import_url.value == "http://")
|
if (form.import_url.value == "" || form.import_url.value == "http://")
|
||||||
{
|
{
|
||||||
alert("<?php echo JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL', true); ?>");
|
alert("<?php echo Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL', true); ?>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -126,7 +130,7 @@ jQuery(document).ready(function($) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div id="installer-import" class="clearfix">
|
<div id="installer-import" class="clearfix">
|
||||||
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_###component###&view=import');?>" method="post" name="adminForm" id="adminForm" class="form-horizontal form-validate">
|
<form enctype="multipart/form-data" action="<?php echo Route::_('index.php?option=com_###component###&view=import');?>" method="post" name="adminForm" id="adminForm" class="form-horizontal form-validate">
|
||||||
|
|
||||||
<?php if (!empty( $this->sidebar)) : ?>
|
<?php if (!empty( $this->sidebar)) : ?>
|
||||||
<div id="j-sidebar-container" class="span2">
|
<div id="j-sidebar-container" class="span2">
|
||||||
@ -137,13 +141,13 @@ jQuery(document).ready(function($) {
|
|||||||
<div id="j-main-container">
|
<div id="j-main-container">
|
||||||
<?php endif;?>
|
<?php endif;?>
|
||||||
|
|
||||||
<?php if ($this->hasPackage && ###Component###Helper::checkArray($this->headerList) && ###Component###Helper::checkArray($this->headers)) : ?>
|
<?php if ($this->hasPackage && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headerList) && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headers)) : ?>
|
||||||
<fieldset class="uploadform">
|
<fieldset class="uploadform">
|
||||||
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend>
|
<legend><?php echo Text::_('COM_###COMPONENT###_IMPORT_LINK_FILE_TO_TABLE_COLUMNS'); ?></legend>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label" ><h4><?php echo JText::_('COM_###COMPONENT###_IMPORT_TABLE_COLUMNS'); ?></h4></label>
|
<label class="control-label" ><h4><?php echo Text::_('COM_###COMPONENT###_IMPORT_TABLE_COLUMNS'); ?></h4></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label class="control-label" ><h4><?php echo JText::_('COM_###COMPONENT###_IMPORT_FILE_COLUMNS'); ?></h4></label>
|
<label class="control-label" ><h4><?php echo Text::_('COM_###COMPONENT###_IMPORT_FILE_COLUMNS'); ?></h4></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php foreach($this->headerList as $name => $title): ?>
|
<?php foreach($this->headerList as $name => $title): ?>
|
||||||
@ -151,72 +155,72 @@ jQuery(document).ready(function($) {
|
|||||||
<label for="<?php echo $name; ?>" class="control-label" ><?php echo $title; ?></label>
|
<label for="<?php echo $name; ?>" class="control-label" ><?php echo $title; ?></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<select name="<?php echo $name; ?>" id="vdm_<?php echo $name; ?>" required class="required input_box" >
|
<select name="<?php echo $name; ?>" id="vdm_<?php echo $name; ?>" required class="required input_box" >
|
||||||
<option value=""><?php echo JText::_('COM_###COMPONENT###_IMPORT_PLEASE_SELECT_COLUMN'); ?></option>
|
<option value=""><?php echo Text::_('COM_###COMPONENT###_IMPORT_PLEASE_SELECT_COLUMN'); ?></option>
|
||||||
<option value="IGNORE"><?php echo JText::_('COM_###COMPONENT###_IMPORT_IGNORE_COLUMN'); ?></option>
|
<option value="IGNORE"><?php echo Text::_('COM_###COMPONENT###_IMPORT_IGNORE_COLUMN'); ?></option>
|
||||||
<?php foreach($this->headers as $value => $option): ?>
|
<?php foreach($this->headers as $value => $option): ?>
|
||||||
<?php $selected = (strtolower($option) == strtolower ($title) || strtolower($option) == strtolower($name))? 'selected="selected"':''; ?>
|
<?php $selected = (strtolower($option) == strtolower ($title) || strtolower($option) == strtolower($name))? 'selected="selected"':''; ?>
|
||||||
<option value="<?php echo ###Component###Helper::htmlEscape($value); ?>" class="required" <?php echo $selected ?>><?php echo ###Component###Helper::htmlEscape($option); ?></option>
|
<option value="<?php echo Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($value); ?>" class="required" <?php echo $selected ?>><?php echo Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($option); ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_CONTINUE'); ?>" onclick="Joomla.continueImport()" />
|
<input class="btn btn-primary" type="button" value="<?php echo Text::_('COM_###COMPONENT###_IMPORT_CONTINUE'); ?>" onclick="Joomla.continueImport()" />
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<input type="hidden" name="gettype" value="continue" />
|
<input type="hidden" name="gettype" value="continue" />
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?>
|
<?php echo Html::_('bootstrap.startTabSet', 'myTab', array('active' => 'upload')); ?>
|
||||||
|
|
||||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'upload', JText::_('COM_###COMPONENT###_IMPORT_FROM_UPLOAD', true)); ?>
|
<?php echo Html::_('bootstrap.addTab', 'myTab', 'upload', Text::_('COM_###COMPONENT###_IMPORT_FROM_UPLOAD', true)); ?>
|
||||||
<fieldset class="uploadform">
|
<fieldset class="uploadform">
|
||||||
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
|
<legend><?php echo Text::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="import_package" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE'); ?></label>
|
<label for="import_package" class="control-label"><?php echo Text::_('COM_###COMPONENT###_IMPORT_SELECT_FILE'); ?></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input class="input_box" id="import_package" name="import_package" type="file" size="57" />
|
<input class="input_box" id="import_package" name="import_package" type="file" size="57" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<input class="btn btn-primary" type="button" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_UPLOAD_BOTTON'); ?>" onclick="Joomla.submitbutton()" /> <small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
<input class="btn btn-primary" type="button" value="<?php echo Text::_('COM_###COMPONENT###_IMPORT_UPLOAD_BOTTON'); ?>" onclick="Joomla.submitbutton()" /> <small><?php echo Text::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
<?php echo Html::_('bootstrap.endTab'); ?>
|
||||||
|
|
||||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'directory', JText::_('COM_###COMPONENT###_IMPORT_FROM_DIRECTORY', true)); ?>
|
<?php echo Html::_('bootstrap.addTab', 'myTab', 'directory', Text::_('COM_###COMPONENT###_IMPORT_FROM_DIRECTORY', true)); ?>
|
||||||
<fieldset class="uploadform">
|
<fieldset class="uploadform">
|
||||||
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
|
<legend><?php echo Text::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="import_directory" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_DIRECTORY'); ?></label>
|
<label for="import_directory" class="control-label"><?php echo Text::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_DIRECTORY'); ?></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="import_directory" name="import_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('import.directory'); ?>" />
|
<input type="text" id="import_directory" name="import_directory" class="span5 input_box" size="70" value="<?php echo $this->state->get('import.directory'); ?>" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton3()" /> <small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
<input type="button" class="btn btn-primary" value="<?php echo Text::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton3()" /> <small><?php echo Text::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
<?php echo Html::_('bootstrap.endTab'); ?>
|
||||||
|
|
||||||
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'url', JText::_('COM_###COMPONENT###_IMPORT_FROM_URL', true)); ?>
|
<?php echo Html::_('bootstrap.addTab', 'myTab', 'url', Text::_('COM_###COMPONENT###_IMPORT_FROM_URL', true)); ?>
|
||||||
<fieldset class="uploadform">
|
<fieldset class="uploadform">
|
||||||
<legend><?php echo JText::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
|
<legend><?php echo Text::_('COM_###COMPONENT###_IMPORT_UPDATE_DATA'); ?></legend>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label for="import_url" class="control-label"><?php echo JText::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_URL'); ?></label>
|
<label for="import_url" class="control-label"><?php echo Text::_('COM_###COMPONENT###_IMPORT_SELECT_FILE_URL'); ?></label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="text" id="import_url" name="import_url" class="span5 input_box" size="70" value="http://" />
|
<input type="text" id="import_url" name="import_url" class="span5 input_box" size="70" value="http://" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<input type="button" class="btn btn-primary" value="<?php echo JText::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" /> <small><?php echo JText::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
<input type="button" class="btn btn-primary" value="<?php echo Text::_('COM_###COMPONENT###_IMPORT_GET_BOTTON'); ?>" onclick="Joomla.submitbutton4()" /> <small><?php echo Text::_('COM_###COMPONENT###_IMPORT_FORMATS_ACCEPTED'); ?> (.csv .xls .ods)</small>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php echo JHtml::_('bootstrap.endTab'); ?>
|
<?php echo Html::_('bootstrap.endTab'); ?>
|
||||||
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
|
<?php echo Html::_('bootstrap.endTabSet'); ?>
|
||||||
<input type="hidden" name="gettype" value="upload" />
|
<input type="hidden" name="gettype" value="upload" />
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<input type="hidden" name="task" value="import.import" />
|
<input type="hidden" name="task" value="import.import" />
|
||||||
<?php echo JHtml::_('form.token'); ?>
|
<?php echo Html::_('form.token'); ?>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,8 +17,13 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
JHtml::_('jquery.framework');
|
use Joomla\CMS\Factory;
|
||||||
JHtml::_('bootstrap.tooltip');
|
use Joomla\CMS\Language\Text;
|
||||||
JHtml::_('script', 'system/core.js', false, true);
|
use Joomla\CMS\Router\Route;
|
||||||
JHtml::_('behavior.keepalive');
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
Html::_('jquery.framework');
|
||||||
|
Html::_('bootstrap.tooltip');
|
||||||
|
Html::_('script', 'system/core.js', false, true);
|
||||||
|
Html::_('behavior.keepalive');
|
||||||
|
|
||||||
?>###IMPORT_DEFAULT_VIEW_CUSTOM###
|
?>###IMPORT_DEFAULT_VIEW_CUSTOM###
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -22,5 +22,5 @@ defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
|||||||
<?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
|
<?php if ($this->canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###
|
||||||
###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM###
|
###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM###
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<h1><?php echo JText::_('COM_###COMPONENT###_NO_ACCESS_GRANTED'); ?></h1>
|
<h1><?php echo Text::_('COM_###COMPONENT###_NO_ACCESS_GRANTED'); ?></h1>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php if(isset($this->icons['main']) && is_array($this->icons['main'])) :?>
|
<?php if(isset($this->icons['main']) && is_array($this->icons['main'])) :?>
|
||||||
<?php foreach($this->icons['main'] as $icon): ?>
|
<?php foreach($this->icons['main'] as $icon): ?>
|
||||||
@ -24,12 +26,12 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
<div class="dashboard-content">
|
<div class="dashboard-content">
|
||||||
<a class="icon" href="<?php echo $icon->url; ?>">
|
<a class="icon" href="<?php echo $icon->url; ?>">
|
||||||
<img alt="<?php echo $icon->alt; ?>" src="components/com_###component###/assets/images/icons/<?php echo $icon->image; ?>">
|
<img alt="<?php echo $icon->alt; ?>" src="components/com_###component###/assets/images/icons/<?php echo $icon->image; ?>">
|
||||||
<span class="dashboard-title"><?php echo JText::_($icon->name); ?></span>
|
<span class="dashboard-title"><?php echo Text::_($icon->name); ?></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="alert alert-error"><h4 class="alert-heading"><?php echo JText::_("Permission denied, or not correctly set"); ?></h4><div class="alert-message"><?php echo JText::_("Please notify your System Administrator if result is unexpected."); ?></div></div>
|
<div class="alert alert-error"><h4 class="alert-heading"><?php echo Text::_("Permission denied, or not correctly set"); ?></h4><div class="alert-message"><?php echo Text::_("Please notify your System Administrator if result is unexpected."); ?></div></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -15,6 +15,10 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
###BOM###
|
###BOM###
|
||||||
|
|
||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_TEMPLATE_CODE_BODY###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
use Joomla\CMS\Layout\LayoutHelper;###SITE_TEMPLATE_CODE_BODY###
|
||||||
|
|
||||||
?>###SITE_TEMPLATE_BODY###
|
?>###SITE_TEMPLATE_BODY###
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,34 +17,37 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div id="filter-bar" class="btn-toolbar">
|
<div id="filter-bar" class="btn-toolbar">
|
||||||
<div class="filter-search btn-group pull-left">
|
<div class="filter-search btn-group pull-left">
|
||||||
<label for="filter_search" class="element-invisible"><?php echo JText::_('Search');?></label>
|
<label for="filter_search" class="element-invisible"><?php echo Text::_('Search');?></label>
|
||||||
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo JText::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo JHtml::tooltipText('Search ###Views###'); ?>" />
|
<input type="text" name="filter_search" id="filter_search" placeholder="<?php echo Text::_('JSEARCH_FILTER'); ?>" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" class="hasTooltip" title="<?php echo Html::tooltipText('Search ###Views###'); ?>" />
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group pull-left">
|
<div class="btn-group pull-left">
|
||||||
<button type="submit" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
|
<button type="submit" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
|
||||||
<button type="button" class="btn hasTooltip" title="<?php echo JHtml::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
<button type="button" class="btn hasTooltip" title="<?php echo Html::tooltipText('JSEARCH_FILTER_CLEAR'); ?>" onclick="document.id('filter_search').value='';this.form.submit();"><i class="icon-remove"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group pull-right hidden-phone">
|
<div class="btn-group pull-right hidden-phone">
|
||||||
<label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
<label for="limit" class="element-invisible"><?php echo Text::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC');?></label>
|
||||||
<?php echo $this->pagination->getLimitBox(); ?>
|
<?php echo $this->pagination->getLimitBox(); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group pull-right hidden-phone">
|
<div class="btn-group pull-right hidden-phone">
|
||||||
<label for="directionTable" class="element-invisible"><?php echo JText::_('JFIELD_ORDERING_DESC');?></label>
|
<label for="directionTable" class="element-invisible"><?php echo Text::_('JFIELD_ORDERING_DESC');?></label>
|
||||||
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
<select name="directionTable" id="directionTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||||
<option value=""><?php echo JText::_('JFIELD_ORDERING_DESC');?></option>
|
<option value=""><?php echo Text::_('JFIELD_ORDERING_DESC');?></option>
|
||||||
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
<option value="asc" <?php if ($this->listDirn == 'asc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_ASCENDING');?></option>
|
||||||
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo JText::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
<option value="desc" <?php if ($this->listDirn == 'desc') echo 'selected="selected"'; ?>><?php echo Text::_('JGLOBAL_ORDER_DESCENDING');?></option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<label for="sortTable" class="element-invisible"><?php echo JText::_('JGLOBAL_SORT_BY');?></label>
|
<label for="sortTable" class="element-invisible"><?php echo Text::_('JGLOBAL_SORT_BY');?></label>
|
||||||
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
<select name="sortTable" id="sortTable" class="input-medium" onchange="Joomla.orderTable()">
|
||||||
<option value=""><?php echo JText::_('JGLOBAL_SORT_BY');?></option>
|
<option value=""><?php echo Text::_('JGLOBAL_SORT_BY');?></option>
|
||||||
<?php echo JHtml::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
|
<?php echo Html::_('select.options', $this->getSortFields(), 'value', 'text', $this->listOrder);?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"> </div>
|
<div class="clearfix"> </div>
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,22 +17,24 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<img alt="<?php echo JText::_('COM_###COMPONENT###'); ?>" src="components/com_###component###/assets/images/vdm-component.###COMP_IMAGE_TYPE###">
|
<img alt="<?php echo Text::_('COM_###COMPONENT###'); ?>" src="components/com_###component###/assets/images/vdm-component.###COMP_IMAGE_TYPE###">
|
||||||
<ul class="list-striped">
|
<ul class="list-striped">
|
||||||
<li><b><?php echo JText::_('COM_###COMPONENT###_VERSION'); ?>:</b> <?php echo $this->manifest->version; ?> <span class="update-notice" id="component-update-notice"></span></li>
|
<li><b><?php echo Text::_('COM_###COMPONENT###_VERSION'); ?>:</b> <?php echo $this->manifest->version; ?> <span class="update-notice" id="component-update-notice"></span></li>
|
||||||
<li><b><?php echo JText::_('COM_###COMPONENT###_DATE'); ?>:</b> <?php echo $this->manifest->creationDate; ?></li>
|
<li><b><?php echo Text::_('COM_###COMPONENT###_DATE'); ?>:</b> <?php echo $this->manifest->creationDate; ?></li>
|
||||||
<li><b><?php echo JText::_('COM_###COMPONENT###_AUTHOR'); ?>:</b> <a href="mailto:<?php echo $this->manifest->authorEmail; ?>"><?php echo $this->manifest->author; ?></a></li>
|
<li><b><?php echo Text::_('COM_###COMPONENT###_AUTHOR'); ?>:</b> <a href="mailto:<?php echo $this->manifest->authorEmail; ?>"><?php echo $this->manifest->author; ?></a></li>
|
||||||
<li><b><?php echo JText::_('COM_###COMPONENT###_WEBSITE'); ?>:</b> <a href="<?php echo $this->manifest->authorUrl; ?>" target="_blank"><?php echo $this->manifest->authorUrl; ?></a></li>
|
<li><b><?php echo Text::_('COM_###COMPONENT###_WEBSITE'); ?>:</b> <a href="<?php echo $this->manifest->authorUrl; ?>" target="_blank"><?php echo $this->manifest->authorUrl; ?></a></li>
|
||||||
<li><b><?php echo JText::_('COM_###COMPONENT###_LICENSE'); ?>:</b> <?php echo $this->manifest->license; ?></li>
|
<li><b><?php echo Text::_('COM_###COMPONENT###_LICENSE'); ?>:</b> <?php echo $this->manifest->license; ?></li>
|
||||||
<li><b><?php echo $this->manifest->copyright; ?></b></li>
|
<li><b><?php echo $this->manifest->copyright; ?></b></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<?php if(###Component###Helper::checkArray($this->contributors)): ?>
|
<?php if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->contributors)): ?>
|
||||||
<?php if(count($this->contributors) > 1): ?>
|
<?php if(count($this->contributors) > 1): ?>
|
||||||
<h3><?php echo JText::_('COM_###COMPONENT###_CONTRIBUTORS'); ?></h3>
|
<h3><?php echo Text::_('COM_###COMPONENT###_CONTRIBUTORS'); ?></h3>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<h3><?php echo JText::_('COM_###COMPONENT###_CONTRIBUTOR'); ?></h3>
|
<h3><?php echo Text::_('COM_###COMPONENT###_CONTRIBUTOR'); ?></h3>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<ul class="list-striped">
|
<ul class="list-striped">
|
||||||
<?php foreach($this->contributors as $contributor): ?>
|
<?php foreach($this->contributors as $contributor): ?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
###ADMIN_VIEW_HEADER###
|
###ADMIN_VIEW_HEADER###
|
||||||
|
|
||||||
$componentParams = $this->params; // will be removed just use $this->params instead
|
$componentParams = $this->params; // will be removed just use $this->params instead
|
||||||
?>
|
?>
|
||||||
###EDITBODYFADEIN###
|
###EDITBODYFADEIN###
|
||||||
<form action="<?php echo JRoute::_('index.php?option=com_###component###&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
<form action="<?php echo Route::_('index.php?option=com_###component###&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||||
###EDITBODY###
|
###EDITBODY###
|
||||||
</form>
|
</form>
|
||||||
</div>###EDITBODYSCRIPT###
|
</div>###EDITBODYSCRIPT###
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
###SITE_ADMIN_VIEW_HEADER###
|
###SITE_ADMIN_VIEW_HEADER###
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="###component###-###view###">
|
<div class="###component###-###view###">
|
||||||
<?php echo $this->toolbar->render(); ?>
|
<?php echo $this->toolbar->render(); ?>
|
||||||
<form action="<?php echo JRoute::_('index.php?option=com_###component###&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
<form action="<?php echo Route::_('index.php?option=com_###component###&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
|
||||||
###EDITBODY###
|
###EDITBODY###
|
||||||
</form>
|
</form>
|
||||||
</div>###EDITBODYSCRIPT###
|
</div>###EDITBODYSCRIPT###
|
||||||
|
@ -29,24 +29,36 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
|
||||||
class ###component###HeaderCheck
|
class ###component###HeaderCheck
|
||||||
{
|
{
|
||||||
|
protected $document = null;
|
||||||
|
protected $app = null;
|
||||||
|
|
||||||
function js_loaded($script_name)
|
function js_loaded($script_name)
|
||||||
{
|
{
|
||||||
// UIkit check point
|
// UIkit check point
|
||||||
if (strpos($script_name,'uikit') !== false)
|
if (strpos($script_name,'uikit') !== false)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
if (!$this->app)
|
||||||
$getTemplateName = $app->getTemplate('template')->template;
|
{
|
||||||
|
$this->app = Factory::getApplication();
|
||||||
|
}
|
||||||
|
|
||||||
|
$getTemplateName = $this->app->getTemplate('template')->template;
|
||||||
if (strpos($getTemplateName,'yoo') !== false)
|
if (strpos($getTemplateName,'yoo') !== false)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$document = JFactory::getDocument();
|
if (!$this->document)
|
||||||
$head_data = $document->getHeadData();
|
{
|
||||||
|
$this->document = Factory::getDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
$head_data = $this->document->getHeadData();
|
||||||
foreach (array_keys($head_data['scripts']) as $script)
|
foreach (array_keys($head_data['scripts']) as $script)
|
||||||
{
|
{
|
||||||
if (stristr($script, $script_name))
|
if (stristr($script, $script_name))
|
||||||
@ -63,18 +75,24 @@ class ###component###HeaderCheck
|
|||||||
// UIkit check point
|
// UIkit check point
|
||||||
if (strpos($script_name,'uikit') !== false)
|
if (strpos($script_name,'uikit') !== false)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
if (!$this->app)
|
||||||
$getTemplateName = $app->getTemplate('template')->template;
|
{
|
||||||
|
$this->app = Factory::getApplication();
|
||||||
|
}
|
||||||
|
|
||||||
|
$getTemplateName = $this->app->getTemplate('template')->template;
|
||||||
if (strpos($getTemplateName,'yoo') !== false)
|
if (strpos($getTemplateName,'yoo') !== false)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$document = JFactory::getDocument();
|
if (!$this->document)
|
||||||
$head_data = $document->getHeadData();
|
{
|
||||||
|
$this->document = Factory::getDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
$head_data = $this->document->getHeadData();
|
||||||
foreach (array_keys($head_data['styleSheets']) as $script)
|
foreach (array_keys($head_data['styleSheets']) as $script)
|
||||||
{
|
{
|
||||||
if (stristr($script, $script_name))
|
if (stristr($script, $script_name))
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,24 +17,36 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
|
||||||
class ###component###HeaderCheck
|
class ###component###HeaderCheck
|
||||||
{
|
{
|
||||||
|
protected $document = null;
|
||||||
|
protected $app = null;
|
||||||
|
|
||||||
function js_loaded($script_name)
|
function js_loaded($script_name)
|
||||||
{
|
{
|
||||||
// UIkit check point
|
// UIkit check point
|
||||||
if (strpos($script_name,'uikit') !== false)
|
if (strpos($script_name,'uikit') !== false)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
if (!$this->app)
|
||||||
$getTemplateName = $app->getTemplate('template')->template;
|
{
|
||||||
|
$this->app = Factory::getApplication();
|
||||||
|
}
|
||||||
|
|
||||||
|
$getTemplateName = $this->app->getTemplate('template')->template;
|
||||||
if (strpos($getTemplateName,'yoo') !== false)
|
if (strpos($getTemplateName,'yoo') !== false)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$document = JFactory::getDocument();
|
if (!$this->document)
|
||||||
$head_data = $document->getHeadData();
|
{
|
||||||
|
$this->document = Factory::getDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
$head_data = $this->document->getHeadData();
|
||||||
foreach (array_keys($head_data['scripts']) as $script)
|
foreach (array_keys($head_data['scripts']) as $script)
|
||||||
{
|
{
|
||||||
if (stristr($script, $script_name))
|
if (stristr($script, $script_name))
|
||||||
@ -51,18 +63,24 @@ class ###component###HeaderCheck
|
|||||||
// UIkit check point
|
// UIkit check point
|
||||||
if (strpos($script_name,'uikit') !== false)
|
if (strpos($script_name,'uikit') !== false)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
if (!$this->app)
|
||||||
$getTemplateName = $app->getTemplate('template')->template;
|
{
|
||||||
|
$this->app = Factory::getApplication();
|
||||||
|
}
|
||||||
|
|
||||||
|
$getTemplateName = $this->app->getTemplate('template')->template;
|
||||||
if (strpos($getTemplateName,'yoo') !== false)
|
if (strpos($getTemplateName,'yoo') !== false)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$document = JFactory::getDocument();
|
if (!$this->document)
|
||||||
$head_data = $document->getHeadData();
|
{
|
||||||
|
$this->document = Factory::getDocument();
|
||||||
|
}
|
||||||
|
|
||||||
|
$head_data = $this->document->getHeadData();
|
||||||
foreach (array_keys($head_data['styleSheets']) as $script)
|
foreach (array_keys($head_data['styleSheets']) as $script)
|
||||||
{
|
{
|
||||||
if (stristr($script, $script_name))
|
if (stristr($script, $script_name))
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 65 KiB |
@ -46,7 +46,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
|||||||
###LAYOUTITEMS###
|
###LAYOUTITEMS###
|
||||||
);
|
);
|
||||||
|
|
||||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php if ($fields && count((array) $fields)) :?>
|
<?php if ($fields && count((array) $fields)) :?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
|||||||
###LAYOUTITEMS###
|
###LAYOUTITEMS###
|
||||||
);
|
);
|
||||||
|
|
||||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php if ($fields && count((array) $fields)) :?>
|
<?php if ($fields && count((array) $fields)) :?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
|||||||
###LAYOUTITEMS###
|
###LAYOUTITEMS###
|
||||||
);
|
);
|
||||||
|
|
||||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php if ($fields && count((array) $fields)) :?>
|
<?php if ($fields && count((array) $fields)) :?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,9 +17,13 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
|
||||||
// set the defaults
|
// set the defaults
|
||||||
$items = $displayData->###LAYOUTITEMS###;
|
$items = $displayData->###LAYOUTITEMS###;
|
||||||
$user = JFactory::getUser();
|
$user = Factory::getUser();
|
||||||
$id = $displayData->item->id;
|
$id = $displayData->item->id;
|
||||||
###LAYOUTITEMSHEADER###
|
###LAYOUTITEMSHEADER###
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
|
||||||
$form = $displayData->getForm();
|
$form = $displayData->getForm();
|
||||||
|
|
||||||
// JLayout for standard handling of metadata fields in the administrator content edit screens.
|
// JLayout for standard handling of metadata fields in the administrator content edit screens.
|
||||||
@ -25,7 +27,7 @@ $fieldSets = $form->getFieldsets('metadata');
|
|||||||
|
|
||||||
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
|
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
|
||||||
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
|
<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
|
||||||
<p class="alert alert-info"><?php echo $this->escape(JText::_($fieldSet->description)); ?></p>
|
<p class="alert alert-info"><?php echo $this->escape(Text::_($fieldSet->description)); ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
|||||||
###LAYOUTITEMS###
|
###LAYOUTITEMS###
|
||||||
);
|
);
|
||||||
|
|
||||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php if ($fields && count((array) $fields)) :?>
|
<?php if ($fields && count((array) $fields)) :?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
|||||||
###LAYOUTITEMS###
|
###LAYOUTITEMS###
|
||||||
);
|
);
|
||||||
|
|
||||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
$hiddenFields = $displayData->get('hidden_fields') ?: [];
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<?php if ($fields && count((array) $fields)) :?>
|
<?php if ($fields && count((array) $fields)) :?>
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,13 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
|
use Joomla\CMS\Language\Multilanguage;
|
||||||
|
use Joomla\CMS\Component\ComponentHelper;
|
||||||
|
use Joomla\CMS\Categories\CategoryNode;
|
||||||
|
use Joomla\CMS\Categories\Categories;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ###Component### Route Helper
|
* ###Component### Route Helper
|
||||||
**/
|
**/
|
||||||
@ -27,7 +34,7 @@ abstract class ###Component###HelperRoute
|
|||||||
/**
|
/**
|
||||||
* Get the URL route for ###component### category from a category ID and language
|
* Get the URL route for ###component### category from a category ID and language
|
||||||
*
|
*
|
||||||
* @param mixed $catid The id of the items's category either an integer id or a instance of JCategoryNode
|
* @param mixed $catid The id of the items's category either an integer id or a instance of CategoryNode
|
||||||
* @param mixed $language The id of the language being used.
|
* @param mixed $language The id of the language being used.
|
||||||
*
|
*
|
||||||
* @return string The link to the contact
|
* @return string The link to the contact
|
||||||
@ -36,20 +43,20 @@ abstract class ###Component###HelperRoute
|
|||||||
*/
|
*/
|
||||||
public static function getCategoryRoute_keep_for_later($catid, $language = 0)
|
public static function getCategoryRoute_keep_for_later($catid, $language = 0)
|
||||||
{
|
{
|
||||||
if ($catid instanceof JCategoryNode)
|
if ($catid instanceof CategoryNode)
|
||||||
{
|
{
|
||||||
$id = $catid->id;
|
$id = $catid->id;
|
||||||
$category = $catid;
|
$category = $catid;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new Exception('First parameter must be JCategoryNode');
|
throw new Exception('First parameter must be CategoryNode');
|
||||||
}
|
}
|
||||||
|
|
||||||
$views = array(###ROUTER_CATEGORY_VIEWS###);
|
$views = array(###ROUTER_CATEGORY_VIEWS###);
|
||||||
$view = $views[$category->extension];
|
$view = $views[$category->extension];
|
||||||
|
|
||||||
if ($id < 1 || !($category instanceof JCategoryNode))
|
if ($id < 1 || !($category instanceof CategoryNode))
|
||||||
{
|
{
|
||||||
$link = '';
|
$link = '';
|
||||||
}
|
}
|
||||||
@ -63,9 +70,9 @@ abstract class ###Component###HelperRoute
|
|||||||
'category' => array($id)
|
'category' => array($id)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($language && $language != "*" && JLanguageMultilang::isEnabled())
|
if ($language && $language != "*" && Multilanguage::isEnabled())
|
||||||
{
|
{
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
$query = $db->getQuery(true)
|
$query = $db->getQuery(true)
|
||||||
->select('a.sef AS sef')
|
->select('a.sef AS sef')
|
||||||
->select('a.lang_code AS lang_code')
|
->select('a.lang_code AS lang_code')
|
||||||
@ -112,16 +119,16 @@ abstract class ###Component###HelperRoute
|
|||||||
|
|
||||||
protected static function _findItem($needles = null,$type = null)
|
protected static function _findItem($needles = null,$type = null)
|
||||||
{
|
{
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$menus = $app->getMenu('site');
|
$menus = $app->getMenu('site');
|
||||||
$language = isset($needles['language']) ? $needles['language'] : '*';
|
$language = isset($needles['language']) ? $needles['language'] : '*';
|
||||||
|
|
||||||
// Prepare the reverse lookup array.
|
// Prepare the reverse lookup array.
|
||||||
if (!isset(self::$lookup[$language]))
|
if (!isset(self::$lookup[$language]))
|
||||||
{
|
{
|
||||||
self::$lookup[$language] = array();
|
self::$lookup[$language] = [];
|
||||||
|
|
||||||
$component = JComponentHelper::getComponent('com_###component###');
|
$component = ComponentHelper::getComponent('com_###component###');
|
||||||
|
|
||||||
$attributes = array('component_id');
|
$attributes = array('component_id');
|
||||||
$values = array($component->id);
|
$values = array($component->id);
|
||||||
@ -142,7 +149,7 @@ abstract class ###Component###HelperRoute
|
|||||||
|
|
||||||
if (!isset(self::$lookup[$language][$view]))
|
if (!isset(self::$lookup[$language][$view]))
|
||||||
{
|
{
|
||||||
self::$lookup[$language][$view] = array();
|
self::$lookup[$language][$view] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($item->query['id']))
|
if (isset($item->query['id']))
|
||||||
@ -171,7 +178,7 @@ abstract class ###Component###HelperRoute
|
|||||||
{
|
{
|
||||||
if (isset(self::$lookup[$language][$view]))
|
if (isset(self::$lookup[$language][$view]))
|
||||||
{
|
{
|
||||||
if (###Component###Helper::checkArray($ids))
|
if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($ids))
|
||||||
{
|
{
|
||||||
foreach ($ids as $id)
|
foreach ($ids as $id)
|
||||||
{
|
{
|
||||||
@ -192,7 +199,7 @@ abstract class ###Component###HelperRoute
|
|||||||
if ($type)
|
if ($type)
|
||||||
{
|
{
|
||||||
// Check if the global menu item has been set.
|
// Check if the global menu item has been set.
|
||||||
$params = JComponentHelper::getParams('com_###component###');
|
$params = ComponentHelper::getParams('com_###component###');
|
||||||
if ($item = $params->get($type.'_menu', 0))
|
if ($item = $params->get($type.'_menu', 0))
|
||||||
{
|
{
|
||||||
return $item;
|
return $item;
|
||||||
@ -204,7 +211,7 @@ abstract class ###Component###HelperRoute
|
|||||||
|
|
||||||
if ($active
|
if ($active
|
||||||
&& $active->component == 'com_###component###'
|
&& $active->component == 'com_###component###'
|
||||||
&& ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled()))
|
&& ($language == '*' || in_array($active->language, array('*', $language)) || !Multilanguage::isEnabled()))
|
||||||
{
|
{
|
||||||
return $active->id;
|
return $active->id;
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
@ -17,6 +17,9 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Component\ComponentHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routing class from com_###component###
|
* Routing class from com_###component###
|
||||||
*
|
*
|
||||||
@ -35,10 +38,10 @@ class ###Component###Router extends JComponentRouterBase
|
|||||||
*/
|
*/
|
||||||
public function build(&$query)
|
public function build(&$query)
|
||||||
{
|
{
|
||||||
$segments = array();
|
$segments = [];
|
||||||
|
|
||||||
// Get a menu item based on Itemid or currently active
|
// Get a menu item based on Itemid or currently active
|
||||||
$params = JComponentHelper::getParams('com_###component###');
|
$params = ComponentHelper::getParams('com_###component###');
|
||||||
|
|
||||||
if (empty($query['Itemid']))
|
if (empty($query['Itemid']))
|
||||||
{
|
{
|
||||||
@ -117,7 +120,7 @@ class ###Component###Router extends JComponentRouterBase
|
|||||||
public function parse(&$segments)
|
public function parse(&$segments)
|
||||||
{
|
{
|
||||||
$count = count($segments);
|
$count = count($segments);
|
||||||
$vars = array();
|
$vars = [];
|
||||||
|
|
||||||
// Handle View and Identifier
|
// Handle View and Identifier
|
||||||
switch($segments[0])
|
switch($segments[0])
|
||||||
@ -134,7 +137,7 @@ class ###Component###Router extends JComponentRouterBase
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Get a db connection.
|
// Get a db connection.
|
||||||
$db = JFactory::getDbo();
|
$db = Factory::getDbo();
|
||||||
// Create a new query object.
|
// Create a new query object.
|
||||||
$query = $db->getQuery(true);
|
$query = $db->getQuery(true);
|
||||||
|
|
||||||
@ -150,7 +153,7 @@ class ###Component###Router extends JComponentRouterBase
|
|||||||
{
|
{
|
||||||
// we must check if the table exist (TODO not ideal)
|
// we must check if the table exist (TODO not ideal)
|
||||||
$tables = $db->getTableList();
|
$tables = $db->getTableList();
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
$prefix = $app->get('dbprefix');
|
$prefix = $app->get('dbprefix');
|
||||||
$check = $prefix.$main.'_'.$table;
|
$check = $prefix.$main.'_'.$table;
|
||||||
if (in_array($check, $tables))
|
if (in_array($check, $tables))
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
* @package Joomla.Component.Builder
|
* @package Joomla.Component.Builder
|
||||||
*
|
*
|
||||||
* @created 30th April, 2015
|
* @created 30th April, 2015
|
||||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||||
*/
|
*/
|
||||||
|
@ -17,20 +17,24 @@ defined('_JEXEC') or die('Restricted access');
|
|||||||
// No direct access to this file
|
// No direct access to this file
|
||||||
defined('_JEXEC') or die('Restricted access');
|
defined('_JEXEC') or die('Restricted access');
|
||||||
|
|
||||||
|
use Joomla\CMS\Factory;
|
||||||
|
use Joomla\CMS\Language\Text;
|
||||||
use Joomla\CMS\Filesystem\File;
|
use Joomla\CMS\Filesystem\File;
|
||||||
use Joomla\CMS\Filesystem\Folder;
|
use Joomla\CMS\Filesystem\Folder;
|
||||||
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
|
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
|
||||||
JHTML::_('bootstrap.renderModal');
|
use Joomla\CMS\Version;
|
||||||
|
use Joomla\CMS\HTML\HTMLHelper as Html;
|
||||||
|
HTML::_('bootstrap.renderModal');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Script File of ###Component### Component
|
* Script File of ###Component### Component
|
||||||
*/
|
*/
|
||||||
class com_###component###InstallerScript
|
class Com_###Component###InstallerScript
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param JAdapterInstance $parent The object responsible for running this script
|
* @param ComponentAdapter $parent The object responsible for running this script
|
||||||
*/
|
*/
|
||||||
public function __construct(ComponentAdapter $parent) {}
|
public function __construct(ComponentAdapter $parent) {}
|
||||||
|
|
||||||
@ -78,14 +82,14 @@ class com_###component###InstallerScript
|
|||||||
public function preflight($type, ComponentAdapter $parent)
|
public function preflight($type, ComponentAdapter $parent)
|
||||||
{
|
{
|
||||||
// get application
|
// get application
|
||||||
$app = JFactory::getApplication();
|
$app = Factory::getApplication();
|
||||||
// is redundant or so it seems ...hmmm let me know if it works again
|
// is redundant or so it seems ...hmmm let me know if it works again
|
||||||
if ($type === 'uninstall')
|
if ($type === 'uninstall')
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// the default for both install and update
|
// the default for both install and update
|
||||||
$jversion = new JVersion();
|
$jversion = new Version();
|
||||||
if (!$jversion->isCompatible('3.8.0'))
|
if (!$jversion->isCompatible('3.8.0'))
|
||||||
{
|
{
|
||||||
$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');
|
$app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error');
|
||||||
@ -121,7 +125,7 @@ class com_###component###InstallerScript
|
|||||||
public function postflight($type, ComponentAdapter $parent)
|
public function postflight($type, ComponentAdapter $parent)
|
||||||
{
|
{
|
||||||
// get application
|
// get application
|
||||||
$app = JFactory::getApplication();###MOVEFOLDERSSCRIPT###
|
$app = Factory::getApplication();###MOVEFOLDERSSCRIPT###
|
||||||
// set the default component settings
|
// set the default component settings
|
||||||
if ($type === 'install')
|
if ($type === 'install')
|
||||||
{###POSTINSTALLSCRIPT###
|
{###POSTINSTALLSCRIPT###
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user