Compare commits
24 Commits
Author | SHA1 | Date | |
---|---|---|---|
9f6e0c49da | |||
b9729c49af | |||
8c284aaed4 | |||
6c2ca03ebc | |||
e4d1917c19 | |||
ffbb733576 | |||
850ee4b7e9 | |||
1a18f5a386 | |||
04c080d460 | |||
693f51aff3 | |||
6539862534 | |||
010a134e1a | |||
d78e3bb215 | |||
548af56265 | |||
39b276ac4b | |||
4fb4069d64 | |||
b8d8b8e813 | |||
dd457ee571 | |||
66c4a87cfc | |||
773a753323 | |||
bb798abe8c | |||
2b1e0a65fa | |||
e3f22d631c | |||
3cbe21f57d |
20
README.md
20
README.md
@ -1,8 +1,8 @@
|
||||
|
||||
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/releases)
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/releases)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](#sponsors)
|
||||
|
||||
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||
|
||||
@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
||||
|
||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
|
||||
|
||||
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.1) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.9) 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)
|
||||
|
||||
@ -110,8 +110,6 @@ Where can you get support and help?
|
||||
+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues)
|
||||
+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint)
|
||||
+ [Open Issue On Github](https://github.com/vdm-io/Joomla-Component-Builder/issues) ^^
|
||||
+ [Telegram Group](https://t.me/jcb_group)
|
||||
+ [JCB IRC Channel](https://vdm.bz/jcb-irc)
|
||||
|
||||
Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
|
||||
|
||||
@ -146,14 +144,14 @@ TODO
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 2nd September, 2019
|
||||
+ *Version*: 2.10.1
|
||||
+ *Last Build*: 13th December, 2019
|
||||
+ *Version*: 2.10.9
|
||||
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **250924**
|
||||
+ *Field count*: **1343**
|
||||
+ *File count*: **1608**
|
||||
+ *Folder count*: **253**
|
||||
+ *Line count*: **277353**
|
||||
+ *Field count*: **1490**
|
||||
+ *File count*: **1752**
|
||||
+ *Folder count*: **278**
|
||||
|
||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/releases)
|
||||
[](https://github.com/vdm-io/Joomla-Component-Builder/releases)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](#sponsors)
|
||||
|
||||
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
|
||||
|
||||
@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
|
||||
|
||||
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have!
|
||||
|
||||
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.1) with **ALL** its features and **ALL** concepts totally open-source and free!
|
||||
You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.9) 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)
|
||||
|
||||
@ -110,8 +110,6 @@ Where can you get support and help?
|
||||
+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues)
|
||||
+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint)
|
||||
+ [Open Issue On Github](https://github.com/vdm-io/Joomla-Component-Builder/issues) ^^
|
||||
+ [Telegram Group](https://t.me/jcb_group)
|
||||
+ [JCB IRC Channel](https://vdm.bz/jcb-irc)
|
||||
|
||||
Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://github.com/vdm-io/Joomla-Component-Builder/blob/staging/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
|
||||
|
||||
@ -146,14 +144,14 @@ TODO
|
||||
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 2nd September, 2019
|
||||
+ *Version*: 2.10.1
|
||||
+ *Last Build*: 13th December, 2019
|
||||
+ *Version*: 2.10.9
|
||||
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **250924**
|
||||
+ *Field count*: **1343**
|
||||
+ *File count*: **1608**
|
||||
+ *Folder count*: **253**
|
||||
+ *Line count*: **277353**
|
||||
+ *Field count*: **1490**
|
||||
+ *File count*: **1752**
|
||||
+ *Folder count*: **278**
|
||||
|
||||
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
|
||||
> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
|
||||
|
@ -171,6 +171,16 @@
|
||||
<action name="component_files_folders.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_OWN_DESC" />
|
||||
<action name="component_files_folders.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_STATE_DESC" />
|
||||
<action name="component_files_folders.version" title="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION_DESC" />
|
||||
<action name="component_modules.access" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_ACCESS_DESC" />
|
||||
<action name="component_modules.batch" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_BATCH_USE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_BATCH_USE_DESC" />
|
||||
<action name="component_modules.create" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_CREATE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_CREATE_DESC" />
|
||||
<action name="component_modules.delete" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_DELETE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_DELETE_DESC" />
|
||||
<action name="component_modules.edit" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_DESC" />
|
||||
<action name="component_modules.edit.created_by" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="component_modules.edit.created" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="component_modules.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_OWN_DESC" />
|
||||
<action name="component_modules.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_STATE_DESC" />
|
||||
<action name="component_modules.version" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_VERSION_DESC" />
|
||||
<action name="component_mysql_tweaks.access" title="COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_ACCESS_DESC" />
|
||||
<action name="component_mysql_tweaks.batch" title="COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_BATCH_USE" description="COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_BATCH_USE_DESC" />
|
||||
<action name="component_mysql_tweaks.create" title="COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_CREATE" description="COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_CREATE_DESC" />
|
||||
@ -324,6 +334,40 @@
|
||||
<action name="joomla_component.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_STATE_DESC" />
|
||||
<action name="joomla_component.version" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION_DESC" />
|
||||
<action name="joomla_component.submenu" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_SUBMENU_DESC" />
|
||||
<action name="joomla_module.get_snippets" title="COM_COMPONENTBUILDER_JOOMLA_MODULE_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULE_GET_SNIPPETS_BUTTON_ACCESS_DESC" />
|
||||
<action name="joomla_module.run_expansion" title="COM_COMPONENTBUILDER_JOOMLA_MODULE_RUN_EXPANSION_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULE_RUN_EXPANSION_BUTTON_ACCESS_DESC" />
|
||||
<action name="joomla_module.access" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS_DESC" />
|
||||
<action name="joomla_module.batch" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_BATCH_USE_DESC" />
|
||||
<action name="joomla_module.create" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_CREATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_CREATE_DESC" />
|
||||
<action name="joomla_module.dashboard_list" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_DASHBOARD_LIST_DESC" />
|
||||
<action name="joomla_module.delete" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_DELETE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_DELETE_DESC" />
|
||||
<action name="joomla_module.edit" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_DESC" />
|
||||
<action name="joomla_module.edit.created_by" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="joomla_module.edit.created" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="joomla_module.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_OWN_DESC" />
|
||||
<action name="joomla_module.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_STATE_DESC" />
|
||||
<action name="joomla_module.version" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_VERSION_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.access" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_ACCESS_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.batch" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_BATCH_USE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.create" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_CREATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_CREATE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.delete" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_DELETE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_DELETE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.created_by" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_BY_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.created" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_OWN_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_STATE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.version" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_VERSION_DESC" />
|
||||
<action name="joomla_module.submenu" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_SUBMENU" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_SUBMENU_DESC" />
|
||||
<action name="joomla_module_updates.access" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_ACCESS_DESC" />
|
||||
<action name="joomla_module_updates.batch" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_BATCH_USE_DESC" />
|
||||
<action name="joomla_module_updates.create" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_CREATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_CREATE_DESC" />
|
||||
<action name="joomla_module_updates.delete" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_DELETE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_DELETE_DESC" />
|
||||
<action name="joomla_module_updates.edit" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_DESC" />
|
||||
<action name="joomla_module_updates.edit.created_by" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="joomla_module_updates.edit.created" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="joomla_module_updates.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_OWN_DESC" />
|
||||
<action name="joomla_module_updates.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_STATE_DESC" />
|
||||
<action name="joomla_module_updates.version" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_VERSION_DESC" />
|
||||
<action name="joomla_plugin.get_boilerplate" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GET_BOILERPLATE_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GET_BOILERPLATE_BUTTON_ACCESS_DESC" />
|
||||
<action name="joomla_plugin_group.access" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_ACCESS_DESC" />
|
||||
<action name="joomla_plugin_group.batch" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_BATCH_USE_DESC" />
|
||||
@ -390,7 +434,6 @@
|
||||
<action name="layout.get_snippets" title="COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS" description="COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS_DESC" />
|
||||
<action name="layout.access" title="COM_COMPONENTBUILDER_LAYOUTS_ACCESS" description="COM_COMPONENTBUILDER_LAYOUTS_ACCESS_DESC" />
|
||||
<action name="layout.batch" title="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE" description="COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE_DESC" />
|
||||
<action name="layout.dashboard_add" title="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD" description="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC" />
|
||||
<action name="layout.dashboard_list" title="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_LIST" description="COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_LIST_DESC" />
|
||||
<action name="layout.version" title="COM_COMPONENTBUILDER_LAYOUTS_EDIT_VERSION" description="COM_COMPONENTBUILDER_LAYOUTS_EDIT_VERSION_DESC" />
|
||||
<action name="layout.export" title="COM_COMPONENTBUILDER_LAYOUTS_EXPORT" description="COM_COMPONENTBUILDER_LAYOUTS_EXPORT_DESC" />
|
||||
@ -513,6 +556,17 @@
|
||||
<action name="joomla_component.access" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_ACCESS_DESC" />
|
||||
<action name="joomla_component.version" title="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="joomla_module">
|
||||
<action name="joomla_module.edit" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_DESC" />
|
||||
<action name="joomla_module.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_OWN_DESC" />
|
||||
<action name="joomla_module.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_STATE_DESC" />
|
||||
<action name="joomla_module.edit.created_by" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="joomla_module.edit.created" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="joomla_module.create" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_CREATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_CREATE_DESC" />
|
||||
<action name="joomla_module.delete" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_DELETE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_DELETE_DESC" />
|
||||
<action name="joomla_module.access" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS_DESC" />
|
||||
<action name="joomla_module.version" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="joomla_plugin">
|
||||
<action name="joomla_plugin.edit" title="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT" description="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_DESC" />
|
||||
<action name="joomla_plugin.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_PLUGINS_EDIT_OWN_DESC" />
|
||||
@ -870,6 +924,17 @@
|
||||
<action name="component_plugins.access" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_ACCESS_DESC" />
|
||||
<action name="component_plugins.version" title="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="component_modules">
|
||||
<action name="component_modules.edit" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_DESC" />
|
||||
<action name="component_modules.edit.own" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_OWN" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_OWN_DESC" />
|
||||
<action name="component_modules.edit.state" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_STATE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_STATE_DESC" />
|
||||
<action name="component_modules.edit.created_by" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="component_modules.edit.created" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="component_modules.create" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_CREATE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_CREATE_DESC" />
|
||||
<action name="component_modules.delete" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_DELETE" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_DELETE_DESC" />
|
||||
<action name="component_modules.access" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_ACCESS" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_ACCESS_DESC" />
|
||||
<action name="component_modules.version" title="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_VERSION" description="COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="snippet_type">
|
||||
<action name="snippet_type.edit" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_DESC" />
|
||||
<action name="snippet_type.edit.own" title="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_OWN" description="COM_COMPONENTBUILDER_SNIPPET_TYPES_EDIT_OWN_DESC" />
|
||||
@ -912,6 +977,28 @@
|
||||
<action name="class_extends.access" title="COM_COMPONENTBUILDER_CLASS_EXTENDINGS_ACCESS" description="COM_COMPONENTBUILDER_CLASS_EXTENDINGS_ACCESS_DESC" />
|
||||
<action name="class_extends.version" title="COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_VERSION" description="COM_COMPONENTBUILDER_CLASS_EXTENDINGS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="joomla_module_updates">
|
||||
<action name="joomla_module_updates.edit" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_DESC" />
|
||||
<action name="joomla_module_updates.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_OWN_DESC" />
|
||||
<action name="joomla_module_updates.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_STATE_DESC" />
|
||||
<action name="joomla_module_updates.edit.created_by" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_BY_DESC" />
|
||||
<action name="joomla_module_updates.edit.created" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="joomla_module_updates.create" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_CREATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_CREATE_DESC" />
|
||||
<action name="joomla_module_updates.delete" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_DELETE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_DELETE_DESC" />
|
||||
<action name="joomla_module_updates.access" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_ACCESS_DESC" />
|
||||
<action name="joomla_module_updates.version" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="joomla_module_files_folders_urls">
|
||||
<action name="joomla_module_files_folders_urls.edit" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.own" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_OWN" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_OWN_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.state" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_STATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_STATE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.created_by" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_BY" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_BY_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.edit.created" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.create" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_CREATE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_CREATE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.delete" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_DELETE" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_DELETE_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.access" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_ACCESS" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_ACCESS_DESC" />
|
||||
<action name="joomla_module_files_folders_urls.version" title="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
<section name="joomla_plugin_group">
|
||||
<action name="joomla_plugin_group.version" title="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION" description="COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUPS_EDIT_VERSION_DESC" />
|
||||
</section>
|
||||
|
13
admin/assets/css/component_modules.css
Normal file
13
admin/assets/css/component_modules.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 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_modules.css
Normal file
13
admin/assets/css/components_modules.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
19
admin/assets/css/joomla_module.css
Normal file
19
admin/assets/css/joomla_module.css
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
#jform_snippet_chzn {
|
||||
width: 100% !important;
|
||||
}
|
||||
.jform_snippet_input_width {
|
||||
width: 90% !important;
|
||||
}
|
16
admin/assets/css/joomla_module_files_folders_urls.css
Normal file
16
admin/assets/css/joomla_module_files_folders_urls.css
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
.control-group, .controls, .controls input[type="url"], .controls input[type="text"], .controls input[type="number"], .controls input[type="email"], .controls select, .controls textarea {
|
||||
max-width: 100%;
|
||||
}
|
15
admin/assets/css/joomla_module_updates.css
Normal file
15
admin/assets/css/joomla_module_updates.css
Normal file
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
||||
.mysql_update { width: 100%; height: 392px; }
|
||||
.version_url { min-width: 100%; }
|
13
admin/assets/css/joomla_modules.css
Normal file
13
admin/assets/css/joomla_modules.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
13
admin/assets/css/joomla_modules_files_folders_urls.css
Normal file
13
admin/assets/css/joomla_modules_files_folders_urls.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
13
admin/assets/css/joomla_modules_updates.css
Normal file
13
admin/assets/css/joomla_modules_updates.css
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
/* CSS Document */
|
||||
|
||||
|
BIN
admin/assets/images/icons/joomla_modules.png
Normal file
BIN
admin/assets/images/icons/joomla_modules.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
Before Width: | Height: | Size: 26 KiB |
@ -17,11 +17,22 @@ defined('_JEXEC') or die('Restricted access');
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Language\Language;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* ###Component### component helper.
|
||||
*/
|
||||
abstract class ###Component###Helper
|
||||
{###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
||||
{
|
||||
/**
|
||||
* The Main Active Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
||||
|
||||
/**
|
||||
* Load the Component xml manifest.
|
||||
**/
|
||||
@ -198,7 +209,15 @@ abstract class ###Component###Helper
|
||||
{
|
||||
$query->from($db->quoteName('#_'.$main.'_'.$table));
|
||||
}
|
||||
$query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')');
|
||||
// add strings to array search
|
||||
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
|
||||
{
|
||||
$query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
|
||||
}
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
@ -654,7 +673,7 @@ abstract class ###Component###Helper
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count($_result))
|
||||
if (count((array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
@ -1063,6 +1082,8 @@ abstract class ###Component###Helper
|
||||
$string = trim($string);
|
||||
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
|
||||
$string = preg_replace('/\s+/', ' ', $string);
|
||||
// Transliterate string
|
||||
$string = self::transliterate($string);
|
||||
// remove all and keep only characters
|
||||
if ($keepOnlyCharacters)
|
||||
{
|
||||
@ -1131,6 +1152,19 @@ abstract class ###Component###Helper
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function transliterate($string)
|
||||
{
|
||||
// set tag only once
|
||||
if (!self::checkString(self::$langTag))
|
||||
{
|
||||
// get global value
|
||||
self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
|
||||
}
|
||||
// Transliterate on the language requested
|
||||
$lang = Language::getInstance(self::$langTag);
|
||||
return $lang->transliterate($string);
|
||||
}
|
||||
|
||||
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
||||
{
|
||||
if (self::checkString($var))
|
||||
|
@ -17,11 +17,21 @@ defined('_JEXEC') or die('Restricted access');
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\Language\Language;
|
||||
use Joomla\String\StringHelper;
|
||||
use Joomla\Utilities\ArrayHelper;
|
||||
|
||||
/**
|
||||
* ###Component### component helper
|
||||
*/
|
||||
abstract class ###Component###Helper
|
||||
{###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
||||
{
|
||||
/**
|
||||
* The Main Active Language
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
|
||||
|
||||
public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name')
|
||||
{
|
||||
@ -292,7 +302,7 @@ abstract class ###Component###Helper
|
||||
}
|
||||
}
|
||||
// check if there are any view values remaining
|
||||
if (count($_result))
|
||||
if (count((array) $_result))
|
||||
{
|
||||
$_result = json_encode($_result);
|
||||
$_result = array($_result);
|
||||
@ -592,7 +602,15 @@ abstract class ###Component###Helper
|
||||
{
|
||||
$query->from($db->quoteName('#_'.$main.'_'.$table));
|
||||
}
|
||||
$query->where($db->quoteName($whereString) . ' '.$operator.' (' . implode(',',$where) . ')');
|
||||
// add strings to array search
|
||||
if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
|
||||
{
|
||||
$query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
|
||||
}
|
||||
else
|
||||
{
|
||||
$query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
|
||||
}
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
if ($db->getNumRows())
|
||||
@ -1053,6 +1071,8 @@ abstract class ###Component###Helper
|
||||
$string = trim($string);
|
||||
$string = preg_replace('/'.$spacer.'+/', ' ', $string);
|
||||
$string = preg_replace('/\s+/', ' ', $string);
|
||||
// Transliterate string
|
||||
$string = self::transliterate($string);
|
||||
// remove all and keep only characters
|
||||
if ($keepOnlyCharacters)
|
||||
{
|
||||
@ -1121,6 +1141,19 @@ abstract class ###Component###Helper
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function transliterate($string)
|
||||
{
|
||||
// set tag only once
|
||||
if (!self::checkString(self::$langTag))
|
||||
{
|
||||
// get global value
|
||||
self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
|
||||
}
|
||||
// Transliterate on the language requested
|
||||
$lang = Language::getInstance(self::$langTag);
|
||||
return $lang->transliterate($string);
|
||||
}
|
||||
|
||||
public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40)
|
||||
{
|
||||
if (self::checkString($var))
|
||||
|
@ -212,6 +212,12 @@
|
||||
"path": "c0mp0n3nt/site/helpers",
|
||||
"rename": false,
|
||||
"type": "file"
|
||||
},
|
||||
"import.gif": {
|
||||
"naam": "import.gif",
|
||||
"path": "c0mp0n3nt/admin/assets/images",
|
||||
"rename": false,
|
||||
"type": "file"
|
||||
}
|
||||
},
|
||||
"dynamic": {
|
||||
@ -461,11 +467,6 @@
|
||||
"newName": "default.php",
|
||||
"type": "import"
|
||||
},
|
||||
"import.gif": {
|
||||
"path": "c0mp0n3nt/admin/assets/images",
|
||||
"rename": false,
|
||||
"type": "import"
|
||||
},
|
||||
"JControllerLegacy_import_custom.php": {
|
||||
"path": "c0mp0n3nt/admin/controllers",
|
||||
"rename": "JControllerLegacy_import_custom",
|
||||
|
@ -67,6 +67,21 @@
|
||||
folder="extension"
|
||||
filter="cmd"
|
||||
/>
|
||||
<!-- Github_access_token Field. Type: Text. (joomla) -->
|
||||
<field
|
||||
type="text"
|
||||
name="github_access_token"
|
||||
label="COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_LABEL"
|
||||
size="128"
|
||||
maxlength="128"
|
||||
description="COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_DESCRIPTION"
|
||||
class="text_area full-width"
|
||||
required="false"
|
||||
filter="STRING"
|
||||
message="COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_MESSAGE"
|
||||
hint="COM_COMPONENTBUILDER_CONFIG_GITHUB_ACCESS_TOKEN_HINT"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<!-- Spacer_hr_one Field. Type: Spacer. A None Database Field. (joomla) -->
|
||||
<field type="spacer" name="spacer_hr_one" hr="true" class="spacer_hr_one" />
|
||||
<!-- Manage_jcb_package_directories Field. Type: Radio. (joomla) -->
|
||||
|
@ -91,6 +91,7 @@ class ComponentbuilderController extends JControllerLegacy
|
||||
// the view relationships
|
||||
$views = array(
|
||||
'joomla_component' => 'joomla_components',
|
||||
'joomla_module' => 'joomla_modules',
|
||||
'joomla_plugin' => 'joomla_plugins',
|
||||
'admin_view' => 'admin_views',
|
||||
'custom_admin_view' => 'custom_admin_views',
|
||||
@ -126,10 +127,13 @@ class ComponentbuilderController extends JControllerLegacy
|
||||
'component_files_folders' => 'components_files_folders',
|
||||
'component_placeholders' => 'components_placeholders',
|
||||
'component_plugins' => 'components_plugins',
|
||||
'component_modules' => 'components_modules',
|
||||
'snippet_type' => 'snippet_types',
|
||||
'library_config' => 'libraries_config',
|
||||
'library_files_folders_urls' => 'libraries_files_folders_urls',
|
||||
'class_extends' => 'class_extendings',
|
||||
'joomla_module_updates' => 'joomla_modules_updates',
|
||||
'joomla_module_files_folders_urls' => 'joomla_modules_files_folders_urls',
|
||||
'joomla_plugin_group' => 'joomla_plugin_groups',
|
||||
'joomla_plugin_updates' => 'joomla_plugins_updates',
|
||||
'joomla_plugin_files_folders_urls' => 'joomla_plugins_files_folders_urls'
|
||||
|
@ -31,6 +31,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
$this->registerTask('getCronPath', 'ajax');
|
||||
$this->registerTask('getJCBpackageInfo', 'ajax');
|
||||
$this->registerTask('getCrowdinDetails', 'ajax');
|
||||
$this->registerTask('getModuleCode', 'ajax');
|
||||
$this->registerTask('getClassCode', 'ajax');
|
||||
$this->registerTask('getClassCodeIds', 'ajax');
|
||||
$this->registerTask('getClassHeaderCode', 'ajax');
|
||||
@ -304,6 +305,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'getModuleCode':
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$dataValue = $jinput->get('data', NULL, 'STRING');
|
||||
if($dataValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getModuleCode($dataValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
{
|
||||
echo $callback . "(".json_encode($result).");";
|
||||
}
|
||||
elseif($returnRaw)
|
||||
{
|
||||
echo json_encode($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($result).");";
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
if($callback = $jinput->get('callback', null, 'CMD'))
|
||||
{
|
||||
echo $callback."(".json_encode($e).");";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "(".json_encode($e).");";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'getClassCode':
|
||||
try
|
||||
{
|
||||
@ -655,7 +694,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$typeValue = $jinput->get('type', NULL, 'INT');
|
||||
$typeValue = $jinput->get('type', NULL, 'ALNUM');
|
||||
if($typeValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->getLinked($typeValue);
|
||||
@ -693,7 +732,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
|
||||
try
|
||||
{
|
||||
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
|
||||
$typeValue = $jinput->get('type', NULL, 'INT');
|
||||
$typeValue = $jinput->get('type', NULL, 'ALNUM');
|
||||
if($typeValue && $user->id != 0)
|
||||
{
|
||||
$result = $this->getModel('ajax')->checkAliasField($typeValue);
|
||||
|
@ -95,14 +95,30 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
}
|
||||
$message .= '<p><button class="btn btn-small btn-success" onclick="Joomla.submitbutton(\'compiler.installCompiledComponent\')">';
|
||||
$message .= 'Install ' . $model->compiler->filepath['component-folder'] . ' on this <span class="icon-joomla icon-white"></span>Joomla website. (component)</button></p>';
|
||||
// switch to set multi install button
|
||||
$add_multi_install = true;
|
||||
// check if we have modules
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['modules']))
|
||||
{
|
||||
foreach ($model->compiler->filepath['modules-folder'] as $module_id => $module_folder)
|
||||
{
|
||||
$message .= '<p><button class="btn btn-small btn-success" onclick="Joomla.submitbutton(\'compiler.installCompiledModule\', ' . (int) $module_id . ')">';
|
||||
$message .= 'Install ' . $module_folder . ' on this <span class="icon-joomla icon-white"></span>Joomla website. (module)</button></p>';
|
||||
}
|
||||
}
|
||||
// check if we have plugins
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins']))
|
||||
{
|
||||
$add_multi_install = true;
|
||||
foreach ($model->compiler->filepath['plugins-folder'] as $plugin_id => $plugin_folder)
|
||||
{
|
||||
$message .= '<p><button class="btn btn-small btn-success" onclick="Joomla.submitbutton(\'compiler.installCompiledPlugin\', ' . (int) $plugin_id . ')">';
|
||||
$message .= 'Install ' . $plugin_folder . ' on this <span class="icon-joomla icon-white"></span>Joomla website. (plugin)</button></p>';
|
||||
}
|
||||
}
|
||||
// set multi install button
|
||||
if ($add_multi_install)
|
||||
{
|
||||
$message .= '<h4>You can install all compiled extensions!</h4>';
|
||||
$message .= '<p><button class="btn btn-small btn-success" onclick="Joomla.submitbutton(\'compiler.installCompiledExtensions\')">';
|
||||
$message .= 'Install all above extensions on this <span class="icon-joomla icon-white"></span>Joomla website.</button></p>';
|
||||
@ -122,13 +138,16 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
$message .= '<p><b>'.$model->compiler->actualTotalHours.' Hours</b> or <b>'.$model->compiler->actualTotalDays.' Eight Hour Days</b> <em>(a total of the realistic time frame for this project)</em><br />';
|
||||
$message .= '<small>(if creating a folder and file took <b>5 seconds</b> and writing one line of code took <b>10 seconds</b>, with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)</small></p>';
|
||||
$message .= '<p>Project duration: <b>'.$model->compiler->projectWeekTime. ' weeks</b> or <b>'.$model->compiler->projectMonthTime.' months</b></p>';
|
||||
// check if we have plugins
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins']))
|
||||
// check if we have modules or plugins
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins']) || ComponentbuilderHelper::checkArray($model->compiler->filepath['modules']))
|
||||
{
|
||||
$plugin_url = array();
|
||||
$message .= '<h2>Path to Zip Files</h2>';
|
||||
$message .= '<p><b>Component Path:</b> <code>' . $model->compiler->filepath['component'] . '</code><br />';
|
||||
$message .= '<b>Component URL:</b> <code>' . $url . '</code><br /><br />';
|
||||
// load plugins if found
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins']))
|
||||
{
|
||||
$plugin_urls = array();
|
||||
// load the plugins path/url
|
||||
foreach ($model->compiler->filepath['plugins'] as $plugin_id => $plugin_path)
|
||||
{
|
||||
@ -140,14 +159,43 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
$message .= '<b>Plugin URL:</b> <code>' . $plugin_urls[$plugin_id] . '</code><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
// load modules if found
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['modules']))
|
||||
{
|
||||
$module_urls = array();
|
||||
// load the modules path/url
|
||||
foreach ($model->compiler->filepath['modules'] as $module_id => $module_path)
|
||||
{
|
||||
// set module path
|
||||
$message .= '<b>Module Path:</b> <code>' . $module_path . '</code><br />';
|
||||
if (($pos = strpos($module_path, "/tmp/")) !== FALSE)
|
||||
{
|
||||
$module_urls[$module_id] = JURI::root() . substr($module_path, $pos + 1);
|
||||
$message .= '<b>Module URL:</b> <code>' . $module_urls[$module_id] . '</code><br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
$message .= '<br /><small>Hey! you can also download these zip files right now!</small><br />';
|
||||
$message .= '<a class="btn btn-success" href="' . $url . '" ><span class="icon-download icon-white"></span>Download Component</a> ';
|
||||
// load the module download URL's
|
||||
if (isset($module_urls) && ComponentbuilderHelper::checkArray($module_urls))
|
||||
{
|
||||
foreach ($module_urls as $module_id => $module_url)
|
||||
{
|
||||
$message .= ' <a class="btn btn-success" href="' . $module_url . '" >';
|
||||
$message .= '<span class="icon-download icon-white"></span>Download ' . $model->compiler->filepath['modules-folder'][$module_id] . '</a> ';
|
||||
}
|
||||
}
|
||||
// load the plugin download URL's
|
||||
if (isset($plugin_urls) && ComponentbuilderHelper::checkArray($plugin_urls))
|
||||
{
|
||||
foreach ($plugin_urls as $plugin_id => $plugin_url)
|
||||
{
|
||||
$message .= ' <a class="btn btn-success" href="' . $plugin_url . '" >';
|
||||
$message .= '<span class="icon-download icon-white"></span>Download ' . $model->compiler->filepath['plugins-folder'][$plugin_id] . '</a> ';
|
||||
}
|
||||
}
|
||||
$message .= '</p>';
|
||||
$message .= '<p><small><b>Remember!</b> These zip files are in your tmp folder and therefore publicly accessible until you click [Clear tmp]!</small></p>';
|
||||
}
|
||||
@ -164,6 +212,11 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
// set redirect
|
||||
$this->setRedirect($redirect_url, $message, 'message');
|
||||
$app->setUserState('com_componentbuilder.component_folder_name', $model->compiler->filepath['component-folder']);
|
||||
// check if we have modules
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['modules']))
|
||||
{
|
||||
$app->setUserState('com_componentbuilder.modules_folder_name', $model->compiler->filepath['modules-folder']);
|
||||
}
|
||||
// check if we have plugins
|
||||
if (ComponentbuilderHelper::checkArray($model->compiler->filepath['plugins']))
|
||||
{
|
||||
@ -177,6 +230,7 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
$app->setUserState('com_componentbuilder.message', '');
|
||||
$app->setUserState('com_componentbuilder.extension_message', '');
|
||||
$app->setUserState('com_componentbuilder.component_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.modules_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.plugins_folder_name', '');
|
||||
// set redirect
|
||||
$this->setRedirect($redirect_url, $message);
|
||||
@ -205,8 +259,20 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_EXTENTIONS');
|
||||
$_message = array('success' => array(), 'error' => array());
|
||||
$app = JFactory::getApplication();
|
||||
$fileNames = $app->getUserState('com_componentbuilder.plugins_folder_name', array());
|
||||
// start file name array
|
||||
$fileNames = array();
|
||||
$fileNames[] = $app->getUserState('com_componentbuilder.component_folder_name', null);
|
||||
// check if we have modules
|
||||
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.modules_folder_name', array()) ));
|
||||
// check if we have plugins
|
||||
$fileNames = ComponentbuilderHelper::mergeArrays(array($fileNames, $app->getUserState('com_componentbuilder.plugins_folder_name', array()) ));
|
||||
|
||||
// wipe out the user c-m-p since we are done with them all
|
||||
$app->setUserState('com_componentbuilder.component_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.modules_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.plugins_folder_name', '');
|
||||
|
||||
// loop and install all extensions found
|
||||
foreach ($fileNames as $fileName)
|
||||
{
|
||||
if ($this->installExtension($fileName))
|
||||
@ -251,7 +317,14 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
if($user->authorise('core.admin'))
|
||||
{
|
||||
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_COMPONENT');
|
||||
$fileName = JFactory::getApplication()->getUserState('com_componentbuilder.component_folder_name');
|
||||
$app = JFactory::getApplication();
|
||||
$fileName = $app->getUserState('com_componentbuilder.component_folder_name');
|
||||
|
||||
// wipe out the user c-m-p since we are done with them all
|
||||
$app->setUserState('com_componentbuilder.component_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.modules_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.plugins_folder_name', '');
|
||||
|
||||
if ($this->installExtension($fileName))
|
||||
{
|
||||
$message = JText::sprintf('COM_COMPONENTBUILDER_ONLY_SZIP_FILE_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileName);
|
||||
@ -263,6 +336,47 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install Compiled Module
|
||||
*
|
||||
* @return true on success
|
||||
*/
|
||||
public function installCompiledModule()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
// check if user has the right
|
||||
$user = JFactory::getUser();
|
||||
// set page redirect
|
||||
$redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false);
|
||||
$message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_MODULE');
|
||||
if($user->authorise('core.admin'))
|
||||
{
|
||||
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_MODULE');
|
||||
$app = JFactory::getApplication();
|
||||
$fileNames = $app->getUserState('com_componentbuilder.modules_folder_name');
|
||||
|
||||
// wipe out the user c-m-p since we are done with them all
|
||||
$app->setUserState('com_componentbuilder.component_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.modules_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.plugins_folder_name', '');
|
||||
|
||||
if (ComponentbuilderHelper::checkArray($fileNames))
|
||||
{
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$moduleId = $jinput->post->get('install_item_id', 0, 'INT');
|
||||
if ($moduleId > 0 && isset($fileNames[$moduleId]) && $this->installExtension($fileNames[$moduleId]))
|
||||
{
|
||||
$message = JText::sprintf('COM_COMPONENTBUILDER_ONLY_SZIP_FILE_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileNames[$moduleId]);
|
||||
$this->setRedirect($redirect_url, $message, 'message');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->setRedirect($redirect_url, $message, 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Install Compiled Plugin
|
||||
*
|
||||
@ -282,6 +396,12 @@ class ComponentbuilderControllerCompiler extends JControllerAdmin
|
||||
$message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_PLUGIN');
|
||||
$app = JFactory::getApplication();
|
||||
$fileNames = $app->getUserState('com_componentbuilder.plugins_folder_name');
|
||||
|
||||
// wipe out the user c-m-p since we are done with them all
|
||||
$app->setUserState('com_componentbuilder.component_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.modules_folder_name', '');
|
||||
$app->setUserState('com_componentbuilder.plugins_folder_name', '');
|
||||
|
||||
if (ComponentbuilderHelper::checkArray($fileNames))
|
||||
{
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
|
321
admin/controllers/component_modules.php
Normal file
321
admin/controllers/component_modules.php
Normal file
@ -0,0 +1,321 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Component_modules Controller
|
||||
*/
|
||||
class ComponentbuilderControllerComponent_modules extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Components_modules'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
// Access check.
|
||||
$access = $user->authorise('component_modules.access', 'com_componentbuilder');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('component_modules.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('component_modules.access', 'com_componentbuilder.component_modules.' . (int) $recordId) && $user->authorise('component_modules.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('component_modules.edit', 'com_componentbuilder.component_modules.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('component_modules.edit.own', 'com_componentbuilder.component_modules.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('component_modules.edit.own', 'com_componentbuilder'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('component_modules.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Component_modules', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_modules' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
43
admin/controllers/components_modules.php
Normal file
43
admin/controllers/components_modules.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Components_modules Controller
|
||||
*/
|
||||
class ComponentbuilderControllerComponents_modules extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_MODULES';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Component_modules', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
347
admin/controllers/joomla_module.php
Normal file
347
admin/controllers/joomla_module.php
Normal file
@ -0,0 +1,347 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_module Controller
|
||||
*/
|
||||
class ComponentbuilderControllerJoomla_module extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Joomla_modules'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
// Access check.
|
||||
$access = $user->authorise('joomla_module.access', 'com_componentbuilder');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_module.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_module.access', 'com_componentbuilder.joomla_module.' . (int) $recordId) && $user->authorise('joomla_module.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('joomla_module.edit', 'com_componentbuilder.joomla_module.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('joomla_module.edit.own', 'com_componentbuilder.joomla_module.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('joomla_module.edit.own', 'com_componentbuilder'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('joomla_module.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Joomla_module', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
{
|
||||
// get the state object (Joomla\CMS\Object\CMSObject)
|
||||
$state = $model->get('state');
|
||||
// if we save2copy we need to also copy linked tables found!
|
||||
if ($state->task === 'save2copy' && $state->{'joomla_plugin.new'})
|
||||
{
|
||||
// get new ID
|
||||
$newID = $state->{'joomla_module.id'};
|
||||
// get old ID
|
||||
$oldID = $this->input->get('id', 0, 'INT');
|
||||
// linked tables to update
|
||||
$_tablesArray = array(
|
||||
'joomla_module_updates' => 'joomla_module',
|
||||
'joomla_module_files_folders_urls' => 'joomla_module'
|
||||
);
|
||||
foreach($_tablesArray as $_updateTable => $_key)
|
||||
{
|
||||
// get the linked ID
|
||||
if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, $_key, 'id'))
|
||||
{
|
||||
// copy fields to new linked table
|
||||
ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array($_key => $newID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
321
admin/controllers/joomla_module_files_folders_urls.php
Normal file
321
admin/controllers/joomla_module_files_folders_urls.php
Normal file
@ -0,0 +1,321 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_module_files_folders_urls Controller
|
||||
*/
|
||||
class ComponentbuilderControllerJoomla_module_files_folders_urls extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Joomla_modules_files_folders_urls'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
// Access check.
|
||||
$access = $user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_module_files_folders_urls.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder.joomla_module_files_folders_urls.' . (int) $recordId) && $user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('joomla_module_files_folders_urls.edit', 'com_componentbuilder.joomla_module_files_folders_urls.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('joomla_module_files_folders_urls.edit.own', 'com_componentbuilder.joomla_module_files_folders_urls.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('joomla_module_files_folders_urls.edit.own', 'com_componentbuilder'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('joomla_module_files_folders_urls.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Joomla_module_files_folders_urls', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules_files_folders_urls' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
339
admin/controllers/joomla_module_updates.php
Normal file
339
admin/controllers/joomla_module_updates.php
Normal file
@ -0,0 +1,339 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_module_updates Controller
|
||||
*/
|
||||
class ComponentbuilderControllerJoomla_module_updates extends JControllerForm
|
||||
{
|
||||
/**
|
||||
* Current or most recently performed task.
|
||||
*
|
||||
* @var string
|
||||
* @since 12.2
|
||||
* @note Replaces _task.
|
||||
*/
|
||||
protected $task;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param array $config A named array of configuration variables.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
$this->view_list = 'Joomla_modules_updates'; // safeguard for setting the return view listing to the main view.
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can add a new record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowAdd($data = array())
|
||||
{
|
||||
// Get user object.
|
||||
$user = JFactory::getUser();
|
||||
// Access check.
|
||||
$access = $user->authorise('joomla_module_updates.access', 'com_componentbuilder');
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('joomla_module_updates.create', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// get user object.
|
||||
$user = JFactory::getUser();
|
||||
// get record id.
|
||||
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
|
||||
|
||||
|
||||
// Access check.
|
||||
$access = ($user->authorise('joomla_module_updates.access', 'com_componentbuilder.joomla_module_updates.' . (int) $recordId) && $user->authorise('joomla_module_updates.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('joomla_module_updates.edit', 'com_componentbuilder.joomla_module_updates.' . (int) $recordId);
|
||||
if (!$permission)
|
||||
{
|
||||
if ($user->authorise('joomla_module_updates.edit.own', 'com_componentbuilder.joomla_module_updates.' . $recordId))
|
||||
{
|
||||
// Now test the owner is the user.
|
||||
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
|
||||
if (empty($ownerId))
|
||||
{
|
||||
// Need to do a lookup from the model.
|
||||
$record = $this->getModel()->getItem($recordId);
|
||||
|
||||
if (empty($record))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$ownerId = $record->created_by;
|
||||
}
|
||||
|
||||
// If the owner matches 'me' then allow.
|
||||
if ($ownerId == $user->id)
|
||||
{
|
||||
if ($user->authorise('joomla_module_updates.edit.own', 'com_componentbuilder'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Since there is no permission, revert to the component permissions.
|
||||
return $user->authorise('joomla_module_updates.edit', $this->option);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the URL arguments to append to an item redirect.
|
||||
*
|
||||
* @param integer $recordId The primary key id for the item.
|
||||
* @param string $urlVar The name of the URL variable for the id.
|
||||
*
|
||||
* @return string The arguments to append to the redirect URL.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
$append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
|
||||
}
|
||||
elseif ($ref)
|
||||
{
|
||||
$append = '&ref='. (string)$ref . $append;
|
||||
}
|
||||
|
||||
return $append;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run batch operations.
|
||||
*
|
||||
* @param object $model The model.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 2.5
|
||||
*/
|
||||
public function batch($model = null)
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
|
||||
// Set the model
|
||||
$model = $this->getModel('Joomla_module_updates', '', array());
|
||||
|
||||
// Preset the redirect
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules_updates' . $this->getRedirectToListAppend(), false));
|
||||
|
||||
return parent::batch($model);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to cancel an edit.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
*
|
||||
* @return boolean True if access level checks pass, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function cancel($key = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
|
||||
$cancel = parent::cancel($key);
|
||||
|
||||
if (!is_null($return) && JUri::isInternal(base64_decode($return)))
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view='.(string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $cancel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save a record.
|
||||
*
|
||||
* @param string $key The name of the primary key of the URL variable.
|
||||
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
|
||||
*
|
||||
* @return boolean True if successful, false otherwise.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function save($key = null, $urlVar = null)
|
||||
{
|
||||
// get the referral options
|
||||
$this->ref = $this->input->get('ref', 0, 'word');
|
||||
$this->refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// Check if there is a return value
|
||||
$return = $this->input->get('return', null, 'base64');
|
||||
$canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
|
||||
|
||||
if ($this->ref || $this->refid || $canReturn)
|
||||
{
|
||||
// to make sure the item is checkedin on redirect
|
||||
$this->task = 'save';
|
||||
}
|
||||
|
||||
$saved = parent::save($key, $urlVar);
|
||||
|
||||
// This is not needed since parent save already does this
|
||||
// Due to the ref and refid implementation we need to add this
|
||||
if ($canReturn)
|
||||
{
|
||||
$redirect = base64_decode($return);
|
||||
|
||||
// Redirect to the return value.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
$redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->refid && $this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
|
||||
|
||||
// Redirect to the item screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
elseif ($this->ref)
|
||||
{
|
||||
$redirect = '&view=' . (string)$this->ref;
|
||||
|
||||
// Redirect to the list screen.
|
||||
$this->setRedirect(
|
||||
JRoute::_(
|
||||
'index.php?option=' . $this->option . $redirect, false
|
||||
)
|
||||
);
|
||||
}
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that allows child controller access to model data
|
||||
* after the data has been saved.
|
||||
*
|
||||
* @param JModel &$model The data model object.
|
||||
* @param array $validData The validated data.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 11.1
|
||||
*/
|
||||
protected function postSaveHook(JModelLegacy $model, $validData = array())
|
||||
{
|
||||
// update the component version to match the updated last version
|
||||
if (isset($validData['joomla_plugin']) && is_numeric($validData['joomla_plugin']) && $validData['joomla_plugin'] > 0)
|
||||
{
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $validData['joomla_plugin'];
|
||||
if (isset($validData['version_update']) && ComponentbuilderHelper::checkArray($validData['version_update'])
|
||||
&& ($plugin_version = end($validData['version_update'])['version'])
|
||||
&& ComponentbuilderHelper::checkString($plugin_version))
|
||||
{
|
||||
$objectUpdate->plugin_version = $plugin_version;
|
||||
}
|
||||
// be sure to update the table if we have a value
|
||||
if (isset($objectUpdate->plugin_version))
|
||||
{
|
||||
JFactory::getDbo()->updateObject('#__componentbuilder_joomla_plugin', $objectUpdate, 'id');
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
52
admin/controllers/joomla_modules.php
Normal file
52
admin/controllers/joomla_modules.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_modules Controller
|
||||
*/
|
||||
class ComponentbuilderControllerJoomla_modules extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER_JOOMLA_MODULES';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Joomla_module', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
|
||||
public function getSnippets()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
|
||||
// redirect to the import snippets custom admin view
|
||||
$this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false));
|
||||
return;
|
||||
}
|
||||
}
|
43
admin/controllers/joomla_modules_files_folders_urls.php
Normal file
43
admin/controllers/joomla_modules_files_folders_urls.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_modules_files_folders_urls Controller
|
||||
*/
|
||||
class ComponentbuilderControllerJoomla_modules_files_folders_urls extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Joomla_module_files_folders_urls', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
43
admin/controllers/joomla_modules_updates.php
Normal file
43
admin/controllers/joomla_modules_updates.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
/**
|
||||
* Joomla_modules_updates Controller
|
||||
*/
|
||||
class ComponentbuilderControllerJoomla_modules_updates extends JControllerAdmin
|
||||
{
|
||||
/**
|
||||
* The prefix to use with controller messages.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name The model name. Optional.
|
||||
* @param string $prefix The class prefix. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel($name = 'Joomla_module_updates', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
return parent::getModel($name, $prefix, $config);
|
||||
}
|
||||
}
|
@ -93,16 +93,25 @@ class Compiler extends Infusion
|
||||
$componentXML = str_replace(array('<files folder="site">' . $textToSite . "</files>", '<languages folder="site">' . $textToSiteLang . "</languages>"), array('', ''), $componentXML);
|
||||
$this->writeFile($xmlPath, $componentXML);
|
||||
}
|
||||
// Trigger Event: jcb_ce_onBeforeUpdateFiles
|
||||
$this->triggerEvent('jcb_ce_onBeforeUpdateFiles', array(&$this->componentContext, $this));
|
||||
// now update the files
|
||||
if (!$this->updateFiles())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Trigger Event: jcb_ce_onBeforeGetCustomCode
|
||||
$this->triggerEvent('jcb_ce_onBeforeGetCustomCode', array(&$this->componentContext, $this));
|
||||
// now insert into the new files
|
||||
if ($this->getCustomCode())
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeAddCustomCode
|
||||
$this->triggerEvent('jcb_ce_onBeforeAddCustomCode', array(&$this->componentContext, $this));
|
||||
|
||||
$this->addCustomCode();
|
||||
}
|
||||
// Trigger Event: jcb_ce_onBeforeSetLangFileData
|
||||
$this->triggerEvent('jcb_ce_onBeforeSetLangFileData', array(&$this->componentContext, $this));
|
||||
// set the lang data now
|
||||
$this->setLangFileData();
|
||||
// set the language notice if it was set
|
||||
@ -148,6 +157,8 @@ class Compiler extends Infusion
|
||||
// done with error
|
||||
return false;
|
||||
}
|
||||
// if there are modules zip them
|
||||
$this->zipModules();
|
||||
// if there are plugins zip them
|
||||
$this->zipPlugins();
|
||||
// do lang mismatch check
|
||||
@ -165,7 +176,7 @@ class Compiler extends Infusion
|
||||
if (isset($mismatch) && ComponentbuilderHelper::checkArray($mismatch))
|
||||
{
|
||||
$this->app->enqueueMessage(JText::_('<hr /><h3>Language Warning</h3>'), 'Warning');
|
||||
if (count($mismatch) > 1)
|
||||
if (count((array) $mismatch) > 1)
|
||||
{
|
||||
$this->app->enqueueMessage(JText::_('<h3>Please check the following mismatching Joomla.JText language constants.</h3>'), 'Warning');
|
||||
}
|
||||
@ -259,6 +270,62 @@ class Compiler extends Infusion
|
||||
}
|
||||
// free up some memory
|
||||
unset($this->newFiles['dynamic']);
|
||||
// do modules if found
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaModules))
|
||||
{
|
||||
foreach ($this->joomlaModules as $module)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkObject($module) && isset($this->newFiles[$module->key]) && ComponentbuilderHelper::checkArray($this->newFiles[$module->key]))
|
||||
{
|
||||
// move field or rule if needed
|
||||
if (isset($module->fields_rules_paths) && $module->fields_rules_paths == 2)
|
||||
{
|
||||
// check the config fields
|
||||
if (isset($module->config_fields) && ComponentbuilderHelper::checkArray($module->config_fields))
|
||||
{
|
||||
foreach ($module->config_fields as $field_name => $fieldsets)
|
||||
{
|
||||
foreach ($fieldsets as $fieldset => $fields)
|
||||
{
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
$this->moveFieldsRules($field, $module->folder_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// check the fieldsets
|
||||
if (isset($module->form_files) && ComponentbuilderHelper::checkArray($module->form_files))
|
||||
{
|
||||
foreach($module->form_files as $file => $files)
|
||||
{
|
||||
foreach ($files as $field_name => $fieldsets)
|
||||
{
|
||||
foreach ($fieldsets as $fieldset => $fields)
|
||||
{
|
||||
foreach ($fields as $field)
|
||||
{
|
||||
$this->moveFieldsRules($field, $module->folder_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// update the module files
|
||||
foreach ($this->newFiles[$module->key] as $module_file)
|
||||
{
|
||||
if (JFile::exists($module_file['path']))
|
||||
{
|
||||
$this->setFileContent($module_file['name'], $module_file['path'], $bom, $module->key);
|
||||
}
|
||||
}
|
||||
// free up some memory
|
||||
unset($this->newFiles[$module->key]);
|
||||
unset($this->fileContentDynamic[$module->key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// do plugins if found
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaPlugins))
|
||||
{
|
||||
@ -301,7 +368,7 @@ class Compiler extends Infusion
|
||||
}
|
||||
}
|
||||
}
|
||||
// now move the files
|
||||
// update the plugin files
|
||||
foreach ($this->newFiles[$plugin->key] as $plugin_file)
|
||||
{
|
||||
if (JFile::exists($plugin_file['path']))
|
||||
@ -563,6 +630,27 @@ class Compiler extends Infusion
|
||||
// Trigger Event: jcb_ce_onAfterUpdateRepo
|
||||
$this->triggerEvent('jcb_ce_onAfterUpdateRepo', array(&$this->componentContext, &$this->componentPath, &$repoFullPath, &$this->componentData));
|
||||
|
||||
// move the modules to local folder repos
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaModules))
|
||||
{
|
||||
foreach ($this->joomlaModules as $module)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkObject($module) && isset($module->file_name))
|
||||
{
|
||||
$module_context = 'module.' . $module->file_name . '.' . $module->id;
|
||||
// set the repo path
|
||||
$repoFullPath = $this->repoPath . '/' . $module->folder_name . '__joomla_' . $this->joomlaVersion;
|
||||
// Trigger Event: jcb_ce_onBeforeUpdateRepo
|
||||
$this->triggerEvent('jcb_ce_onBeforeUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module));
|
||||
// remove old data
|
||||
$this->removeFolder($repoFullPath, $this->componentData->toignore);
|
||||
// set the new data
|
||||
JFolder::copy($module->folder_path, $repoFullPath, '', true);
|
||||
// Trigger Event: jcb_ce_onAfterUpdateRepo
|
||||
$this->triggerEvent('jcb_ce_onAfterUpdateRepo', array(&$module_context, &$module->folder_path, &$repoFullPath, &$module));
|
||||
}
|
||||
}
|
||||
}
|
||||
// move the plugins to local folder repos
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaPlugins))
|
||||
{
|
||||
@ -630,6 +718,60 @@ class Compiler extends Infusion
|
||||
return false;
|
||||
}
|
||||
|
||||
private function zipModules()
|
||||
{
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaModules))
|
||||
{
|
||||
foreach ($this->joomlaModules as $module)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkObject($module) && isset($module->zip_name)
|
||||
&& ComponentbuilderHelper::checkString($module->zip_name)
|
||||
&& isset($module->folder_path)
|
||||
&& ComponentbuilderHelper::checkString($module->folder_path))
|
||||
{
|
||||
// set module context
|
||||
$module_context = $module->file_name . '.' . $module->id;
|
||||
// Component Folder Name
|
||||
$this->filepath['modules-folder'][$module->id] = $module->zip_name;
|
||||
// the name of the zip file to create
|
||||
$this->filepath['modules'][$module->id] = $this->tempPath . '/' . $module->zip_name . '.zip';
|
||||
// Trigger Event: jcb_ce_onBeforeZipModule
|
||||
$this->triggerEvent('jcb_ce_onBeforeZipModule', array(&$module_context, &$module->folder_path, &$this->filepath['modules'][$module->id], &$this->tempPath, &$module->zip_name, &$module));
|
||||
//create the zip file
|
||||
if (ComponentbuilderHelper::zip($module->folder_path, $this->filepath['modules'][$module->id]))
|
||||
{
|
||||
// now move to backup if zip was made and backup is required
|
||||
if ($this->backupPath)
|
||||
{
|
||||
$__module_context = 'module.' . $module_context;
|
||||
// Trigger Event: jcb_ce_onBeforeBackupZip
|
||||
$this->triggerEvent('jcb_ce_onBeforeBackupZip', array(&$__module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, &$this->backupPath, &$module));
|
||||
// copy the zip to backup path
|
||||
JFile::copy($this->filepath['modules'][$module->id], $this->backupPath . '/' . $module->zip_name . '.zip');
|
||||
}
|
||||
|
||||
// move to sales server host
|
||||
if ($module->add_sales_server == 1)
|
||||
{
|
||||
// make sure we have the correct file
|
||||
if (isset($module->sales_server))
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeMoveToServer
|
||||
$this->triggerEvent('jcb_ce_onBeforeMoveToServer', array(&$__module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, &$module->zip_name, &$module));
|
||||
// move to server
|
||||
ComponentbuilderHelper::moveToServer($this->filepath['modules'][$module->id], $module->zip_name . '.zip', (int) $module->sales_server, $module->sales_server_protocol);
|
||||
}
|
||||
}
|
||||
// Trigger Event: jcb_ce_onAfterZipModule
|
||||
$this->triggerEvent('jcb_ce_onAfterZipModule', array(&$module_context, &$this->filepath['modules'][$module->id], &$this->tempPath, &$module->zip_name, &$module));
|
||||
// remove the module folder since we are done
|
||||
$this->removeFolder($module->folder_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function zipPlugins()
|
||||
{
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaPlugins))
|
||||
@ -733,7 +875,7 @@ class Compiler extends Infusion
|
||||
// we musk keep last three lines to dynamic find target entry
|
||||
$fingerPrint[$lineNumber] = trim($lineContent);
|
||||
// check lines each time if it fits our target
|
||||
if (count($fingerPrint) === $sizeEnd && !$foundEnd)
|
||||
if (count((array) $fingerPrint) === $sizeEnd && !$foundEnd)
|
||||
{
|
||||
$fingerTest = md5(implode('', $fingerPrint));
|
||||
if ($fingerTest === $hashEnd)
|
||||
@ -757,7 +899,7 @@ class Compiler extends Infusion
|
||||
// we musk keep last three lines to dynamic find target entry
|
||||
$fingerPrint[$lineNumber] = trim($lineContent);
|
||||
// check lines each time if it fits our target
|
||||
if (count($fingerPrint) === $size && !$found)
|
||||
if (count((array) $fingerPrint) === $size && !$found)
|
||||
{
|
||||
$fingerTest = md5(implode('', $fingerPrint));
|
||||
if ($fingerTest === $hash)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -371,6 +371,8 @@ class Structure extends Get
|
||||
$this->removeFolder($this->componentPath);
|
||||
// load the libraries files/folders and url's
|
||||
$this->setLibraries();
|
||||
// load the module files/folders and url's
|
||||
$this->buildModules();
|
||||
// load the plugin files/folders and url's
|
||||
$this->buildPlugins();
|
||||
// set the Joomla Version Data
|
||||
@ -404,7 +406,7 @@ class Structure extends Get
|
||||
*
|
||||
* @param int $nr The line number
|
||||
*
|
||||
* @return void
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
private function setLine($nr)
|
||||
@ -416,6 +418,384 @@ class Structure extends Get
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the Modules files, folders, url's and config
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
private function buildModules()
|
||||
{
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaModules))
|
||||
{
|
||||
// Trigger Event: jcb_ce_onBeforeSetModules
|
||||
$this->triggerEvent('jcb_ce_onBeforeBuildModules', array(&$this->componentContext, &$this->joomlaModules));
|
||||
foreach ($this->joomlaModules as $module)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkObject($module) && isset($module->folder_name)
|
||||
&& ComponentbuilderHelper::checkString($module->folder_name))
|
||||
{
|
||||
// module path
|
||||
$module->folder_path = $this->compilerPath . '/' . $module->folder_name;
|
||||
// set the module paths
|
||||
$this->dynamicPaths[$module->key] = $module->folder_path;
|
||||
// make sure there is no old build
|
||||
$this->removeFolder($module->folder_path);
|
||||
// creat the main component folder
|
||||
if (!JFolder::exists($module->folder_path))
|
||||
{
|
||||
JFolder::create($module->folder_path);
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name, $this->compilerPath);
|
||||
}
|
||||
// set main mod file
|
||||
$fileDetails = array('path' => $module->folder_path . '/' . $module->file_name . '.php',
|
||||
'name' => $module->file_name . '.php', 'zip' => $module->file_name . '.php');
|
||||
$this->writeFile($fileDetails['path'],
|
||||
'<?php' . PHP_EOL . '// main modfile' .
|
||||
PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL .
|
||||
PHP_EOL . '// No direct access to this file' . PHP_EOL .
|
||||
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL .
|
||||
$this->hhh . 'MODCODE' . $this->hhh);
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
// set custom_get
|
||||
if ($module->custom_get)
|
||||
{
|
||||
$fileDetails = array('path' => $module->folder_path . '/data.php',
|
||||
'name' => 'data.php', 'zip' => 'data.php');
|
||||
$this->writeFile($fileDetails['path'],
|
||||
'<?php' . PHP_EOL . '// get data file' .
|
||||
PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL .
|
||||
PHP_EOL . '// No direct access to this file' . PHP_EOL .
|
||||
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL . PHP_EOL .
|
||||
'/**' . PHP_EOL .
|
||||
' * Module ' . $module->official_name . ' Data' . PHP_EOL .
|
||||
' */' . PHP_EOL .
|
||||
"class " . $module->class_data_name . ' extends \JObject' . PHP_EOL .
|
||||
"{" . $this->hhh . 'DYNAMICGETS' . $this->hhh . "}" . PHP_EOL);
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
// set helper file
|
||||
if ($module->add_class_helper >= 1)
|
||||
{
|
||||
$fileDetails = array('path' => $module->folder_path . '/helper.php',
|
||||
'name' => 'helper.php', 'zip' => 'helper.php');
|
||||
$this->writeFile($fileDetails['path'],
|
||||
'<?php' . PHP_EOL . '// helper file' .
|
||||
PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL .
|
||||
PHP_EOL . '// No direct access to this file' . PHP_EOL .
|
||||
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL .
|
||||
$this->hhh . 'HELPERCODE' . $this->hhh);
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
// set main xml file
|
||||
$fileDetails = array('path' => $module->folder_path . '/' . $module->file_name . '.xml',
|
||||
'name' => $module->file_name . '.xml', 'zip' => $module->file_name . '.xml');
|
||||
$this->writeFile($fileDetails['path'], $this->getModuleXMLTemplate($module));
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
// set tmpl folder
|
||||
if (!JFolder::exists($module->folder_path . '/tmpl'))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/tmpl');
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name . '/tmpl', $this->compilerPath);
|
||||
}
|
||||
// set default file
|
||||
$fileDetails = array('path' => $module->folder_path . '/tmpl/default.php',
|
||||
'name' => 'default.php', 'zip' => 'tmpl/default.php');
|
||||
$this->writeFile($fileDetails['path'],
|
||||
'<?php' . PHP_EOL . '// default tmpl' .
|
||||
PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL .
|
||||
PHP_EOL . '// No direct access to this file' . PHP_EOL .
|
||||
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL .
|
||||
$this->hhh . 'MODDEFAULT' . $this->hhh);
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
// set install script if needed
|
||||
if ($module->add_install_script)
|
||||
{
|
||||
$fileDetails = array('path' => $module->folder_path . '/script.php',
|
||||
'name' => 'script.php', 'zip' => 'script.php');
|
||||
$this->writeFile($fileDetails['path'],
|
||||
'<?php' . PHP_EOL . '// Script template' .
|
||||
PHP_EOL . $this->hhh . 'BOM' . $this->hhh . PHP_EOL .
|
||||
PHP_EOL . '// No direct access to this file' . PHP_EOL .
|
||||
"defined('_JEXEC') or die('Restricted access');" . PHP_EOL .
|
||||
$this->hhh . 'INSTALLCLASS' . $this->hhh);
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
// set readme if found
|
||||
if ($module->addreadme)
|
||||
{
|
||||
$fileDetails = array('path' => $module->folder_path . '/README.md',
|
||||
'name' => 'README.md', 'zip' => 'README.md');
|
||||
$this->writeFile($fileDetails['path'], $module->readme);
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
// set fields & rules folders if needed
|
||||
if (isset($module->fields_rules_paths) && $module->fields_rules_paths == 2)
|
||||
{
|
||||
// create fields folder
|
||||
if (!JFolder::exists($module->folder_path . '/fields'))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/fields');
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name . '/fields', $this->compilerPath);
|
||||
}
|
||||
// create rules folder
|
||||
if (!JFolder::exists($module->folder_path . '/rules'))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/rules');
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name . '/rules', $this->compilerPath);
|
||||
}
|
||||
}
|
||||
// set forms folder if needed
|
||||
if (isset($module->form_files) && ComponentbuilderHelper::checkArray($module->form_files))
|
||||
{
|
||||
// create forms folder
|
||||
if (!JFolder::exists($module->folder_path . '/forms'))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/forms');
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name . '/forms', $this->compilerPath);
|
||||
}
|
||||
// set the template files
|
||||
foreach($module->form_files as $file => $fields)
|
||||
{
|
||||
// set file details
|
||||
$fileDetails = array('path' => $module->folder_path . '/forms/' . $file . '.xml',
|
||||
'name' => $file . '.xml', 'zip' => 'forms/' . $file . '.xml');
|
||||
// biuld basic XML
|
||||
$xml = '<?xml version="1.0" encoding="utf-8"?>';
|
||||
$xml .= PHP_EOL . '<!--' . $this->setLine(__LINE__) . ' default paths of ' . $file . ' form points to ' . $this->componentCodeName . ' -->';
|
||||
// search if we must add the component path
|
||||
$add_component_path = false;
|
||||
foreach ($fields as $field_name => $fieldsets)
|
||||
{
|
||||
if (!$add_component_path)
|
||||
{
|
||||
foreach ($fieldsets as $fieldset => $field)
|
||||
{
|
||||
if (!$add_component_path && isset($module->fieldsets_paths[$file . $field_name . $fieldset]) && $module->fieldsets_paths[$file . $field_name . $fieldset] == 1)
|
||||
{
|
||||
$add_component_path = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// only add if part of the component field types path is required
|
||||
if ($add_component_path)
|
||||
{
|
||||
$xml .= PHP_EOL . '<form';
|
||||
$xml .= PHP_EOL . $this->_t(1) . 'addrulepath="/administrator/components/com_' . $this->componentCodeName . '/models/rules"';
|
||||
$xml .= PHP_EOL . $this->_t(1) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/models/fields"';
|
||||
$xml .= PHP_EOL . '>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml .= PHP_EOL . '<form>';
|
||||
}
|
||||
// add the fields
|
||||
foreach ($fields as $field_name => $fieldsets)
|
||||
{
|
||||
// check if we have an double fields naming set
|
||||
$field_name_inner = '';
|
||||
$field_name_outer = $field_name;
|
||||
if (strpos($field_name, '.') !== false)
|
||||
{
|
||||
$field_names = explode('.', $field_name);
|
||||
if (count((array) $field_names) == 2)
|
||||
{
|
||||
$field_name_outer = $field_names[0];
|
||||
$field_name_inner = $field_names[1];
|
||||
}
|
||||
}
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name_outer . '">';
|
||||
foreach ($fieldsets as $fieldset => $field)
|
||||
{
|
||||
// default to the field set name
|
||||
$label = $fieldset;
|
||||
if (isset($module->fieldsets_label[$file.$field_name.$fieldset]))
|
||||
{
|
||||
$label = $module->fieldsets_label[$file.$field_name.$fieldset];
|
||||
}
|
||||
// add path to module rules and custom fields
|
||||
if (isset($module->fieldsets_paths[$file.$field_name.$fieldset]) && $module->fieldsets_paths[$file.$field_name.$fieldset] == 2)
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<!--' . $this->setLine(__LINE__) . ' default paths of ' . $fieldset . ' fieldset points to the module -->';
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fieldset name="' . $fieldset . '" label="' . $label . '"';
|
||||
$xml .= PHP_EOL . $this->_t(2) . 'addrulepath="/modules/' . strtolower($module->code_name) . '/rules"';
|
||||
$xml .= PHP_EOL . $this->_t(2) . 'addfieldpath="/modules/' . strtolower($module->code_name) . '/fields"';
|
||||
$xml .= PHP_EOL . $this->_t(1) . '>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fieldset name="' . $fieldset . '" label="' . $label . '">';
|
||||
}
|
||||
// check if we have an inner field set
|
||||
if (ComponentbuilderHelper::checkString($field_name_inner))
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name_inner . '">';
|
||||
}
|
||||
// add the placeholder of the fields
|
||||
$xml .= $this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh;
|
||||
// check if we have an inner field set
|
||||
if (ComponentbuilderHelper::checkString($field_name_inner))
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '</fields>';
|
||||
}
|
||||
$xml .= PHP_EOL . $this->_t(1) . '</fieldset>';
|
||||
}
|
||||
$xml .= PHP_EOL . $this->_t(1) . '</fields>';
|
||||
}
|
||||
$xml .= PHP_EOL . '</form>';
|
||||
// add xml to file
|
||||
$this->writeFile($fileDetails['path'], $xml);
|
||||
$this->newFiles[$module->key][] = $fileDetails;
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
}
|
||||
// set SQL stuff if needed
|
||||
if ($module->add_sql || $module->add_sql_uninstall)
|
||||
{
|
||||
// create SQL folder
|
||||
if (!JFolder::exists($module->folder_path . '/sql'))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/sql');
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name . '/sql', $this->compilerPath);
|
||||
}
|
||||
// create mysql folder
|
||||
if (!JFolder::exists($module->folder_path . '/sql/mysql'))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/sql/mysql');
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name . '/sql/mysql', $this->compilerPath);
|
||||
}
|
||||
// now set the install file
|
||||
if ($module->add_sql)
|
||||
{
|
||||
$this->writeFile($module->folder_path . '/sql/mysql/install.sql', $module->sql);
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
// now set the uninstall file
|
||||
if ($module->add_sql_uninstall)
|
||||
{
|
||||
$this->writeFile($module->folder_path . '/sql/mysql/uninstall.sql', $module->sql_uninstall);
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
}
|
||||
// creat the language folder
|
||||
if (!JFolder::exists($module->folder_path . '/language'))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/language');
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
// also the lang tag
|
||||
if (!JFolder::exists($module->folder_path . '/language/' . $this->langTag))
|
||||
{
|
||||
JFolder::create($module->folder_path . '/language/' . $this->langTag);
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
}
|
||||
}
|
||||
// check if this lib has files
|
||||
if (isset($module->files) && ComponentbuilderHelper::checkArray($module->files))
|
||||
{
|
||||
// add to component files
|
||||
foreach ($module->files as $file)
|
||||
{
|
||||
// set the path finder
|
||||
$file['target_type'] = $module->target_type;
|
||||
$file['target_id'] = $module->id;
|
||||
$this->componentData->files[] = $file;
|
||||
}
|
||||
}
|
||||
// check if this lib has folders
|
||||
if (isset($module->folders) && ComponentbuilderHelper::checkArray($module->folders))
|
||||
{
|
||||
// add to component folders
|
||||
foreach ($module->folders as $folder)
|
||||
{
|
||||
// set the path finder
|
||||
$folder['target_type'] = $module->target_type;
|
||||
$folder['target_id'] = $module->id;
|
||||
$this->componentData->folders[] = $folder;
|
||||
}
|
||||
}
|
||||
// check if this module has urls
|
||||
if (isset($module->urls) && ComponentbuilderHelper::checkArray($module->urls))
|
||||
{
|
||||
// add to component urls
|
||||
foreach ($module->urls as $n => &$url)
|
||||
{
|
||||
// should we add the local folder
|
||||
if (isset($url['type']) && $url['type'] > 1 && isset($url['url'])
|
||||
&& ComponentbuilderHelper::checkString($url['url']))
|
||||
{
|
||||
// set file name
|
||||
$fileName = basename($url['url']);
|
||||
// get the file contents
|
||||
$data = ComponentbuilderHelper::getFileContents($url['url']);
|
||||
// build sub path
|
||||
if (strpos($fileName, '.js') !== false)
|
||||
{
|
||||
$path = '/js';
|
||||
}
|
||||
elseif (strpos($fileName, '.css') !== false)
|
||||
{
|
||||
$path = '/css';
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = '';
|
||||
}
|
||||
// create sub media path if not set
|
||||
if (!JFolder::exists($module->folder_path .$path))
|
||||
{
|
||||
JFolder::create($module->folder_path . $path);
|
||||
// count the folder created
|
||||
$this->folderCount++;
|
||||
$this->indexHTML($module->folder_name . $path, $this->compilerPath);
|
||||
}
|
||||
// set the path to module file
|
||||
$url['path'] = $module->folder_path . $path . '/' . $fileName; // we need this for later
|
||||
// write data to path
|
||||
$this->writeFile($url['path'], $data);
|
||||
// count the file created
|
||||
$this->fileCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the Plugins files, folders, url's and config
|
||||
*
|
||||
@ -531,13 +911,49 @@ class Structure extends Get
|
||||
// biuld basic XML
|
||||
$xml = '<?xml version="1.0" encoding="utf-8"?>';
|
||||
$xml .= PHP_EOL . '<!--' . $this->setLine(__LINE__) . ' default paths of ' . $file . ' form points to ' . $this->componentCodeName . ' -->';
|
||||
// search if we must add the component path
|
||||
$add_component_path = false;
|
||||
foreach ($fields as $field_name => $fieldsets)
|
||||
{
|
||||
if (!$add_component_path)
|
||||
{
|
||||
foreach ($fieldsets as $fieldset => $field)
|
||||
{
|
||||
if (!$add_component_path && isset($plugin->fieldsets_paths[$file . $field_name . $fieldset]) && $plugin->fieldsets_paths[$file . $field_name . $fieldset] == 1)
|
||||
{
|
||||
$add_component_path = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// only add if part of the component field types path is required
|
||||
if ($add_component_path)
|
||||
{
|
||||
$xml .= PHP_EOL . '<form';
|
||||
$xml .= PHP_EOL . $this->_t(1) . 'addrulepath="/administrator/components/com_' . $this->componentCodeName . '/models/rules"';
|
||||
$xml .= PHP_EOL . $this->_t(1) . 'addfieldpath="/administrator/components/com_' . $this->componentCodeName . '/models/fields"';
|
||||
$xml .= PHP_EOL . '>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$xml .= PHP_EOL . '<form>';
|
||||
}
|
||||
// add the fields
|
||||
foreach ($fields as $field_name => $fieldsets)
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name . '">';
|
||||
// check if we have an double fields naming set
|
||||
$field_name_inner = '';
|
||||
$field_name_outer = $field_name;
|
||||
if (strpos($field_name, '.') !== false)
|
||||
{
|
||||
$field_names = explode('.', $field_name);
|
||||
if (count((array) $field_names) == 2)
|
||||
{
|
||||
$field_name_outer = $field_names[0];
|
||||
$field_name_inner = $field_names[1];
|
||||
}
|
||||
}
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name_outer . '">';
|
||||
foreach ($fieldsets as $fieldset => $field)
|
||||
{
|
||||
// default to the field set name
|
||||
@ -559,8 +975,18 @@ class Structure extends Get
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fieldset name="' . $fieldset . '" label="' . $label . '">';
|
||||
}
|
||||
// check if we have an inner field set
|
||||
if (ComponentbuilderHelper::checkString($field_name_inner))
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '<fields name="' . $field_name_inner . '">';
|
||||
}
|
||||
// add the placeholder of the fields
|
||||
$xml .= $this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh;
|
||||
// check if we have an inner field set
|
||||
if (ComponentbuilderHelper::checkString($field_name_inner))
|
||||
{
|
||||
$xml .= PHP_EOL . $this->_t(1) . '</fields>';
|
||||
}
|
||||
$xml .= PHP_EOL . $this->_t(1) . '</fieldset>';
|
||||
}
|
||||
$xml .= PHP_EOL . $this->_t(1) . '</fields>';
|
||||
@ -843,7 +1269,7 @@ class Structure extends Get
|
||||
{
|
||||
// set the default view
|
||||
$getter = explode('_', $this->componentData->dashboard);
|
||||
if (count($getter) == 2 && is_numeric($getter[1]))
|
||||
if (count((array) $getter) == 2 && is_numeric($getter[1]))
|
||||
{
|
||||
// the pointers
|
||||
$t = ComponentbuilderHelper::safeString($getter[0], 'U');
|
||||
@ -1212,7 +1638,7 @@ class Structure extends Get
|
||||
$this->app->enqueueMessage(JText::sprintf('A method (setDynamicF0ld3rs) was added to the install <b>script.php</b> of this package to insure that the folder/s are copied into the correct place when this componet is installed!'), 'Notice');
|
||||
}
|
||||
}
|
||||
elseif (count($checker) == 2 && ComponentbuilderHelper::checkString($checker[0]))
|
||||
elseif (count((array) $checker) == 2 && ComponentbuilderHelper::checkString($checker[0]))
|
||||
{
|
||||
$add_to_extra = false;
|
||||
// set the target
|
||||
|
@ -243,25 +243,39 @@ class Fields extends Structure
|
||||
public $base64Builder = array();
|
||||
|
||||
/**
|
||||
* Basic Encryption Builder
|
||||
* Basic Encryption Field Modeling
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $basicEncryptionBuilder = array();
|
||||
public $basicFieldModeling = array();
|
||||
|
||||
/**
|
||||
* WHMCS Encryption Builder
|
||||
* WHMCS Encryption Field Modeling
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $whmcsEncryptionBuilder = array();
|
||||
public $whmcsFieldModeling = array();
|
||||
|
||||
/**
|
||||
* Medium Encryption Builder
|
||||
* Medium Encryption Field Modeling
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $mediumEncryptionBuilder = array();
|
||||
public $mediumFieldModeling = array();
|
||||
|
||||
/**
|
||||
* Expert Field Modeling
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $expertFieldModeling = array();
|
||||
|
||||
/**
|
||||
* Expert Mode Initiator
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $expertFieldModelInitiator = array();
|
||||
|
||||
/**
|
||||
* Get Items Method List String Fix Builder
|
||||
@ -420,7 +434,7 @@ class Fields extends Structure
|
||||
$this->setLangContent($this->lang, $langView . '_MODIFIED_BY_LABEL', "Modified By");
|
||||
$this->setLangContent($this->lang, $langView . '_MODIFIED_BY_DESC', "The last user that modified this " . $view['settings']->name_single . ".");
|
||||
$this->setLangContent($this->lang, $langView . '_ORDERING_LABEL', "Ordering");
|
||||
$this->setLangContent($this->lang, $langView . '_VERSION_LABEL', "Revision");
|
||||
$this->setLangContent($this->lang, $langView . '_VERSION_LABEL', "Version");
|
||||
$this->setLangContent($this->lang, $langView . '_VERSION_DESC', "A count of the number of times this " . $view['settings']->name_single . " has been revised.");
|
||||
$this->setLangContent($this->lang, $langView . '_SAVE_WARNING', "Alias already existed so a number was added at the end. You can re-edit the " . $view['settings']->name_single . " to customise the alias.");
|
||||
// check what type of field builder to use
|
||||
@ -633,6 +647,8 @@ class Fields extends Structure
|
||||
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
|
||||
{
|
||||
// metakey
|
||||
if (!isset($this->fieldsNames[$view_name_single]['metakey']))
|
||||
{
|
||||
$fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metakey Field. Type: Textarea (joomla) -->";
|
||||
$fieldSet[] = $this->_t(2) . "<field";
|
||||
$fieldSet[] = $this->_t(3) . 'name="metakey"';
|
||||
@ -644,7 +660,10 @@ class Fields extends Structure
|
||||
$fieldSet[] = $this->_t(2) . "/>";
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
// metadesc
|
||||
if (!isset($this->fieldsNames[$view_name_single]['metadesc']))
|
||||
{
|
||||
$fieldSet[] = $this->_t(2) . "<!--" . $this->setLine(__LINE__) . " Metadesc Field. Type: Textarea (joomla) -->";
|
||||
$fieldSet[] = $this->_t(2) . "<field";
|
||||
$fieldSet[] = $this->_t(3) . 'name="metadesc"';
|
||||
@ -657,6 +676,7 @@ class Fields extends Structure
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
}
|
||||
// load the dynamic fields now
|
||||
if (ComponentbuilderHelper::checkString($dynamicFields))
|
||||
{
|
||||
@ -666,12 +686,18 @@ class Fields extends Structure
|
||||
$fieldSet[] = $this->_t(1) . "</fieldset>";
|
||||
// check if metadata is added to this view
|
||||
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
|
||||
{
|
||||
if (!isset($this->fieldsNames[$view_name_single]['robots'])
|
||||
|| !isset($this->fieldsNames[$view_name_single]['rights'])
|
||||
|| !isset($this->fieldsNames[$view_name_single]['author']))
|
||||
{
|
||||
$fieldSet[] = PHP_EOL . $this->_t(1) . "<!--" . $this->setLine(__LINE__) . " Metadata Fields. -->";
|
||||
$fieldSet[] = $this->_t(1) . "<fields" . ' name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
|
||||
$fieldSet[] = $this->_t(2) . '<fieldset name="vdmmetadata"';
|
||||
$fieldSet[] = $this->_t(3) . 'label="JGLOBAL_FIELDSET_METADATA_OPTIONS">';
|
||||
// robots
|
||||
if (!isset($this->fieldsNames[$view_name_single]['robots']))
|
||||
{
|
||||
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Robots Field. Type: List (joomla) -->";
|
||||
$fieldSet[] = $this->_t(3) . '<field name="robots"';
|
||||
$fieldSet[] = $this->_t(4) . 'type="list"';
|
||||
@ -685,7 +711,10 @@ class Fields extends Structure
|
||||
$fieldSet[] = $this->_t(3) . '</field>';
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
// author
|
||||
if (!isset($this->fieldsNames[$view_name_single]['author']))
|
||||
{
|
||||
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Author Field. Type: Text (joomla) -->";
|
||||
$fieldSet[] = $this->_t(3) . '<field name="author"';
|
||||
$fieldSet[] = $this->_t(4) . 'type="text"';
|
||||
@ -694,7 +723,10 @@ class Fields extends Structure
|
||||
$fieldSet[] = $this->_t(3) . "/>";
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
// rights
|
||||
if (!isset($this->fieldsNames[$view_name_single]['rights']))
|
||||
{
|
||||
$fieldSet[] = $this->_t(3) . "<!--" . $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla) -->";
|
||||
$fieldSet[] = $this->_t(3) . '<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"';
|
||||
$fieldSet[] = $this->_t(4) . 'description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"';
|
||||
@ -702,9 +734,11 @@ class Fields extends Structure
|
||||
$fieldSet[] = $this->_t(3) . "/>";
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
$fieldSet[] = $this->_t(2) . "</fieldset>";
|
||||
$fieldSet[] = $this->_t(1) . "</fields>";
|
||||
}
|
||||
}
|
||||
// retunr the set
|
||||
return implode(PHP_EOL, $fieldSet);
|
||||
}
|
||||
@ -923,6 +957,8 @@ class Fields extends Structure
|
||||
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
|
||||
{
|
||||
// metakey
|
||||
if (!isset($this->fieldsNames[$view_name_single]['metakey']))
|
||||
{
|
||||
$attributes = array(
|
||||
'name' => 'metakey',
|
||||
'type' => 'textarea',
|
||||
@ -936,7 +972,10 @@ class Fields extends Structure
|
||||
ComponentbuilderHelper::xmlAddAttributes($fieldXML, $attributes);
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
// metadesc
|
||||
if (!isset($this->fieldsNames[$view_name_single]['metadesc']))
|
||||
{
|
||||
$attributes['name'] = 'metadesc';
|
||||
$attributes['label'] = 'JFIELD_META_DESCRIPTION_LABEL';
|
||||
$attributes['description'] = 'JFIELD_META_DESCRIPTION_DESC';
|
||||
@ -946,8 +985,9 @@ class Fields extends Structure
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
}
|
||||
// load the dynamic fields now
|
||||
if (count($dynamicFieldsXML))
|
||||
if (count((array) $dynamicFieldsXML))
|
||||
{
|
||||
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Dynamic Fields.");
|
||||
foreach ($dynamicFieldsXML as $dynamicfield)
|
||||
@ -957,6 +997,10 @@ class Fields extends Structure
|
||||
}
|
||||
// check if metadata is added to this view
|
||||
if (isset($this->metadataBuilder[$view_name_single]) && ComponentbuilderHelper::checkString($this->metadataBuilder[$view_name_single]))
|
||||
{
|
||||
if (!isset($this->fieldsNames[$view_name_single]['robots'])
|
||||
|| !isset($this->fieldsNames[$view_name_single]['author'])
|
||||
|| !isset($this->fieldsNames[$view_name_single]['rights']))
|
||||
{
|
||||
ComponentbuilderHelper::xmlComment($fieldSetXML, $this->setLine(__LINE__) . " Metadata Fields");
|
||||
$fieldsXML = $fieldSetXML->addChild('fields');
|
||||
@ -966,6 +1010,8 @@ class Fields extends Structure
|
||||
$fieldsFieldSetXML->addAttribute('name', 'vdmmetadata');
|
||||
$fieldsFieldSetXML->addAttribute('label', 'JGLOBAL_FIELDSET_METADATA_OPTIONS');
|
||||
// robots
|
||||
if (!isset($this->fieldsNames[$view_name_single]['robots']))
|
||||
{
|
||||
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Robots Field. Type: List (joomla)");
|
||||
$robots = $fieldsFieldSetXML->addChild('field');
|
||||
$attributes = array(
|
||||
@ -990,7 +1036,10 @@ class Fields extends Structure
|
||||
$option->addAttribute('value', $value);
|
||||
$option[] = $text;
|
||||
}
|
||||
}
|
||||
// author
|
||||
if (!isset($this->fieldsNames[$view_name_single]['author']))
|
||||
{
|
||||
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Author Field. Type: Text (joomla)");
|
||||
$author = $fieldsFieldSetXML->addChild('field');
|
||||
$attributes = array(
|
||||
@ -1003,7 +1052,10 @@ class Fields extends Structure
|
||||
ComponentbuilderHelper::xmlAddAttributes($author, $attributes);
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
// rights
|
||||
if (!isset($this->fieldsNames[$view_name_single]['rights']))
|
||||
{
|
||||
ComponentbuilderHelper::xmlComment($fieldsFieldSetXML, $this->setLine(__LINE__) . " Rights Field. Type: Textarea (joomla)");
|
||||
$rights = $fieldsFieldSetXML->addChild('field');
|
||||
$attributes = array(
|
||||
@ -1020,6 +1072,8 @@ class Fields extends Structure
|
||||
// count the static field created
|
||||
$this->fieldCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// return the set
|
||||
return $this->xmlPrettyPrint($XML, 'fieldset');
|
||||
}
|
||||
@ -1775,7 +1829,7 @@ class Fields extends Structure
|
||||
// add to lang array
|
||||
$this->setLangContent($this->lang, $langValue, $option);
|
||||
// now add to option set
|
||||
$grouped_['option'][$option] = array('value' => $valueKeyArray[0], 'text' => $langValue);
|
||||
$grouped_['option'][$option] = array('value' => $option, 'text' => $langValue);
|
||||
$optionArray[$option] = $langValue;
|
||||
// set order
|
||||
$order_['option' . $option] = $option;
|
||||
@ -2280,7 +2334,7 @@ class Fields extends Structure
|
||||
*/
|
||||
public function buildSiteFieldData($view, $field, $set, $type)
|
||||
{
|
||||
$decode = array('json', 'base64', 'basic_encryption', 'whmcs_encryption', 'medium_encryption');
|
||||
$decode = array('json', 'base64', 'basic_encryption', 'whmcs_encryption', 'medium_encryption', 'expert_mode');
|
||||
$textareas = array('textarea', 'editor');
|
||||
if (isset($this->siteFields[$view][$field]) && ComponentbuilderHelper::checkArray($this->siteFields[$view][$field]))
|
||||
{
|
||||
@ -2303,7 +2357,7 @@ class Fields extends Structure
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']] = array('decode' => array($set), 'type' => $type);
|
||||
$this->siteFieldData['decode'][$array['site']][$code][$array['as']][$array['key']] = array('decode' => array($set), 'type' => $type, 'admin_view' => $view);
|
||||
}
|
||||
}
|
||||
// set the uikit checker
|
||||
@ -2331,7 +2385,7 @@ class Fields extends Structure
|
||||
* @param string $langLabel The language string for field label
|
||||
* @param string $langView The language string of the view
|
||||
* @param string $view_name_list The list view name
|
||||
* @param string $view_name_single The singel view name
|
||||
* @param string $view_name_single The single view name
|
||||
* @param array $placeholders The place holder and replace values
|
||||
* @param boolean $repeatable The repeatable field switch
|
||||
*
|
||||
@ -2657,7 +2711,7 @@ class Fields extends Structure
|
||||
*
|
||||
* @param string $langLabel The language string for field label
|
||||
* @param string $langView The language string of the view
|
||||
* @param string $view_name_single The singel view name
|
||||
* @param string $view_name_single The single view name
|
||||
* @param string $view_name_list The list view name
|
||||
* @param string $name The field name
|
||||
* @param array $view The view data
|
||||
@ -2760,7 +2814,7 @@ class Fields extends Structure
|
||||
}
|
||||
else
|
||||
{
|
||||
$tempName = $view_name_single . ' category';
|
||||
$tempName = $view_name_list . ' categories';
|
||||
}
|
||||
// set lang
|
||||
$listLangName = $langView . '_' . ComponentbuilderHelper::safeFieldName($tempName, true);
|
||||
@ -2948,22 +3002,41 @@ class Fields extends Structure
|
||||
break;
|
||||
case 3:
|
||||
// BASIC_ENCRYPTION_LOCALKEY
|
||||
$this->basicEncryptionBuilder[$view_name_single][] = $name;
|
||||
$this->basicFieldModeling[$view_name_single][] = $name;
|
||||
// Site settings of each field if needed
|
||||
$this->buildSiteFieldData($view_name_single, $name, 'basic_encryption', $typeName);
|
||||
break;
|
||||
case 4:
|
||||
// WHMCS_ENCRYPTION_VDMKEY
|
||||
$this->whmcsEncryptionBuilder[$view_name_single][] = $name;
|
||||
$this->whmcsFieldModeling[$view_name_single][] = $name;
|
||||
// Site settings of each field if needed
|
||||
$this->buildSiteFieldData($view_name_single, $name, 'whmcs_encryption', $typeName);
|
||||
break;
|
||||
case 5:
|
||||
// MEDIUM_ENCRYPTION_LOCALFILE
|
||||
$this->mediumEncryptionBuilder[$view_name_single][] = $name;
|
||||
$this->mediumFieldModeling[$view_name_single][] = $name;
|
||||
// Site settings of each field if needed
|
||||
$this->buildSiteFieldData($view_name_single, $name, 'medium_encryption', $typeName);
|
||||
break;
|
||||
case 6:
|
||||
// EXPERT_MODE
|
||||
if(isset($field['settings']->model_field))
|
||||
{
|
||||
if (isset($field['settings']->initiator_save_key))
|
||||
{
|
||||
$this->expertFieldModelInitiator[$view_name_single]['save'][$field['settings']->initiator_save_key]
|
||||
= $field['settings']->initiator_save;
|
||||
}
|
||||
if (isset($field['settings']->initiator_get_key))
|
||||
{
|
||||
$this->expertFieldModelInitiator[$view_name_single]['get'][$field['settings']->initiator_get_key]
|
||||
= $field['settings']->initiator_get;
|
||||
}
|
||||
$this->expertFieldModeling[$view_name_single][$name] = $field['settings']->model_field;
|
||||
// Site settings of each field if needed
|
||||
$this->buildSiteFieldData($view_name_single, $name, 'expert_mode', $typeName);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// JSON_ARRAY_ENCODE
|
||||
$this->jsonItemBuilder[$view_name_single][] = $name;
|
||||
@ -2979,8 +3052,8 @@ class Fields extends Structure
|
||||
$this->buildSiteFieldData($view_name_single, $name, 'json', $typeName);
|
||||
}
|
||||
|
||||
// load the json list display fix
|
||||
if (($listSwitch || $listJoin) && $typeName != 'repeatable' && $typeName != 'subform')
|
||||
// load the model list display fix
|
||||
if (($listSwitch || $listJoin) && (($typeName != 'repeatable' && $typeName != 'subform') || $field['settings']->store == 6))
|
||||
{
|
||||
if (ComponentbuilderHelper::checkArray($options))
|
||||
{
|
||||
@ -3073,7 +3146,7 @@ class Fields extends Structure
|
||||
// so we have name spacing in custom field type name
|
||||
$dotTypeArray = explode('.', $data['type']);
|
||||
// set the J prefix
|
||||
if (count($dotTypeArray) > 1)
|
||||
if (count((array) $dotTypeArray) > 1)
|
||||
{
|
||||
$jprefix = strtoupper(array_shift($dotTypeArray));
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -224,7 +224,6 @@ class Infusion extends Interpretation
|
||||
$this->fileContentStatic[$globalPlaceholder] = $gloabalValue;
|
||||
}
|
||||
}
|
||||
|
||||
// reset view array
|
||||
$viewarray = array();
|
||||
$site_edit_view_array = array();
|
||||
@ -313,7 +312,6 @@ class Infusion extends Interpretation
|
||||
{
|
||||
$this->fileContentDynamic[$viewName_single][$this->hhh . 'DOCUMENT_CUSTOM_PHP' . $this->hhh] = '';
|
||||
}
|
||||
|
||||
// LINKEDVIEWTABLESCRIPTS <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_single][$this->hhh . 'LINKEDVIEWTABLESCRIPTS' . $this->hhh] = '';
|
||||
|
||||
@ -475,7 +473,7 @@ class Infusion extends Interpretation
|
||||
$this->fileContentDynamic[$viewName_list][$this->hhh . 'LISTQUERY' . $this->hhh] = $this->setListQuery($viewName_single, $viewName_list);
|
||||
|
||||
// MODELEXPORTMETHOD <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_list][$this->hhh . 'MODELEXPORTMETHOD' . $this->hhh] = $this->setModelExportMethod($viewName_single, $viewName_list);
|
||||
$this->fileContentDynamic[$viewName_list][$this->hhh . 'MODELEXPORTMETHOD' . $this->hhh] = $this->setGetItemsModelMethod($viewName_single, $viewName_list);
|
||||
|
||||
// MODELEXIMPORTMETHOD <<<DYNAMIC>>>
|
||||
$this->fileContentDynamic[$viewName_list][$this->hhh . 'CONTROLLEREXIMPORTMETHOD' . $this->hhh] = $this->setControllerEximportMethod($viewName_single, $viewName_list);
|
||||
@ -606,7 +604,6 @@ class Infusion extends Interpretation
|
||||
}
|
||||
// HELPER_EXEL
|
||||
$this->fileContentStatic[$this->hhh . 'HELPER_EXEL' . $this->hhh] = $this->setExelHelperMethods();
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterBuildAdminViewContent
|
||||
$this->triggerEvent('jcb_ce_onAfterBuildAdminViewContent', array(&$this->componentContext, &$view, &$viewName_single, &$viewName_list, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
|
||||
}
|
||||
@ -1032,17 +1029,65 @@ class Infusion extends Interpretation
|
||||
$this->fileContentStatic[$this->hhh . 'README' . $this->hhh] = $this->componentData->readme;
|
||||
}
|
||||
|
||||
// infuze plugin data if set
|
||||
// tweak system to set stuff to the module domain
|
||||
$_backup_target = $this->target;
|
||||
$_backup_lang = $this->lang;
|
||||
$_backup_langPrefix = $this->langPrefix;
|
||||
// infuse module data if set
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaModules))
|
||||
{
|
||||
foreach ($this->joomlaModules as $module)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkObject($module))
|
||||
{
|
||||
$this->target = $module->key;
|
||||
$this->lang = $module->key;
|
||||
$this->langPrefix = $module->lang_prefix;
|
||||
// MODCODE
|
||||
$this->fileContentDynamic[$module->key][$this->hhh . 'MODCODE' . $this->hhh] = $this->getModCode($module);
|
||||
// DYNAMICGET
|
||||
$this->fileContentDynamic[$module->key][$this->hhh . 'DYNAMICGETS' . $this->hhh] = $this->setCustomViewCustomMethods($module, $module->key);
|
||||
// HELPERCODE
|
||||
if ($module->add_class_helper >= 1)
|
||||
{
|
||||
$this->fileContentDynamic[$module->key][$this->hhh . 'HELPERCODE' . $this->hhh] = $this->getModHelperCode($module);
|
||||
}
|
||||
// MODDEFAULT
|
||||
$this->fileContentDynamic[$module->key][$this->hhh . 'MODDEFAULT' . $this->hhh] = $this->getModDefault($module);
|
||||
// only add install script if needed
|
||||
if ($module->add_install_script)
|
||||
{
|
||||
// INSTALLCLASS
|
||||
$this->fileContentDynamic[$module->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] = $this->getExtensionInstallClass($module);
|
||||
}
|
||||
// FIELDSET
|
||||
if (isset($module->form_files) && ComponentbuilderHelper::checkArray($module->form_files))
|
||||
{
|
||||
foreach($module->form_files as $file => $files)
|
||||
{
|
||||
foreach ($files as $field_name => $fieldsets)
|
||||
{
|
||||
foreach ($fieldsets as $fieldset => $fields)
|
||||
{
|
||||
// FIELDSET_ . $file.$field_name.$fieldset
|
||||
$this->fileContentDynamic[$module->key][$this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh] =
|
||||
$this->getExtensionFieldsetXML($module, $fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// MAINXML
|
||||
$this->fileContentDynamic[$module->key][$this->hhh . 'MAINXML' . $this->hhh] = $this->getModuleMainXML($module);
|
||||
}
|
||||
}
|
||||
}
|
||||
// infuse plugin data if set
|
||||
if (ComponentbuilderHelper::checkArray($this->joomlaPlugins))
|
||||
{
|
||||
foreach ($this->joomlaPlugins as $plugin)
|
||||
{
|
||||
if (ComponentbuilderHelper::checkObject($plugin))
|
||||
{
|
||||
// tweak system to set stuff to the plugin domain
|
||||
$_backup_target = $this->target;
|
||||
$_backup_lang = $this->lang;
|
||||
$_backup_langPrefix = $this->langPrefix;
|
||||
$this->target = $plugin->key;
|
||||
$this->lang = $plugin->key;
|
||||
$this->langPrefix = $plugin->lang_prefix;
|
||||
@ -1052,7 +1097,7 @@ class Infusion extends Interpretation
|
||||
if ($plugin->add_install_script)
|
||||
{
|
||||
// INSTALLCLASS
|
||||
$this->fileContentDynamic[$plugin->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] = $this->getPluginInstallClass($plugin);
|
||||
$this->fileContentDynamic[$plugin->key][$this->hhh . 'INSTALLCLASS' . $this->hhh] = $this->getExtensionInstallClass($plugin);
|
||||
}
|
||||
// FIELDSET
|
||||
if (isset($plugin->form_files) && ComponentbuilderHelper::checkArray($plugin->form_files))
|
||||
@ -1065,20 +1110,20 @@ class Infusion extends Interpretation
|
||||
{
|
||||
// FIELDSET_ . $file.$field_name.$fieldset
|
||||
$this->fileContentDynamic[$plugin->key][$this->hhh . 'FIELDSET_' . $file.$field_name.$fieldset . $this->hhh] =
|
||||
$this->getPluginFieldsetXML($plugin, $fields);
|
||||
$this->getExtensionFieldsetXML($plugin, $fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// MAINXML
|
||||
$this->fileContentDynamic[$plugin->key][$this->hhh . 'MAINXML' . $this->hhh] = $this->getPluginMainXML($plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
// rest globals
|
||||
$this->target = $_backup_target;
|
||||
$this->lang = $_backup_lang;
|
||||
$this->langPrefix = $_backup_langPrefix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger Event: jcb_ce_onAfterBuildFilesContent
|
||||
$this->triggerEvent('jcb_ce_onAfterBuildFilesContent', array(&$this->componentContext, &$this->componentData, &$this->fileContentStatic, &$this->fileContentDynamic, &$this->placeholders, &$this->hhh));
|
||||
@ -1172,6 +1217,7 @@ class Infusion extends Interpretation
|
||||
*/
|
||||
public function setLangFileData()
|
||||
{
|
||||
// reset values
|
||||
$values = array();
|
||||
$mainLangLoader = array();
|
||||
// check the admin lang is set
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -311,6 +311,26 @@ COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_STATE="Components Files Fold
|
||||
COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component files folders"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION="Components Files Folders Edit Version"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components files folders"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_ACCESS="Components Modules Access"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_ACCESS_DESC="Allows the users in this group to access access components modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_BATCH_USE="Components Modules Batch Use"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_CREATE="Components Modules Create"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_CREATE_DESC="Allows the users in this group to create create components modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_DELETE="Components Modules Delete"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_DELETE_DESC="Allows the users in this group to delete delete components modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT="Components Modules Edit"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_BY="Components Modules Edit Created By"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_DATE="Components Modules Edit Created Date"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_DESC="Allows the users in this group to edit the component modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_OWN="Components Modules Edit Own"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_OWN_DESC="Allows the users in this group to edit edit own components modules created by them"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_STATE="Components Modules Edit State"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_STATE_DESC="Allows the users in this group to update the state of the component modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_VERSION="Components Modules Edit Version"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MODULES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components modules"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_ACCESS="Components Mysql Tweaks Access"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_ACCESS_DESC="Allows the users in this group to access access components mysql tweaks"
|
||||
COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_BATCH_USE="Components Mysql Tweaks Batch Use"
|
||||
@ -638,6 +658,74 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_JCB_PACKAGES_BUTTON_ACCESS="Joomla
|
||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMPORT_JCB_PACKAGES_BUTTON_ACCESS_DESC="Allows the users in this group to access the import jcb packages button."
|
||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_RUN_EXPANSION_BUTTON_ACCESS="Joomla Component Run Expansion Button Access"
|
||||
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button."
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS="Joomla Modules Access"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_ACCESS_DESC="Allows the users in this group to access access joomla modules"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_BATCH_USE="Joomla Modules Batch Use"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla modules"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_CREATE="Joomla Modules Create"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_CREATE_DESC="Allows the users in this group to create create joomla modules"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_DASHBOARD_LIST="Joomla Modules Dashboard List"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of joomla module"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_DELETE="Joomla Modules Delete"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_DELETE_DESC="Allows the users in this group to delete delete joomla modules"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT="Joomla Modules Edit"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_BY="Joomla Modules Edit Created By"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by joomla modules"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_DATE="Joomla Modules Edit Created Date"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created joomla modules"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_DESC="Allows the users in this group to edit the joomla module"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_OWN="Joomla Modules Edit Own"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_OWN_DESC="Allows the users in this group to edit edit own joomla modules created by them"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_STATE="Joomla Modules Edit State"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla module"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_VERSION="Joomla Modules Edit Version"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla modules"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_ACCESS="Joomla Modules Files Folders Urls Access"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_ACCESS_DESC="Allows the users in this group to access access joomla modules files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_BATCH_USE="Joomla Modules Files Folders Urls Batch Use"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla modules files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_CREATE="Joomla Modules Files Folders Urls Create"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_CREATE_DESC="Allows the users in this group to create create joomla modules files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_DELETE="Joomla Modules Files Folders Urls Delete"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_DELETE_DESC="Allows the users in this group to delete delete joomla modules files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT="Joomla Modules Files Folders Urls Edit"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_BY="Joomla Modules Files Folders Urls Edit Created By"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by joomla modules files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE="Joomla Modules Files Folders Urls Edit Created Date"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created joomla modules files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_DESC="Allows the users in this group to edit the joomla module files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_OWN="Joomla Modules Files Folders Urls Edit Own"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_OWN_DESC="Allows the users in this group to edit edit own joomla modules files folders urls created by them"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_STATE="Joomla Modules Files Folders Urls Edit State"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla module files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_VERSION="Joomla Modules Files Folders Urls Edit Version"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_FILES_FOLDERS_URLS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla modules files folders urls"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_SUBMENU="Joomla Modules Submenu"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_SUBMENU_DESC="Allows the users in this group to submenu of joomla module"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_ACCESS="Joomla Modules Updates Access"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_ACCESS_DESC="Allows the users in this group to access access joomla modules updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_BATCH_USE="Joomla Modules Updates Batch Use"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch joomla modules updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_CREATE="Joomla Modules Updates Create"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_CREATE_DESC="Allows the users in this group to create create joomla modules updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_DELETE="Joomla Modules Updates Delete"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_DELETE_DESC="Allows the users in this group to delete delete joomla modules updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT="Joomla Modules Updates Edit"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_BY="Joomla Modules Updates Edit Created By"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by joomla modules updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_DATE="Joomla Modules Updates Edit Created Date"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created joomla modules updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_DESC="Allows the users in this group to edit the joomla module updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_OWN="Joomla Modules Updates Edit Own"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_OWN_DESC="Allows the users in this group to edit edit own joomla modules updates created by them"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_STATE="Joomla Modules Updates Edit State"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_STATE_DESC="Allows the users in this group to update the state of the joomla module updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_VERSION="Joomla Modules Updates Edit Version"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version joomla modules updates"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULE_GET_SNIPPETS_BUTTON_ACCESS="Joomla Module Get Snippets Button Access"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULE_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button."
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULE_RUN_EXPANSION_BUTTON_ACCESS="Joomla Module Run Expansion Button Access"
|
||||
COM_COMPONENTBUILDER_JOOMLA_MODULE_RUN_EXPANSION_BUTTON_ACCESS_DESC="Allows the users in this group to access the run expansion button."
|
||||
COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS="Joomla Plugins Access"
|
||||
COM_COMPONENTBUILDER_JOOMLA_PLUGINS_ACCESS_DESC="Allows the users in this group to access access joomla plugins"
|
||||
COM_COMPONENTBUILDER_JOOMLA_PLUGINS_BATCH_USE="Joomla Plugins Batch Use"
|
||||
@ -770,8 +858,6 @@ COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE="Layouts Batch Use"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch layouts"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_CREATE="Layouts Create"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_CREATE_DESC="Allows the users in this group to create create layouts"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD="Layouts Dashboard Add"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_ADD_DESC="Allows the users in this group to dashboard add of layout"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_LIST="Layouts Dashboard List"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_DASHBOARD_LIST_DESC="Allows the users in this group to dashboard list of layout"
|
||||
COM_COMPONENTBUILDER_LAYOUTS_DELETE="Layouts Delete"
|
||||
@ -864,6 +950,7 @@ COM_COMPONENTBUILDER_MENU_FIELDS="Fields"
|
||||
COM_COMPONENTBUILDER_MENU_FIELDTYPES="Fieldtypes"
|
||||
COM_COMPONENTBUILDER_MENU_HELP_DOCUMENTS="Help Documents"
|
||||
COM_COMPONENTBUILDER_MENU_JOOMLA_COMPONENTS="Joomla Components"
|
||||
COM_COMPONENTBUILDER_MENU_JOOMLA_MODULES="Joomla Modules"
|
||||
COM_COMPONENTBUILDER_MENU_JOOMLA_PLUGINS="Joomla Plugins"
|
||||
COM_COMPONENTBUILDER_MENU_LANGUAGE_TRANSLATIONS="Language Translations"
|
||||
COM_COMPONENTBUILDER_MENU_LAYOUTS="Layouts"
|
||||
|
44
admin/layouts/component_modules/modules_above.php
Normal file
44
admin/layouts/component_modules/modules_above.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'joomla_component'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
45
admin/layouts/component_modules/modules_fullwidth.php
Normal file
45
admin/layouts/component_modules/modules_fullwidth.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'note_on_joomla_modules',
|
||||
'addjoomla_modules'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
45
admin/layouts/component_modules/publishing.php
Normal file
45
admin/layouts/component_modules/publishing.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
47
admin/layouts/component_modules/publlshing.php
Normal file
47
admin/layouts/component_modules/publlshing.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
@ -29,7 +29,12 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'indexes',
|
||||
'null_switch',
|
||||
'store',
|
||||
'note_whmcs_encryption'
|
||||
'note_whmcs_encryption',
|
||||
'note_expert_field_save_mode',
|
||||
'initiator_on_save_model',
|
||||
'initiator_on_get_model',
|
||||
'on_save_model_field',
|
||||
'on_get_model_field'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
@ -13,7 +13,7 @@
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// set the defaults
|
||||
$items = $displayData->vxwfields;
|
||||
$items = $displayData->vymfields;
|
||||
$user = JFactory::getUser();
|
||||
$id = $displayData->item->id;
|
||||
// set the edit URL
|
||||
@ -74,7 +74,7 @@ $can = ComponentbuilderHelper::getActions('field');
|
||||
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'); ?>
|
||||
</th>
|
||||
<th data-breakpoints="all" data-type="html" data-sort-use="text">
|
||||
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD_FIELD_CATEGORY'); ?>
|
||||
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'); ?>
|
||||
</th>
|
||||
<th width="10" data-breakpoints="xs sm md">
|
||||
<?php echo JText::_('COM_COMPONENTBUILDER_FIELD_STATUS'); ?>
|
||||
|
44
admin/layouts/joomla_module/code_fullwidth.php
Normal file
44
admin/layouts/joomla_module/code_fullwidth.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'mod_code'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
42
admin/layouts/joomla_module/code_left.php
Normal file
42
admin/layouts/joomla_module/code_left.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'custom_get'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
42
admin/layouts/joomla_module/code_right.php
Normal file
42
admin/layouts/joomla_module/code_right.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'note_mod_file_options'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
50
admin/layouts/joomla_module/dynamic_integration_left.php
Normal file
50
admin/layouts/joomla_module/dynamic_integration_left.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'add_update_server',
|
||||
'update_server_url',
|
||||
'update_server_target',
|
||||
'note_update_server_note_ftp',
|
||||
'note_update_server_note_zip',
|
||||
'note_update_server_note_other',
|
||||
'update_server',
|
||||
'add_sales_server',
|
||||
'sales_server'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
44
admin/layouts/joomla_module/forms_fields_fullwidth.php
Normal file
44
admin/layouts/joomla_module/forms_fields_fullwidth.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'fields'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
45
admin/layouts/joomla_module/helper_fullwidth.php
Normal file
45
admin/layouts/joomla_module/helper_fullwidth.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'class_helper_header',
|
||||
'class_helper_code'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
42
admin/layouts/joomla_module/helper_left.php
Normal file
42
admin/layouts/joomla_module/helper_left.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'add_class_helper'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
42
admin/layouts/joomla_module/helper_right.php
Normal file
42
admin/layouts/joomla_module/helper_right.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'add_class_helper_header'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
45
admin/layouts/joomla_module/html_above.php
Normal file
45
admin/layouts/joomla_module/html_above.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'system_name',
|
||||
'module_version'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
46
admin/layouts/joomla_module/html_fullwidth.php
Normal file
46
admin/layouts/joomla_module/html_fullwidth.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'default',
|
||||
'note_linked_to_notice',
|
||||
'not_required'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
46
admin/layouts/joomla_module/html_left.php
Normal file
46
admin/layouts/joomla_module/html_left.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'name',
|
||||
'description',
|
||||
'libraries',
|
||||
'note_libraries_options',
|
||||
'note_add_language_string'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
44
admin/layouts/joomla_module/html_right.php
Normal file
44
admin/layouts/joomla_module/html_right.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'snippet',
|
||||
'note_uikit_snippet',
|
||||
'note_snippet_usage'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
47
admin/layouts/joomla_module/mysql_fullwidth.php
Normal file
47
admin/layouts/joomla_module/mysql_fullwidth.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'add_sql',
|
||||
'sql',
|
||||
'add_sql_uninstall',
|
||||
'sql_uninstall'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
45
admin/layouts/joomla_module/publishing.php
Normal file
45
admin/layouts/joomla_module/publishing.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
47
admin/layouts/joomla_module/publlshing.php
Normal file
47
admin/layouts/joomla_module/publlshing.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
43
admin/layouts/joomla_module/readme_left.php
Normal file
43
admin/layouts/joomla_module/readme_left.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'addreadme',
|
||||
'readme'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
57
admin/layouts/joomla_module/script_file_fullwidth.php
Normal file
57
admin/layouts/joomla_module/script_file_fullwidth.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'add_php_script_construct',
|
||||
'php_script_construct',
|
||||
'add_php_preflight_install',
|
||||
'php_preflight_install',
|
||||
'add_php_preflight_update',
|
||||
'php_preflight_update',
|
||||
'add_php_preflight_uninstall',
|
||||
'php_preflight_uninstall',
|
||||
'add_php_postflight_install',
|
||||
'php_postflight_install',
|
||||
'add_php_postflight_update',
|
||||
'php_postflight_update',
|
||||
'add_php_method_uninstall',
|
||||
'php_method_uninstall'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'note_add_files_fullpath',
|
||||
'addfilesfullpath',
|
||||
'note_add_folders_fullpath',
|
||||
'addfoldersfullpath',
|
||||
'note_constant_paths'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'joomla_module'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'note_add_urls',
|
||||
'addurls',
|
||||
'note_add_files',
|
||||
'addfiles',
|
||||
'note_add_folders',
|
||||
'addfolders'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
1
admin/layouts/joomla_module_updates/index.html
Normal file
1
admin/layouts/joomla_module_updates/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
45
admin/layouts/joomla_module_updates/publishing.php
Normal file
45
admin/layouts/joomla_module_updates/publishing.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'created',
|
||||
'created_by',
|
||||
'modified',
|
||||
'modified_by'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
47
admin/layouts/joomla_module_updates/publlshing.php
Normal file
47
admin/layouts/joomla_module_updates/publlshing.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'published',
|
||||
'ordering',
|
||||
'access',
|
||||
'version',
|
||||
'hits',
|
||||
'id'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
44
admin/layouts/joomla_module_updates/updates_above.php
Normal file
44
admin/layouts/joomla_module_updates/updates_above.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'joomla_module'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-inline form-inline-header">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
44
admin/layouts/joomla_module_updates/updates_fullwidth.php
Normal file
44
admin/layouts/joomla_module_updates/updates_fullwidth.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// get the form
|
||||
$form = $displayData->getForm();
|
||||
|
||||
// get the layout fields override method name (from layout path/ID)
|
||||
$layout_path_array = explode('.', $this->getLayoutId());
|
||||
// Since we cannot pass the layout and tab names as parameters to the model method
|
||||
// this name combination of tab and layout in the method name is the only work around
|
||||
// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name.
|
||||
// example of layout name: details_left.php
|
||||
// example of method name: getFields_details_left()
|
||||
$fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'version_update'
|
||||
);
|
||||
|
||||
$hiddenFields = $displayData->get('hidden_fields') ?: array();
|
||||
|
||||
?>
|
||||
<?php if ($fields && count((array) $fields)) :?>
|
||||
<div class="form-vertical">
|
||||
<?php foreach($fields as $field): ?>
|
||||
<?php if (in_array($field, $hiddenFields)) : ?>
|
||||
<?php $form->setFieldAttribute($field, 'type', 'hidden'); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo $form->renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
@ -27,6 +27,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
|
||||
// get the fields
|
||||
$fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'name',
|
||||
'target',
|
||||
'how',
|
||||
'type'
|
||||
);
|
||||
|
@ -29,6 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array(
|
||||
'note_no_behaviour_one',
|
||||
'note_yes_behaviour_one',
|
||||
'note_build_in_behaviour_one',
|
||||
'note_yes_behaviour_library',
|
||||
'addconditions',
|
||||
'php_setdocument'
|
||||
);
|
||||
|
@ -13,7 +13,7 @@
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// set the defaults
|
||||
$items = $displayData->vyglinked_components;
|
||||
$items = $displayData->vywlinked_components;
|
||||
$user = JFactory::getUser();
|
||||
$id = $displayData->item->id;
|
||||
// set the edit URL
|
||||
@ -84,6 +84,11 @@ else
|
||||
- <?php echo $this->escape($item->component_version); ?>
|
||||
</div>
|
||||
<?php
|
||||
// always make sure the $this->return_here is set
|
||||
if (!isset($this->return_here))
|
||||
{
|
||||
$this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
|
||||
}
|
||||
// setup the buttons
|
||||
if (!isset($_buttons) || !ComponentbuilderHelper::checkArray($_buttons))
|
||||
{
|
||||
@ -143,6 +148,11 @@ else
|
||||
'views' => 'components_dashboard',
|
||||
'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'),
|
||||
'icon' => 'dashboard'),
|
||||
array(
|
||||
'view' => 'component_modules',
|
||||
'views' => 'components_modules',
|
||||
'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'),
|
||||
'icon' => 'cube'),
|
||||
array(
|
||||
'view' => 'component_plugins',
|
||||
'views' => 'components_plugins',
|
||||
|
@ -130,8 +130,23 @@ class ComponentbuilderModelAdmin_custom_tabs extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.admin_custom_tabs', 'admin_custom_tabs', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.admin_custom_tabs', 'admin_custom_tabs', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -151,8 +151,23 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.admin_fields', 'admin_fields', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.admin_fields', 'admin_fields', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -151,8 +151,23 @@ class ComponentbuilderModelAdmin_fields_conditions extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.admin_fields_conditions', 'admin_fields_conditions', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.admin_fields_conditions', 'admin_fields_conditions', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -69,11 +69,55 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get VDM internal session key
|
||||
*
|
||||
* @return string the session key
|
||||
*
|
||||
*/
|
||||
public function getVDM()
|
||||
{
|
||||
if (!isset($this->vastDevMod))
|
||||
{
|
||||
$_id = 0; // new item probably (since it was not set in the getItem method)
|
||||
|
||||
if (empty($_id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $_id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('admin_fields_relations__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'admin_fields_relations__'.$id);
|
||||
ComponentbuilderHelper::set('admin_fields_relations__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
*
|
||||
@ -135,6 +179,13 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
@ -162,8 +213,23 @@ class ComponentbuilderModelAdmin_fields_relations extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.admin_fields_relations', 'admin_fields_relations', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.admin_fields_relations', 'admin_fields_relations', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -215,14 +215,51 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get VDM session key
|
||||
* get VDM internal session key
|
||||
*
|
||||
* @return string the session key
|
||||
*
|
||||
*/
|
||||
public function getVDM()
|
||||
{
|
||||
if (!isset($this->vastDevMod))
|
||||
{
|
||||
$_id = 0; // new item probably (since it was not set in the getItem method)
|
||||
|
||||
if (empty($_id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $_id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('admin_view__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'admin_view__'.$id);
|
||||
ComponentbuilderHelper::set('admin_view__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
@ -540,6 +577,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$item->ajax_input = $ajax_input->toArray();
|
||||
}
|
||||
|
||||
|
||||
if (empty($item->id))
|
||||
{
|
||||
$id = 0;
|
||||
@ -563,8 +601,14 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
|
||||
// update the fields
|
||||
$objectUpdate = new stdClass();
|
||||
$objectUpdate->id = (int) $item->id;
|
||||
@ -643,8 +687,23 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.admin_view', 'admin_view', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.admin_view', 'admin_view', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -114,12 +114,18 @@ class ComponentbuilderModelAdmin_views extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -326,17 +332,23 @@ class ComponentbuilderModelAdmin_views extends JModelList
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @param array $pks The ids of the items to get
|
||||
* @param JUser $user The user making the request
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
public function getExportData($pks, $user = null)
|
||||
{
|
||||
// setup the query
|
||||
if (ComponentbuilderHelper::checkArray($pks))
|
||||
{
|
||||
// Set a value to know this is exporting method.
|
||||
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
|
||||
$_export = true;
|
||||
// Get the user object.
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
// Create a new query object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
@ -364,12 +376,13 @@ class ComponentbuilderModelAdmin_views extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && JFactory::getUser()->authorise('admin_view.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('admin_view.access', 'com_componentbuilder.admin_view.' . (int) $item->id) && $user->authorise('admin_view.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
@ -84,12 +84,18 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('admin_custom_tabs.access', 'com_componentbuilder.admin_custom_tabs.' . (int) $item->id) && JFactory::getUser()->authorise('admin_custom_tabs.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('admin_custom_tabs.access', 'com_componentbuilder.admin_custom_tabs.' . (int) $item->id) && $user->authorise('admin_custom_tabs.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
@ -84,12 +84,18 @@ class ComponentbuilderModelAdmins_fields extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('admin_fields.access', 'com_componentbuilder.admin_fields.' . (int) $item->id) && $user->authorise('admin_fields.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
@ -84,12 +84,18 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('admin_fields_conditions.access', 'com_componentbuilder.admin_fields_conditions.' . (int) $item->id) && $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
@ -84,12 +84,18 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && JFactory::getUser()->authorise('admin_fields_relations.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('admin_fields_relations.access', 'com_componentbuilder.admin_fields_relations.' . (int) $item->id) && $user->authorise('admin_fields_relations.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -90,12 +90,18 @@ class ComponentbuilderModelClass_extendings extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $item->id) && JFactory::getUser()->authorise('class_extends.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('class_extends.access', 'com_componentbuilder.class_extends.' . (int) $item->id) && $user->authorise('class_extends.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
@ -72,14 +72,51 @@ class ComponentbuilderModelClass_extends extends JModelAdmin
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get VDM session key
|
||||
* get VDM internal session key
|
||||
*
|
||||
* @return string the session key
|
||||
*
|
||||
*/
|
||||
public function getVDM()
|
||||
{
|
||||
if (!isset($this->vastDevMod))
|
||||
{
|
||||
$_id = 0; // new item probably (since it was not set in the getItem method)
|
||||
|
||||
if (empty($_id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $_id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('class_extends__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'class_extends__'.$id);
|
||||
ComponentbuilderHelper::set('class_extends__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
@ -149,6 +186,13 @@ class ComponentbuilderModelClass_extends extends JModelAdmin
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
@ -176,8 +220,23 @@ class ComponentbuilderModelClass_extends extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.class_extends', 'class_extends', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.class_extends', 'class_extends', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -75,14 +75,51 @@ class ComponentbuilderModelClass_method extends JModelAdmin
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get VDM session key
|
||||
* get VDM internal session key
|
||||
*
|
||||
* @return string the session key
|
||||
*
|
||||
*/
|
||||
public function getVDM()
|
||||
{
|
||||
if (!isset($this->vastDevMod))
|
||||
{
|
||||
$_id = 0; // new item probably (since it was not set in the getItem method)
|
||||
|
||||
if (empty($_id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $_id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('class_method__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'class_method__'.$id);
|
||||
ComponentbuilderHelper::set('class_method__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
@ -158,6 +195,13 @@ class ComponentbuilderModelClass_method extends JModelAdmin
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
@ -185,8 +229,23 @@ class ComponentbuilderModelClass_method extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.class_method', 'class_method', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.class_method', 'class_method', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -94,12 +94,18 @@ class ComponentbuilderModelClass_methods extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && $user->authorise('class_method.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -253,17 +259,23 @@ class ComponentbuilderModelClass_methods extends JModelList
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @param array $pks The ids of the items to get
|
||||
* @param JUser $user The user making the request
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
public function getExportData($pks, $user = null)
|
||||
{
|
||||
// setup the query
|
||||
if (ComponentbuilderHelper::checkArray($pks))
|
||||
{
|
||||
// Set a value to know this is exporting method.
|
||||
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
|
||||
$_export = true;
|
||||
// Get the user object.
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
// Create a new query object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
@ -291,12 +303,13 @@ class ComponentbuilderModelClass_methods extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && JFactory::getUser()->authorise('class_method.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('class_method.access', 'com_componentbuilder.class_method.' . (int) $item->id) && $user->authorise('class_method.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
@ -94,12 +94,18 @@ class ComponentbuilderModelClass_properties extends JModelList
|
||||
// load parent items
|
||||
$items = parent::getItems();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && $user->authorise('class_property.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
@ -253,17 +259,23 @@ class ComponentbuilderModelClass_properties extends JModelList
|
||||
/**
|
||||
* Method to get list export data.
|
||||
*
|
||||
* @param array $pks The ids of the items to get
|
||||
* @param JUser $user The user making the request
|
||||
*
|
||||
* @return mixed An array of data items on success, false on failure.
|
||||
*/
|
||||
public function getExportData($pks)
|
||||
public function getExportData($pks, $user = null)
|
||||
{
|
||||
// setup the query
|
||||
if (ComponentbuilderHelper::checkArray($pks))
|
||||
{
|
||||
// Set a value to know this is exporting method.
|
||||
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
|
||||
$_export = true;
|
||||
// Get the user object.
|
||||
// Get the user object if not set.
|
||||
if (!isset($user) || !ComponentbuilderHelper::checkObject($user))
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
}
|
||||
// Create a new query object.
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
@ -291,12 +303,13 @@ class ComponentbuilderModelClass_properties extends JModelList
|
||||
{
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
// set values to display correctly.
|
||||
// Set values to display correctly.
|
||||
if (ComponentbuilderHelper::checkArray($items))
|
||||
{
|
||||
foreach ($items as $nr => &$item)
|
||||
{
|
||||
$access = (JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && JFactory::getUser()->authorise('class_property.access', 'com_componentbuilder'));
|
||||
// Remove items the user can't access.
|
||||
$access = ($user->authorise('class_property.access', 'com_componentbuilder.class_property.' . (int) $item->id) && $user->authorise('class_property.access', 'com_componentbuilder'));
|
||||
if (!$access)
|
||||
{
|
||||
unset($items[$nr]);
|
||||
|
@ -72,14 +72,51 @@ class ComponentbuilderModelClass_property extends JModelAdmin
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get VDM session key
|
||||
* get VDM internal session key
|
||||
*
|
||||
* @return string the session key
|
||||
*
|
||||
*/
|
||||
public function getVDM()
|
||||
{
|
||||
if (!isset($this->vastDevMod))
|
||||
{
|
||||
$_id = 0; // new item probably (since it was not set in the getItem method)
|
||||
|
||||
if (empty($_id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $_id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('class_property__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'class_property__'.$id);
|
||||
ComponentbuilderHelper::set('class_property__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
@ -149,6 +186,13 @@ class ComponentbuilderModelClass_property extends JModelAdmin
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
@ -176,8 +220,23 @@ class ComponentbuilderModelClass_property extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.class_property', 'class_property', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.class_property', 'class_property', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -162,8 +162,23 @@ class ComponentbuilderModelComponent_admin_views extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.component_admin_views', 'component_admin_views', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.component_admin_views', 'component_admin_views', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -161,8 +161,23 @@ class ComponentbuilderModelComponent_config extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.component_config', 'component_config', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.component_config', 'component_config', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -161,8 +161,23 @@ class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.component_custom_admin_menus', 'component_custom_admin_menus', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.component_custom_admin_menus', 'component_custom_admin_menus', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -162,8 +162,23 @@ class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.component_custom_admin_views', 'component_custom_admin_views', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.component_custom_admin_views', 'component_custom_admin_views', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -70,11 +70,55 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get VDM internal session key
|
||||
*
|
||||
* @return string the session key
|
||||
*
|
||||
*/
|
||||
public function getVDM()
|
||||
{
|
||||
if (!isset($this->vastDevMod))
|
||||
{
|
||||
$_id = 0; // new item probably (since it was not set in the getItem method)
|
||||
|
||||
if (empty($_id))
|
||||
{
|
||||
$id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$id = $_id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('component_dashboard__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'component_dashboard__'.$id);
|
||||
ComponentbuilderHelper::set('component_dashboard__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $this->vastDevMod;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
*
|
||||
@ -128,7 +172,7 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
|
||||
$id = $item->id;
|
||||
}
|
||||
// set the id and view name to session
|
||||
if ($vdm = ComponentbuilderHelper::get('components_dashboard__'.$id))
|
||||
if ($vdm = ComponentbuilderHelper::get('component_dashboard__'.$id))
|
||||
{
|
||||
$this->vastDevMod = $vdm;
|
||||
}
|
||||
@ -136,12 +180,19 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
|
||||
{
|
||||
// set the vast development method key
|
||||
$this->vastDevMod = ComponentbuilderHelper::randomkey(50);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'components_dashboard__'.$id);
|
||||
ComponentbuilderHelper::set('components_dashboard__'.$id, $this->vastDevMod);
|
||||
ComponentbuilderHelper::set($this->vastDevMod, 'component_dashboard__'.$id);
|
||||
ComponentbuilderHelper::set('component_dashboard__'.$id, $this->vastDevMod);
|
||||
// set a return value if found
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$return = $jinput->get('return', null, 'base64');
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__return', $return);
|
||||
// set a GUID value if found
|
||||
if (isset($item) && ComponentbuilderHelper::checkObject($item) && isset($item->guid)
|
||||
&& method_exists('ComponentbuilderHelper', 'validGUID')
|
||||
&& ComponentbuilderHelper::validGUID($item->guid))
|
||||
{
|
||||
ComponentbuilderHelper::set($this->vastDevMod . '__guid', $item->guid);
|
||||
}
|
||||
}
|
||||
// update the fields
|
||||
$objectUpdate = new stdClass();
|
||||
@ -199,8 +250,23 @@ class ComponentbuilderModelComponent_dashboard extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.component_dashboard', 'component_dashboard', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.component_dashboard', 'component_dashboard', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
@ -198,8 +198,23 @@ class ComponentbuilderModelComponent_files_folders extends JModelAdmin
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.component_files_folders', 'component_files_folders', $options);
|
||||
$form = $this->loadForm('com_componentbuilder.component_files_folders', 'component_files_folders', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
|
898
admin/models/component_modules.php
Normal file
898
admin/models/component_modules.php
Normal file
@ -0,0 +1,898 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
||||
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
||||
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
// No direct access to this file
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\Registry\Registry;
|
||||
|
||||
/**
|
||||
* Componentbuilder Component_modules Model
|
||||
*/
|
||||
class ComponentbuilderModelComponent_modules extends JModelAdmin
|
||||
{
|
||||
/**
|
||||
* The tab layout fields array.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tabLayoutFields = array(
|
||||
'modules' => array(
|
||||
'fullwidth' => array(
|
||||
'note_on_joomla_modules',
|
||||
'addjoomla_modules'
|
||||
),
|
||||
'above' => array(
|
||||
'joomla_component'
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_COMPONENTBUILDER';
|
||||
|
||||
/**
|
||||
* The type alias for this content type.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.2
|
||||
*/
|
||||
public $typeAlias = 'com_componentbuilder.component_modules';
|
||||
|
||||
/**
|
||||
* Returns a Table object, always creating it
|
||||
*
|
||||
* @param type $type The table type to instantiate
|
||||
* @param string $prefix A prefix for the table class name. Optional.
|
||||
* @param array $config Configuration array for model. Optional.
|
||||
*
|
||||
* @return JTable A database object
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getTable($type = 'component_modules', $prefix = 'ComponentbuilderTable', $config = array())
|
||||
{
|
||||
// add table path for when model gets used from other component
|
||||
$this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/tables');
|
||||
// get instance of the table
|
||||
return JTable::getInstance($type, $prefix, $config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get a single record.
|
||||
*
|
||||
* @param integer $pk The id of the primary key.
|
||||
*
|
||||
* @return mixed Object on success, false on failure.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getItem($pk = null)
|
||||
{
|
||||
if ($item = parent::getItem($pk))
|
||||
{
|
||||
if (!empty($item->params) && !is_array($item->params))
|
||||
{
|
||||
// Convert the params field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->params);
|
||||
$item->params = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->metadata))
|
||||
{
|
||||
// Convert the metadata field to an array.
|
||||
$registry = new Registry;
|
||||
$registry->loadString($item->metadata);
|
||||
$item->metadata = $registry->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->addjoomla_modules))
|
||||
{
|
||||
// Convert the addjoomla_modules field to an array.
|
||||
$addjoomla_modules = new Registry;
|
||||
$addjoomla_modules->loadString($item->addjoomla_modules);
|
||||
$item->addjoomla_modules = $addjoomla_modules->toArray();
|
||||
}
|
||||
|
||||
if (!empty($item->id))
|
||||
{
|
||||
$item->tags = new JHelperTags;
|
||||
$item->tags->getTagIds($item->id, 'com_componentbuilder.component_modules');
|
||||
}
|
||||
}
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data Data for the form.
|
||||
* @param boolean $loadData True if the form is to load its own data (default case), false if not.
|
||||
* @param array $options Optional array of options for the form creation.
|
||||
*
|
||||
* @return mixed A JForm object on success, false on failure
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform'))
|
||||
{
|
||||
// set load data option
|
||||
$options['load_data'] = $loadData;
|
||||
// // check if xpath was set in options
|
||||
$xpath = false;
|
||||
if (isset($options['xpath']))
|
||||
{
|
||||
$xpath = $options['xpath'];
|
||||
unset($options['xpath']);
|
||||
}
|
||||
// // check if clear form was set in options
|
||||
$clear = false;
|
||||
if (isset($options['clear']))
|
||||
{
|
||||
$clear = $options['clear'];
|
||||
unset($options['clear']);
|
||||
}
|
||||
|
||||
// Get the form.
|
||||
$form = $this->loadForm('com_componentbuilder.component_modules', 'component_modules', $options, $clear, $xpath);
|
||||
|
||||
if (empty($form))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
|
||||
// The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
|
||||
if ($jinput->get('a_id'))
|
||||
{
|
||||
$id = $jinput->get('a_id', 0, 'INT');
|
||||
}
|
||||
// The back end uses id so we use that the rest of the time and set it to 0 by default.
|
||||
else
|
||||
{
|
||||
$id = $jinput->get('id', 0, 'INT');
|
||||
}
|
||||
|
||||
$user = JFactory::getUser();
|
||||
|
||||
// Check for existing item.
|
||||
// Modify the form based on Edit State access controls.
|
||||
if ($id != 0 && (!$user->authorise('component_modules.edit.state', 'com_componentbuilder.component_modules.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('component_modules.edit.state', 'com_componentbuilder')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('ordering', 'disabled', 'true');
|
||||
$form->setFieldAttribute('published', 'disabled', 'true');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('ordering', 'filter', 'unset');
|
||||
$form->setFieldAttribute('published', 'filter', 'unset');
|
||||
}
|
||||
// If this is a new item insure the greated by is set.
|
||||
if (0 == $id)
|
||||
{
|
||||
// Set the created_by to this user
|
||||
$form->setValue('created_by', null, $user->id);
|
||||
}
|
||||
// Modify the form based on Edit Creaded By access controls.
|
||||
if ($id != 0 && (!$user->authorise('component_modules.edit.created_by', 'com_componentbuilder.component_modules.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('component_modules.edit.created_by', 'com_componentbuilder')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('created_by', 'disabled', 'true');
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('created_by', 'readonly', 'true');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('created_by', 'filter', 'unset');
|
||||
}
|
||||
// Modify the form based on Edit Creaded Date access controls.
|
||||
if ($id != 0 && (!$user->authorise('component_modules.edit.created', 'com_componentbuilder.component_modules.' . (int) $id))
|
||||
|| ($id == 0 && !$user->authorise('component_modules.edit.created', 'com_componentbuilder')))
|
||||
{
|
||||
// Disable fields for display.
|
||||
$form->setFieldAttribute('created', 'disabled', 'true');
|
||||
// Disable fields while saving.
|
||||
$form->setFieldAttribute('created', 'filter', 'unset');
|
||||
}
|
||||
// Only load these values if no id is found
|
||||
if (0 == $id)
|
||||
{
|
||||
// Set redirected view name
|
||||
$redirectedView = $jinput->get('ref', null, 'STRING');
|
||||
// Set field name (or fall back to view name)
|
||||
$redirectedField = $jinput->get('field', $redirectedView, 'STRING');
|
||||
// Set redirected view id
|
||||
$redirectedId = $jinput->get('refid', 0, 'INT');
|
||||
// Set field id (or fall back to redirected view id)
|
||||
$redirectedValue = $jinput->get('field_id', $redirectedId, 'INT');
|
||||
if (0 != $redirectedValue && $redirectedField)
|
||||
{
|
||||
// Now set the local-redirected field default value
|
||||
$form->setValue($redirectedField, null, $redirectedValue);
|
||||
}
|
||||
}
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the form
|
||||
*
|
||||
* @return string script files
|
||||
*/
|
||||
public function getScript()
|
||||
{
|
||||
return 'administrator/components/com_componentbuilder/models/forms/component_modules.js';
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can be deleted.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canDelete($record)
|
||||
{
|
||||
if (!empty($record->id))
|
||||
{
|
||||
if ($record->published != -2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$user = JFactory::getUser();
|
||||
// The record has been set. Check the record permissions.
|
||||
return $user->authorise('component_modules.delete', 'com_componentbuilder.component_modules.' . (int) $record->id);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to test whether a record can have its state edited.
|
||||
*
|
||||
* @param object $record A record object.
|
||||
*
|
||||
* @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function canEditState($record)
|
||||
{
|
||||
$user = JFactory::getUser();
|
||||
$recordId = (!empty($record->id)) ? $record->id : 0;
|
||||
|
||||
if ($recordId)
|
||||
{
|
||||
// The record has been set. Check the record permissions.
|
||||
$permission = $user->authorise('component_modules.edit.state', 'com_componentbuilder.component_modules.' . (int) $recordId);
|
||||
if (!$permission && !is_null($permission))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// In the absense of better information, revert to the component permissions.
|
||||
return $user->authorise('component_modules.edit.state', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* Method override to check if you can edit an existing record.
|
||||
*
|
||||
* @param array $data An array of input data.
|
||||
* @param string $key The name of the key for the primary key.
|
||||
*
|
||||
* @return boolean
|
||||
* @since 2.5
|
||||
*/
|
||||
protected function allowEdit($data = array(), $key = 'id')
|
||||
{
|
||||
// Check specific edit permission then general edit permission.
|
||||
$user = JFactory::getUser();
|
||||
|
||||
return $user->authorise('component_modules.edit', 'com_componentbuilder.component_modules.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_modules.edit', 'com_componentbuilder');
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare and sanitise the table data prior to saving.
|
||||
*
|
||||
* @param JTable $table A JTable object.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function prepareTable($table)
|
||||
{
|
||||
$date = JFactory::getDate();
|
||||
$user = JFactory::getUser();
|
||||
|
||||
if (isset($table->name))
|
||||
{
|
||||
$table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
|
||||
}
|
||||
|
||||
if (isset($table->alias) && empty($table->alias))
|
||||
{
|
||||
$table->generateAlias();
|
||||
}
|
||||
|
||||
if (empty($table->id))
|
||||
{
|
||||
$table->created = $date->toSql();
|
||||
// set the user
|
||||
if ($table->created_by == 0 || empty($table->created_by))
|
||||
{
|
||||
$table->created_by = $user->id;
|
||||
}
|
||||
// Set ordering to the last item if not set
|
||||
if (empty($table->ordering))
|
||||
{
|
||||
$db = JFactory::getDbo();
|
||||
$query = $db->getQuery(true)
|
||||
->select('MAX(ordering)')
|
||||
->from($db->quoteName('#__componentbuilder_component_modules'));
|
||||
$db->setQuery($query);
|
||||
$max = $db->loadResult();
|
||||
|
||||
$table->ordering = $max + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$table->modified = $date->toSql();
|
||||
$table->modified_by = $user->id;
|
||||
}
|
||||
|
||||
if (!empty($table->id))
|
||||
{
|
||||
// Increment the items version number.
|
||||
$table->version++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_modules.data', array());
|
||||
|
||||
if (empty($data))
|
||||
{
|
||||
$data = $this->getItem();
|
||||
// run the perprocess of the data
|
||||
$this->preprocessData('com_componentbuilder.component_modules', $data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the unique fields of this table.
|
||||
*
|
||||
* @return mixed An array of field names, boolean false if none is set.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
protected function getUniqeFields()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to delete one or more records.
|
||||
*
|
||||
* @param array &$pks An array of record primary keys.
|
||||
*
|
||||
* @return boolean True if successful, false if an error occurs.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function delete(&$pks)
|
||||
{
|
||||
if (!parent::delete($pks))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to change the published state of one or more records.
|
||||
*
|
||||
* @param array &$pks A list of the primary keys to change.
|
||||
* @param integer $value The value of the published state.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function publish(&$pks, $value = 1)
|
||||
{
|
||||
if (!parent::publish($pks, $value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to perform batch operations on an item or a set of items.
|
||||
*
|
||||
* @param array $commands An array of commands to perform.
|
||||
* @param array $pks An array of item ids.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return boolean Returns true on success, false on failure.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function batch($commands, $pks, $contexts)
|
||||
{
|
||||
// Sanitize ids.
|
||||
$pks = array_unique($pks);
|
||||
JArrayHelper::toInteger($pks);
|
||||
|
||||
// Remove any values of zero.
|
||||
if (array_search(0, $pks, true))
|
||||
{
|
||||
unset($pks[array_search(0, $pks, true)]);
|
||||
}
|
||||
|
||||
if (empty($pks))
|
||||
{
|
||||
$this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = false;
|
||||
|
||||
// Set some needed variables.
|
||||
$this->user = JFactory::getUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->contentType = new JUcmType;
|
||||
$this->type = $this->contentType->getTypeByTable($this->tableClassName);
|
||||
$this->canDo = ComponentbuilderHelper::getActions('component_modules');
|
||||
$this->batchSet = true;
|
||||
|
||||
if (!$this->canDo->get('core.batch'))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->type == false)
|
||||
{
|
||||
$type = new JUcmType;
|
||||
$this->type = $type->getTypeByAlias($this->typeAlias);
|
||||
}
|
||||
|
||||
$this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
|
||||
|
||||
if (!empty($commands['move_copy']))
|
||||
{
|
||||
$cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
|
||||
|
||||
if ($cmd == 'c')
|
||||
{
|
||||
$result = $this->batchCopy($commands, $pks, $contexts);
|
||||
|
||||
if (is_array($result))
|
||||
{
|
||||
foreach ($result as $old => $new)
|
||||
{
|
||||
$contexts[$new] = $contexts[$old];
|
||||
}
|
||||
$pks = array_values($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$done = true;
|
||||
}
|
||||
|
||||
if (!$done)
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Clear the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch copy items to a new category or current.
|
||||
*
|
||||
* @param integer $values The new values.
|
||||
* @param array $pks An array of row IDs.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return mixed An array of new IDs on success, boolean false on failure.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchCopy($values, $pks, $contexts)
|
||||
{
|
||||
if (empty($this->batchSet))
|
||||
{
|
||||
// Set some needed variables.
|
||||
$this->user = JFactory::getUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->canDo = ComponentbuilderHelper::getActions('component_modules');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('component_modules.create') && !$this->canDo->get('component_modules.batch'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// get list of uniqe fields
|
||||
$uniqeFields = $this->getUniqeFields();
|
||||
// remove move_copy from array
|
||||
unset($values['move_copy']);
|
||||
|
||||
// make sure published is set
|
||||
if (!isset($values['published']))
|
||||
{
|
||||
$values['published'] = 0;
|
||||
}
|
||||
elseif (isset($values['published']) && !$this->canDo->get('component_modules.edit.state'))
|
||||
{
|
||||
$values['published'] = 0;
|
||||
}
|
||||
|
||||
$newIds = array();
|
||||
// Parent exists so let's proceed
|
||||
while (!empty($pks))
|
||||
{
|
||||
// Pop the first ID off the stack
|
||||
$pk = array_shift($pks);
|
||||
|
||||
$this->table->reset();
|
||||
|
||||
// only allow copy if user may edit this item.
|
||||
if (!$this->user->authorise('component_modules.edit', $contexts[$pk]))
|
||||
{
|
||||
// Not fatal error
|
||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check that the row actually exists
|
||||
if (!$this->table->load($pk))
|
||||
{
|
||||
if ($error = $this->table->getError())
|
||||
{
|
||||
// Fatal error
|
||||
$this->setError($error);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not fatal error
|
||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Only for strings
|
||||
if (ComponentbuilderHelper::checkString($this->table->joomla_component) && !is_numeric($this->table->joomla_component))
|
||||
{
|
||||
$this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
|
||||
}
|
||||
|
||||
// insert all set values
|
||||
if (ComponentbuilderHelper::checkArray($values))
|
||||
{
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
if (strlen($value) > 0 && isset($this->table->$key))
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// update all uniqe fields
|
||||
if (ComponentbuilderHelper::checkArray($uniqeFields))
|
||||
{
|
||||
foreach ($uniqeFields as $uniqeField)
|
||||
{
|
||||
$this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset the ID because we are making a copy
|
||||
$this->table->id = 0;
|
||||
|
||||
// TODO: Deal with ordering?
|
||||
// $this->table->ordering = 1;
|
||||
|
||||
// Check the row.
|
||||
if (!$this->table->check())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($this->type))
|
||||
{
|
||||
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
|
||||
}
|
||||
|
||||
// Store the row.
|
||||
if (!$this->table->store())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the new item ID
|
||||
$newId = $this->table->get('id');
|
||||
|
||||
// Add the new ID to the array
|
||||
$newIds[$pk] = $newId;
|
||||
}
|
||||
|
||||
// Clean the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return $newIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch move items to a new category
|
||||
*
|
||||
* @param integer $value The new category ID.
|
||||
* @param array $pks An array of row IDs.
|
||||
* @param array $contexts An array of item contexts.
|
||||
*
|
||||
* @return boolean True if successful, false otherwise and internal error is set.
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
protected function batchMove($values, $pks, $contexts)
|
||||
{
|
||||
if (empty($this->batchSet))
|
||||
{
|
||||
// Set some needed variables.
|
||||
$this->user = JFactory::getUser();
|
||||
$this->table = $this->getTable();
|
||||
$this->tableClassName = get_class($this->table);
|
||||
$this->canDo = ComponentbuilderHelper::getActions('component_modules');
|
||||
}
|
||||
|
||||
if (!$this->canDo->get('component_modules.edit') && !$this->canDo->get('component_modules.batch'))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// make sure published only updates if user has the permission.
|
||||
if (isset($values['published']) && !$this->canDo->get('component_modules.edit.state'))
|
||||
{
|
||||
unset($values['published']);
|
||||
}
|
||||
// remove move_copy from array
|
||||
unset($values['move_copy']);
|
||||
|
||||
// Parent exists so we proceed
|
||||
foreach ($pks as $pk)
|
||||
{
|
||||
if (!$this->user->authorise('component_modules.edit', $contexts[$pk]))
|
||||
{
|
||||
$this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check that the row actually exists
|
||||
if (!$this->table->load($pk))
|
||||
{
|
||||
if ($error = $this->table->getError())
|
||||
{
|
||||
// Fatal error
|
||||
$this->setError($error);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Not fatal error
|
||||
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// insert all set values.
|
||||
if (ComponentbuilderHelper::checkArray($values))
|
||||
{
|
||||
foreach ($values as $key => $value)
|
||||
{
|
||||
// Do special action for access.
|
||||
if ('access' === $key && strlen($value) > 0)
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
elseif (strlen($value) > 0 && isset($this->table->$key))
|
||||
{
|
||||
$this->table->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Check the row.
|
||||
if (!$this->table->check())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($this->type))
|
||||
{
|
||||
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
|
||||
}
|
||||
|
||||
// Store the row.
|
||||
if (!$this->table->store())
|
||||
{
|
||||
$this->setError($this->table->getError());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Clean the cache
|
||||
$this->cleanCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to save the form data.
|
||||
*
|
||||
* @param array $data The form data.
|
||||
*
|
||||
* @return boolean True on success.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function save($data)
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$filter = JFilterInput::getInstance();
|
||||
|
||||
// set the metadata to the Item Data
|
||||
if (isset($data['metadata']) && isset($data['metadata']['author']))
|
||||
{
|
||||
$data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
|
||||
|
||||
$metadata = new JRegistry;
|
||||
$metadata->loadArray($data['metadata']);
|
||||
$data['metadata'] = (string) $metadata;
|
||||
}
|
||||
|
||||
// Set the addjoomla_modules items to data.
|
||||
if (isset($data['addjoomla_modules']) && is_array($data['addjoomla_modules']))
|
||||
{
|
||||
$addjoomla_modules = new JRegistry;
|
||||
$addjoomla_modules->loadArray($data['addjoomla_modules']);
|
||||
$data['addjoomla_modules'] = (string) $addjoomla_modules;
|
||||
}
|
||||
elseif (!isset($data['addjoomla_modules']))
|
||||
{
|
||||
// Set the empty addjoomla_modules to data
|
||||
$data['addjoomla_modules'] = '';
|
||||
}
|
||||
|
||||
// Set the Params Items to data
|
||||
if (isset($data['params']) && is_array($data['params']))
|
||||
{
|
||||
$params = new JRegistry;
|
||||
$params->loadArray($data['params']);
|
||||
$data['params'] = (string) $params;
|
||||
}
|
||||
|
||||
// Alter the uniqe field for save as copy
|
||||
if ($input->get('task') === 'save2copy')
|
||||
{
|
||||
// Automatic handling of other uniqe fields
|
||||
$uniqeFields = $this->getUniqeFields();
|
||||
if (ComponentbuilderHelper::checkArray($uniqeFields))
|
||||
{
|
||||
foreach ($uniqeFields as $uniqeField)
|
||||
{
|
||||
$data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parent::save($data))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to generate a uniqe value.
|
||||
*
|
||||
* @param string $field name.
|
||||
* @param string $value data.
|
||||
*
|
||||
* @return string New value.
|
||||
*
|
||||
* @since 3.0
|
||||
*/
|
||||
protected function generateUniqe($field,$value)
|
||||
{
|
||||
|
||||
// set field value uniqe
|
||||
$table = $this->getTable();
|
||||
|
||||
while ($table->load(array($field => $value)))
|
||||
{
|
||||
$value = JString::increment($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to change the title
|
||||
*
|
||||
* @param string $title The title.
|
||||
*
|
||||
* @return array Contains the modified title and alias.
|
||||
*
|
||||
*/
|
||||
protected function _generateNewTitle($title)
|
||||
{
|
||||
|
||||
// Alter the title
|
||||
$table = $this->getTable();
|
||||
|
||||
while ($table->load(array('title' => $title)))
|
||||
{
|
||||
$title = JString::increment($title);
|
||||
}
|
||||
|
||||
return $title;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user