diff --git a/.gitea/ISSUE_TEMPLATE/a-bug.yml b/.gitea/ISSUE_TEMPLATE/a-bug.yml new file mode 100644 index 000000000..3de278ba0 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/a-bug.yml @@ -0,0 +1,176 @@ +name: Bug Report +about: Draft a report to aid in our Debugging efforts. +title: "[BUG]: " +labels: + - bug +body: + - type: markdown + attributes: + value: | + We value your effort in reporting an bug! Your feedback is essential for us to address and fix the problem. + - type: textarea + id: what-happened + attributes: + label: What Happened? + description: Please provide a detailed description of the issue and explain what outcome you anticipate. + placeholder: Describe the issue you experienced. + value: "" + validations: + required: true + - type: textarea + id: steps_to_reproduce + attributes: + label: Steps to reproduce the Bug + description: Please provide a detailed description of the steps to reproduce the issue you experienced. + placeholder: Describe the steps to reproduce the issue. + value: "" + validations: + required: true + - type: markdown + attributes: + value: | + # Environment Details + - type: input + id: joomla_version_compiling + attributes: + label: Which Joomla version are you compiling in? + placeholder: e.g., v4.4.3, + validations: + required: true + - type: input + id: php_version_compiling + attributes: + label: Which PHP version are you compiling in? + placeholder: e.g., v8.1, + validations: + required: true + - type: input + id: joomla_versions_targeting + attributes: + label: Which Joomla versions are you targeting? + placeholder: e.g., v5.0.3, + validations: + required: true + - type: input + id: php_version_targeting + attributes: + label: Which PHP version are you targeting? + placeholder: e.g., 8.2 + validations: + required: true + - type: input + id: apache_version_using + attributes: + label: Which Web server is JCB running on? + description: Please provide the full name of the web server on which you are running JCB. + placeholder: e.g., Apache 2.4 + validations: + required: true + - type: input + id: mysql_version_using + attributes: + label: Which Relational Database is JCB running on? + description: Please provide the full name of the database on which you are running JCB. + placeholder: e.g., Mysql 8.0, MariaDB 10.6, + validations: + required: true + - type: input + id: os + attributes: + label: Which OS is JCB running on? + description: Please provide the full name of the OS on which you are running JCB. + placeholder: e.g. CentOS 8 sever, + value: "" + validations: + required: true + - type: input + id: jcb_version + attributes: + label: Which JCB version are you using? + description: Please provide the full name of the JCB version you are using. + placeholder: e.g., v5.0.0-alpha3 + validations: + required: true + - type: dropdown + id: jcb_installed_on_joomla + attributes: + label: Which Joomla version is JCB installed on? + multiple: true + options: + - Joomla 5 + - Joomla 4 + - Joomla 3 + validations: + required: true + - type: dropdown + id: area + attributes: + label: Where in JCB did this issue occur? + multiple: true + options: + - Compilation of a component + - Installation of a component + - Installation JCB pkg + - Installation of JCB plugins + - Compiler(admin_view) + - Dashboard(admin_view) + - Joomla Components(admin_views) + - Joomla Component(admin_view) + - Joomla Modules(admin_views) + - Joomla Module(admin_view) + - Joomla Plugins(admin_views) + - Joomla Plugin(admin_view) + - Power(admin_view) + - Powers(admin_views) + - Search(admin_view) + - Admin View(admin_view) + - Admin Views(admin_views) + - Custom Admin Views(admin_views) + - Site View(admin_view) + - Site Views(admin_views) + - Template(admin_view) + - Templates(admin_views) + - Layout(admin_view) + - Layouts(admin_views) + - Dynamic Get(admin_view) + - Dynamic Gets(admin_views) + - Custom Code(admin_view) + - Custom Codes(admin_views) + - Placeholder(admin_view) + - Placeholders(admin_views) + - Library(admin_view) + - Libraries(admin_views) + - Snippet(admin_view) + - Snippets(admin_views) + - Validation Rule(admin_view) + - Validation Rules(admin_views) + - Field(admin_view) + - Fields(admin_views) + - Fieldtypes(admin_views) + - Language Translations(admin_views) + - Server(admin_view) + - Servers(admin_views) + - Help Documents(admin_views) + - Other + validations: + required: true + - type: dropdown + id: browsers + attributes: + label: On which browsers did you encounter the issue? + multiple: true + options: + - Firefox + - Chrome + - Microsoft Edge + - Safari + - Opera + - Brave + - Vivaldi + validations: + required: true + - type: textarea + id: comments + attributes: + label: Additional Comments + description: Feel free to include any further comments or pertinent details that might assist us. \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/b-enhancement.yml b/.gitea/ISSUE_TEMPLATE/b-enhancement.yml new file mode 100644 index 000000000..b62273bc1 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/b-enhancement.yml @@ -0,0 +1,81 @@ +name: Enhancement Request +about: Suggest an idea for JCB +title: "[ENHANCEMENT]: " +labels: + - enhancement +body: + - type: markdown + attributes: + value: | + Thank you for suggesting an enhancement! Your input is crucial for our innovation and progress. To assist us better, please share detailed information about your idea. + - type: textarea + id: enhancement-details + attributes: + label: Enhancement Details + description: Could you detail the enhancement you're suggesting? Explain the issue it addresses or the new feature it introduces. + placeholder: Please give an in-depth explanation of your proposed enhancement. + validations: + required: true + - type: markdown + attributes: + value: | + # Context and Priority + - type: dropdown + id: area + attributes: + label: Which part of the extension will be affected by this enhancement? + multiple: true + options: + - Compilation of component + - Installation of a component + - Installation JCB pkg + - Installation of JCB plugins + - Compiler(admin_view) + - Dashboard(admin_view) + - Joomla Components(admin_views) + - Joomla Component(admin_view) + - Joomla Modules(admin_views) + - Joomla Module(admin_view) + - Joomla Plugins(admin_views) + - Joomla Plugin(admin_view) + - Power(admin_view) + - Powers(admin_views) + - Search(admin_view) + - Admin View(admin_view) + - Admin Views(admin_views) + - Custom Admin Views(admin_views) + - Site View(admin_view) + - Site Views(admin_views) + - Template(admin_view) + - Templates(admin_views) + - Layout(admin_view) + - Layouts(admin_views) + - Dynamic Get(admin_view) + - Dynamic Gets(admin_views) + - Custom Code(admin_view) + - Custom Codes(admin_views) + - Placeholder(admin_view) + - Placeholders(admin_views) + - Library(admin_view) + - Libraries(admin_views) + - Snippet(admin_view) + - Snippets(admin_views) + - Validation Rule(admin_view) + - Validation Rules(admin_views) + - Field(admin_view) + - Fields(admin_views) + - Fieldtypes(admin_views) + - Language Translations(admin_views) + - Server(admin_view) + - Servers(admin_views) + - Help Documents(admin_views) + - Other + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Supply additional context or screenshots related to the enhancement request in this space. + validations: + required: false \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/c-task.yml b/.gitea/ISSUE_TEMPLATE/c-task.yml new file mode 100644 index 000000000..de46e1bbd --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/c-task.yml @@ -0,0 +1,45 @@ +name: Task +about: Create a task for project management +title: "[TASK]: " +labels: + - task +body: + - type: markdown + attributes: + value: | + Thanks for setting up the task! Tasks assist us in arranging and ranking our work. Kindly provide comprehensive details about the task for clarity and efficient tracking. + - type: textarea + id: task-details + attributes: + label: Task Details + description: Please describe the task. What are the specific actions required? + placeholder: Provide a detailed description of the task. + validations: + required: true + - type: markdown + attributes: + value: | + # Task Context and Priority + - type: textarea + id: task-environment + attributes: + label: Task environment + description: Please provide the details of the environment in which this task will be completed. + placeholder: Describe the environment applicable to the task. + validations: + required: true + - type: textarea + id: task-objective + attributes: + label: Task Objective + description: What's the aim or purpose of this task? How will it contribute to the project or system's success? + placeholder: Describe the goal and anticipated result of the task. + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Please share any extra context, files, or screenshots that could aid in comprehending or carrying out the task. + validations: + required: false \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/d-docs.yml b/.gitea/ISSUE_TEMPLATE/d-docs.yml new file mode 100644 index 000000000..ac6a62f34 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/d-docs.yml @@ -0,0 +1,37 @@ +name: Documentation +about: Propose improvements to the documentation or highlight any issues found within it. +title: "[DOCUMENTATION]: " +labels: + - documentation +body: + - type: markdown + attributes: + value: | + We appreciate your input on our documentation! Clear and comprehensive documentation plays a vital role in enabling users to effectively interact with our systems. To assist us in making improvements, kindly offer thorough details regarding your suggestion or the specific problem you've encountered. + - type: textarea + id: documentation-details + attributes: + label: Documentation Details + description: Please explain the specific problem with the documentation or the improvements you recommend. Is it a missing topic, unclear instructions, outdated content, or something else? + placeholder: Detail the issue with the documentation or suggest improvements.. + validations: + required: true + - type: markdown + attributes: + value: | + # Specific Context + - type: textarea + id: expected-outcome + attributes: + label: Expected Outcome + description: What outcomes do you anticipate from this change in documentation? How will it benifit the users or enhance the project? + placeholder: Explain the expected result of this change in the documentation. + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Share any extra details, files, or screenshots that could help in understanding or applying the documentation change. + validations: + required: false \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/e-performance.yml b/.gitea/ISSUE_TEMPLATE/e-performance.yml new file mode 100644 index 000000000..4a2448328 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/e-performance.yml @@ -0,0 +1,61 @@ +name: Performance Issue +about: Recommend or propose performance improvements +title: "[PERFORMANCE]: " +labels: + - performance +body: + - type: markdown + attributes: + value: | + Appreciation for tackling performance challenges! Optimizing performance is vital for our system's efficiency and the user experience. Could you offer more comprehensive details to aid in identifying and resolving the suggested performance issue or improvement? + - type: textarea + id: performance-details + attributes: + label: Performance Details + description: Please outline the performance problem or the enhancements you propose. Is it related to speed, resource usage, responsiveness, or something else? + placeholder: Offer an in-depth explanation of the performance challenge or improvement. + validations: + required: true + - type: markdown + attributes: + value: | + # Affected Systems and Context + - type: textarea + id: performance-environment + attributes: + label: Environment in which performance issue occurs + description: Provide a detailed description of the environment in which you are experiencing this perforamnce issue. + placeholder: Describe the environment of the preformance issue. + validations: + required: true + - type: textarea + id: replication-steps + attributes: + label: Steps to Replicate + description: If possible, share a step-by-step guide to replicate the performance problem. + placeholder: Explain how to replicate the problem. + validations: + required: false + - type: textarea + id: impact-assessment + attributes: + label: Impact Assessment + description: How does the performance problem impact the system or its users? How severe is its effect? + placeholder: Explain the impact of the performance problem. + validations: + required: true + - type: textarea + id: proposed-solutions + attributes: + label: Proposed Solutions or Ideas + description: If you have any suggestions or ideas for resolving the performance problem, please share them here. + placeholder: Share any potential solutions or improvement problem. + validations: + required: false + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Provide any additional context, benchmarks, logs, or screenshots that might help in understanding or addressing the performance problem. + validations: + required: false \ No newline at end of file diff --git a/.gitea/ISSUE_TEMPLATE/f-refactor.yml b/.gitea/ISSUE_TEMPLATE/f-refactor.yml new file mode 100644 index 000000000..d1181c219 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/f-refactor.yml @@ -0,0 +1,45 @@ +name: Refactoring Task +about: Recommend or identify the necessity for code refactoring. +title: "[REFACTOR]: " +labels: + - refactor +body: + - type: markdown + attributes: + value: | + We appreciate your commitment to enhancing the maintainability and quality of our codebase! Code refactoring plays a crucial role in ensuring our system remains efficient and easy to manage. To assist us effectively, please share comprehensive details about the refactoring task you are suggesting or identifying. + - type: textarea + id: refactoring-details + attributes: + label: Refactoring Details + description: Outline the refactoring task, specifying which code segment requires attention and the reasons behind this need. What improvements are expected from this refactoring? + placeholder: Provide an in-depth explanation of the refactoring task? + validations: + required: true + - type: markdown + attributes: + value: | + # Affected Components and Context + - type: textarea + id: area + attributes: + label: Which file or area of JCB needs refactoring? + description: Which area in JCB should be refactored? + placeholder: Give a road map where the refactoring should take place. + validations: + required: true + - type: textarea + id: expected-outcome + attributes: + label: Expected Outcome + description: What benefits do you anticipate from this refactoring? How will it enhance the codebase or overall system? + placeholder: Explain the expected results of this refactoring. + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Share any further details or information, like code snippets, that could aid in comprehending or executing the refactoring task. + validations: + required: false diff --git a/.gitea/ISSUE_TEMPLATE/g-security.yml b/.gitea/ISSUE_TEMPLATE/g-security.yml new file mode 100644 index 000000000..edf2a04c8 --- /dev/null +++ b/.gitea/ISSUE_TEMPLATE/g-security.yml @@ -0,0 +1,38 @@ +name: Security Issue +about: Identify a possible security risk. +title: "[SECURITY]: " +labels: + - security +body: + - type: markdown + attributes: + value: | + **⚠️ CRITICAL: Avoid sharing any sensitive or confidential details in this message.** Should you suspect a security flaw, please contact us directly at [joomla@vdm.io]. + - type: textarea + id: security-general-description + attributes: + label: General Description + description: Offer a broad overview of the security concern, ensuring not to disclose any sensitive information. + placeholder: Provide a general description of the security problem. + validations: + required: true + - type: markdown + attributes: + value: | + # Affected Systems + - type: textarea + id: security-environment + attributes: + label: Environment affected by security issue. + description: Give a general description of the environment affected by this security issue. + placeholder: Describe the affected environment. + validations: + required: true + - type: textarea + id: non-sensitive-details + attributes: + label: Non-Sensitive Details + description: If applicable, please offer further non-sensitive information or general observations regarding the security concern. + placeholder: Provide any relevant non-sensitive details or observations. + validations: + required: false \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bcc73892..cfcd8c2b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,92 @@ +# v3.2.0 + +- Fix #1053 so that the right and left tabs display correctly in Joomla 4&5 +- Move the old helper compiler files to powers +- Move the old helper extrusion files to powers +- Add Preferred Joomla Version to Components +- Add custom file file mapping for Joomla 4 and 5 +- Fix the plug-in installer script builder bug #1068 +- Fix Event triggers for Joomla 4 and 5 builds. +- Fix plugin field selection +- Fix plugin params tab layout +- Add issue templates +- Force autoloader to always load +- Add Factory class to the J5 Event class. #1093 +- Fix [Set String Value] in placeholder table to store the value as a base64 string. +- Fix the search area layout. +- Fix the search area code line selection. +- Fix the input edit button for custom fields. +- Add the new layout to list fields (GUI UPDATE) + +# v3.2.0-beta + +- Move beta to main repo + +# v3.1.42 + +- Fix #1055 to add the style and scripts to all views. + +# v3.1.40 + +- Fix #1052 so that tabs last opened is remembered and opened again on save, refresh or reopening of an item. +- Fix #1057 so that the datetime fields will be set correctly in mysql. + +# v3.1.39 + +- Fix #1051 making sure the list view is lowercase. + +# v3.1.38 + +- Fix #1046 so that the version restore function will work. + +# v3.1.37 + +- Fix #1041 so that custom tabs are build correctly. +- Fix #1043 so that delete function in Joomla 4 and 5 will work. +- Fix #1045 so that plug-in Structure::setMainXmlFile method will except an object. +- Fix #1042 so that it will remove line breaks and new lines from other languages as well. + +# v3.1.36 + +- Move the defined or die below use statements. +- Add the new router view + +# v3.1.35 + +- Improve the Joomla 4 Templates. +- Fix #1033 the response class issue for the gitea classes. +- Remove the JRegistry class to resolve #1036, #1035 + +# v3.1.34 + +- Fix the AjaxController contructor class. +- Improved the getModel calls from the AxajController class. + +# v3.1.33 + +- Fix #1026 by adding the correct layout to the filter views. +- Fix #1026 by adding the class to the filter views. +- Fix #1026 by adding a hint to the filters that are having multiple selection. +- Fix the directional bog where a field in the filters are also called direction. +- Fix the getModel helper method fot J4+. + +# v3.1.32 + +- Fix #1026 by removing chosen everywhere. +- Resolve #1028 by adding in line helper toggle integration to all admin views. +- Remove the import and export buttons until the area is fixed. +- Add emptystate list template to all admin list views. + +# v3.1.31 + +- Add joomla_version to custom code. +- Add Joomla 4 and 5 correct build files. + +# v3.1.30 + +- Add namspace prefix to both global, and component override level. +- Add Joomla 4 and 5 build option + # v3.1.28 - Updates PHPSecLib. @@ -23,7 +112,7 @@ - Adds option to add additional templates to a module. - Resolves #1002 by adding STRING instead of WORD. - Ported the FOF encryption class into Powers. https://git.vdm.dev/joomla/fof -- Changed all CSS and JS to use `JHtml::_(` instead of `$this->document->` in compiler code. +- Changed all CSS and JS to use `Html::_(` instead of `$this->document->` in compiler code. - Adds option to turn jQuery off if UIKIT 3 is added. - Adds option to auto write injection boilerplate code in Powers area. - Adds option to auto write service provider boilerplate code in the Powers area. diff --git a/README.md b/README.md index 1ec22857e..e8af74a71 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.28) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.0) 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) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 24th October, 2023 -+ *Version*: 3.1.28 ++ *Last Build*: 27th March, 2024 ++ *Version*: 3.2.0 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **635155** -+ *Field count*: **2047** -+ *File count*: **4731** -+ *Folder count*: **436** ++ *Line count*: **738967** ++ *Field count*: **2078** ++ *File count*: **5201** ++ *Folder count*: **459** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/README.txt b/admin/README.txt index 1ec22857e..e8af74a71 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.1.28) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.0) 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) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 24th October, 2023 -+ *Version*: 3.1.28 ++ *Last Build*: 27th March, 2024 ++ *Version*: 3.2.0 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **635155** -+ *Field count*: **2047** -+ *File count*: **4731** -+ *Folder count*: **436** ++ *Line count*: **738967** ++ *Field count*: **2078** ++ *File count*: **5201** ++ *Folder count*: **459** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/access.xml b/admin/access.xml index 37dfadbef..86cf7d64b 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -211,6 +211,16 @@ + + + + + + + + + + @@ -899,6 +909,17 @@ +
+ + + + + + + + + +
diff --git a/admin/assets/css/component_router.css b/admin/assets/css/component_router.css new file mode 100644 index 000000000..2731fc5aa --- /dev/null +++ b/admin/assets/css/component_router.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/components_routers.css b/admin/assets/css/components_routers.css new file mode 100644 index 000000000..2731fc5aa --- /dev/null +++ b/admin/assets/css/components_routers.css @@ -0,0 +1,13 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +/* CSS Document */ + + diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 615e5f30f..3b92116c7 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -11,153 +11,153 @@ /* CSS Document */ .dashboard-container { - margin-left: 10px; - margin-top: 10px; - width: 100%; + margin-left: 10px; + margin-top: 10px; + width: 100%; } .dashboard-container [class*="span"] { - display: block; - float: none; - margin-left: 0; - width: auto; + display: block; + float: none; + margin-left: 0; + width: auto; } .dashboard-container:before, .dashboard-container:after { - content: ""; - display: table; + content: ""; + display: table; } .dashboard-container:after { - clear: both; + clear: both; } .dashboard-container [class*="span"] { - box-sizing: border-box; - display: block; - float: left; - min-height: 145px; - min-width: 96px; - width: 100%; + box-sizing: border-box; + display: block; + float: left; + min-height: 145px; + min-width: 96px; + width: 100%; } .dashboard-container [class*="span"]:first-child { - margin-left: 0; + margin-left: 0; } .dashboard-wraper { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 5px; - float: left; - margin: 1%; - padding: 3px; - width: 17%; - min-height: 194px; - min-width: 96px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 5px; + float: left; + margin: 1%; + padding: 3px; + width: 17%; + min-height: 194px; + min-width: 96px; } .dashboard-content a { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - min-height: 89px; - padding: 10px; - text-align: center; - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + min-height: 89px; + padding: 10px; + text-align: center; + text-decoration: none; } .dashboard-content a:hover { - background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - color: hsl(200, 100%, 30%); - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + color: hsl(200, 100%, 30%); + text-decoration: none; } .dashboard-title { - display: block; - padding-top: 5px; + display: block; + padding-top: 5px; } .dashboard-info { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - font-size: 12px; - padding: 10px; - text-align: center; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + font-size: 12px; + padding: 10px; + text-align: center; } .dashboard-info span { - display: block; - text-align: center; + display: block; + text-align: center; } .dashboard-info img { - margin: 0 auto; + margin: 0 auto; } .dashboard-table { - border-top: 1px solid hsl(0, 0%, 87%); - margin-top: 5px; - width: 100%; + border-top: 1px solid hsl(0, 0%, 87%); + margin-top: 5px; + width: 100%; } .dashboard-info h5 { - font-size: 11px; - font-weight: bold; + font-size: 11px; + font-weight: bold; } .dashboard-block { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 76%); - border-radius: 3px; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; - margin-bottom: 20px; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 76%); + border-radius: 3px; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; + margin-bottom: 20px; } .dashboard-block .dashboard-block-head { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border-bottom: 1px solid hsl(0, 0%, 76%); - border-radius: 3px 3px 0 0; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); - height: 40px; - position: relative; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border-bottom: 1px solid hsl(0, 0%, 76%); + border-radius: 3px 3px 0 0; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); + height: 40px; + position: relative; } .dashboard-block .dashboard-block-head h5 { - font-size: 12px; - margin: 0; - padding-left: 10px; - padding-top: 11px; - text-transform: uppercase; + font-size: 12px; + margin: 0; + padding-left: 10px; + padding-top: 11px; + text-transform: uppercase; } .dashboard-block .dashboard-block-content { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 0 0 3px 3px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 0 0 3px 3px; } .dashboard-block .dashboard-block-box { - background: none repeat scroll 0 0 hsl(0, 0%, 100%); - border-top: 1px solid hsl(0, 0%, 82%); - box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; + background: none repeat scroll 0 0 hsl(0, 0%, 100%); + border-top: 1px solid hsl(0, 0%, 82%); + box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; } .dashboard-block .dashboard-block-content .dashboard-block-box { - margin-top: 0 !important; + margin-top: 0 !important; } .dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table { - margin-bottom: 0 !important; + margin-bottom: 0 !important; } .dashboard-block-table { - background-color: hsla(0, 0%, 0%, 0); - border-collapse: collapse; - border-spacing: 0; - margin-bottom: 20px; - max-width: 100%; - width: 100%; + background-color: hsla(0, 0%, 0%, 0); + border-collapse: collapse; + border-spacing: 0; + margin-bottom: 20px; + max-width: 100%; + width: 100%; } .dashboard-block-table th, .dashboard-block-table td { - border-top: 1px solid hsl(0, 0%, 87%); - line-height: 20px; - padding: 5px; - text-align: left; - vertical-align: middle; + border-top: 1px solid hsl(0, 0%, 87%); + line-height: 20px; + padding: 5px; + text-align: left; + vertical-align: middle; } .dashboard-badge { - background-color: hsl(0, 0%, 60%); - border-radius: 9px; - color: hsl(0, 0%, 100%); - font-size: 11.844px; - font-weight: bold; - line-height: 14px; - padding: 1px 9px 2px; - text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); - vertical-align: baseline; - white-space: nowrap; + background-color: hsl(0, 0%, 60%); + border-radius: 9px; + color: hsl(0, 0%, 100%); + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + padding: 1px 9px 2px; + text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); + vertical-align: baseline; + white-space: nowrap; } \ No newline at end of file diff --git a/admin/assets/images/import.gif b/admin/assets/images/import.gif index 4371cc618..10bcb8569 100644 Binary files a/admin/assets/images/import.gif and b/admin/assets/images/import.gif differ diff --git a/admin/compiler/joomla_3/AdminController.php b/admin/compiler/joomla_3/AdminController.php index 98c6d9aeb..1837a17b6 100644 --- a/admin/compiler/joomla_3/AdminController.php +++ b/admin/compiler/joomla_3/AdminController.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/AdminControllerDashboard.php b/admin/compiler/joomla_3/AdminControllerDashboard.php index 8f53ecd75..4bb2b3659 100644 --- a/admin/compiler/joomla_3/AdminControllerDashboard.php +++ b/admin/compiler/joomla_3/AdminControllerDashboard.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/AdminController_custom_admin.php b/admin/compiler/joomla_3/AdminController_custom_admin.php index 8c32dc3cb..2cd69c6ed 100644 --- a/admin/compiler/joomla_3/AdminController_custom_admin.php +++ b/admin/compiler/joomla_3/AdminController_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -34,9 +34,9 @@ class ###Component###Controller###SViews### extends AdminController /** * Proxy for getModel. - * @since 2.5 + * @since 2.5 */ - public function getModel($name = '###SView###', $prefix = '###Component###Model', $config = array()) + public function getModel($name = '###SView###', $prefix = '###Component###Model', $config = []) { $model = parent::getModel($name, $prefix, array('ignore_request' => true)); @@ -45,7 +45,7 @@ class ###Component###Controller###SViews### extends AdminController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_###component###', false)); + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); return; }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### } diff --git a/admin/compiler/joomla_3/AdminModel.php b/admin/compiler/joomla_3/AdminModel.php index 4c2c92c56..a41ce196a 100644 --- a/admin/compiler/joomla_3/AdminModel.php +++ b/admin/compiler/joomla_3/AdminModel.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -52,18 +52,18 @@ class ###Component###Model###View### extends AdminModel * @param string $prefix A prefix for the table class name. Optional. * @param array $config Configuration array for model. Optional. * - * @return JTable A database object + * @return Table A database object * * @since 1.6 */ - public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array()) + public function getTable($type = '###view###', $prefix = '###Component###Table', $config = []) { // add table path for when model gets used from other component $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables'); // get instance of the table - return JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); }###ADMIN_CUSTOM_BUTTONS_METHOD### - + /** * Method to get a single record. * @@ -108,7 +108,7 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + public function getForm($data = [], $loadData = true, $options = array('control' => 'jform')) { // set load data option $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### @@ -117,13 +117,13 @@ class ###Component###Model###View### extends AdminModel /** * Method to get the script that have to be included on the form * - * @return string script files + * @return string script files */ public function getScript() { return 'media/com_###component###/js/###view###.js'; } - + /** * Method to test whether a record can be deleted. * @@ -149,24 +149,24 @@ class ###Component###Model###View### extends AdminModel protected function canEditState($record) {###JMODELADMIN_CANEDITSTATE### } - + /** * 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. + * @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 + * @return boolean + * @since 2.5 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JMODELADMIN_ALLOWEDIT### } - + /** * Prepare and sanitise the table data prior to saving. * - * @param JTable $table A JTable object. + * @param Table $table A Table object. * * @return void * @@ -174,19 +174,19 @@ class ###Component###Model###View### extends AdminModel */ protected function prepareTable($table) {###LICENSE_TABLE_LOCKED_CHECK### - $date = JFactory::getDate(); - $user = JFactory::getUser(); - + $date = Factory::getDate(); + $user = Factory::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(); @@ -198,7 +198,7 @@ class ###Component###Model###View### extends AdminModel // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__###component###_###view###')); @@ -213,7 +213,7 @@ class ###Component###Model###View### extends AdminModel $table->modified = $date->toSql(); $table->modified_by = $user->id; } - + if (!empty($table->id)) { // Increment the items version number. @@ -228,10 +228,10 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - protected function loadFormData() + protected function loadFormData() { // Check the session for previously entered form data. - $data = JFactory::getApplication()->getUserState('com_###component###.edit.###view###.data', array()); + $data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); if (empty($data)) { @@ -242,7 +242,7 @@ class ###Component###Model###View### extends AdminModel return $data; }###VALIDATIONFIX######UNIQUEFIELDS### - + /** * Method to delete one or more records. * @@ -258,7 +258,7 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_DELETE### - + return true; } @@ -278,10 +278,10 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_PUBLISH### - + return true; - } - + } + /** * Method to perform batch operations on an item or a set of items. * @@ -307,30 +307,30 @@ class ###Component###Model###View### extends AdminModel if (empty($pks)) { - $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + $this->setError(Text::_('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 = ###Component###Helper::getActions('###view###'); - $this->batchSet = true; + $this->user = Factory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; if (!$this->canDo->get('core.batch')) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } - + if ($this->type == false) { - $type = new JUcmType; + $type = new UCMType; $this->type = $type->getTypeByAlias($this->typeAlias); } @@ -367,8 +367,7 @@ class ###Component###Model###View### extends AdminModel if (!$done) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); - + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } @@ -377,7 +376,7 @@ class ###Component###Model###View### extends AdminModel return true; }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### - + /** * Method to save the form data. * @@ -389,34 +388,34 @@ class ###Component###Model###View### extends AdminModel */ public function save($data) { - $input = JFactory::getApplication()->input; - $filter = JFilterInput::getInstance(); - + $input = Factory::getApplication()->input; + $filter = InputFilter::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 = new Registry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### - + // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) { - $params = new JRegistry; + $params = new Registry; $params->loadArray($data['params']); $data['params'] = (string) $params; }###TITLEALIASFIX### - + if (parent::save($data)) { return true; } return false; } - + /** * Method to generate a unique value. * @@ -429,7 +428,6 @@ class ###Component###Model###View### extends AdminModel */ protected function generateUnique($field,$value) { - // set field value unique $table = $this->getTable(); diff --git a/admin/compiler/joomla_3/AdminModel_site.php b/admin/compiler/joomla_3/AdminModel_site.php index b805c970f..beb541e8d 100644 --- a/admin/compiler/joomla_3/AdminModel_site.php +++ b/admin/compiler/joomla_3/AdminModel_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -52,18 +52,18 @@ class ###Component###Model###View### extends AdminModel * @param string $prefix A prefix for the table class name. Optional. * @param array $config Configuration array for model. Optional. * - * @return JTable A database object + * @return Table A database object * * @since 1.6 */ - public function getTable($type = '###view###', $prefix = '###Component###Table', $config = array()) + public function getTable($type = '###view###', $prefix = '###Component###Table', $config = []) { // add table path for when model gets used from other component $this->addTablePath(JPATH_ADMINISTRATOR . '/components/com_###component###/tables'); // get instance of the table - return JTable::getInstance($type, $prefix, $config); + return Table::getInstance($type, $prefix, $config); }###ADMIN_CUSTOM_BUTTONS_METHOD### - + /** * Method to get a single record. * @@ -108,7 +108,7 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - public function getForm($data = array(), $loadData = true, $options = array('control' => 'jform')) + public function getForm($data = [], $loadData = true, $options = array('control' => 'jform')) { // set load data option $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### @@ -117,13 +117,13 @@ class ###Component###Model###View### extends AdminModel /** * Method to get the script that have to be included on the form * - * @return string script files + * @return string script files */ public function getScript() { return 'media/com_###component###/js/###view###.js'; } - + /** * Method to test whether a record can be deleted. * @@ -149,24 +149,24 @@ class ###Component###Model###View### extends AdminModel protected function canEditState($record) {###JMODELADMIN_CANEDITSTATE### } - + /** * 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. + * @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 + * @return boolean + * @since 2.5 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JMODELADMIN_ALLOWEDIT### } - + /** * Prepare and sanitise the table data prior to saving. * - * @param JTable $table A JTable object. + * @param Table $table A Table object. * * @return void * @@ -174,19 +174,19 @@ class ###Component###Model###View### extends AdminModel */ protected function prepareTable($table) {###LICENSE_TABLE_LOCKED_CHECK### - $date = JFactory::getDate(); - $user = JFactory::getUser(); - + $date = Factory::getDate(); + $user = Factory::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(); @@ -198,7 +198,7 @@ class ###Component###Model###View### extends AdminModel // Set ordering to the last item if not set if (empty($table->ordering)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select('MAX(ordering)') ->from($db->quoteName('#__###component###_###view###')); @@ -213,7 +213,7 @@ class ###Component###Model###View### extends AdminModel $table->modified = $date->toSql(); $table->modified_by = $user->id; } - + if (!empty($table->id)) { // Increment the items version number. @@ -228,10 +228,10 @@ class ###Component###Model###View### extends AdminModel * * @since 1.6 */ - protected function loadFormData() + protected function loadFormData() { // Check the session for previously entered form data. - $data = JFactory::getApplication()->getUserState('com_###component###.edit.###view###.data', array()); + $data = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); if (empty($data)) { @@ -242,7 +242,7 @@ class ###Component###Model###View### extends AdminModel return $data; }###VALIDATIONFIX######UNIQUEFIELDS### - + /** * Method to delete one or more records. * @@ -258,7 +258,7 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_DELETE### - + return true; } @@ -278,10 +278,10 @@ class ###Component###Model###View### extends AdminModel { return false; }###JMODELADMIN_AFTER_PUBLISH### - + return true; - } - + } + /** * Method to perform batch operations on an item or a set of items. * @@ -307,30 +307,30 @@ class ###Component###Model###View### extends AdminModel if (empty($pks)) { - $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + $this->setError(Text::_('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 = ###Component###Helper::getActions('###view###'); - $this->batchSet = true; + $this->user = Factory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; if (!$this->canDo->get('core.batch')) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } - + if ($this->type == false) { - $type = new JUcmType; + $type = new UCMType; $this->type = $type->getTypeByAlias($this->typeAlias); } @@ -367,8 +367,7 @@ class ###Component###Model###View### extends AdminModel if (!$done) { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); - + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); return false; } @@ -377,7 +376,7 @@ class ###Component###Model###View### extends AdminModel return true; }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### - + /** * Method to save the form data. * @@ -389,34 +388,34 @@ class ###Component###Model###View### extends AdminModel */ public function save($data) { - $input = JFactory::getApplication()->input; - $filter = JFilterInput::getInstance(); - + $input = Factory::getApplication()->input; + $filter = InputFilter::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 = new Registry; $metadata->loadArray($data['metadata']); $data['metadata'] = (string) $metadata; }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### - + // Set the Params Items to data if (isset($data['params']) && is_array($data['params'])) { - $params = new JRegistry; + $params = new Registry; $params->loadArray($data['params']); $data['params'] = (string) $params; }###TITLEALIASFIX### - + if (parent::save($data)) { return true; } return false; } - + /** * Method to generate a unique value. * @@ -427,9 +426,8 @@ class ###Component###Model###View### extends AdminModel * * @since 3.0 */ - protected function generateUnique($field,$value) + protected function generateUnique($field, $value) { - // set field value unique $table = $this->getTable(); diff --git a/admin/compiler/joomla_3/BaseController.php b/admin/compiler/joomla_3/BaseController.php index b7dd77c85..51991743a 100644 --- a/admin/compiler/joomla_3/BaseController.php +++ b/admin/compiler/joomla_3/BaseController.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -19,6 +19,8 @@ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\MVC\Controller\BaseController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; /** * General Controller of ###Component### component @@ -34,7 +36,7 @@ class ###Component###Controller extends BaseController * * @since 3.0 */ - public function __construct($config = array()) + public function __construct($config = []) { // set the default view $config['default_view'] = '###DASHBOARDVIEW###'; @@ -50,38 +52,38 @@ class ###Component###Controller extends BaseController function display($cachable = false, $urlparams = false) { // set default view if not set - $view = $this->input->getCmd('view', '###DASHBOARDVIEW###'); - $data = $this->getViewRelation($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); + $view = $this->input->getCmd('view', '###DASHBOARDVIEW###'); + $data = $this->getViewRelation($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); // Check for edit form. - if(###Component###Helper::checkArray($data)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($data)) { if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$data['view'], $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ###Component###Helper::checkString($ref)) + if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (###Component###Helper::checkString($ref)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false)); } else { // normal redirect back to the list view - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.$data['views'], false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.$data['views'], false)); } return false; @@ -94,7 +96,7 @@ class ###Component###Controller extends BaseController protected function getViewRelation($view) { // check the we have a value - if (###Component###Helper::checkString($view)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view)) { // the view relationships $views = array(###VIEWARRAY### diff --git a/admin/compiler/joomla_3/BaseControllerAjax.php b/admin/compiler/joomla_3/BaseControllerAjax.php index fb3b4ac1c..1d9640c5b 100644 --- a/admin/compiler/joomla_3/BaseControllerAjax.php +++ b/admin/compiler/joomla_3/BaseControllerAjax.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,9 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -29,9 +31,9 @@ class ###Component###ControllerAjax extends BaseController { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getDocument()->setMimeEncoding( 'application/json' ); // get the application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); $app->setHeader('Access-Control-Allow-Origin', '*'); // load the tasks ###REGISTER_AJAX_TASK### @@ -40,16 +42,16 @@ class ###Component###ControllerAjax extends BaseController public function ajax() { // get the user for later use - $user = JFactory::getUser(); + $user = Factory::getUser(); // get the input values - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; // check if we should return raw - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); // return to a callback function - $callback = $jinput->get('callback', null, 'CMD'); + $callback = $jinput->get('callback', null, 'CMD'); // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { // get the task diff --git a/admin/compiler/joomla_3/BaseControllerAjaxSite.php b/admin/compiler/joomla_3/BaseControllerAjaxSite.php index b32768f64..a02fa0127 100644 --- a/admin/compiler/joomla_3/BaseControllerAjaxSite.php +++ b/admin/compiler/joomla_3/BaseControllerAjaxSite.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,9 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -29,9 +31,9 @@ class ###Component###ControllerAjax extends BaseController { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getDocument()->setMimeEncoding( 'application/json' ); // get the application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); $app->setHeader('Access-Control-Allow-Origin', '*'); // load the tasks ###REGISTER_SITE_AJAX_TASK### @@ -40,16 +42,16 @@ class ###Component###ControllerAjax extends BaseController public function ajax() { // get the user for later use - $user = JFactory::getUser(); + $user = Factory::getUser(); // get the input values - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; // check if we should return raw - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); // return to a callback function - $callback = $jinput->get('callback', null, 'CMD'); + $callback = $jinput->get('callback', null, 'CMD'); // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { // get the task @@ -71,7 +73,7 @@ class ###Component###ControllerAjax extends BaseController echo json_encode(false); } else - { + { echo "(".json_encode(false).");"; } } diff --git a/admin/compiler/joomla_3/BaseControllerHelp.php b/admin/compiler/joomla_3/BaseControllerHelp.php index 86f92aa41..8cd3d0ebf 100644 --- a/admin/compiler/joomla_3/BaseControllerHelp.php +++ b/admin/compiler/joomla_3/BaseControllerHelp.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -34,12 +37,12 @@ class ###Component###ControllerHelp extends BaseController public function help() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); - if($user->id != 0 && $token == $call_token) + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) { $task = $this->getTask(); switch($task){ @@ -67,7 +70,7 @@ class ###Component###ControllerHelp extends BaseController break; } } - else + else { // stop execution gracefully jexit(); @@ -76,8 +79,8 @@ class ###Component###ControllerHelp extends BaseController protected function getHelpDocumentText($id) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true); + $db = Factory::getDbo(); + $query = $db->getQuery(true); $query->select(array('a.title','a.content')); $query->from('#__###component###_help_document AS a'); $query->where('a.id = '.(int) $id); @@ -86,21 +89,21 @@ class ###Component###ControllerHelp extends BaseController $db->execute(); if($db->getNumRows()) { - $text = array(); + $text = []; $document = $db->loadObject(); // fix image issue - $images['src="images'] = 'src="'.JURI::root().'images'; - $images["src='images"] = "src='".JURI::root()."images"; - $images['src="/images'] = 'src="'.JURI::root().'images'; - $images["src='/images"] = "src='".JURI::root()."images"; + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; // set document template $text[] = ""; $text[] = ''; $text[] = ""; $text[] = ''; $text[] = "".$document->title.""; - $text[] = ''; - $text[] = ''; + $text[] = ''; + $text[] = ''; $text[] = ""; $text[] = '
'; $text[] = '
'; diff --git a/admin/compiler/joomla_3/BaseControllerHelp_site.php b/admin/compiler/joomla_3/BaseControllerHelp_site.php index 2df722c4b..dfeb2d229 100644 --- a/admin/compiler/joomla_3/BaseControllerHelp_site.php +++ b/admin/compiler/joomla_3/BaseControllerHelp_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -34,12 +37,12 @@ class ###Component###ControllerHelp extends BaseController public function help() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token) + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) { $task = $this->getTask(); switch($task){ @@ -76,8 +79,8 @@ class ###Component###ControllerHelp extends BaseController protected function getHelpDocumentText($id) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true); + $db = Factory::getDbo(); + $query = $db->getQuery(true); $query->select(array('a.title','a.content')); $query->from('#__###component###_help_document AS a'); $query->where('a.id = '.(int) $id); @@ -87,21 +90,21 @@ class ###Component###ControllerHelp extends BaseController $db->execute(); if($db->getNumRows()) { - $text = array(); + $text = []; $document = $db->loadObject(); // fix image issue - $images['src="images'] = 'src="'.JURI::root().'images'; - $images["src='images"] = "src='".JURI::root()."images"; - $images['src="/images'] = 'src="'.JURI::root().'images'; - $images["src='/images"] = "src='".JURI::root()."images"; + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; // set document template $text[] = ""; $text[] = ''; $text[] = ""; $text[] = ''; $text[] = "".$document->title.""; - $text[] = ''; - $text[] = ''; + $text[] = ''; + $text[] = ''; $text[] = ""; $text[] = '
'; $text[] = '
'; diff --git a/admin/compiler/joomla_3/BaseControllerSITE.php b/admin/compiler/joomla_3/BaseControllerSITE.php index af2bde03e..cee5dbb72 100644 --- a/admin/compiler/joomla_3/BaseControllerSITE.php +++ b/admin/compiler/joomla_3/BaseControllerSITE.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,8 +17,11 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; /** * ###Component### Component Base Controller @@ -37,51 +40,51 @@ class ###Component###Controller extends BaseController function display($cachable = false, $urlparams = false) { // set default view if not set - $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); + $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); $this->input->set('view', $view); - $isEdit = $this->checkEditView($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); - // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) - + $isEdit = $this->checkEditView($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); + // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) + // insure that the view is not cashable if edit view or if user is logged in - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->get('id') || $isEdit) { $cachable = false; } - + // Check for edit form. if($isEdit) { if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ###Component###Helper::checkString($ref)) + if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (###Component###Helper::checkString($ref)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false)); } else { // normal redirect back to the list default site view - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false)); } return false; } } - + // we may need to make this more dynamic in the future. (TODO) $safeurlparams = array( 'catid' => 'INT', @@ -102,9 +105,9 @@ class ###Component###Controller extends BaseController 'Itemid' => 'INT'); // should these not merge? - if (###Component###Helper::checkArray($urlparams)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($urlparams)) { - $safeurlparams = ###Component###Helper::mergeArrays(array($urlparams, $safeurlparams)); + $safeurlparams = Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge(array($urlparams, $safeurlparams)); } return parent::display($cachable, $safeurlparams); @@ -112,7 +115,7 @@ class ###Component###Controller extends BaseController protected function checkEditView($view) { - if (###Component###Helper::checkString($view)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view)) { $views = array(###SITE_EDIT_VIEW_ARRAY### ); diff --git a/admin/compiler/joomla_3/BaseController_custom_admin.php b/admin/compiler/joomla_3/BaseController_custom_admin.php index 8ed50653a..3976b770a 100644 --- a/admin/compiler/joomla_3/BaseController_custom_admin.php +++ b/admin/compiler/joomla_3/BaseController_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -31,7 +31,7 @@ class ###Component###Controller###SView### extends BaseController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_###component###', false)); + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); return; }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### } diff --git a/admin/compiler/joomla_3/BaseController_import.php b/admin/compiler/joomla_3/BaseController_import.php index 504c266f2..f5811358a 100644 --- a/admin/compiler/joomla_3/BaseController_import.php +++ b/admin/compiler/joomla_3/BaseController_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -32,21 +32,21 @@ class ###Component###ControllerImport extends BaseController public function import() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $model = $this->getModel('import'); if ($model->import()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $redirect_url = $app->getUserState('com_###component###.redirect_url'); if (empty($redirect_url)) { - $redirect_url = JRoute::_('index.php?option=com_###component###&view=import', false); + $redirect_url = Route::_('index.php?option=com_###component###&view=import', false); } else { diff --git a/admin/compiler/joomla_3/BaseController_import_custom.php b/admin/compiler/joomla_3/BaseController_import_custom.php index dbe424603..a9283454a 100644 --- a/admin/compiler/joomla_3/BaseController_import_custom.php +++ b/admin/compiler/joomla_3/BaseController_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -32,21 +32,21 @@ class ###Component###Controller###View### extends BaseController public function import() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $model = $this->getModel('###View###'); if ($model->import()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $redirect_url = $app->getUserState('com_###component###.redirect_url'); if (empty($redirect_url)) { - $redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false); + $redirect_url = Route::_('index.php?option=com_###component###&view=###view###', false); } else { diff --git a/admin/compiler/joomla_3/BaseDatabaseModel_import.php b/admin/compiler/joomla_3/BaseDatabaseModel_import.php index f7501c7ec..020739141 100644 --- a/admin/compiler/joomla_3/BaseDatabaseModel_import.php +++ b/admin/compiler/joomla_3/BaseDatabaseModel_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -27,8 +27,8 @@ class ###Component###ModelImport extends BaseDatabaseModel // set uploading values protected $use_streams = false; protected $allow_unsafe = false; - protected $safeFileOptions = array(); - + protected $safeFileOptions = []; + /** * @var object JTable object */ @@ -45,13 +45,13 @@ class ###Component###ModelImport extends BaseDatabaseModel * @var string */ protected $_context = 'com_###component###.import'; - + /** * Import Settings */ - protected $getType = NULL; - protected $dataType = NULL; - + protected $getType = NULL; + protected $dataType = NULL; + /** * Method to auto-populate the model state. * @@ -62,7 +62,7 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function populateState() { - $app = JFactory::getApplication('administrator'); + $app = Factory::getApplication('administrator'); $this->setState('message', $app->getUserState('com_###component###.message')); $app->setUserState('com_###component###.message', ''); @@ -82,14 +82,14 @@ class ###Component###ModelImport extends BaseDatabaseModel public function import() { $this->setState('action', 'import'); - $app = JFactory::getApplication(); - $session = JFactory::getSession(); + $app = Factory::getApplication(); + $session = Factory::getSession(); $package = null; $continue = false; // get import type $this->getType = $app->input->getString('gettype', NULL); // get import type - $this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL); + $this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL); if ($package === null) { @@ -110,9 +110,9 @@ class ###Component###ModelImport extends BaseDatabaseModel break; case 'continue': - $continue = true; - $package = $session->get('package', null); - $package = json_decode($package, true); + $continue = true; + $package = $session->get('package', null); + $package = json_decode($package, true); // clear session $session->clear('package'); $session->clear('dataType'); @@ -120,7 +120,7 @@ class ###Component###ModelImport extends BaseDatabaseModel break; default: - $app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND')); + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND')); return false; break; @@ -134,10 +134,10 @@ class ###Component###ModelImport extends BaseDatabaseModel $this->remove($package['packagename']); } - $app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE')); + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE')); return false; } - + // first link data to table headers if(!$continue){ $package = json_encode($package); @@ -146,13 +146,13 @@ class ###Component###ModelImport extends BaseDatabaseModel $session->set('hasPackage', true); return true; } - + // set the data $headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true); if (!$this->setData($package,$this->dataType,$headerList)) { // There was an error importing the package - $msg = JText::_('COM_###COMPONENT###_IMPORT_ERROR'); + $msg = Text::_('COM_###COMPONENT###_IMPORT_ERROR'); $back = $session->get('backto_VDM_IMPORT', NULL); if ($back) { @@ -164,12 +164,12 @@ class ###Component###ModelImport extends BaseDatabaseModel else { // Package imported sucessfully - $msg = JText::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']); + $msg = Text::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']); $back = $session->get('backto_VDM_IMPORT', NULL); if ($back) { - $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); - $session->clear('backto_VDM_IMPORT'); + $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); + $session->clear('backto_VDM_IMPORT'); } $result = true; } @@ -180,7 +180,7 @@ class ###Component###ModelImport extends BaseDatabaseModel // remove file after import $this->remove($package['packagename']); $session->clear($this->getType.'_VDM_IMPORTHEADERS'); - + return $result; } @@ -190,48 +190,47 @@ class ###Component###ModelImport extends BaseDatabaseModel * @return spreadsheet definition or false on failure */ protected function _getPackageFromUpload() - { + { // Get the uploaded file information - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. $userfile = $input->files->get('import_package', null, 'raw'); - + // Make sure that file uploads are enabled in php if (!(bool) ini_get('file_uploads')) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); return false; } // If there is no uploaded file, we have a problem... if (!is_array($userfile)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); return false; } // Check if there was a problem uploading the file. if ($userfile['error'] || $userfile['size'] < 1) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); return false; } // Build the appropriate paths - $config = JFactory::getConfig(); + $config = Factory::getConfig(); $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_src = $userfile['tmp_name']; // Move uploaded file - jimport('joomla.filesystem.file'); $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); // Was the package downloaded? if (!$p_file) { - $session = JFactory::getSession(); + $session = Factory::getSession(); $session->clear('package'); $session->clear('dataType'); $session->clear('hasPackage'); @@ -253,16 +252,16 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function _getPackageFromFolder() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Get the path to the package to import $p_dir = $input->getString('import_directory'); - $p_dir = JPath::clean($p_dir); + $p_dir = Path::clean($p_dir); // Did you give us a valid path? if (!file_exists($p_dir)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); return false; } @@ -272,17 +271,17 @@ class ###Component###ModelImport extends BaseDatabaseModel // Did you give us a valid package? if (!$type) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); } - + // check the extention if(!$this->checkExtension($p_dir)) { // set error message - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - + $package['packagename'] = null; $package['dir'] = $p_dir; $package['type'] = $type; @@ -298,26 +297,26 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function _getPackageFromUrl() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; - + // Get the URL of the package to import $url = $input->getString('import_url'); // Did you give us a URL? if (!$url) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); return false; } // Download the package at the URL given - $p_file = JInstallerHelper::downloadPackage($url); + $p_file = InstallerHelper::downloadPackage($url); // Was the package downloaded? if (!$p_file) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); return false; } @@ -326,7 +325,7 @@ class ###Component###ModelImport extends BaseDatabaseModel return $package; } - + /** * Check a file and verifies it as a spreadsheet file * Supports .csv .xlsx .xls and .ods @@ -338,29 +337,29 @@ class ###Component###ModelImport extends BaseDatabaseModel */ protected function check($archivename) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Clean the name - $archivename = JPath::clean($archivename); - + $archivename = Path::clean($archivename); + // check the extention if(!$this->checkExtension($archivename)) { // Cleanup the import files $this->remove($archivename); - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - - $config = JFactory::getConfig(); + + $config = Factory::getConfig(); // set Package Name $check['packagename'] = $archivename; - + // set directory $check['dir'] = $config->get('tmp_path'). '/' .$archivename; - + // set type $check['type'] = $this->getType; - + return $check; }###IMPORT_EXT_METHOD### @@ -375,8 +374,8 @@ class ###Component###ModelImport extends BaseDatabaseModel protected function remove($package) { jimport('joomla.filesystem.file'); - - $config = JFactory::getConfig(); + + $config = Factory::getConfig(); $package = $config->get('tmp_path'). '/' .$package; // Is the package file a valid file? @@ -384,23 +383,23 @@ class ###Component###ModelImport extends BaseDatabaseModel { File::delete($package); } - elseif (is_file(JPath::clean($package))) + elseif (is_file(Path::clean($package))) { // It might also be just a base filename - File::delete(JPath::clean($package)); + File::delete(Path::clean($package)); } }###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD### protected function getAlias($name,$type = false) { // sanitize the name to an alias - if (JFactory::getConfig()->get('unicodeslugs') == 1) + if (Factory::getConfig()->get('unicodeslugs') == 1) { - $alias = JFilterOutput::stringURLUnicodeSlug($name); + $alias = OutputFilter::stringURLUnicodeSlug($name); } else { - $alias = JFilterOutput::stringURLSafe($name); + $alias = OutputFilter::stringURLSafe($name); } // must be a uniqe alias if ($type) @@ -409,7 +408,7 @@ class ###Component###ModelImport extends BaseDatabaseModel } return $alias; } - + /** * Method to generate a uniqe value. * @@ -424,16 +423,16 @@ class ###Component###ModelImport extends BaseDatabaseModel // insure the filed is always uniqe while (isset($this->uniqeValueArray[$type][$field][$value])) { - $value = JString::increment($value, 'dash'); + $value = StringHelper::increment($value, 'dash'); } $this->uniqeValueArray[$type][$field][$value] = $value; return $value; } - + protected function getAliasesUsed($table) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // first we check if there is a alias column $columns = $db->getTableColumns('#__###component###_'.$table); if(isset($columns['alias'])){ diff --git a/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php b/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php index 19be712eb..e429a0223 100644 --- a/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php +++ b/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -27,8 +27,8 @@ class ###Component###Model###View### extends BaseDatabaseModel // set uploading values protected $use_streams = false; protected $allow_unsafe = false; - protected $safeFileOptions = array(); - + protected $safeFileOptions = []; + /** * @var object JTable object */ @@ -45,13 +45,13 @@ class ###Component###Model###View### extends BaseDatabaseModel * @var string */ protected $_context = 'com_###component###.###view###'; - + /** * Import Settings */ protected $getType = NULL; protected $dataType = NULL; - + /** * Method to auto-populate the model state. * @@ -62,7 +62,7 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function populateState() { - $app = JFactory::getApplication('administrator'); + $app = Factory::getApplication('administrator'); $this->setState('message', $app->getUserState('com_###component###.message')); $app->setUserState('com_###component###.message', ''); @@ -72,7 +72,7 @@ class ###Component###Model###View### extends BaseDatabaseModel $this->setState('import.directory', $path); parent::populateState(); } - ###IMPORT_METHOD_CUSTOM### + ###IMPORT_METHOD_CUSTOM### /** * Works out an importation spreadsheet from a HTTP upload @@ -80,37 +80,37 @@ class ###Component###Model###View### extends BaseDatabaseModel * @return spreadsheet definition or false on failure */ protected function _getPackageFromUpload() - { + { // Get the uploaded file information - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. $userfile = $input->files->get('import_package', null, 'raw'); - + // Make sure that file uploads are enabled in php if (!(bool) ini_get('file_uploads')) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); return false; } // If there is no uploaded file, we have a problem... if (!is_array($userfile)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); return false; } // Check if there was a problem uploading the file. if ($userfile['error'] || $userfile['size'] < 1) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); return false; } // Build the appropriate paths - $config = JFactory::getConfig(); + $config = Factory::getConfig(); $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; $tmp_src = $userfile['tmp_name']; @@ -120,7 +120,7 @@ class ###Component###Model###View### extends BaseDatabaseModel // Was the package downloaded? if (!$p_file) { - $session = JFactory::getSession(); + $session = Factory::getSession(); $session->clear('package'); $session->clear('dataType'); $session->clear('hasPackage'); @@ -142,16 +142,16 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function _getPackageFromFolder() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Get the path to the package to import $p_dir = $input->getString('import_directory'); - $p_dir = JPath::clean($p_dir); + $p_dir = Path::clean($p_dir); // Did you give us a valid path? if (!file_exists($p_dir)) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); return false; } @@ -161,17 +161,17 @@ class ###Component###Model###View### extends BaseDatabaseModel // Did you give us a valid package? if (!$type) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); } - + // check the extention if(!$this->checkExtension($p_dir)) { // set error message - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - + $package['packagename'] = null; $package['dir'] = $p_dir; $package['type'] = $type; @@ -187,7 +187,7 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function _getPackageFromUrl() { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $input = $app->input; // Get the URL of the package to import @@ -196,17 +196,17 @@ class ###Component###Model###View### extends BaseDatabaseModel // Did you give us a URL? if (!$url) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); return false; } // Download the package at the URL given - $p_file = JInstallerHelper::downloadPackage($url); + $p_file = InstallerHelper::downloadPackage($url); // Was the package downloaded? if (!$p_file) { - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); return false; } @@ -215,7 +215,7 @@ class ###Component###Model###View### extends BaseDatabaseModel return $package; } - + /** * Check a file and verifies it as a spreadsheet file * Supports .csv .xlsx .xls and .ods @@ -227,29 +227,29 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function check($archivename) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Clean the name - $archivename = JPath::clean($archivename); - + $archivename = Path::clean($archivename); + // check the extention if(!$this->checkExtension($archivename)) { // Cleanup the import files $this->remove($archivename); - $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; } - - $config = JFactory::getConfig(); + + $config = Factory::getConfig(); // set Package Name $check['packagename'] = $archivename; - + // set directory $check['dir'] = $config->get('tmp_path'). '/' .$archivename; - + // set type $check['type'] = $this->getType; - + return $check; } ###IMPORT_EXT_METHOD### @@ -264,9 +264,7 @@ class ###Component###Model###View### extends BaseDatabaseModel */ protected function remove($package) { - jimport('joomla.filesystem.file'); - - $config = JFactory::getConfig(); + $config = Factory::getConfig(); $package = $config->get('tmp_path'). '/' .$package; // Is the package file a valid file? @@ -274,10 +272,10 @@ class ###Component###Model###View### extends BaseDatabaseModel { File::delete($package); } - elseif (is_file(JPath::clean($package))) + elseif (is_file(Path::clean($package))) { // It might also be just a base filename - File::delete(JPath::clean($package)); + File::delete(Path::clean($package)); } } ###IMPORT_SETDATA_METHOD### @@ -286,13 +284,13 @@ class ###Component###Model###View### extends BaseDatabaseModel protected function getAlias($name,$type = false) { // sanitize the name to an alias - if (JFactory::getConfig()->get('unicodeslugs') == 1) + if (Factory::getConfig()->get('unicodeslugs') == 1) { - $alias = JFilterOutput::stringURLUnicodeSlug($name); + $alias = OutputFilter::stringURLUnicodeSlug($name); } else { - $alias = JFilterOutput::stringURLSafe($name); + $alias = OutputFilter::stringURLSafe($name); } // must be a uniqe alias if ($type) @@ -301,7 +299,7 @@ class ###Component###Model###View### extends BaseDatabaseModel } return $alias; } - + /** * Method to generate a uniqe value. * @@ -316,16 +314,16 @@ class ###Component###Model###View### extends BaseDatabaseModel // insure the filed is always uniqe while (isset($this->uniqeValueArray[$type][$field][$value])) { - $value = JString::increment($value, 'dash'); + $value = StringHelper::increment($value, 'dash'); } $this->uniqeValueArray[$type][$field][$value] = $value; return $value; } - + protected function getAliasesUsed($table) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // first we check if there is a alias column $columns = $db->getTableColumns('#__###component###_'.$table); if(isset($columns['alias'])){ diff --git a/admin/compiler/joomla_3/DASHJViewLagacy.php b/admin/compiler/joomla_3/DASHJViewLagacy.php index c9a759f75..d8dc3d60f 100644 --- a/admin/compiler/joomla_3/DASHJViewLagacy.php +++ b/admin/compiler/joomla_3/DASHJViewLagacy.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,7 +22,7 @@ defined('_JEXEC') or die('Restricted access'); /** * ###Component### View class */ -class ###Component###View###Component### extends JViewLegacy +class ###Component###View###Component### extends HtmlView { /** * View display method @@ -31,15 +31,15 @@ class ###Component###View###Component### extends JViewLegacy function display($tpl = null) { // Assign data to the view - $this->icons = $this->get('Icons'); - $this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA### - + $this->icons = $this->get('Icons'); + $this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA### + // get the manifest details of the component $this->manifest = ###Component###Helper::manifest(); - + // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -59,18 +59,18 @@ class ###Component###View###Component### extends JViewLegacy protected function addToolBar() { $canDo = ###Component###Helper::getActions('###component###'); - JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###component###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } if ($canDo->get('core.admin') || $canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } } @@ -81,15 +81,17 @@ class ###Component###View###Component### extends JViewLegacy */ protected function setDocument() { - $document = JFactory::getDocument(); - - // add dashboard style sheets - $document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/dashboard.css"); - + if (!isset($this->document)) + { + $this->document = Factory::getDocument(); + } // set page title - $document->setTitle(JText::_('COM_###COMPONENT###_DASHBOARD')); - + $this->document->setTitle(Text::_('COM_###COMPONENT###_DASHBOARD')); + // add manifest to page JavaScript - $document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript"); + $this->document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript"); + + // add dashboard style sheets + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/dashboard.css", ['version' => 'auto']); } } diff --git a/admin/compiler/joomla_3/DASHdefault.php b/admin/compiler/joomla_3/DASHdefault.php index 14691c6cd..bda607bcf 100644 --- a/admin/compiler/joomla_3/DASHdefault.php +++ b/admin/compiler/joomla_3/DASHdefault.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/FormController.php b/admin/compiler/joomla_3/FormController.php index feb4ec217..59827b281 100644 --- a/admin/compiler/joomla_3/FormController.php +++ b/admin/compiler/joomla_3/FormController.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -40,13 +40,13 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = '###Views###'; // safeguard for setting the return view listing to the main view. parent::__construct($config); }###ADMIN_CUSTOM_BUTTONS_CONTROLLER### - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) {###JCONTROLLERFORM_ALLOWADD### } @@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JCONTROLLERFORM_ALLOWEDIT### } @@ -94,12 +94,12 @@ class ###Component###Controller###View### extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('###View###', '', array()); + $model = $this->getModel('###View###', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -147,13 +147,13 @@ class ###Component###Controller###View### extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -164,7 +164,7 @@ class ###Component###Controller###View### extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -175,7 +175,7 @@ class ###Component###Controller###View### extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -253,15 +253,14 @@ class ###Component###Controller###View### extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) {###POSTSAVEHOOK### } - } diff --git a/admin/compiler/joomla_3/FormController_custom_site.php b/admin/compiler/joomla_3/FormController_custom_site.php index 8d6d30cd5..6f38faedb 100644 --- a/admin/compiler/joomla_3/FormController_custom_site.php +++ b/admin/compiler/joomla_3/FormController_custom_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -33,7 +33,7 @@ class ###Component###Controller###SView### extends FormController */ protected $task; - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view. parent::__construct($config); @@ -51,13 +51,13 @@ class ###Component###Controller###SView### extends FormController * * @since 12.2 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // to insure no other tampering return false; } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -66,7 +66,7 @@ class ###Component###Controller###SView### extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // to insure no other tampering return false; @@ -101,7 +101,7 @@ class ###Component###Controller###SView### extends FormController * * @since 12.2 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(JModelLegacy $model, $validData = []) { } } diff --git a/admin/compiler/joomla_3/FormController_site.php b/admin/compiler/joomla_3/FormController_site.php index 530f3ac90..b55b176fc 100644 --- a/admin/compiler/joomla_3/FormController_site.php +++ b/admin/compiler/joomla_3/FormController_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -40,13 +40,13 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view. parent::__construct($config); }###ADMIN_CUSTOM_BUTTONS_CONTROLLER### - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) {###JCONTROLLERFORM_ALLOWADD### } @@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') {###JCONTROLLERFORM_ALLOWEDIT### } @@ -94,12 +94,12 @@ class ###Component###Controller###View### extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('###View###', '', array()); + $model = $this->getModel('###View###', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -147,35 +147,35 @@ class ###Component###Controller###View### extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -253,14 +253,14 @@ class ###Component###Controller###View### extends FormController * Function that allows child controller access to model data * after the data has been saved. * - * @param JModel &$model The data model object. - * @param array $validData The validated data. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) {###POSTSAVEHOOK### } diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index ded32f2d4..6caa65c0a 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -29,7 +29,7 @@ abstract class ###Component###Helper * * @var array */ - protected static $composer = array(); + protected static $composer = []; /** * The Main Active Language @@ -80,7 +80,7 @@ abstract class ###Component###Helper // check if set if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -91,18 +91,18 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) - { + { if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } @@ -116,8 +116,8 @@ abstract class ###Component###Helper $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -129,7 +129,7 @@ abstract class ###Component###Helper public static function addSubmenu($submenu) { // load user for access menus - $user = JFactory::getUser(); + $user = Factory::getUser(); // load the submenus to sidebar ###SUBMENU### }###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL### @@ -211,7 +211,7 @@ abstract class ###Component###Helper { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -229,7 +229,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -238,7 +238,7 @@ abstract class ###Component###Helper $db->execute(); $found = $db->getNumRows(); if($found) - { + { return $db->loadResult(); } return $id; @@ -254,7 +254,7 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions + * @return object The CMSObject of permission/authorised actions * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') @@ -263,22 +263,22 @@ abstract class ###Component###Helper if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); - } + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; @@ -445,14 +445,14 @@ abstract class ###Component###Helper /** * Get any component's model */ - public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = []) { // fix the name $name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name); // full path to models $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model'); // make sure the table path is loaded if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path'])) { @@ -460,7 +460,7 @@ abstract class ###Component###Helper $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; } // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { @@ -495,14 +495,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -526,14 +526,14 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else @@ -546,7 +546,7 @@ abstract class ###Component###Helper $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -563,7 +563,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -578,8 +578,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -594,7 +594,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -602,8 +602,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -648,7 +648,7 @@ abstract class ###Component###Helper * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -662,7 +662,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -733,7 +733,7 @@ abstract class ###Component###Helper /** * Check if have an json string * - * @input string The json string to check + * @input string The json string to check * * @returns bool true on success * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); @@ -746,7 +746,7 @@ abstract class ###Component###Helper /** * Check if have an object with a length * - * @input object The object to check + * @input object The object to check * * @returns bool true on success * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); @@ -759,7 +759,7 @@ abstract class ###Component###Helper /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); @@ -772,7 +772,7 @@ abstract class ###Component###Helper /** * Check if have a string with a length * - * @input string The string to check + * @input string The string to check * * @returns bool true on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); @@ -792,7 +792,7 @@ abstract class ###Component###Helper { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -810,7 +810,7 @@ abstract class ###Component###Helper /** * Merge an array of array's * - * @input array The arrays you would like to merge + * @input array The arrays you would like to merge * * @returns array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); @@ -829,7 +829,7 @@ abstract class ###Component###Helper /** * Shorten a string * - * @input string The you would like to shorten + * @input string The you would like to shorten * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); @@ -842,7 +842,7 @@ abstract class ###Component###Helper /** * Making strings safe (various ways) * - * @input string The you would like to make safe + * @input string The you would like to make safe * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); @@ -861,7 +861,7 @@ abstract class ###Component###Helper /** * Convert none English strings to code usable string * - * @input an string + * @input an string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); @@ -874,7 +874,7 @@ abstract class ###Component###Helper /** * make sure a string is HTML save * - * @input an html string + * @input an html string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); @@ -892,7 +892,7 @@ abstract class ###Component###Helper /** * Convert all int in a string to an English word string * - * @input an string with numbers + * @input an string with numbers * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); @@ -906,7 +906,7 @@ abstract class ###Component###Helper * Convert an integer into an English word string * Thanks to Tom Nicholson * - * @input an int + * @input an int * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); */ diff --git a/admin/compiler/joomla_3/Helper_category.php b/admin/compiler/joomla_3/Helper_category.php index ad4ed490c..193ebff3a 100644 --- a/admin/compiler/joomla_3/Helper_category.php +++ b/admin/compiler/joomla_3/Helper_category.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/Helper_category_view.php b/admin/compiler/joomla_3/Helper_category_view.php index 53e2d88d3..ac2046a0e 100644 --- a/admin/compiler/joomla_3/Helper_category_view.php +++ b/admin/compiler/joomla_3/Helper_category_view.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -28,7 +28,7 @@ class ###Component######View###Categories extends JCategories * @param array $options Array of options * */ - public function __construct($options = array()) + public function __construct($options = []) { $options['table'] = '#__###component###_###view###'; $options['extension'] = 'com_###component###.###view###'; diff --git a/admin/compiler/joomla_3/Helper_email.php b/admin/compiler/joomla_3/Helper_email.php index 309817cac..f51347eb9 100644 --- a/admin/compiler/joomla_3/Helper_email.php +++ b/admin/compiler/joomla_3/Helper_email.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,11 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Mail\Mail; +use Joomla\Registry\Registry; + /** * ###Component### component email helper */ @@ -27,28 +32,28 @@ abstract class ###Component###Email * * @var activeRecipient (array) */ - public static $active = array(); + public static $active = []; /** * Configuraiton object * - * @var JConfig + * @var Registry */ - public static $config = null; + public static ?Registry $config = null; /** * Mailer object * - * @var JMail + * @var Mail */ - public static $mailer = null; + public static ?Mail $mailer = null; /** * Custom Headers * * @var array */ - protected static $header = array(); + protected static array $header = []; /** * Get a configuration object @@ -58,7 +63,7 @@ abstract class ###Component###Email { if (!self::$config) { - self::$config = JComponentHelper::getParams('com_###component###'); + self::$config = ComponentHelper::getParams('com_###component###'); } return self::$config; @@ -97,7 +102,7 @@ abstract class ###Component###Email * @static * @access public */ - public static function validateAddress($address, $patternselect = null) + public static function validateAddress($address, $patternselect = null): bool { return self::getMailerInstance()->validateAddress($address, $patternselect); } @@ -105,13 +110,13 @@ abstract class ###Component###Email /** * Get a mailer object. * - * Returns the global {@link JMail} object, only creating it if it doesn't already exist. + * Returns the global {@link Mail} object, only creating it if it doesn't already exist. * - * @return JMail object + * @return Mail object * - * @see JMail + * @see Mail */ - public static function getMailer() + public static function getMailer(): Mail { if (!self::$mailer) { @@ -126,58 +131,58 @@ abstract class ###Component###Email /** * Create a mailer object * - * @return JMail object + * @return Mail object * - * @see JMail + * @see Mail */ - protected static function createMailer() + protected static function createMailer(): Mail { // set component params $conf = self::getConfig(); - + // now load the mailer $mailer = $conf->get('mailer', 'global'); - - // Create a JMail object - $mail = JMail::getInstance(); + + // Create a Mail object + $mail = Mail::getInstance(); // check if set to global if ('global' == $mailer) { // get the global details - $globalConf = JFactory::getConfig(); - - $mailer = $globalConf->get('mailer'); - $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; - $smtpuser = $globalConf->get('smtpuser'); - $smtppass = $globalConf->get('smtppass'); - $smtphost = $globalConf->get('smtphost'); - $smtpsecure = $globalConf->get('smtpsecure'); - $smtpport = $globalConf->get('smtpport'); - $sendmail = $globalConf->get('sendmail'); - $mailfrom = $globalConf->get('mailfrom'); - $fromname = $globalConf->get('fromname'); - $replyto = $globalConf->get('replyto'); - $replytoname = $globalConf->get('replytoname'); + $globalConf = Factory::getConfig(); + + $mailer = $globalConf->get('mailer'); + $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $globalConf->get('smtpuser'); + $smtppass = $globalConf->get('smtppass'); + $smtphost = $globalConf->get('smtphost'); + $smtpsecure = $globalConf->get('smtpsecure'); + $smtpport = $globalConf->get('smtpport'); + $sendmail = $globalConf->get('sendmail'); + $mailfrom = $globalConf->get('mailfrom'); + $fromname = $globalConf->get('fromname'); + $replyto = $globalConf->get('replyto'); + $replytoname = $globalConf->get('replytoname'); } else { - $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; - $smtpuser = $conf->get('smtpuser'); - $smtppass = $conf->get('smtppass'); - $smtphost = $conf->get('smtphost'); - $smtpsecure = $conf->get('smtpsecure'); - $smtpport = $conf->get('smtpport'); - $sendmail = $conf->get('sendmail'); - $mailfrom = $conf->get('emailfrom'); - $fromname = $conf->get('fromname'); - $replyto = $conf->get('replyto'); - $replytoname = $conf->get('replytoname'); + $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $conf->get('smtpuser'); + $smtppass = $conf->get('smtppass'); + $smtphost = $conf->get('smtphost'); + $smtpsecure = $conf->get('smtpsecure'); + $smtpport = $conf->get('smtpport'); + $sendmail = $conf->get('sendmail'); + $mailfrom = $conf->get('emailfrom'); + $fromname = $conf->get('fromname'); + $replyto = $conf->get('replyto'); + $replytoname = $conf->get('replytoname'); } // Set global sender $mail->setSender(array($mailfrom, $fromname)); - + // set the global reply-to if found if ($replyto && $replytoname) { @@ -226,25 +231,25 @@ abstract class ###Component###Email */ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null) { - // Get a JMail instance + // Get a Mail instance $mail = self::getMailer(); - + // set component params $conf = self::getConfig(); - + // set if we have override if ($mailfrom && $fromname) { $mail->setSender(array($mailfrom, $fromname)); } - + // load the bounce email as sender if set if (!is_null($bounce_email)) - { + { $mail->Sender = $bounce_email; } - - // Add tag to email to identify it + + // Add tag to email to identify it if (!is_null($idsession)) { $mail->addCustomHeader('X-VDMmethodID:'.$idsession); @@ -262,7 +267,7 @@ abstract class ###Component###Email // set the subject & Body $mail->setSubject($subject); $mail->setBody($body); - + // Are we sending the email as HTML? if ($mode) { @@ -273,7 +278,7 @@ abstract class ###Component###Email //embed images if ($embeded) { - if(###Component###Helper::checkArray($embeds)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($embeds)) { foreach($embeds as $embed) { @@ -308,21 +313,21 @@ abstract class ###Component###Email { if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) { - $mail->DKIM_domain = $conf->get('dkim_domain'); - $mail->DKIM_selector = $conf->get('dkim_selector'); - $mail->DKIM_identity = $conf->get('dkim_identity'); - $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); - - $tmp = tempnam(sys_get_temp_dir(), 'VDM'); - $h = fopen($tmp, 'w'); + $mail->DKIM_domain = $conf->get('dkim_domain'); + $mail->DKIM_selector = $conf->get('dkim_selector'); + $mail->DKIM_identity = $conf->get('dkim_identity'); + $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); + + $tmp = tempnam(sys_get_temp_dir(), 'VDM'); + $h = fopen($tmp, 'w'); fwrite($h, $conf->get('dkim_private')); fclose($h); - $mail->DKIM_private = $tmp; + $mail->DKIM_private = $tmp; } } $sendmail = $mail->Send(); - + if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) { @unlink($tmp); @@ -351,7 +356,7 @@ abstract class ###Component###Email /** * Set html text (in a row) and subject (as title) to a email table. * do not use

instead use
- * in your html that you pass to this method + * in your html that you pass to this method * since it is a table row it does not * work well with paragraphs * @@ -360,7 +365,7 @@ abstract class ###Component###Email */ public static function setBasicBody($html, $subject) { - $body = array(); + $body = []; $body[] = ""; $body[] = ""; $body[] = ""; @@ -397,7 +402,7 @@ abstract class ###Component###Email /** * Set html text (in a row) and subject (as title) to a email table. * do not use

instead use
- * in your html that you pass to this method + * in your html that you pass to this method * since it is a table row it does not * work well with paragraphs * @@ -406,7 +411,7 @@ abstract class ###Component###Email */ public static function setTableBody($html, $subject) { - $body = array(); + $body = []; $body[] = ""; $body[] = ""; $body[] = ""; diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index 2f61d0c50..c831a708b 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -29,7 +29,7 @@ abstract class ###Component###Helper * * @var array */ - protected static $composer = array(); + protected static $composer = []; /** * The Main Active Language @@ -99,7 +99,7 @@ abstract class ###Component###Helper // check if set if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -110,9 +110,9 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) @@ -121,22 +121,22 @@ abstract class ###Component###Helper { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } - elseif($params->get("useContributor".$nr) == 2) - { + elseif($params->get("useContributor".$nr) == 2) + { $link_front = ''; $link_back = ''; } - else - { + else + { $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -145,14 +145,14 @@ abstract class ###Component###Helper /** * Get any component's model */ - public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = []) { // fix the name $name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name); // full path to models $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model'); // make sure the table path is loaded if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path'])) { @@ -160,7 +160,7 @@ abstract class ###Component###Helper $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; } // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { @@ -195,14 +195,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -226,14 +226,14 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else @@ -246,7 +246,7 @@ abstract class ###Component###Helper $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -263,7 +263,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -278,8 +278,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -294,7 +294,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -302,8 +302,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -348,7 +348,7 @@ abstract class ###Component###Helper * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -362,7 +362,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -488,7 +488,7 @@ abstract class ###Component###Helper { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -506,7 +506,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -531,7 +531,7 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions + * @return object The CMSObject of permission/authorised actions * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') @@ -540,22 +540,22 @@ abstract class ###Component###Helper if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); - } + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; @@ -722,7 +722,7 @@ abstract class ###Component###Helper /** * Check if have an json string * - * @input string The json string to check + * @input string The json string to check * * @returns bool true on success * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); @@ -735,7 +735,7 @@ abstract class ###Component###Helper /** * Check if have an object with a length * - * @input object The object to check + * @input object The object to check * * @returns bool true on success * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); @@ -748,7 +748,7 @@ abstract class ###Component###Helper /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); @@ -761,7 +761,7 @@ abstract class ###Component###Helper /** * Check if have a string with a length * - * @input string The string to check + * @input string The string to check * * @returns bool true on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); @@ -781,7 +781,7 @@ abstract class ###Component###Helper { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -799,7 +799,7 @@ abstract class ###Component###Helper /** * Merge an array of array's * - * @input array The arrays you would like to merge + * @input array The arrays you would like to merge * * @returns array on success * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); @@ -818,7 +818,7 @@ abstract class ###Component###Helper /** * Shorten a string * - * @input string The you would like to shorten + * @input string The you would like to shorten * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); @@ -831,7 +831,7 @@ abstract class ###Component###Helper /** * Making strings safe (various ways) * - * @input string The you would like to make safe + * @input string The you would like to make safe * * @returns string on success * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); @@ -850,7 +850,7 @@ abstract class ###Component###Helper /** * Convert none English strings to code usable string * - * @input an string + * @input an string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); @@ -863,7 +863,7 @@ abstract class ###Component###Helper /** * make sure a string is HTML save * - * @input an html string + * @input an html string * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); @@ -881,7 +881,7 @@ abstract class ###Component###Helper /** * Convert all int in a string to an English word string * - * @input an string with numbers + * @input an string with numbers * * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); @@ -895,7 +895,7 @@ abstract class ###Component###Helper * Convert an integer into an English word string * Thanks to Tom Nicholson * - * @input an int + * @input an int * @returns a string * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); */ diff --git a/admin/compiler/joomla_3/HtmlView_custom_admin.php b/admin/compiler/joomla_3/HtmlView_custom_admin.php index a7f97fbee..dc0f06ed4 100644 --- a/admin/compiler/joomla_3/HtmlView_custom_admin.php +++ b/admin/compiler/joomla_3/HtmlView_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED### -###CUSTOM_ADMIN_VIEW_HTML_HEADER### +###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SView### @@ -28,11 +28,11 @@ class ###Component###View###SView### extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### @@ -43,7 +43,7 @@ class ###Component###View###SView### extends HtmlView protected function setDocument() {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### } /** @@ -59,22 +59,22 @@ class ###Component###View###SView### extends HtmlView // Check for empty title and add view name if param is set if (empty($title)) { - $title = JText::_('COM_###COMPONENT###_###SVIEW###'); + $title = Text::_('COM_###COMPONENT###_###SVIEW###'); } // add title to the page - JToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + ToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } }###CUSTOM_ADMIN_GET_MODULE### @@ -88,7 +88,17 @@ class ###Component###View###SView### extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } ?> diff --git a/admin/compiler/joomla_3/HtmlView_edit.php b/admin/compiler/joomla_3/HtmlView_edit.php index 309e298b9..a0c3431a5 100644 --- a/admin/compiler/joomla_3/HtmlView_edit.php +++ b/admin/compiler/joomla_3/HtmlView_edit.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView // get action permissions $this->canDo = ###Component###Helper::getActions('###view###', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -65,7 +65,7 @@ class ###Component###View###View### extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -99,11 +99,11 @@ class ###Component###View###View### extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); } /** @@ -114,14 +114,20 @@ class ###Component###View###View### extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### - $this->document->addScript(JURI::root() . $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP### - JText::script('view not acceptable. Error'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP### + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_edit_site.php b/admin/compiler/joomla_3/HtmlView_edit_site.php index b2fd1f338..070fde9f5 100644 --- a/admin/compiler/joomla_3/HtmlView_edit_site.php +++ b/admin/compiler/joomla_3/HtmlView_edit_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView // get action permissions $this->canDo = ###Component###Helper::getActions('###view###', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -65,7 +65,7 @@ class ###Component###View###View### extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -86,7 +86,7 @@ class ###Component###View###View### extends HtmlView protected function addToolBar() {###ADDTOOLBAR### // now initiate the toolbar - $this->toolbar = JToolbar::getInstance(); + $this->toolbar = Toolbar::getInstance(); } /** @@ -100,11 +100,11 @@ class ###Component###View###View### extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); } /** @@ -115,11 +115,7 @@ class ###Component###View###View### extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); // only add the ISIS template css & js if needed (default is 1 = true) // you can override this in the global component options // just add a (radio yes/no field) with a name called add_isis_template @@ -127,14 +123,24 @@ class ###Component###View###View### extends HtmlView if ($this->params->get('add_isis_template', 1)) { // we need this to fix the form display (TODO) - $this->document->addStyleSheet(JURI::root() . "administrator/templates/isis/css/template.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); - $this->document->addScript(JURI::root() . "administrator/templates/isis/js/template.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('stylesheet', "administrator/templates/isis/css/template.css", ['version' => 'auto']); + Html::_('script', "administrator/templates/isis/js/template.js", ['version' => 'auto']); } // the default style of this view - $this->document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + Html::_('stylesheet', "components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### // default javascript of this view - $this->document->addScript(JURI::root(). $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP### - JText::script('view not acceptable. Error'); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP### + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_import.php b/admin/compiler/joomla_3/HtmlView_import.php index c19e19f8d..9569a7aec 100644 --- a/admin/compiler/joomla_3/HtmlView_import.php +++ b/admin/compiler/joomla_3/HtmlView_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; /** * ###Component### Import Html View @@ -31,7 +34,7 @@ class ###Component###ViewImport extends HtmlView protected $dataType; public function display($tpl = null) - { + { if ($this->getLayout() !== 'modal') { // Include helper submenu @@ -44,7 +47,7 @@ class ###Component###ViewImport extends HtmlView $this->paths = &$paths; $this->state = &$state; - // get global action permissions + // get global action permissions $this->canDo = ###Component###Helper::getActions('import'); // We don't need toolbar in the modal window. @@ -55,18 +58,18 @@ class ###Component###ViewImport extends HtmlView } // get the session object - $session = JFactory::getSession(); + $session = Factory::getSession(); // check if it has package - $this->hasPackage = $session->get('hasPackage', false); - $this->dataType = $session->get('dataType', false); + $this->hasPackage = $session->get('hasPackage', false); + $this->dataType = $session->get('dataType', false); if($this->hasPackage && $this->dataType) { - $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); - $this->headers = ###Component###Helper::getFileHeaders($this->dataType); + $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); + $this->headers = ###Component###Helper::getFileHeaders($this->dataType); // clear the data type $session->clear('dataType'); } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -82,19 +85,19 @@ class ###Component###ViewImport extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=import'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('import'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/compiler/joomla_3/HtmlView_import_custom.php b/admin/compiler/joomla_3/HtmlView_import_custom.php index bee878fc1..68390de5b 100644 --- a/admin/compiler/joomla_3/HtmlView_import_custom.php +++ b/admin/compiler/joomla_3/HtmlView_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; /** * ###Component### ###View### Html View @@ -30,19 +36,19 @@ class ###Component###View###View### extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=###view###'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###view###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/compiler/joomla_3/HtmlView_list.php b/admin/compiler/joomla_3/HtmlView_list.php index 740a8c545..f00898087 100644 --- a/admin/compiler/joomla_3/HtmlView_list.php +++ b/admin/compiler/joomla_3/HtmlView_list.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -40,10 +40,10 @@ class ###Component###View###Views### extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser();###ADMIN_DIPLAY_METHOD### + $this->user = Factory::getUser();###ADMIN_DIPLAY_METHOD### $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### @@ -58,7 +58,7 @@ class ###Component###View###Views### extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -77,32 +77,32 @@ class ###Component###View###Views### extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('###view###.add'); + ToolbarHelper::addNew('###view###.add'); } // Only load if there are items - if (###Component###Helper::checkArray($this->items)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('###view###.edit'); + ToolbarHelper::editList('###view###.edit'); } if ($this->canState) { - JToolBarHelper::publishList('###views###.publish'); - JToolBarHelper::unpublishList('###views###.unpublish'); - JToolBarHelper::archiveList('###views###.archive'); + ToolbarHelper::publishList('###views###.publish'); + ToolbarHelper::unpublishList('###views###.unpublish'); + ToolbarHelper::archiveList('###views###.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('###views###.checkin'); + ToolbarHelper::checkin('###views###.checkin'); } } @@ -110,11 +110,11 @@ class ###Component###View###Views### extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -122,25 +122,25 @@ class ###Component###View###Views### extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('###views###.trash'); + ToolbarHelper::trash('###views###.trash'); }###EXPORTBUTTON### }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON### // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###views###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); }###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER### } @@ -153,10 +153,10 @@ class ###Component###View###Views### extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_###COMPONENT###_###VIEWS###')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###ADMIN_ADD_JAVASCRIPT_FILE### + $this->document->setTitle(Text::_('COM_###COMPONENT###_###VIEWS###')); + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###views###.css", ['version' => 'auto']);###ADMIN_ADD_JAVASCRIPT_FILE### } /** @@ -171,19 +171,29 @@ class ###Component###View###Views### extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ###Component###Helper::htmlEscape($var, $this->_charset, true); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { ###SORTFIELDS### + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; }###FILTERFUNCTIONS### } diff --git a/admin/compiler/joomla_3/HtmlView_list_custom_admin.php b/admin/compiler/joomla_3/HtmlView_list_custom_admin.php index 171226444..ebea61327 100644 --- a/admin/compiler/joomla_3/HtmlView_list_custom_admin.php +++ b/admin/compiler/joomla_3/HtmlView_list_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -###CUSTOM_ADMIN_VIEWS_HTML_HEADER### +###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SViews### @@ -28,11 +28,11 @@ class ###Component###View###SViews### extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_###component###'); + $this->params = ComponentHelper::getParams('com_###component###'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD### }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### @@ -43,7 +43,7 @@ class ###Component###View###SViews### extends HtmlView protected function setDocument() {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### } /** @@ -52,19 +52,19 @@ class ###Component###View###SViews### extends HtmlView protected function addToolBar() {###HIDEMAINMENU### // add title to the page - JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_###component###'); + ToolbarHelper::preferences('com_###component###'); } }###CUSTOM_ADMIN_GET_MODULE### @@ -78,6 +78,16 @@ class ###Component###View###SViews### extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_list_site.php b/admin/compiler/joomla_3/HtmlView_list_site.php index e981783d2..424a6acae 100644 --- a/admin/compiler/joomla_3/HtmlView_list_site.php +++ b/admin/compiler/joomla_3/HtmlView_list_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -###SITE_VIEWS_HTML_HEADER### +###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SViews### @@ -26,13 +26,13 @@ class ###Component###View###SViews### extends HtmlView { // Overwriting JView display method function display($tpl = null) - { + { // get combined params of both component and menu - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); // get the user object - $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### + $this->user = Factory::getUser();###SITE_DIPLAY_METHOD### }###SITE_EXTRA_DIPLAY_METHODS### /** @@ -41,7 +41,7 @@ class ###Component###View###SViews### extends HtmlView protected function _prepareDocument() {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### } /** @@ -49,15 +49,15 @@ class ###Component###View###SViews### extends HtmlView */ protected function addToolBar() {###SITE_CUSTOM_BUTTONS### - + // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar - $this->toolbar = JToolbar::getInstance(); + $this->toolbar = Toolbar::getInstance(); }###SITE_GET_MODULE### /** @@ -70,6 +70,16 @@ class ###Component###View###SViews### extends HtmlView public function escape($var, $sorten = false, $length = 40) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/HtmlView_site.php b/admin/compiler/joomla_3/HtmlView_site.php index 13bc3fd01..5c4ca5ecd 100644 --- a/admin/compiler/joomla_3/HtmlView_site.php +++ b/admin/compiler/joomla_3/HtmlView_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -###SITE_VIEW_HTML_HEADER### +###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT### /** * ###Component### Html View class for the ###SView### @@ -26,22 +26,22 @@ class ###Component###View###SView### extends HtmlView { // Overwriting JView display method function display($tpl = null) - { + { // get combined params of both component and menu - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); // get the user object - $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD### + $this->user = Factory::getUser();###SITE_DIPLAY_METHOD### }###SITE_EXTRA_DIPLAY_METHODS### /** * Prepares the document */ protected function _prepareDocument() - {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### + {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### // add the document default css file - JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### } /** @@ -52,12 +52,12 @@ class ###Component###View###SView### extends HtmlView // set help url for this view if found $this->help_url = ###Component###Helper::getHelpUrl('###sview###'); - if (###Component###Helper::checkString($this->help_url)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) { - JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar - $this->toolbar = JToolbar::getInstance(); + $this->toolbar = Toolbar::getInstance(); }###SITE_GET_MODULE### /** @@ -70,6 +70,16 @@ class ###Component###View###SView### extends HtmlView public function escape($var, $sorten = false, $length = 40) { // use the helper htmlEscape method instead. - return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length); + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/compiler/joomla_3/ItemModel_custom_admin.php b/admin/compiler/joomla_3/ItemModel_custom_admin.php index 56f08cab1..c8c49b430 100644 --- a/admin/compiler/joomla_3/ItemModel_custom_admin.php +++ b/admin/compiler/joomla_3/ItemModel_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -31,7 +31,7 @@ class ###Component###Model###SView### extends ItemModel */ protected $_context = 'com_###component###.###sview###'; - /** + /** * Model user data. * * @var strings @@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel */ protected function populateState() { - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; // Get the item main id $id = $this->input->getInt('id', null); @@ -80,12 +80,12 @@ class ###Component###Model###SView### extends ItemModel */ public function getItem($pk = null) { - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // check if this user has permission to access item if (!$this->user->authorise('###sview###.access', 'com_###component###')) { - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('Not authorised!'), 'error'); + $app = Factory::getApplication(); + $app->enqueueMessage(Text::_('Not authorised!'), 'error'); // redirect away if not a correct to cPanel/default view $app->redirect('index.php?option=com_###component###'); return false; @@ -98,10 +98,10 @@ class ###Component###Model###SView### extends ItemModel $this->initSet = true; $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM### - + if ($this->_item === null) { - $this->_item = array(); + $this->_item = []; }###LICENSE_LOCKED_CHECK### if (!isset($this->_item[$pk])) @@ -114,7 +114,7 @@ class ###Component###Model###SView### extends ItemModel if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWarning(404, $e->getMessage()); + JError::raiseError(404, $e->getMessage()); } else { diff --git a/admin/compiler/joomla_3/ItemModel_site.php b/admin/compiler/joomla_3/ItemModel_site.php index 621f2f1c7..ca73e7e3e 100644 --- a/admin/compiler/joomla_3/ItemModel_site.php +++ b/admin/compiler/joomla_3/ItemModel_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel */ protected function populateState() { - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; // Get the itme main id $id = $this->input->getInt('id', null); @@ -82,7 +82,7 @@ class ###Component###Model###SView### extends ItemModel */ public function getItem($pk = null) { - $this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS### + $this->user = Factory::getUser();###USER_PERMISSION_CHECK_ACCESS### $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); $this->groups = $this->user->get('groups'); @@ -91,10 +91,10 @@ class ###Component###Model###SView### extends ItemModel $this->initSet = true; $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM### - + if ($this->_item === null) { - $this->_item = array(); + $this->_item = []; }###LICENSE_LOCKED_CHECK### if (!isset($this->_item[$pk])) @@ -107,7 +107,7 @@ class ###Component###Model###SView### extends ItemModel if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWarning(404, $e->getMessage()); + JError::raiseError(404, $e->getMessage()); } else { diff --git a/admin/compiler/joomla_3/JFormFieldCheckboxes.php b/admin/compiler/joomla_3/JFormFieldCheckboxes.php index d5a12f4ba..f852886b6 100644 --- a/admin/compiler/joomla_3/JFormFieldCheckboxes.php +++ b/admin/compiler/joomla_3/JFormFieldCheckboxes.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('checkboxes'); @@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldCheckboxes /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###'; /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of Html options. */ protected function getOptions() { diff --git a/admin/compiler/joomla_3/JFormFieldCustom.php b/admin/compiler/joomla_3/JFormFieldCustom.php index ee8b72e07..307bc608a 100644 --- a/admin/compiler/joomla_3/JFormFieldCustom.php +++ b/admin/compiler/joomla_3/JFormFieldCustom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,7 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); -###JFORM_TYPE_HEADER### +###FORM_CUSTOM_FIELD_HEADER### /** * ###Type### Form Field class for the ###Component### component @@ -27,7 +27,7 @@ class ###JPREFIX###FormField###Type### extends JFormField###JFORM_EXTENDS### /** * The ###type### field type. * - * @var string + * @var string */ - public $type = '###type###';###JFORM_TYPE_PHP### + public $type = '###type###';###FORM_CUSTOM_FIELD_PHP### } diff --git a/admin/compiler/joomla_3/JFormFieldList.php b/admin/compiler/joomla_3/JFormFieldList.php index 5a56cd132..504167838 100644 --- a/admin/compiler/joomla_3/JFormFieldList.php +++ b/admin/compiler/joomla_3/JFormFieldList.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('list'); @@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldList /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###';###ADD_BUTTON### /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of Html options. */ protected function getOptions() { diff --git a/admin/compiler/joomla_3/JFormFieldRadio.php b/admin/compiler/joomla_3/JFormFieldRadio.php index ac9412514..75ec4e5c5 100644 --- a/admin/compiler/joomla_3/JFormFieldRadio.php +++ b/admin/compiler/joomla_3/JFormFieldRadio.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('radio'); @@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldRadio /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###'; /** * Method to get a list of options for a list input. * - * @return array An array of JHtml options. + * @return array An array of Html options. */ protected function getOptions() { diff --git a/admin/compiler/joomla_3/JFormFieldUser.php b/admin/compiler/joomla_3/JFormFieldUser.php index 4a9966db1..85ed69077 100644 --- a/admin/compiler/joomla_3/JFormFieldUser.php +++ b/admin/compiler/joomla_3/JFormFieldUser.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('user'); @@ -29,7 +33,7 @@ class ###JPREFIX###FormField###Type### extends JFormFieldUser /** * The ###type### field type. * - * @var string + * @var string */ public $type = '###type###'; diff --git a/admin/compiler/joomla_3/JFormRule.php b/admin/compiler/joomla_3/JFormRule.php index 830ed92a0..34b02fefa 100644 --- a/admin/compiler/joomla_3/JFormRule.php +++ b/admin/compiler/joomla_3/JFormRule.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,9 +17,12 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('JPATH_PLATFORM') or die; +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\Form\Form; use Joomla\CMS\Form\FormRule; use Joomla\Registry\Registry; +use Joomla\CMS\HTML\HTMLHelper as Html; /** * Form Rule (###Name###) class for the Joomla Platform. diff --git a/admin/compiler/joomla_3/ListModel.php b/admin/compiler/joomla_3/ListModel.php index 2d45037ab..f2d12e963 100644 --- a/admin/compiler/joomla_3/ListModel.php +++ b/admin/compiler/joomla_3/ListModel.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -24,10 +24,10 @@ defined('_JEXEC') or die('Restricted access'); */ class ###Component###Model###Views### extends ListModel { - public function __construct($config = array()) + public function __construct($config = []) { if (empty($config['filter_fields'])) - { + { $config['filter_fields'] = array( ###FILTER_FIELDS### ); @@ -49,7 +49,7 @@ class ###Component###Model###Views### extends ListModel */ protected function populateState($ordering = null, $direction = null) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Adjust the context to support modal layouts. if ($layout = $app->input->get('layout')) @@ -60,7 +60,7 @@ class ###Component###Model###Views### extends ListModel // List state information. parent::populateState($ordering, $direction); } - + /** * Method to get an array of data items. * @@ -70,21 +70,21 @@ class ###Component###Model###Views### extends ListModel {###LICENSE_LOCKED_CHECK######CHECKINCALL### // load parent items $items = parent::getItems();###GET_ITEMS_METHOD_STRING_FIX######SELECTIONTRANSLATIONFIX######GET_ITEMS_METHOD_AFTER_ALL### - + // return items return $items; }###SELECTIONTRANSLATIONFIXFUNC### - + /** * Method to build an SQL query to load the list data. * - * @return string An SQL query + * @return string An SQL query */ protected function getListQuery() {###LICENSE_LOCKED_CHECK### ###LISTQUERY### }###MODELEXPORTMETHOD######LICENSE_LOCKED_SET_BOOL### - + /** * Method to get a store id based on model configuration state. * diff --git a/admin/compiler/joomla_3/ListModelAjax.php b/admin/compiler/joomla_3/ListModelAjax.php index cf9cb916f..18d5f23b7 100644 --- a/admin/compiler/joomla_3/ListModelAjax.php +++ b/admin/compiler/joomla_3/ListModelAjax.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -25,12 +25,12 @@ defined('_JEXEC') or die('Restricted access'); class ###Component###ModelAjax extends ListModel { protected $app_params; - - public function __construct() - { - parent::__construct(); + + public function __construct() + { + parent::__construct(); // get params - $this->app_params = JComponentHelper::getParams('com_###component###'); - + $this->app_params = ComponentHelper::getParams('com_###component###'); + }###AJAX_MODEL_METHODS### } diff --git a/admin/compiler/joomla_3/ListModelAjaxSite.php b/admin/compiler/joomla_3/ListModelAjaxSite.php index 2aacc4948..d02c9bfca 100644 --- a/admin/compiler/joomla_3/ListModelAjaxSite.php +++ b/admin/compiler/joomla_3/ListModelAjaxSite.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -30,7 +30,7 @@ class ###Component###ModelAjax extends ListModel { parent::__construct(); // get params - $this->app_params = JComponentHelper::getParams('com_###component###'); + $this->app_params = ComponentHelper::getParams('com_###component###'); }###AJAX_SITE_MODEL_METHODS### } diff --git a/admin/compiler/joomla_3/ListModelDASH.php b/admin/compiler/joomla_3/ListModelDASH.php index ad8357abb..25f57f5eb 100644 --- a/admin/compiler/joomla_3/ListModelDASH.php +++ b/admin/compiler/joomla_3/ListModelDASH.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -27,9 +27,9 @@ class ###Component###Model###Component### extends ListModel public function getIcons() { // load user for access menus - $user = JFactory::getUser(); + $user = Factory::getUser(); // reset icon array - $icons = array(); + $icons = []; // view groups array $viewGroups = array( 'main' => array(###DASHBOARDICONS###) @@ -38,7 +38,7 @@ class ###Component###Model###Component### extends ListModel foreach($viewGroups as $group => $views) { $i = 0; - if (###Component###Helper::checkArray($views)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($views)) { foreach($views as $view) { @@ -50,11 +50,11 @@ class ###Component###Model###Component### extends ListModel if (count($dwd) == 3) { list($type, $name, $url) = $dwd; - $viewName = $name; - $alt = $name; - $url = $url; - $image = $name . '.' . $type; - $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U'); + $viewName = $name; + $alt = $name; + $url = $url; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); } } // internal views @@ -76,11 +76,11 @@ class ###Component###Model###Component### extends ListModel switch($action) { case 'add': - $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit'; - $image = $name . '_' . $action. '.' . $type; - $alt = $name . ' ' . $action; - $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD'; - $add = true; + $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit'; + $image = $name . '_' . $action. '.' . $type; + $alt = $name . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_'.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U').'_ADD'; + $add = true; break; default: // check for new convention (more stable) @@ -93,34 +93,34 @@ class ###Component###Model###Component### extends ListModel { $extension = 'com_###component###.' . $name; } - $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; - $image = $name . '_' . $action . '.' . $type; - $alt = $viewName . ' ' . $action; - $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U') . '_' . ###Component###Helper::safeString($action,'U'); + $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; + $image = $name . '_' . $action . '.' . $type; + $alt = $viewName . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U') . '_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($action,'U'); break; } } else { - $viewName = $name; - $alt = $name; - $url = 'index.php?option=com_###component###&view=' . $name; - $image = $name . '.' . $type; - $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U'); - $hover = false; + $viewName = $name; + $alt = $name; + $url = 'index.php?option=com_###component###&view=' . $name; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); + $hover = false; } } else { - $viewName = $view; - $alt = $view; - $url = 'index.php?option=com_###component###&view=' . $view; - $image = $view . '.png'; - $name = ucwords($view).'

'; - $hover = false; + $viewName = $view; + $alt = $view; + $url = 'index.php?option=com_###component###&view=' . $view; + $image = $view . '.png'; + $name = ucwords($view).'

'; + $hover = false; } // first make sure the view access is set - if (###Component###Helper::checkArray($viewAccess)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($viewAccess)) { // setup some defaults $dashboard_add = false; @@ -128,11 +128,11 @@ class ###Component###Model###Component### extends ListModel $accessTo = ''; $accessAdd = ''; // access checking start - $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.create']):false; - $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.access']):false; + $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.create']):false; + $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.access']):false; // set main controllers - $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_add']):false; - $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? ###Component###Helper::checkString($viewAccess[$viewName.'.dashboard_list']):false; + $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_add']):false; + $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_list']):false; // check for adding access if ($add && $accessCreate) { @@ -150,64 +150,64 @@ class ###Component###Model###Component### extends ListModel // set main access controllers if ($accessDashboard_add) { - $dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_###component###'); + $dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_###component###'); } if ($accessDashboard_list) { $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###'); } - if (###Component###Helper::checkString($accessAdd) && ###Component###Helper::checkString($accessTo)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) { // check access if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add) { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } - elseif (###Component###Helper::checkString($accessTo)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) { // check access if($user->authorise($accessTo, 'com_###component###') && $dashboard_list) { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } - elseif (###Component###Helper::checkString($accessAdd)) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd)) { // check access if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add) { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } else { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } } else { - $icons[$group][$i] = new StdClass; - $icons[$group][$i]->url = $url; - $icons[$group][$i]->name = $name; - $icons[$group][$i]->image = $image; - $icons[$group][$i]->alt = $alt; + $icons[$group][$i] = new StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; } $i++; } diff --git a/admin/compiler/joomla_3/ListModel_custom_admin.php b/admin/compiler/joomla_3/ListModel_custom_admin.php index d49fcec4a..fd561d58e 100644 --- a/admin/compiler/joomla_3/ListModel_custom_admin.php +++ b/admin/compiler/joomla_3/ListModel_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -46,15 +46,15 @@ class ###Component###Model###SViews### extends ListModel protected function getListQuery() { // Get the current user for authorisation checks - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); $this->groups = $this->user->get('groups'); - $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->levels = $this->user->getAuthorisedViewLevels(); - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; - $this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY### + $this->initSet = true;###CUSTOM_ADMIN_GET_LIST_QUERY### } /** @@ -64,12 +64,12 @@ class ###Component###Model###SViews### extends ListModel */ public function getItems() { - $user = JFactory::getUser(); + $user = Factory::getUser(); // check if this user has permission to access items if (!$user->authorise('###sviews###.access', 'com_###component###')) { - $app = JFactory::getApplication(); - $app->enqueueMessage(JText::_('Not authorised!'), 'error'); + $app = Factory::getApplication(); + $app->enqueueMessage(Text::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) $app->redirect('index.php?option=com_###component###'); return false; @@ -78,7 +78,7 @@ class ###Component###Model###SViews### extends ListModel $items = parent::getItems(); // Get the global params - $globalParams = JComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS### + $globalParams = ComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS### // return items return $items; diff --git a/admin/compiler/joomla_3/ListModel_site.php b/admin/compiler/joomla_3/ListModel_site.php index 441031541..4ccc2f36b 100644 --- a/admin/compiler/joomla_3/ListModel_site.php +++ b/admin/compiler/joomla_3/ListModel_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -46,13 +46,13 @@ class ###Component###Model###SViews### extends ListModel protected function getListQuery() { // Get the current user for authorisation checks - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); $this->groups = $this->user->get('groups'); $this->authorisedGroups = $this->user->getAuthorisedGroups(); $this->levels = $this->user->getAuthorisedViewLevels(); - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; $this->initSet = true; ###SITE_GET_LIST_QUERY### } @@ -64,12 +64,12 @@ class ###Component###Model###SViews### extends ListModel */ public function getItems() { - $user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS### + $user = Factory::getUser();###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS### // load parent items $items = parent::getItems(); // Get the global params - $globalParams = JComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS### + $globalParams = ComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS### // return items return $items; diff --git a/admin/compiler/joomla_3/Table.php b/admin/compiler/joomla_3/Table.php index fd286af4b..cacbbf67c 100644 --- a/admin/compiler/joomla_3/Table.php +++ b/admin/compiler/joomla_3/Table.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,10 +17,17 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\Table\Table; +use Joomla\CMS\Access\Access as AccessRules; +use Joomla\CMS\Access\Rules; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\String\PunycodeHelper; +use Joomla\CMS\Table\Observer\Tags as TableObserverTags; +use Joomla\CMS\Table\Observer\ContentHistory as TableObserverContenthistory; +use Joomla\CMS\Application\ApplicationHelper; /** * ###Views### Table class @@ -34,60 +41,60 @@ class ###Component###Table###View### extends Table * @since 3.3 */ protected $_jsonEncode = array('params', 'metadata'); - + /** * Constructor * * @param object Database connector object */ - function __construct(&$db) + function __construct(&$db) { parent::__construct('#__###component###_###view###', 'id', $db);###JTABLECONSTRUCTOR######LICENSE_LOCKED_CHECK### - } - + } + public function bind($array, $ignore = '') { - + if (isset($array['params']) && is_array($array['params'])) { - $registry = new JRegistry; + $registry = new Registry; $registry->loadArray($array['params']); $array['params'] = (string) $registry; } if (isset($array['metadata']) && is_array($array['metadata'])) { - $registry = new JRegistry; + $registry = new Registry; $registry->loadArray($array['metadata']); $array['metadata'] = (string) $registry; } - - // Bind the rules. + + // Bind the rules. if (isset($array['rules']) && is_array($array['rules'])) - { - $rules = new JAccessRules($array['rules']); - $this->setRules($rules); + { + $rules = new AccessRules($array['rules']); + $this->setRules($rules); } return parent::bind($array, $ignore); } - + /** * Overload the store method for the ###View### table. * - * @param boolean Toggle whether null values should be updated. + * @param boolean Toggle whether null values should be updated. * @return boolean True on success, false on failure. * @since 1.6 */ public function store($updateNulls = false) { - $date = JFactory::getDate(); - $user = JFactory::getUser(); + $date = Factory::getDate(); + $user = Factory::getUser(); if ($this->id) { // Existing item - $this->modified = $date->toSql(); - $this->modified_by = $user->get('id'); + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); } else { @@ -102,33 +109,38 @@ class ###Component###Table###View### extends Table $this->created_by = $user->get('id'); } } - + if (isset($this->alias)) { // Verify that the alias is unique - $table = JTable::getInstance('###view###', '###Component###Table'); + $table = Table::getInstance('###view###', '###Component###Table'); if ($table->load(array('alias' => $this->alias###JTABLEALIASCATEGORY###)) && ($table->id != $this->id || $this->id == 0)) { - $this->setError(JText::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS')); + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS')); + + if ($table->published === -2) + { + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS_TRASHED')); + } return false; } } - + if (isset($this->url)) { // Convert IDN urls to punycode - $this->url = JStringPunycode::urlToPunycode($this->url); + $this->url = PunycodeHelper::urlToPunycode($this->url); } if (isset($this->website)) { // Convert IDN urls to punycode - $this->website = JStringPunycode::urlToPunycode($this->website); + $this->website = PunycodeHelper::urlToPunycode($this->website); } return parent::store($updateNulls); } - + /** * Overloaded check method to ensure data integrity. * @@ -140,20 +152,20 @@ class ###Component###Table###View### extends Table { // Generate a valid alias $this->generateAlias(); - - $table = JTable::getInstance('###view###', '###component###Table'); + + $table = Table::getInstance('###view###', '###component###Table'); while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) { $this->alias = StringHelper::increment($this->alias, 'dash'); } } - + /* * Clean up keywords -- eliminate extra spaces between phrases * and cr (\r) and lf (\n) characters from string. * Only process if not empty. - */ + */ if (!empty($this->metakey)) { // Array of characters to remove. @@ -164,7 +176,7 @@ class ###Component###Table###View### extends Table // Create array using commas as delimiter. $keys = explode(',', $after_clean); - $clean_keys = array(); + $clean_keys = []; foreach ($keys as $key) { @@ -187,13 +199,13 @@ class ###Component###Table###View### extends Table $this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc); } - // If we don't have any access rules set at this point just use an empty JAccessRules class + // If we don't have any access rules set at this point just use an empty AccessRules class if (!$this->getRules()) { $rules = $this->getDefaultAssetValues('com_###component###.###view###.'.$this->id); $this->setRules($rules); } - + // Set ordering if ($this->published < 0) { @@ -209,12 +221,12 @@ class ###Component###Table###View### extends Table * * @param $string $component The component asset name to search for * - * @return JAccessRules The JAccessRules object for the asset + * @return AccessRules The AccessRules object for the asset */ protected function getDefaultAssetValues($component, $try = true) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -225,14 +237,14 @@ class ###Component###Table###View### extends Table { // asset already set so use saved rules $assetId = (int) $db->loadResult(); - return JAccess::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + return AccessRules::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. } // try again elseif ($try) { $try = explode('.',$component); $result = $this->getDefaultAssetValues($try[0], false); - if ($result instanceof JAccessRules) + if ($result instanceof AccessRules) { if (isset($try[1])) { @@ -249,7 +261,7 @@ class ###Component###Table###View### extends Table else { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -257,8 +269,8 @@ class ###Component###Table###View### extends Table { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules; + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules; $rules->mergeCollection($_result); return $rules; @@ -267,7 +279,7 @@ class ###Component###Table###View### extends Table return $result; } } - return JAccess::getAssetRules(0); + return AccessRules::getAssetRules(0); } /** @@ -275,8 +287,8 @@ class ###Component###Table###View### extends Table * The default name is in the form 'table_name.id' * where id is the value of the primary key of the table. * - * @return string - * @since 2.5 + * @return string + * @since 2.5 */ protected function _getAssetName() { @@ -287,8 +299,8 @@ class ###Component###Table###View### extends Table /** * Method to return the title to use for the asset table. * - * @return string - * @since 2.5 + * @return string + * @since 2.5 */ protected function _getAssetTitle() { @@ -302,12 +314,12 @@ class ###Component###Table###View### extends Table /** * Get the parent asset id for the record * - * @return int - * @since 2.5 + * @return int + * @since 2.5 */ - protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + protected function _getAssetParentId(?Table $table = null, $id = null) { - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName('com_###component###'); return $asset->id; diff --git a/admin/compiler/joomla_3/ajax.json.php b/admin/compiler/joomla_3/ajax.json.php index 6883172ef..54ca2b52a 100644 --- a/admin/compiler/joomla_3/ajax.json.php +++ b/admin/compiler/joomla_3/ajax.json.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,9 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Session\Session; + /** * ###Component### Ajax Controller */ @@ -26,19 +29,19 @@ class ###Component###ControllerAjax extends JControllerLegacy { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); - JFactory::getApplication()->setHeader('Content-Disposition','attachment;filename="getajax.json"'); - JFactory::getApplication()->setHeader("Access-Control-Allow-Origin", "*"); + Factory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getApplication()->setHeader('Content-Disposition','attachment;filename="getajax.json"'); + Factory::getApplication()->setHeader("Access-Control-Allow-Origin", "*"); // load the tasks $this->registerTask('fieldRequired', 'ajax'); } public function ajax() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); + $token = Session::getFormToken(); $call_token = $jinput->get('token', 0, 'ALNUM'); if($user->id != 0 && $token == $call_token) { @@ -50,8 +53,8 @@ class ###Component###ControllerAjax extends JControllerLegacy $name = $jinput->get('name', NULL, 'WORD'); $form = $jinput->get('form', NULL, 'WORD'); $status = $jinput->get('status', NULL, 'INT'); - - if (###Component###Helper::checkString($name) && ###Component###Helper::checkString($form)) + + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($name) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($form)) { $result = $this->getModel('ajax')->setFieldRequired($name,$form,$status); } diff --git a/admin/compiler/joomla_3/ajax.php b/admin/compiler/joomla_3/ajax.php index 198a571f4..9500de486 100644 --- a/admin/compiler/joomla_3/ajax.php +++ b/admin/compiler/joomla_3/ajax.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,27 +17,32 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Model\ListModel; +use Joomla\CMS\Component\ComponentHelper; + /** * ###Component### Ajax Model */ -class ###Component###ModelAjax extends JModelList +class ###Component###ModelAjax extends ListModel { protected $app_params; public function __construct() - { - parent::__construct(); + { + parent::__construct(); // get params - $this->app_params = JComponentHelper::getParams('com_###component###'); + $this->app_params = ComponentHelper::getParams('com_###component###'); } public function setFieldRequired($name,$form,$status) { // get the session - $session = JFactory::getSession(); + $session = Factory::getSession(); // get this forms set fields $fields = $session->get($form.'_requiredFieldFix'); - if(###Component###Helper::checkArray($fields)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($fields)) { if ($status == 1) { @@ -45,7 +50,7 @@ class ###Component###ModelAjax extends JModelList $fields = array_unique($fields); } else - { + { // remove from array if(($key = array_search($name, $fields)) !== false) { @@ -61,7 +66,7 @@ class ###Component###ModelAjax extends JModelList } } // load the remaining values to session - if(###Component###Helper::checkArray($fields)) + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($fields)) { $session->set($form.'_requiredFieldFix', $fields); } diff --git a/admin/compiler/joomla_3/batch_.php b/admin/compiler/joomla_3/batch_.php index 0d8a36c64..ef1abac7f 100644 --- a/admin/compiler/joomla_3/batch_.php +++ b/admin/compiler/joomla_3/batch_.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -30,7 +30,7 @@ abstract class JHtmlBatch_ * @var array * @since 3.0 */ - protected static $ListSelection = array(); + protected static $ListSelection = []; /** * Render the batch selection options. diff --git a/admin/compiler/joomla_3/batchselection.php b/admin/compiler/joomla_3/batchselection.php index 455979edf..d8199d7bb 100644 --- a/admin/compiler/joomla_3/batchselection.php +++ b/admin/compiler/joomla_3/batchselection.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,7 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('JPATH_BASE') or die; +use Joomla\CMS\Language\Text; JHtmlBehavior::core(); $divWrapper = range(1,120,2); $counter = 0; @@ -24,8 +25,8 @@ $counter = 0; ListSelection) : ?>

ListSelection as $ListSelection) : ?> -
-
+
+
-
+
- +
- - -
+ + +
\ No newline at end of file diff --git a/admin/compiler/joomla_3/component_admin.php b/admin/compiler/joomla_3/component_admin.php index 43ddf1f01..cc77f250d 100644 --- a/admin/compiler/joomla_3/component_admin.php +++ b/admin/compiler/joomla_3/component_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -20,25 +20,24 @@ defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### ###ADMIN_COMPONENT_HEADER### // Access check. -if (!JFactory::getUser()->authorise('core.manage', 'com_###component###')) +if (!Factory::getUser()->authorise('core.manage', 'com_###component###')) { - throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); -}; + throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); +} // Add CSS file for all pages -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_###component###/assets/css/admin.css'); -$document->addScript('components/com_###component###/assets/js/admin.js'); +Html::_('stylesheet', 'components/com_###component###/assets/css/admin.css', ['version' => 'auto']); +Html::_('script', 'components/com_###component###/assets/js/admin.js', ['version' => 'auto']); // require helper files JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL### JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');###LICENSE_LOCKED_INT######ADMIN_GLOBAL_EVENT### // Get an instance of the controller prefixed by ###Component### -$controller = JControllerLegacy::getInstance('###Component###'); +$controller = BaseController::getInstance('###Component###'); // Perform the Request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/admin/compiler/joomla_3/component_site.php b/admin/compiler/joomla_3/component_site.php index 88d3a5de8..cd21c9a13 100644 --- a/admin/compiler/joomla_3/component_site.php +++ b/admin/compiler/joomla_3/component_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -20,19 +20,18 @@ defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### ###SITE_COMPONENT_HEADER### // Set the component css/js -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_###component###/assets/css/site.css'); -$document->addScript('components/com_###component###/assets/js/site.js'); +Html::_('stylesheet', 'components/com_###component###/assets/css/site.css', ['version' => 'auto']); +Html::_('script', 'components/com_###component###/assets/js/site.js', ['version' => 'auto']); // Require helper files JLoader::register('###Component###Helper', __DIR__ . '/helpers/###component###.php');###HELPER_EMAIL### JLoader::register('###Component###HelperRoute', __DIR__ . '/helpers/route.php');###LICENSE_LOCKED_INT######SITE_GLOBAL_EVENT### // Get an instance of the controller prefixed by ###Component### -$controller = JControllerLegacy::getInstance('###Component###'); +$controller = BaseController::getInstance('###Component###'); // Perform the request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/admin/compiler/joomla_3/dashboard.css b/admin/compiler/joomla_3/dashboard.css index 65aa4e8b2..6502707ff 100644 --- a/admin/compiler/joomla_3/dashboard.css +++ b/admin/compiler/joomla_3/dashboard.css @@ -3,153 +3,153 @@ /* CSS Document */ .dashboard-container { - margin-left: 10px; - margin-top: 10px; - width: 100%; + margin-left: 10px; + margin-top: 10px; + width: 100%; } .dashboard-container [class*="span"] { - display: block; - float: none; - margin-left: 0; - width: auto; + display: block; + float: none; + margin-left: 0; + width: auto; } .dashboard-container:before, .dashboard-container:after { - content: ""; - display: table; + content: ""; + display: table; } .dashboard-container:after { - clear: both; + clear: both; } .dashboard-container [class*="span"] { - box-sizing: border-box; - display: block; - float: left; - min-height: 145px; - min-width: 96px; - width: 100%; + box-sizing: border-box; + display: block; + float: left; + min-height: 145px; + min-width: 96px; + width: 100%; } .dashboard-container [class*="span"]:first-child { - margin-left: 0; + margin-left: 0; } .dashboard-wraper { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 5px; - float: left; - margin: 1%; - padding: 3px; - width: 17%; - min-height: 194px; - min-width: 96px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 5px; + float: left; + margin: 1%; + padding: 3px; + width: 17%; + min-height: 194px; + min-width: 96px; } .dashboard-content a { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - min-height: 89px; - padding: 10px; - text-align: center; - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + min-height: 89px; + padding: 10px; + text-align: center; + text-decoration: none; } .dashboard-content a:hover { - background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - color: hsl(200, 100%, 30%); - text-decoration: none; + background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + color: hsl(200, 100%, 30%); + text-decoration: none; } .dashboard-title { - display: block; - padding-top: 5px; + display: block; + padding-top: 5px; } .dashboard-info { - background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 85%); - border-radius: 4px; - box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; - color: hsl(0, 0%, 20%); - display: block; - font-size: 12px; - padding: 10px; - text-align: center; + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + font-size: 12px; + padding: 10px; + text-align: center; } .dashboard-info span { - display: block; - text-align: center; + display: block; + text-align: center; } .dashboard-info img { - margin: 0 auto; + margin: 0 auto; } .dashboard-table { - border-top: 1px solid hsl(0, 0%, 87%); - margin-top: 5px; - width: 100%; + border-top: 1px solid hsl(0, 0%, 87%); + margin-top: 5px; + width: 100%; } .dashboard-info h5 { - font-size: 11px; - font-weight: bold; + font-size: 11px; + font-weight: bold; } .dashboard-block { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border: 1px solid hsl(0, 0%, 76%); - border-radius: 3px; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; - margin-bottom: 20px; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 76%); + border-radius: 3px; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; + margin-bottom: 20px; } .dashboard-block .dashboard-block-head { - background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); - border-bottom: 1px solid hsl(0, 0%, 76%); - border-radius: 3px 3px 0 0; - box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); - height: 40px; - position: relative; + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border-bottom: 1px solid hsl(0, 0%, 76%); + border-radius: 3px 3px 0 0; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); + height: 40px; + position: relative; } .dashboard-block .dashboard-block-head h5 { - font-size: 12px; - margin: 0; - padding-left: 10px; - padding-top: 11px; - text-transform: uppercase; + font-size: 12px; + margin: 0; + padding-left: 10px; + padding-top: 11px; + text-transform: uppercase; } .dashboard-block .dashboard-block-content { - background: none repeat scroll 0 0 hsl(0, 0%, 93%); - border-radius: 0 0 3px 3px; + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 0 0 3px 3px; } .dashboard-block .dashboard-block-box { - background: none repeat scroll 0 0 hsl(0, 0%, 100%); - border-top: 1px solid hsl(0, 0%, 82%); - box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; + background: none repeat scroll 0 0 hsl(0, 0%, 100%); + border-top: 1px solid hsl(0, 0%, 82%); + box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; } .dashboard-block .dashboard-block-content .dashboard-block-box { - margin-top: 0 !important; + margin-top: 0 !important; } .dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table { - margin-bottom: 0 !important; + margin-bottom: 0 !important; } .dashboard-block-table { - background-color: hsla(0, 0%, 0%, 0); - border-collapse: collapse; - border-spacing: 0; - margin-bottom: 20px; - max-width: 100%; - width: 100%; + background-color: hsla(0, 0%, 0%, 0); + border-collapse: collapse; + border-spacing: 0; + margin-bottom: 20px; + max-width: 100%; + width: 100%; } .dashboard-block-table th, .dashboard-block-table td { - border-top: 1px solid hsl(0, 0%, 87%); - line-height: 20px; - padding: 5px; - text-align: left; - vertical-align: middle; + border-top: 1px solid hsl(0, 0%, 87%); + line-height: 20px; + padding: 5px; + text-align: left; + vertical-align: middle; } .dashboard-badge { - background-color: hsl(0, 0%, 60%); - border-radius: 9px; - color: hsl(0, 0%, 100%); - font-size: 11.844px; - font-weight: bold; - line-height: 14px; - padding: 1px 9px 2px; - text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); - vertical-align: baseline; - white-space: nowrap; + background-color: hsl(0, 0%, 60%); + border-radius: 9px; + color: hsl(0, 0%, 100%); + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + padding: 1px 9px 2px; + text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); + vertical-align: baseline; + white-space: nowrap; } \ No newline at end of file diff --git a/admin/compiler/joomla_3/default.php b/admin/compiler/joomla_3/default.php index 0166c0fb8..8eecd5d99 100644 --- a/admin/compiler/joomla_3/default.php +++ b/admin/compiler/joomla_3/default.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### ###ADMIN_VIEWS_HEADER### + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_###component###&task=###views###.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> ###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT### diff --git a/admin/compiler/joomla_3/default_batch_body.php b/admin/compiler/joomla_3/default_batch_body.php index a1fe1378e..ec4f6be38 100644 --- a/admin/compiler/joomla_3/default_batch_body.php +++ b/admin/compiler/joomla_3/default_batch_body.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/compiler/joomla_3/default_batch_footer.php b/admin/compiler/joomla_3/default_batch_footer.php index 7964422a5..73d7824e9 100644 --- a/admin/compiler/joomla_3/default_batch_footer.php +++ b/admin/compiler/joomla_3/default_batch_footer.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,12 +17,14 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/compiler/joomla_3/default_body.php b/admin/compiler/joomla_3/default_body.php index 5db8ffb81..d5c40e434 100644 --- a/admin/compiler/joomla_3/default_body.php +++ b/admin/compiler/joomla_3/default_body.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_###component###&view=###views###&task=###view###.edit"; ?> diff --git a/admin/compiler/joomla_3/default_custom_admin.php b/admin/compiler/joomla_3/default_custom_admin.php index 925f748c9..c68079a4d 100644 --- a/admin/compiler/joomla_3/default_custom_admin.php +++ b/admin/compiler/joomla_3/default_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -18,11 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### ###CUSTOM_ADMIN_VIEW_HEADER######CUSTOM_ADMIN_CODE_BODY### + ?> canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### item->id)) ? '&id='. (int) $this->item->id : ''; ?> ###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### -

+

- diff --git a/admin/compiler/joomla_3/default_custom_admin_template.php b/admin/compiler/joomla_3/default_custom_admin_template.php index 3b5ea3e22..de8533c69 100644 --- a/admin/compiler/joomla_3/default_custom_admin_template.php +++ b/admin/compiler/joomla_3/default_custom_admin_template.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,6 +15,10 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_TEMPLATE_CODE_BODY### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html;###CUSTOM_ADMIN_TEMPLATE_CODE_BODY### ?>###CUSTOM_ADMIN_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_3/default_foot.php b/admin/compiler/joomla_3/default_foot.php index 725eba045..93585b9b7 100644 --- a/admin/compiler/joomla_3/default_foot.php +++ b/admin/compiler/joomla_3/default_foot.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/default_head.php b/admin/compiler/joomla_3/default_head.php index 894d421fe..72243e3e8 100644 --- a/admin/compiler/joomla_3/default_head.php +++ b/admin/compiler/joomla_3/default_head.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,5 +17,8 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> ###LISTHEAD### \ No newline at end of file diff --git a/admin/compiler/joomla_3/default_import.php b/admin/compiler/joomla_3/default_import.php index 1cab7a6c4..ba0519b09 100644 --- a/admin/compiler/joomla_3/default_import.php +++ b/admin/compiler/joomla_3/default_import.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,13 +17,17 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?>
-
+ sidebar)) : ?>
@@ -137,13 +141,13 @@ jQuery(document).ready(function($) {
- hasPackage && ###Component###Helper::checkArray($this->headerList) && ###Component###Helper::checkArray($this->headers)) : ?> + hasPackage && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headerList) && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headers)) : ?>
- +
- +
- +
headerList as $name => $title): ?> @@ -151,72 +155,72 @@ jQuery(document).ready(function($) {
- +
- 'upload')); ?> - - + 'upload')); ?> + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - - + + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- + - +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - + + - +
\ No newline at end of file diff --git a/admin/compiler/joomla_3/default_import_custom.php b/admin/compiler/joomla_3/default_import_custom.php index 6329fd18b..04bc64bdc 100644 --- a/admin/compiler/joomla_3/default_import_custom.php +++ b/admin/compiler/joomla_3/default_import_custom.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,8 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?>###IMPORT_DEFAULT_VIEW_CUSTOM### diff --git a/admin/compiler/joomla_3/default_list_custom_admin.php b/admin/compiler/joomla_3/default_list_custom_admin.php index 3f6dd6fb1..a3d41a83f 100644 --- a/admin/compiler/joomla_3/default_list_custom_admin.php +++ b/admin/compiler/joomla_3/default_list_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -22,5 +22,5 @@ defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### ###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### -

+

diff --git a/admin/compiler/joomla_3/default_list_site.php b/admin/compiler/joomla_3/default_list_site.php index 936804bd2..62479ff87 100644 --- a/admin/compiler/joomla_3/default_list_site.php +++ b/admin/compiler/joomla_3/default_list_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/default_main.php b/admin/compiler/joomla_3/default_main.php index 4bde280d1..5bec37199 100644 --- a/admin/compiler/joomla_3/default_main.php +++ b/admin/compiler/joomla_3/default_main.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,19 +17,21 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> icons['main']) && is_array($this->icons['main'])) :?> icons['main'] as $icon): ?>
-
-

+

\ No newline at end of file diff --git a/admin/compiler/joomla_3/default_site.php b/admin/compiler/joomla_3/default_site.php index 61864331f..6ab8f1a3a 100644 --- a/admin/compiler/joomla_3/default_site.php +++ b/admin/compiler/joomla_3/default_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/default_site_template.php b/admin/compiler/joomla_3/default_site_template.php index 55687f70a..337f5b7ca 100644 --- a/admin/compiler/joomla_3/default_site_template.php +++ b/admin/compiler/joomla_3/default_site_template.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -15,6 +15,10 @@ defined('_JEXEC') or die('Restricted access'); ###BOM### // No direct access to this file -defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_TEMPLATE_CODE_BODY### +defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper;###SITE_TEMPLATE_CODE_BODY### ?>###SITE_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_3/default_toolbar.php b/admin/compiler/joomla_3/default_toolbar.php index c608f71e0..ba3d37eb1 100644 --- a/admin/compiler/joomla_3/default_toolbar.php +++ b/admin/compiler/joomla_3/default_toolbar.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,34 +17,37 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/compiler/joomla_3/default_vdm.php b/admin/compiler/joomla_3/default_vdm.php index ec4349bd6..4f12c9cab 100644 --- a/admin/compiler/joomla_3/default_vdm.php +++ b/admin/compiler/joomla_3/default_vdm.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,22 +17,24 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> -<?php echo JText::_('COM_###COMPONENT###'); ?> +<?php echo Text::_('COM_###COMPONENT###'); ?>
-contributors)): ?> +contributors)): ?> contributors) > 1): ?> -

+

-

+

    contributors as $contributor): ?> diff --git a/admin/compiler/joomla_3/edit.php b/admin/compiler/joomla_3/edit.php index 86edbead4..fa2f7ff82 100644 --- a/admin/compiler/joomla_3/edit.php +++ b/admin/compiler/joomla_3/edit.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access'); ###ADMIN_VIEW_HEADER### + $componentParams = $this->params; // will be removed just use $this->params instead ?> ###EDITBODYFADEIN### -
    + ###EDITBODY###
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_3/edit_site.php b/admin/compiler/joomla_3/edit_site.php index 7a6efb4f7..a398e73e7 100644 --- a/admin/compiler/joomla_3/edit_site.php +++ b/admin/compiler/joomla_3/edit_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -18,10 +18,11 @@ defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access'); ###SITE_ADMIN_VIEW_HEADER### + ?>
toolbar->render(); ?> -
+ ###EDITBODY###
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_3/headercheck.php b/admin/compiler/joomla_3/headercheck.php index 6dcee6c35..36d0e0d04 100644 --- a/admin/compiler/joomla_3/headercheck.php +++ b/admin/compiler/joomla_3/headercheck.php @@ -1,24 +1,24 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - + @package Component Builder + @subpackage componentbuilder.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + /-----------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file @@ -29,24 +29,36 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; + class ###component###HeaderCheck { + protected $document = null; + protected $app = null; + function js_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['scripts']) as $script) { if (stristr($script, $script_name)) @@ -57,24 +69,30 @@ class ###component###HeaderCheck return false; } - + function css_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); - + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['styleSheets']) as $script) { if (stristr($script, $script_name)) diff --git a/admin/compiler/joomla_3/headercheck_admin.php b/admin/compiler/joomla_3/headercheck_admin.php index 402101246..7955eb0e0 100644 --- a/admin/compiler/joomla_3/headercheck_admin.php +++ b/admin/compiler/joomla_3/headercheck_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,24 +17,36 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; + class ###component###HeaderCheck { + protected $document = null; + protected $app = null; + function js_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['scripts']) as $script) { if (stristr($script, $script_name)) @@ -45,24 +57,30 @@ class ###component###HeaderCheck return false; } - + function css_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); - + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['styleSheets']) as $script) { if (stristr($script, $script_name)) @@ -73,4 +91,4 @@ class ###component###HeaderCheck return false; } -} \ No newline at end of file +} diff --git a/admin/compiler/joomla_3/import.gif b/admin/compiler/joomla_3/import.gif index 4371cc618..10bcb8569 100644 Binary files a/admin/compiler/joomla_3/import.gif and b/admin/compiler/joomla_3/import.gif differ diff --git a/admin/compiler/joomla_3/layout.php b/admin/compiler/joomla_3/layout.php index 2a1d95ed8..d7af88c11 100644 --- a/admin/compiler/joomla_3/layout.php +++ b/admin/compiler/joomla_3/layout.php @@ -1,24 +1,24 @@ - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - + @package Component Builder + @subpackage componentbuilder.php + @author Llewellyn van der Merwe + @my wife Roline van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + /-----------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file @@ -46,7 +46,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layout_admin.php b/admin/compiler/joomla_3/layout_admin.php index c9c13b2cd..5188aec67 100644 --- a/admin/compiler/joomla_3/layout_admin.php +++ b/admin/compiler/joomla_3/layout_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/layout_custom_admin.php b/admin/compiler/joomla_3/layout_custom_admin.php index c26e133cc..12e0c32d7 100644 --- a/admin/compiler/joomla_3/layout_custom_admin.php +++ b/admin/compiler/joomla_3/layout_custom_admin.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/layout_site.php b/admin/compiler/joomla_3/layout_site.php index 31edafa09..cd8bd0548 100644 --- a/admin/compiler/joomla_3/layout_site.php +++ b/admin/compiler/joomla_3/layout_site.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/layoutfull.php b/admin/compiler/joomla_3/layoutfull.php index e6b6cc02a..bdc3cda15 100644 --- a/admin/compiler/joomla_3/layoutfull.php +++ b/admin/compiler/joomla_3/layoutfull.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layoutitems.php b/admin/compiler/joomla_3/layoutitems.php index 1314a034e..b58e0dcf4 100644 --- a/admin/compiler/joomla_3/layoutitems.php +++ b/admin/compiler/joomla_3/layoutitems.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layoutlinkedview.php b/admin/compiler/joomla_3/layoutlinkedview.php index 86c99b879..5ab1010a0 100644 --- a/admin/compiler/joomla_3/layoutlinkedview.php +++ b/admin/compiler/joomla_3/layoutlinkedview.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,9 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + // set the defaults $items = $displayData->###LAYOUTITEMS###; -$user = JFactory::getUser(); +$user = Factory::getUser(); $id = $displayData->item->id; ###LAYOUTITEMSHEADER### diff --git a/admin/compiler/joomla_3/layoutmetadata.php b/admin/compiler/joomla_3/layoutmetadata.php index d19a24cb1..3c465bddb 100644 --- a/admin/compiler/joomla_3/layoutmetadata.php +++ b/admin/compiler/joomla_3/layoutmetadata.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + $form = $displayData->getForm(); // JLayout for standard handling of metadata fields in the administrator content edit screens. @@ -25,7 +27,7 @@ $fieldSets = $form->getFieldsets('metadata'); $fieldSet) : ?> description) && trim($fieldSet->description)) : ?> -

escape(JText::_($fieldSet->description)); ?>

+

escape(Text::_($fieldSet->description)); ?>

- * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/layoutpublished.php b/admin/compiler/joomla_3/layoutpublished.php index 1314a034e..b58e0dcf4 100644 --- a/admin/compiler/joomla_3/layoutpublished.php +++ b/admin/compiler/joomla_3/layoutpublished.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/layouttitle.php b/admin/compiler/joomla_3/layouttitle.php index 95149e8c8..2afa93ac1 100644 --- a/admin/compiler/joomla_3/layouttitle.php +++ b/admin/compiler/joomla_3/layouttitle.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( ###LAYOUTITEMS### ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/compiler/joomla_3/module_forms.js b/admin/compiler/joomla_3/module_forms.js index ec598c680..4bf5019bf 100644 --- a/admin/compiler/joomla_3/module_forms.js +++ b/admin/compiler/joomla_3/module_forms.js @@ -1,3 +1,3 @@ ###BOM### -###VIEW_SCRIPT### +###VIEW_SCRIPT### diff --git a/admin/compiler/joomla_3/module_forms.xml b/admin/compiler/joomla_3/module_forms.xml index a31e5d4ac..8028c6880 100644 --- a/admin/compiler/joomla_3/module_forms.xml +++ b/admin/compiler/joomla_3/module_forms.xml @@ -4,6 +4,6 @@ addfieldpath="/administrator/components/com_###component###/models/fields" > ###FIELDSETS### - + ###ACCESSCONTROL### \ No newline at end of file diff --git a/admin/compiler/joomla_3/routeHelper.php b/admin/compiler/joomla_3/routeHelper.php index d28c1c0ec..afa52631f 100644 --- a/admin/compiler/joomla_3/routeHelper.php +++ b/admin/compiler/joomla_3/routeHelper.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,6 +17,13 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Language\Multilanguage; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Categories\CategoryNode; +use Joomla\CMS\Categories\Categories; + /** * ###Component### Route Helper **/ @@ -27,7 +34,7 @@ abstract class ###Component###HelperRoute /** * Get the URL route for ###component### category from a category ID and language * - * @param mixed $catid The id of the items's category either an integer id or a instance of JCategoryNode + * @param mixed $catid The id of the items's category either an integer id or a instance of CategoryNode * @param mixed $language The id of the language being used. * * @return string The link to the contact @@ -36,20 +43,20 @@ abstract class ###Component###HelperRoute */ public static function getCategoryRoute_keep_for_later($catid, $language = 0) { - if ($catid instanceof JCategoryNode) + if ($catid instanceof CategoryNode) { - $id = $catid->id; - $category = $catid; + $id = $catid->id; + $category = $catid; } else - { - throw new Exception('First parameter must be JCategoryNode'); + { + throw new Exception('First parameter must be CategoryNode'); } - + $views = array(###ROUTER_CATEGORY_VIEWS###); $view = $views[$category->extension]; - - if ($id < 1 || !($category instanceof JCategoryNode)) + + if ($id < 1 || !($category instanceof CategoryNode)) { $link = ''; } @@ -57,20 +64,20 @@ abstract class ###Component###HelperRoute { //Create the link $link = 'index.php?option=com_###component###&view='.$view.'&category='.$category->slug; - + $needles = array( $view => array($id), 'category' => array($id) ); - - if ($language && $language != "*" && JLanguageMultilang::isEnabled()) + + if ($language && $language != "*" && Multilanguage::isEnabled()) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) + $db = Factory::getDbo(); + $query = $db->getQuery(true) ->select('a.sef AS sef') ->select('a.lang_code AS lang_code') ->from('#__languages AS a'); - + $db->setQuery($query); $langs = $db->loadObjectList(); foreach ($langs as $lang) @@ -82,11 +89,11 @@ abstract class ###Component###HelperRoute } } } - + if ($item = self::_findItem($needles,'category')) { - $link .= '&Itemid='.$item; + $link .= '&Itemid='.$item; } else { @@ -112,16 +119,16 @@ abstract class ###Component###HelperRoute protected static function _findItem($needles = null,$type = null) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $menus = $app->getMenu('site'); $language = isset($needles['language']) ? $needles['language'] : '*'; // Prepare the reverse lookup array. if (!isset(self::$lookup[$language])) { - self::$lookup[$language] = array(); + self::$lookup[$language] = []; - $component = JComponentHelper::getComponent('com_###component###'); + $component = ComponentHelper::getComponent('com_###component###'); $attributes = array('component_id'); $values = array($component->id); @@ -142,7 +149,7 @@ abstract class ###Component###HelperRoute if (!isset(self::$lookup[$language][$view])) { - self::$lookup[$language][$view] = array(); + self::$lookup[$language][$view] = []; } if (isset($item->query['id'])) @@ -171,7 +178,7 @@ abstract class ###Component###HelperRoute { if (isset(self::$lookup[$language][$view])) { - if (###Component###Helper::checkArray($ids)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($ids)) { foreach ($ids as $id) { @@ -192,7 +199,7 @@ abstract class ###Component###HelperRoute if ($type) { // Check if the global menu item has been set. - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); if ($item = $params->get($type.'_menu', 0)) { return $item; @@ -204,7 +211,7 @@ abstract class ###Component###HelperRoute if ($active && $active->component == 'com_###component###' - && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) + && ($language == '*' || in_array($active->language, array('*', $language)) || !Multilanguage::isEnabled())) { return $active->id; } diff --git a/admin/compiler/joomla_3/router.php b/admin/compiler/joomla_3/router.php index 6bd91af36..834ab4e37 100644 --- a/admin/compiler/joomla_3/router.php +++ b/admin/compiler/joomla_3/router.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ @@ -17,13 +17,16 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; + /** * Routing class from com_###component### * * @since 3.3 */ class ###Component###Router extends JComponentRouterBase -{ +{ /** * Build the route for the com_###component### component * @@ -35,11 +38,11 @@ class ###Component###Router extends JComponentRouterBase */ public function build(&$query) { - $segments = array(); + $segments = []; // Get a menu item based on Itemid or currently active - $params = JComponentHelper::getParams('com_###component###'); - + $params = ComponentHelper::getParams('com_###component###'); + if (empty($query['Itemid'])) { $menuItem = $this->menu->getActive(); @@ -63,7 +66,7 @@ class ###Component###Router extends JComponentRouterBase unset($query['view']); } - + // Are we dealing with a item that is attached to a menu item? if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id'])) { @@ -93,7 +96,7 @@ class ###Component###Router extends JComponentRouterBase } unset($query['id']); } - + $total = count($segments); for ($i = 0; $i < $total; $i++) @@ -101,8 +104,8 @@ class ###Component###Router extends JComponentRouterBase $segments[$i] = str_replace(':', '-', $segments[$i]); } - return $segments; - + return $segments; + } /** @@ -115,17 +118,17 @@ class ###Component###Router extends JComponentRouterBase * @since 3.3 */ public function parse(&$segments) - { + { $count = count($segments); - $vars = array(); - + $vars = []; + // Handle View and Identifier switch($segments[0]) {###ROUTER_PARSE_SWITCH### } return $vars; - } + } protected function getVar($table, $where = null, $whereString = null, $what = null, $category = false, $operator = '=', $main = '###component###') { @@ -134,7 +137,7 @@ class ###Component###Router extends JComponentRouterBase return false; } // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -150,7 +153,7 @@ class ###Component###Router extends JComponentRouterBase { // we must check if the table exist (TODO not ideal) $tables = $db->getTableList(); - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $prefix = $app->get('dbprefix'); $check = $prefix.$main.'_'.$table; if (in_array($check, $tables)) @@ -192,7 +195,7 @@ class ###Component###Router extends JComponentRouterBase } return false; } - + protected function checkString($string) { if (isset($string) && is_string($string) && strlen($string) > 0) @@ -206,7 +209,7 @@ class ###Component###Router extends JComponentRouterBase function ###Component###BuildRoute(&$query) { $router = new ###Component###Router; - + return $router->build($query); } diff --git a/admin/compiler/joomla_3/router_4.php b/admin/compiler/joomla_3/router_4.php index 72b9168c2..c03d0f2f4 100644 --- a/admin/compiler/joomla_3/router_4.php +++ b/admin/compiler/joomla_3/router_4.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_3/script.php b/admin/compiler/joomla_3/script.php index 7240aed62..2b16ff45d 100644 --- a/admin/compiler/joomla_3/script.php +++ b/admin/compiler/joomla_3/script.php @@ -17,20 +17,24 @@ defined('_JEXEC') or die('Restricted access'); // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Installer\Adapter\ComponentAdapter; -JHTML::_('bootstrap.renderModal'); +use Joomla\CMS\Version; +use Joomla\CMS\HTML\HTMLHelper as Html; +HTML::_('bootstrap.renderModal'); /** * Script File of ###Component### Component */ -class com_###component###InstallerScript +class Com_###Component###InstallerScript { /** * Constructor * - * @param JAdapterInstance $parent The object responsible for running this script + * @param ComponentAdapter $parent The object responsible for running this script */ public function __construct(ComponentAdapter $parent) {} @@ -78,14 +82,14 @@ class com_###component###InstallerScript public function preflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // is redundant or so it seems ...hmmm let me know if it works again if ($type === 'uninstall') { return true; } // the default for both install and update - $jversion = new JVersion(); + $jversion = new Version(); if (!$jversion->isCompatible('3.8.0')) { $app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error'); @@ -121,7 +125,7 @@ class com_###component###InstallerScript public function postflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication();###MOVEFOLDERSSCRIPT### + $app = Factory::getApplication();###MOVEFOLDERSSCRIPT### // set the default component settings if ($type === 'install') {###POSTINSTALLSCRIPT### @@ -135,12 +139,12 @@ class com_###component###InstallerScript /** * Remove folders with files - * + * * @param string $dir The path to folder to remove * @param boolean $ignore The folders and files to ignore and not remove * * @return boolean True in all is removed - * + * */ protected function removeFolder($dir, $ignore = false) { @@ -209,7 +213,7 @@ class com_###component###InstallerScript /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success */ diff --git a/admin/compiler/joomla_3/settings_componentbuilder.json b/admin/compiler/joomla_3/settings_componentbuilder.json deleted file mode 100644 index 79cbabbfa..000000000 --- a/admin/compiler/joomla_3/settings_componentbuilder.json +++ /dev/null @@ -1,790 +0,0 @@ -{ - "create": { - "admin": { - "assets": { - "css": "css", - "images": { - "icons": "icons" - }, - "js": "js" - }, - "controllers": "controllers", - "helpers": { - "html": "html" - }, - "language": { - "en-GB": "en-GB" - }, - "layouts": "layouts", - "models": { - "fields": "fields", - "forms": "forms", - "rules": "rules" - }, - "sql": { - "updates": { - "mysql": "mysql" - } - }, - "tables": "tables", - "views": "views" - }, - "site": { - "assets": { - "css": "css", - "images": "images", - "js": "js" - }, - "controllers": "controllers", - "helpers": "helpers", - "language": { - "en-GB": "en-GB" - }, - "layouts": "layouts", - "models": "models", - "views": "views" - }, - "media": { - "css": "css", - "images": "images", - "js": "js" - } - }, - "move": { - "static": { - "access.xml": { - "naam": "access.xml", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "config.xml": { - "naam": "config.xml", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "BaseController.php": { - "naam": "BaseController.php", - "path": "c0mp0n3nt/admin", - "rename": "new", - "newName": "controller.php", - "type": "file" - }, - "component.xml": { - "naam": "component.xml", - "path": "c0mp0n3nt/", - "rename": "component", - "type": "file" - }, - "component_admin.php": { - "naam": "component_admin.php", - "path": "c0mp0n3nt/admin", - "rename": "component_admin", - "type": "file" - }, - "admin.css": { - "naam": "admin.css", - "path": "c0mp0n3nt/admin/assets/css", - "rename": false, - "type": "file" - }, - "admin.js": { - "naam": "admin.js", - "path": "c0mp0n3nt/admin/assets/js", - "rename": false, - "type": "file" - }, - "site.css": { - "naam": "site.css", - "path": "c0mp0n3nt/site/assets/css", - "rename": false, - "type": "file" - }, - "site.js": { - "naam": "site.js", - "path": "c0mp0n3nt/site/assets/js", - "rename": false, - "type": "file" - }, - "batch_.php": { - "naam": "batch_.php", - "path": "c0mp0n3nt/admin/helpers/html", - "rename": false, - "type": "file" - }, - "batchselection.php": { - "naam": "batchselection.php", - "path": "c0mp0n3nt/admin/layouts", - "rename": false, - "type": "file" - }, - "component_site.php": { - "naam": "component_site.php", - "path": "c0mp0n3nt/site", - "rename": "component_site", - "type": "file" - }, - "router.php": { - "naam": "router.php", - "path": "c0mp0n3nt/site", - "rename": false, - "type": "file" - }, - "routeHelper.php": { - "naam": "routeHelper.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "new", - "newName": "route.php", - "type": "file" - }, - "BaseControllerSITE.php": { - "naam": "BaseControllerSITE.php", - "path": "c0mp0n3nt/site", - "rename": "new", - "newName": "controller.php", - "type": "file" - }, - "Helper.php": { - "naam": "JCB_Helper.php", - "path": "c0mp0n3nt/admin/helpers", - "rename": "JCB_Helper", - "type": "file" - }, - "Helper_site.php": { - "naam": "JCB_Helper_site.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "JCB_Helper_site", - "type": "file" - }, - "Helper_category.php": { - "naam": "Helper_category.php", - "path": "c0mp0n3nt/site/helpers", - "rename": "new", - "newName": "category.php", - "type": "file" - }, - "script.php": { - "naam": "script.php", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "install.mysql.utf8.sql": { - "naam": "install.mysql.utf8.sql", - "path": "c0mp0n3nt/admin/sql", - "rename": false, - "type": "file" - }, - "uninstall.mysql.utf8.sql": { - "naam": "uninstall.mysql.utf8.sql", - "path": "c0mp0n3nt/admin/sql", - "rename": false, - "type": "file" - }, - "headercheck_admin.php": { - "naam": "headercheck_admin.php", - "path": "c0mp0n3nt/admin/helpers", - "rename": "new", - "newName": "headercheck.php", - "type": "file" - }, - "LICENSE.txt": { - "naam": "LICENSE.txt", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "README.txt": { - "naam": "README.txt", - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "file" - }, - "README.md": { - "naam": "README.md", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "CHANGELOG.md": { - "naam": "CHANGELOG.md", - "path": "c0mp0n3nt/", - "rename": false, - "type": "file" - }, - "headercheck.php": { - "naam": "headercheck.php", - "path": "c0mp0n3nt/site/helpers", - "rename": false, - "type": "file" - }, - "import.gif": { - "naam": "import.gif", - "path": "c0mp0n3nt/admin/assets/images", - "rename": false, - "type": "file" - } - }, - "dynamic": { - "admin": { - "whmcs.php": { - "path": "c0mp0n3nt/admin", - "rename": false, - "type": "whmcs" - }, - "Helper_email.php": { - "path": "c0mp0n3nt/admin/helpers", - "rename": "Helper_", - "type": "emailer" - }, - "AdminControllerDashboard.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "AdminControllerDashboard", - "type": "dashboard" - }, - "ListModelDASH.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ListModelDASH", - "type": "dashboard" - }, - "DASHJViewLagacy.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "dashboard" - }, - "default_vdm.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "dashboard" - }, - "default_main.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "dashboard" - }, - "DASHdefault.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "dashboard" - }, - "dashboard.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": false, - "type": "dashboard" - }, - "filter_forms.xml": { - "path": "c0mp0n3nt/admin/models/forms", - "rename": "filter_forms", - "type": "filter" - }, - "module_forms.xml": { - "path": "c0mp0n3nt/admin/models/forms", - "rename": "module_forms", - "type": "single" - }, - "module_forms.js": { - "path": "c0mp0n3nt/media/js", - "rename": "module_forms", - "type": "single" - }, - "edit.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "single" - }, - "AdminModel.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "AdminModel", - "type": "single" - }, - "FormController.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "FormController", - "type": "single" - }, - "Table.php": { - "path": "c0mp0n3nt/admin/tables", - "rename": "Table", - "type": "single" - }, - "submitbutton.js": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": false, - "type": "single" - }, - "HtmlView_edit.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "view.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "view", - "type": "single" - }, - "AdminController.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "AdminController", - "type": "list" - }, - "ListModel.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ListModel", - "type": "list" - }, - "views.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "views", - "type": "list" - }, - "HtmlView_list.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "default.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_batch_body.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_batch_footer.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_toolbar.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_head.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_body.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "default_foot.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": false, - "type": "list" - }, - "JFormRule.php": { - "path": "c0mp0n3nt/admin/models/rules", - "rename": "JFormRule", - "type": "rule" - }, - "layout_admin.php": { - "path": "c0mp0n3nt/admin/layouts", - "rename": "layout_admin", - "type": "layout" - }, - "layoutoverride.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutoverride", - "type": "layoutoverride" - }, - "layoutitems.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutitems", - "type": "layoutitems" - }, - "layoutfull.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutfull", - "type": "layoutfull" - }, - "layoutlinkedview.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutlinkedview", - "type": "layoutlinkedview" - }, - "layouttitle.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layouttitle", - "type": "layouttitle" - }, - "layoutpublished.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutpublished", - "type": "layoutpublished" - }, - "layoutmetadata.php": { - "path": "c0mp0n3nt/admin/layouts/VIEW", - "rename": "layoutmetadata", - "type": "layoutmetadata" - }, - "JFormFieldCustom.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldCustom", - "type": "fieldcustom" - }, - "JFormFieldList.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldList", - "type": "fieldlist" - }, - "JFormFieldRadio.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldRadio", - "type": "fieldradio" - }, - "JFormFieldCheckboxes.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldCheckboxes", - "type": "fieldcheckboxes" - }, - "JFormFieldUser.php": { - "path": "c0mp0n3nt/admin/models/fields", - "rename": "JFormFieldUser", - "type": "fielduser" - }, - "BaseControllerAjax.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "ajax.json.php", - "type": "ajax" - }, - "ListModelAjax.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "new", - "newName": "ajax.php", - "type": "ajax" - }, - "BaseController_import.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "import.php", - "type": "import" - }, - "BaseDatabaseModel_import.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "new", - "newName": "import.php", - "type": "import" - }, - "HtmlView_import.php": { - "path": "c0mp0n3nt/admin/views/import", - "rename": "new", - "newName": "view.html.php", - "type": "import" - }, - "default_import.php": { - "path": "c0mp0n3nt/admin/views/import/tmpl", - "rename": "new", - "newName": "default.php", - "type": "import" - }, - "BaseController_import_custom.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "BaseController_import_custom", - "type": "customimport" - }, - "BaseDatabaseModel_import_custom.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "BaseDatabaseModel_import_custom", - "type": "customimport" - }, - "HtmlView_import_custom.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "customimport" - }, - "default_import_custom.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "customimport" - }, - "BaseControllerHelp.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "new", - "newName": "help.php", - "type": "help" - }, - "1.0.0.sql": { - "path": "c0mp0n3nt/admin/sql/updates/mysql", - "rename": "1.0.0", - "type": "sql_update" - }, - "update_server.xml": { - "path": "c0mp0n3nt/", - "rename": "update_server", - "type": "update_server" - }, - "viewFile.js": { - "path": "c0mp0n3nt/admin/assets/js", - "rename": "viewFile", - "type": "javascript_file" - } - }, - "site": { - "HtmlView_list_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "ListModel_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "ListModel_site", - "type": "list" - }, - "views_site.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "views_site", - "type": "list" - }, - "default_list_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "list" - }, - "HtmlView_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "view_site.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "view_site", - "type": "single" - }, - "ItemModel_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "ItemModel_site", - "type": "single" - }, - "default_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "single" - }, - "default_site_template.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "site_template", - "type": "template" - }, - "layout_site.php": { - "path": "c0mp0n3nt/site/layouts", - "rename": "layout_site", - "type": "layout" - }, - "layoutoverride.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutoverride", - "type": "layoutoverride" - }, - "layoutitems.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutitems", - "type": "layoutitems" - }, - "layoutfull.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutfull", - "type": "layoutfull" - }, - "layoutlinkedview.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutlinkedview", - "type": "layoutlinkedview" - }, - "layouttitle.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layouttitle", - "type": "layouttitle" - }, - "layoutpublished.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutpublished", - "type": "layoutpublished" - }, - "layoutmetadata.php": { - "path": "c0mp0n3nt/site/layouts/VIEW", - "rename": "layoutmetadata", - "type": "layoutmetadata" - }, - "default.xml": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": false, - "type": "menu" - }, - "edit.xml": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": false, - "type": "admin_menu" - }, - "module_forms.xml": { - "path": "c0mp0n3nt/site/models/forms", - "rename": "module_forms", - "type": "edit" - }, - "module_forms.js": { - "path": "c0mp0n3nt/site/models/forms", - "rename": "module_forms", - "type": "edit" - }, - "edit_site.php": { - "path": "c0mp0n3nt/site/views/VIEW/tmpl", - "rename": "new", - "newName": "edit.php", - "type": "edit" - }, - "AdminModel_site.php": { - "path": "c0mp0n3nt/site/models", - "rename": "AdminModel_site", - "type": "edit" - }, - "FormController_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "FormController_site", - "type": "edit" - }, - "submitbutton.js": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": false, - "type": "edit" - }, - "HtmlView_edit_site.php": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "edit" - }, - "view_site_edit.css": { - "path": "c0mp0n3nt/site/assets/css", - "rename": "view_site_edit", - "type": "edit" - }, - "BaseControllerAjaxSite.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "new", - "newName": "ajax.json.php", - "type": "ajax" - }, - "ListModelAjaxSite.php": { - "path": "c0mp0n3nt/site/models", - "rename": "new", - "newName": "ajax.php", - "type": "ajax" - }, - "BaseControllerHelp_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "new", - "newName": "help.php", - "type": "help" - }, - "FormController_custom_site.php": { - "path": "c0mp0n3nt/site/controllers", - "rename": "FormController_custom_site", - "type": "custom_form" - }, - "submitbutton_site.js": { - "path": "c0mp0n3nt/site/views/VIEW", - "rename": "new", - "newName": "submitbutton.js", - "type": "custom_form" - }, - "Helper_category_view.php": { - "path": "c0mp0n3nt/site/helpers", - "rename": "Helper_category_view", - "type": "category" - }, - "viewFileSite.js": { - "path": "c0mp0n3nt/site/assets/js", - "rename": "viewFileSite", - "type": "javascript_file" - } - }, - "custom_admin": { - "HtmlView_list_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "list" - }, - "ListModel_custom_admin.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ListModel_custom_admin", - "type": "list" - }, - "default_list_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "list" - }, - "AdminController_custom_admin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "AdminController_custom_admin", - "type": "list" - }, - "views_custom_admin.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "views_custom_admin", - "type": "list" - }, - "view_custom_admin.css": { - "path": "c0mp0n3nt/admin/assets/css", - "rename": "view_custom_admin", - "type": "single" - }, - "HtmlView_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW", - "rename": "new", - "newName": "view.html.php", - "type": "single" - }, - "ItemModel_custom_admin.php": { - "path": "c0mp0n3nt/admin/models", - "rename": "ItemModel_custom_admin", - "type": "single" - }, - "default_custom_admin.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "new", - "newName": "default.php", - "type": "single" - }, - "BaseController_custom_admin.php": { - "path": "c0mp0n3nt/admin/controllers", - "rename": "BaseController_custom_admin", - "type": "single" - }, - "default_custom_admin_template.php": { - "path": "c0mp0n3nt/admin/views/VIEW/tmpl", - "rename": "custom_admin_template", - "type": "template" - }, - "layout_custom_admin.php": { - "path": "c0mp0n3nt/admin/layouts", - "rename": "layout_custom_admin", - "type": "layout" - }, - "viewFileCustomAdmin.js": { - "path": "c0mp0n3nt/admin/assets/js", - "rename": "viewFileCustomAdmin", - "type": "javascript_file" - } - } - } - } -} \ No newline at end of file diff --git a/admin/compiler/joomla_3/submitbutton.js b/admin/compiler/joomla_3/submitbutton.js index e459e897e..cd10493cd 100644 --- a/admin/compiler/joomla_3/submitbutton.js +++ b/admin/compiler/joomla_3/submitbutton.js @@ -4,7 +4,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/compiler/joomla_3/submitbutton_site.js b/admin/compiler/joomla_3/submitbutton_site.js index ed4feb712..40938b445 100644 --- a/admin/compiler/joomla_3/submitbutton_site.js +++ b/admin/compiler/joomla_3/submitbutton_site.js @@ -4,7 +4,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/compiler/joomla_3/whmcs.php b/admin/compiler/joomla_3/whmcs.php index 06e6cc3af..2bf15a8ff 100644 --- a/admin/compiler/joomla_3/whmcs.php +++ b/admin/compiler/joomla_3/whmcs.php @@ -3,8 +3,8 @@ * @package Joomla.Component.Builder * * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ diff --git a/admin/compiler/joomla_4/1.0.0.sql b/admin/compiler/joomla_4/1.0.0.sql new file mode 100644 index 000000000..2e5802f84 --- /dev/null +++ b/admin/compiler/joomla_4/1.0.0.sql @@ -0,0 +1 @@ +###UPDATE_VERSION_MYSQL### diff --git a/admin/compiler/joomla_4/ADMIN_AJAX_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_AJAX_CONTROLLER.php new file mode 100644 index 000000000..2f67bb7db --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_AJAX_CONTROLLER.php @@ -0,0 +1,102 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use Joomla\CMS\Session\Session; +use Joomla\Input\Input; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax Base Controller + * + * @since 1.6 + */ +class AjaxController extends BaseController +{ + /** + * Constructor. + * + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input + * + * @since 3.0 + */ + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + { + parent::__construct($config, $factory, $app, $input); + + // make sure all json stuff are set + $this->app->getDocument()->setMimeEncoding( 'application/json' ); + $this->app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); + $this->app->setHeader('Access-Control-Allow-Origin', '*'); + // load the tasks###REGISTER_AJAX_TASK### + } + + /** + * The ajax function + * + * @since 3.10 + */ + public function ajax() + { + // get the user for later use + $user = $this->app->getIdentity(); + // get the input values + $jinput = $this->input ?? $this->app->input; + // check if we should return raw (DEFAULT TRUE SINCE J4) + $returnRaw = $jinput->get('raw', true, 'BOOLEAN'); + // return to a callback function + $callback = $jinput->get('callback', null, 'CMD'); + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) + { + // get the task + $task = $this->getTask(); + switch($task) + {###AJAX_INPUT_RETURN### + } + } + else + { + // return to a callback function + if($callback) + { + echo $callback."(".json_encode(['error' => 'There was an error! [129]']).");"; + } + elseif($returnRaw) + { + echo json_encode(['error' => 'There was an error! [129]']); + } + else + { + echo "(".json_encode(['error' => 'There was an error! [129]']).");"; + } + } + } +} diff --git a/admin/compiler/joomla_4/ADMIN_AJAX_MODEL.php b/admin/compiler/joomla_4/ADMIN_AJAX_MODEL.php new file mode 100644 index 000000000..c02dcc00a --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_AJAX_MODEL.php @@ -0,0 +1,62 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###AJAX_ADMIN_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax List Model + * + * @since 1.6 + */ +class AjaxModel extends ListModel +{ + /** + * The component params. + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $app_params; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app_params = ComponentHelper::getParams('com_###component###'); + $this->app ??= Factory::getApplication(); + }###AJAX_MODEL_METHODS### +} diff --git a/admin/compiler/joomla_4/ADMIN_DISPLAY_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_DISPLAY_CONTROLLER.php new file mode 100644 index 000000000..199578ec5 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_DISPLAY_CONTROLLER.php @@ -0,0 +1,50 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### master admin display controller. + * + * @since 4.0 + */ +class DisplayController extends BaseController +{ + /** + * The default view. + * + * @var string + * @since 1.0.0 + */ + protected $default_view = '###DASHBOARDVIEW###'; + + /** + * display task + * + * @return void + */ + function display($cachable = false, $urlparams = false) + { + return parent::display($cachable, $urlparams); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_EXTENSION_COMPONENT.php b/admin/compiler/joomla_4/ADMIN_EXTENSION_COMPONENT.php new file mode 100644 index 000000000..abb451609 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_EXTENSION_COMPONENT.php @@ -0,0 +1,80 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Extension; + +use Joomla\CMS\Association\AssociationServiceInterface; +use Joomla\CMS\Association\AssociationServiceTrait; +use Joomla\CMS\Categories\CategoryServiceInterface; +use Joomla\CMS\Categories\CategoryServiceTrait; +use Joomla\CMS\Component\Router\RouterServiceInterface; +use Joomla\CMS\Component\Router\RouterServiceTrait; +use Joomla\CMS\Extension\BootableExtensionInterface; +use Joomla\CMS\Extension\MVCComponent; +use Joomla\CMS\Factory; +use Joomla\CMS\Fields\FieldsServiceInterface; +use Joomla\CMS\Form\Form; +use Joomla\CMS\HTML\HTMLRegistryAwareTrait; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Tag\TagServiceInterface; +use Joomla\CMS\Tag\TagServiceTrait; +use Joomla\CMS\User\UserFactoryInterface; +// (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Service\HTML\AdministratorService; +use Psr\Container\ContainerInterface; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Component class for com_###component### + * + * @since 4.0 + */ +class ###Component###Component extends MVCComponent implements + BootableExtensionInterface, + CategoryServiceInterface, + RouterServiceInterface +{ + use AssociationServiceTrait; + use HTMLRegistryAwareTrait; + use RouterServiceTrait; + use CategoryServiceTrait, TagServiceTrait { + CategoryServiceTrait::getTableNameForSection insteadof TagServiceTrait; + CategoryServiceTrait::getStateColumnForSection insteadof TagServiceTrait; + } + + /** + * Booting the extension. This is the function to set up the environment of the extension like + * registering new class loaders, etc. + * + * If required, some initial set up can be done from services of the container, eg. + * registering HTML services. + * + * @param ContainerInterface $container The container + * + * @return void + * + * @since 4.0.0 + */ + public function boot(ContainerInterface $container) + { + // (soon) $this->getRegistry()->register('###component###administrator', new AdministratorService()); + } + + // will fix these soon + protected function getTableNameForSection(string $section = null){} + public function countItems(array $items, string $section){} + +} diff --git a/admin/compiler/joomla_4/ADMIN_HEADERCHECK.php b/admin/compiler/joomla_4/ADMIN_HEADERCHECK.php new file mode 100644 index 000000000..e07898584 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_HEADERCHECK.php @@ -0,0 +1,135 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Document\Document; +use Joomla\CMS\Application\CMSApplication; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Helper class for checking loaded scripts and styles in the document header. + * + * @since 3.2.0 + */ +class HeaderCheck +{ + /** + * @var CMSApplication Application object + * + * @since 3.2.0 + */ + protected CMSApplication $app; + + /** + * @var Document object + * + * @since 3.2.0 + */ + protected Document $document; + + /** + * Construct the app and document + * + * @since 3.2.0 + */ + public function __construct() + { + // Initializes the application object. + $this->app ??= Factory::getApplication(); + + // Initializes the document object. + $this->document = $this->app->getDocument(); + } + + /** + * Check if a JavaScript file is loaded in the document head. + * + * @param string $scriptName Name of the script to check. + * + * @return bool True if the script is loaded, false otherwise. + * @since 3.2.0 + */ + public function js_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'scripts'); + } + + /** + * Check if a CSS file is loaded in the document head. + * + * @param string $scriptName Name of the stylesheet to check. + * + * @return bool True if the stylesheet is loaded, false otherwise. + * @since 3.2.0 + */ + public function css_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'styleSheets'); + } + + /** + * Abstract method to check if a given script or stylesheet is loaded. + * + * @param string $scriptName Name of the script or stylesheet. + * @param string $type Type of asset to check ('scripts' or 'styleSheets'). + * + * @return bool True if the asset is loaded, false otherwise. + * @since 3.2.0 + */ + private function isLoaded(string $scriptName, string $type): bool + { + // UIkit specific check + if ($this->isUIkit($scriptName)) + { + return true; + } + + $head_data = $this->document->getHeadData(); + foreach (array_keys($head_data[$type]) as $script) + { + if (stristr($script, $scriptName)) + { + return true; + } + } + + return false; + } + + /** + * Check for UIkit framework specific conditions. + * + * @param string $scriptName Name of the script or stylesheet. + * + * @return bool True if UIkit specific conditions are met, false otherwise. + * @since 3.2.0 + */ + private function isUIkit(string $scriptName): bool + { + if (strpos($scriptName, 'uikit') !== false) + { + $get_template_name = $this->app->getTemplate('template')->template; + if (strpos($get_template_name, 'yoo') !== false) + { + return true; + } + } + return false; + } +} diff --git a/admin/compiler/joomla_3/JCB_Helper.php b/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php similarity index 55% rename from admin/compiler/joomla_3/JCB_Helper.php rename to admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php index 1819d2ba2..ddd00b885 100644 --- a/admin/compiler/joomla_3/JCB_Helper.php +++ b/admin/compiler/joomla_4/ADMIN_HELPER_CLASS.php @@ -2,46 +2,46 @@ /** * @package Joomla.Component.Builder * - * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @created 4th September 2022 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; ?> ###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper; -// No direct access to this file -defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER### +###ADMIN_POWER_HELPER### ###ADMIN_HELPER_CLASS_HEADER### +// No direct access to this file +\defined('_JEXEC') or die; + /** * ###Component### component helper. + * + * @since 3.0 */ abstract class ###Component###Helper { - /** - * Adding the utilities trait to this class - * - * @deprecated 4.0 - Check the trait methods for details, a legacy implementation - */ - use Utilities; - - /** - * get the Component Code Name - */ - public static $ComponentCodeName = '###component###'; - /** * Composer Switch - * + * * @var array */ - protected static $composer = array();###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### + protected static $composer = []; + + /** + * The Main Active Language + * + * @var string + */ + public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### /** * Load the Composer Vendors @@ -52,7 +52,7 @@ abstract class ###Component###Helper if (!isset(self::$composer[$target])) { // get the function name - $functionName = self::safeString('compose' . $target); + $functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target); // check if method exist if (method_exists(__CLASS__, $functionName)) { @@ -74,7 +74,7 @@ abstract class ###Component###Helper /** * Joomla version object - */ + */ protected static $JVersion; /** @@ -83,9 +83,9 @@ abstract class ###Component###Helper public static function jVersion() { // check if set - if (!self::checkObject(self::$JVersion)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -96,18 +96,18 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) - { + { if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } @@ -121,8 +121,8 @@ abstract class ###Component###Helper $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -134,18 +134,89 @@ abstract class ###Component###Helper public static function addSubmenu($submenu) { // load user for access menus - $user = JFactory::getUser(); + $user = Factory::getApplication()->getIdentity(); // load the submenus to sidebar ###SUBMENU### }###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL### + /** + * Get a Variable + * + * @param string $table The table from which to get the variable + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * + * @return mix string/int/float + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...); + */ + public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###') + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var( + $table, + $where, + $whereString, + $what, + $operator, + $main + ); + } + + /** + * Get array of variables + * + * @param string $table The table from which to get the variables + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * @param bool $unique The switch to return a unique array + * + * @return array + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...); + */ + public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true) + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars( + $table, + $where, + $whereString, + $what, + $operator, + $main, + $unique + ); + } + + /** + * Convert a json object to a string + * + * @input string $value The json string to convert + * + * @returns a string + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...); + */ + public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string( + $value, + $sperator, + $table, + $id, + $name + ); + } + public static function isPublished($id,$type) { if ($type == 'raw') { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -163,7 +234,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -172,7 +243,7 @@ abstract class ###Component###Helper $db->execute(); $found = $db->getNumRows(); if($found) - { + { return $db->loadResult(); } return $id; @@ -188,39 +259,39 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions - * + * @return object The CMSObject of permission/authorised actions + * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') { // load the user if not given - if (!self::checkObject($user)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getApplication()->getIdentity(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) - $view = self::safeString($view); - if (self::checkString($views)) + $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { - $views = self::safeString($views); - } + $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; } // get created by if not found - if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id)) { - $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + $record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component); } // set actions only set in component settings $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); @@ -229,12 +300,12 @@ abstract class ###Component###Helper if ($target) { // convert to an array - if (self::checkString($target)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target)) { $target = array($target); } // check if we are good to go - if (self::checkArray($target)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target)) { $checkTarget = true; } @@ -255,7 +326,7 @@ abstract class ###Component###Helper // set area $area = 'comp'; // check if the record has an ID and the action is item related (not a component action) - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) { // we are in item @@ -288,7 +359,7 @@ abstract class ###Component###Helper } } } - elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0) { // we are in item $area = 'category'; @@ -360,7 +431,7 @@ abstract class ###Component###Helper * @param array $targets The array of target actions * * @return boolean true if action should be filtered out - * + * */ protected static function filterActions(&$view, &$action, &$targets) { @@ -377,51 +448,55 @@ abstract class ###Component###Helper } /** - * Get any component's model + * Returns any Model object. + * + * @param string $type The model type to instantiate + * @param string $prefix Prefix for the model class name. Optional. + * @param string $component Component name the model belongs to. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * @throws \Exception + * @since 4.4 */ - public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array()) + public static function getModel(string $type, string $prefix = 'Administrator', + string $component = '###component###', array $config = []) { - // fix the name - $name = self::safeString($name); - // full path to models - $fullPathModels = $path . '/models'; - // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); - // make sure the table path is loaded - if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + // make sure the name is correct + $type = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($type, 'F'); + $component = strtolower($component); + + if ($prefix !== 'Site' && $prefix !== 'Administrator') { - // This is the JCB default path to tables in Joomla 3.x - $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + $prefix = self::getPrefixFromModelPath($prefix); } - // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); - // if model not found (strange) - if ($model == false) + + // Get the model through the MVCFactory + return Factory::getApplication()->bootComponent('com_' . $component)->getMVCFactory()->createModel($type, $prefix, $config); + } + + /** + * Get the prefix from the model path + * + * @param string $path The model path + * + * @return string The prefix value + * @since 4.4 + */ + protected static function getPrefixFromModelPath(string $path): string + { + // Check if $path starts with JPATH_ADMINISTRATOR path + if (str_starts_with($path, JPATH_ADMINISTRATOR . '/components/')) { - jimport('joomla.filesystem.file'); - // get file path - $filePath = $path . '/' . $name . '.php'; - $fullPathModel = $fullPathModels . '/' . $name . '.php'; - // check if it exists - if (File::exists($filePath)) - { - // get the file - require_once $filePath; - } - elseif (File::exists($fullPathModel)) - { - // get the file - require_once $fullPathModel; - } - // build class names - $modelClass = $Component . 'Model' . $name; - if (class_exists($modelClass)) - { - // initialize the model - return new $modelClass($config); - } + return 'Administrator'; } - return $model; + // Check if $path starts with JPATH_SITE path + elseif (str_starts_with($path, JPATH_SITE . '/components/')) + { + return 'Site'; + } + + return 'Administrator'; } /** @@ -429,14 +504,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); - + $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -460,27 +535,27 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else { // Create an asset_id or heal one that is corrupted. - $object = new stdClass(); + $object = new \StdClass(); // Must be a valid primary key value. $object->id = $id; $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -497,7 +572,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -512,8 +587,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -528,7 +603,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -536,8 +611,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -582,7 +657,7 @@ abstract class ###Component###Helper * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -596,7 +671,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -651,17 +726,69 @@ abstract class ###Component###Helper // button attributes $buttonAttributes = array( 'type' => 'radio', - 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', - 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); // set the button options $buttonOptions = array( - '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', - '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + '1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES', + '0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO'); // return the input - return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + } + + /** + * Check if have an json string + * + * @input string The json string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + */ + public static function checkJson($string) + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + } + + /** + * Check if have an object with a length + * + * @input object The object to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + */ + public static function checkObject($object) + { + return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + } + + /** + * Check if have an array with a length + * + * @input array The array to check + * + * @returns bool/int number of items in array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + */ + public static function checkArray($array, $removeEmptyString = false) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + } + + /** + * Check if have a string with a length + * + * @input string The string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); + */ + public static function checkString($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); } /** @@ -673,8 +800,8 @@ abstract class ###Component###Helper public static function isConnected() { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? - $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -689,9 +816,122 @@ abstract class ###Component###Helper return $is_conn; } + /** + * Merge an array of array's + * + * @input array The arrays you would like to merge + * + * @returns array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + */ + public static function mergeArrays($arrays) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) { return self::shorten($string, $length, $addTip); - }###HELPER_LICENSE_LOCK######GET_CRYPT_KEY### + } + + /** + * Shorten a string + * + * @input string The you would like to shorten + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); + */ + public static function shorten($string, $length = 40, $addTip = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip); + } + + /** + * Making strings safe (various ways) + * + * @input string The you would like to make safe + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); + */ + public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe( + $string, + $type, + $spacer, + $replaceNumbers, + $keepOnlyCharacters + ); + } + + /** + * Convert none English strings to code usable string + * + * @input an string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + */ + public static function transliterate($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + } + + /** + * make sure a string is HTML save + * + * @input an html string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); + */ + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html( + $var, + $charset, + $shorten, + $length + ); + }###HELPER_LICENSE_LOCK### + + /** + * Convert all int in a string to an English word string + * + * @input an string with numbers + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + */ + public static function replaceNumbers($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + } + + /** + * Convert an integer into an English word string + * Thanks to Tom Nicholson + * + * @input an int + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + */ + public static function numberToString($x) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + } + + /** + * Random Key + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + */ + public static function randomkey($size) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + }###GET_CRYPT_KEY### } diff --git a/admin/compiler/joomla_4/ADMIN_HELPER_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_HELPER_CONTROLLER.php new file mode 100644 index 000000000..91b90a0d1 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_HELPER_CONTROLLER.php @@ -0,0 +1,128 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Database\DatabaseInterface; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Help Base Controller + * + * @since 1.6 + */ +class HelpController extends BaseController +{ + public function __construct($config) + { + parent::__construct($config); + // load the tasks + $this->registerTask('getText', 'help'); + } + + public function help() + { + $user = Factory::getApplication()->getIdentity(); + $jinput = Factory::getApplication()->input; + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) + { + $task = $this->getTask(); + switch($task){ + case 'getText': + try + { + $idValue = $jinput->get('id', 0, 'INT'); + if($idValue) + { + $result = $this->getHelpDocumentText($idValue); + } + else + { + $result = ''; + } + echo $result; + // stop execution gracefully + jexit(); + } + catch(Exception $e) + { + // stop execution gracefully + jexit(); + } + break; + } + } + else + { + // stop execution gracefully + jexit(); + } + } + + protected function getHelpDocumentText($id) + { + $db = Factory::getContainer()->get(DatabaseInterface::class); + $query = $db->getQuery(true); + $query->select(array('a.title','a.content')); + $query->from('#__###component###_help_document AS a'); + $query->where('a.id = '.(int) $id); + $query->where('a.published = 1'); + $db->setQuery($query); + $db->execute(); + if($db->getNumRows()) + { + $text = []; + $document = $db->loadObject(); + // fix image issue + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; + // set document template + $text[] = ""; + $text[] = ''; + $text[] = ""; + $text[] = ''; + $text[] = "".$document->title.""; + $text[] = ''; + $text[] = ''; + $text[] = ""; + $text[] = '
'; + $text[] = '
'; + $text[] = '
'; + // build the help text + $text[] = '

'.$document->title."

"; + $text[] = str_replace(array_keys($images),array_values($images),$document->content); + // end template + $text[] = '


'; + $text[] = '
'; + $text[] = ""; + $text[] = ""; + + return implode("\n",$text); + } + return false; + } +} diff --git a/admin/compiler/joomla_4/ADMIN_HELPER_EMAIL.php b/admin/compiler/joomla_4/ADMIN_HELPER_EMAIL.php new file mode 100644 index 000000000..ac42ef225 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_HELPER_EMAIL.php @@ -0,0 +1,474 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Mail\Mail; +use Joomla\Registry\Registry; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### component email helper + * + * @since 3.0 + */ +abstract class ###Component###Email +{ + /** + * The active recipient + * + * @var activeRecipient (array) + */ + public static $active = []; + + /** + * Configuraiton object + * + * @var Registry + */ + public static ?Registry $config = null; + + /** + * Mailer object + * + * @var Mail + */ + public static ?Mail $mailer = null; + + /** + * Custom Headers + * + * @var array + */ + protected static array $header = []; + + /** + * Get a configuration object + * + */ + public static function getConfig() + { + if (!self::$config) + { + self::$config = ComponentHelper::getParams('com_###component###'); + } + + return self::$config; + } + + /** + * Returns the global mailer object, only creating it if it doesn't already exist. + * + */ + public static function getMailerInstance() + { + if (!self::$mailer) + { + self::$mailer = self::createMailer(); + } + + return self::$mailer; + } + + /** + * Check that a string looks like an email address. + * @param string $address The email address to check + * @param string|callable $patternselect A selector for the validation pattern to use : + * * `auto` Pick best pattern automatically; + * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; + * * `pcre` Use old PCRE implementation; + * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; + * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements. + * * `noregex` Don't use a regex: super fast, really dumb. + * Alternatively you may pass in a callable to inject your own validator, for example: + * PHPMailer::validateAddress('user@example.com', function($address) { + * return (strpos($address, '@') !== false); + * }); + * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator. + * @return boolean + * @static + * @access public + */ + public static function validateAddress($address, $patternselect = null): bool + { + return self::getMailerInstance()->validateAddress($address, $patternselect); + } + + /** + * Get a mailer object. + * + * Returns the global {@link Mail} object, only creating it if it doesn't already exist. + * + * @return Mail object + * + * @see Mail + */ + public static function getMailer(): Mail + { + if (!self::$mailer) + { + self::$mailer = self::createMailer(); + } + + $copy = clone self::$mailer; + + return $copy; + } + + /** + * Create a mailer object + * + * @return Mail object + * + * @see Mail + */ + protected static function createMailer(): Mail + { + // set component params + $conf = self::getConfig(); + + // now load the mailer + $mailer = $conf->get('mailer', 'global'); + + // Create a Mail object + $mail = Mail::getInstance(); + + // check if set to global + if ('global' == $mailer) + { + // get the global details + $globalConf = Factory::getConfig(); + + $mailer = $globalConf->get('mailer'); + $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $globalConf->get('smtpuser'); + $smtppass = $globalConf->get('smtppass'); + $smtphost = $globalConf->get('smtphost'); + $smtpsecure = $globalConf->get('smtpsecure'); + $smtpport = $globalConf->get('smtpport'); + $sendmail = $globalConf->get('sendmail'); + $mailfrom = $globalConf->get('mailfrom'); + $fromname = $globalConf->get('fromname'); + $replyto = $globalConf->get('replyto'); + $replytoname = $globalConf->get('replytoname'); + } + else + { + $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $conf->get('smtpuser'); + $smtppass = $conf->get('smtppass'); + $smtphost = $conf->get('smtphost'); + $smtpsecure = $conf->get('smtpsecure'); + $smtpport = $conf->get('smtpport'); + $sendmail = $conf->get('sendmail'); + $mailfrom = $conf->get('emailfrom'); + $fromname = $conf->get('fromname'); + $replyto = $conf->get('replyto'); + $replytoname = $conf->get('replytoname'); + } + + // Set global sender + $mail->setSender(array($mailfrom, $fromname)); + + // set the global reply-to if found + if ($replyto && $replytoname) + { + $mail->ClearReplyTos(); + $mail->addReplyTo($replyto, $replytoname); + } + + // Default mailer is to use PHP's mail function + switch ($mailer) + { + case 'smtp': + // set the SMTP option + $mail->useSMTP($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport); + break; + + case 'sendmail': + // set the sendmail option + $mail->useSendmail($sendmail); + $mail->IsSendmail(); + break; + + default: + $mail->IsMail(); + break; + } + + return $mail; + } + + /** + * Set a Mail custom header. + * + * @return void + */ + public static function setHeader($target, $value) + { + // set the header + self::$header[$target] = $value; + } + + /** + * Send an email + * + * @return bool on success + * + */ + public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null) + { + // Get a Mail instance + $mail = self::getMailer(); + + // set component params + $conf = self::getConfig(); + + // set if we have override + if ($mailfrom && $fromname) + { + $mail->setSender(array($mailfrom, $fromname)); + } + + // load the bounce email as sender if set + if (!is_null($bounce_email)) + { + $mail->Sender = $bounce_email; + } + + // Add tag to email to identify it + if (!is_null($idsession)) + { + $mail->addCustomHeader('X-VDMmethodID:'.$idsession); + } + + // set headers if found + if (isset(self::$header) && is_array(self::$header) && count((array)self::$header) > 0) + { + foreach (self::$header as $_target => $_value) + { + $mail->addCustomHeader($_target.':'.$_value); + } + } + + // set the subject & Body + $mail->setSubject($subject); + $mail->setBody($body); + + // Are we sending the email as HTML? + if ($mode) + { + $mail->IsHTML(true); + $mail->AltBody = $textonly; + } + + //embed images + if ($embeded) + { + if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($embeds)) + { + foreach($embeds as $embed) + { + $mail->AddEmbeddedImage($embed->Path,$embed->FileName); + } + } + } + + $mail->addRecipient($recipient); + $mail->addCC($cc); + $mail->addBCC($bcc); + $mail->addAttachment($attachment); + + // Take care of reply email addresses + if (is_array($mailreply)) + { + $mail->ClearReplyTos(); + $numReplyTo = count((array)$mailreply); + for ($i=0; $i < $numReplyTo; $i++) + { + $mail->addReplyTo($mailreply[$i], $replyname[$i]); + } + } + elseif (!empty($mailreply)) + { + $mail->ClearReplyTos(); + $mail->addReplyTo($mailreply, $replyname); + } + + // check if we can add the DKIM to email + if ($conf->get('enable_dkim')) + { + if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) + { + $mail->DKIM_domain = $conf->get('dkim_domain'); + $mail->DKIM_selector = $conf->get('dkim_selector'); + $mail->DKIM_identity = $conf->get('dkim_identity'); + $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); + + $tmp = tempnam(sys_get_temp_dir(), 'VDM'); + $h = fopen($tmp, 'w'); + fwrite($h, $conf->get('dkim_private')); + fclose($h); + $mail->DKIM_private = $tmp; + } + } + + $sendmail = $mail->Send(); + + if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) + { + @unlink($tmp); + } + + if (method_exists('###Component###Helper','storeMessage')) + { + // if we have active recipient details + if (isset(self::$active[$recipient])) + { + // store the massage if the method is set + ###Component###Helper::storeMessage($sendmail, self::$active[$recipient], $subject, $body, $textonly, $mode, 'email'); + // clear memory + unset(self::$active[$recipient]); + } + else + { + // store the massage if the method is set + ###Component###Helper::storeMessage($sendmail, $recipient, $subject, $body, $textonly, $mode, 'email'); + } + } + + return $sendmail; + } + + /** + * Set html text (in a row) and subject (as title) to a email table. + * do not use

instead use
+ * in your html that you pass to this method + * since it is a table row it does not + * work well with paragraphs + * + * @return string on success + * + */ + public static function setBasicBody($html, $subject) + { + $body = []; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "" . $subject . ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = $html; + $body[] = ""; + $body[] = ""; + + return implode("\n", $body); + } + + /** + * Set html text (in a row) and subject (as title) to a email table. + * do not use

instead use
+ * in your html that you pass to this method + * since it is a table row it does not + * work well with paragraphs + * + * @return string on success + * + */ + public static function setTableBody($html, $subject) + { + $body = []; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "" . $subject . ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "\n"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = ""; + $body[] = "
"; + $body[] = $html; + $body[] = "
"; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = "
"; + $body[] = ""; + $body[] = ""; + $body[] = ""; + + return implode("\n", $body); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER.php new file mode 100644 index 000000000..865a18c44 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER.php @@ -0,0 +1,63 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +###IMPORT_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Import Base Controller + * + * @since 1.6 + */ +class ImportController extends BaseController +{ + /** + * Import an spreadsheet. + * + * @return void + */ + public function import() + { + // Check for request forgeries + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + $model = $this->getModel('import'); + if ($model->import()) + { + $cache = Factory::getCache('mod_menu'); + $cache->clean(); + // TODO: Reset the users acl here as well to kill off any missing bits + } + + $app = Factory::getApplication(); + $redirect_url = $app->getUserState('com_###component###.redirect_url'); + if (empty($redirect_url)) + { + $redirect_url = Route::_('index.php?option=com_###component###&view=import', false); + } + else + { + // wipe out the user state when we're going to redirect + $app->setUserState('com_###component###.redirect_url', ''); + $app->setUserState('com_###component###.message', ''); + $app->setUserState('com_###component###.extension_message', ''); + } + $this->setRedirect($redirect_url); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER_CUSTOM.php b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER_CUSTOM.php new file mode 100644 index 000000000..59b242d3d --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_CONTROLLER_CUSTOM.php @@ -0,0 +1,63 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +###IMPORT_CUSTOM_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Base Controller + * + * @since 1.6 + */ +class ###View###importController extends BaseController +{ + /** + * Import an spreadsheet. + * + * @return void + */ + public function import() + { + // Check for request forgeries + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + $model = $this->getModel('###View###'); + if ($model->import()) + { + $cache = Factory::getCache('mod_menu'); + $cache->clean(); + // TODO: Reset the users acl here as well to kill off any missing bits + } + + $app = Factory::getApplication(); + $redirect_url = $app->getUserState('com_###component###.redirect_url'); + if (empty($redirect_url)) + { + $redirect_url = Route::_('index.php?option=com_###component###&view=###view###', false); + } + else + { + // wipe out the user state when we're going to redirect + $app->setUserState('com_###component###.redirect_url', ''); + $app->setUserState('com_###component###.message', ''); + $app->setUserState('com_###component###.extension_message', ''); + } + $this->setRedirect($redirect_url); + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_HTML.php b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML.php new file mode 100644 index 000000000..87dee6372 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML.php @@ -0,0 +1,110 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\Import; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Import Html View + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + protected $headerList; + protected $hasPackage = false; + protected $headers; + protected $hasHeader = 0; + protected $dataType; + + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + $paths = new \StdClass; + $paths->first = ''; + $state = $this->get('state'); + + $this->paths = &$paths; + $this->state = &$state; + // get global action permissions + $this->canDo = ###Component###Helper::getActions('import'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + } + + // get the session object + $session = Factory::getSession(); + // check if it has package + $this->hasPackage = $session->get('hasPackage', false); + $this->dataType = $session->get('dataType', false); + if($this->hasPackage && $this->dataType) + { + $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); + $this->headers = ###Component###Helper::getFileHeaders($this->dataType); + // clear the data type + $session->clear('dataType'); + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('import'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_HTML_CUSTOM.php b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML_CUSTOM.php new file mode 100644 index 000000000..7265d0600 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_HTML_CUSTOM.php @@ -0,0 +1,60 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###View###Import; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### ###View### Html View + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{###IMPORT_DISPLAY_METHOD_CUSTOM### + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload'); + + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###view###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL.php b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL.php new file mode 100644 index 000000000..70efddb07 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL.php @@ -0,0 +1,460 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###IMPORT_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/*** + * ###Component### Import Base Database Model + * + * @since 1.6 + */ +class ImportModel extends BaseDatabaseModel +{ + // set uploading values + protected $use_streams = false; + protected $allow_unsafe = false; + protected $safeFileOptions = []; + + /** + * @var object JTable object + */ + protected $_table = null; + + /** + * @var object JTable object + */ + protected $_url = null; + + /** + * Model context string. + * + * @var string + */ + protected $_context = 'com_###component###.import'; + + /** + * Import Settings + */ + protected $getType = NULL; + protected $dataType = NULL; + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * + */ + protected function populateState() + { + $app = Factory::getApplication('administrator'); + + $this->setState('message', $app->getUserState('com_###component###.message')); + $app->setUserState('com_###component###.message', ''); + + // Recall the 'Import from Directory' path. + $path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path')); + $this->setState('import.directory', $path); + parent::populateState(); + } + + /** + * Import an spreadsheet from either folder, url or upload. + * + * @return boolean result of import + * + */ + public function import() + { + $this->setState('action', 'import'); + $app = Factory::getApplication(); + $session = Factory::getSession(); + $package = null; + $continue = false; + // get import type + $this->getType = $app->input->getString('gettype', NULL); + // get import type + $this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL); + + if ($package === null) + { + switch ($this->getType) + { + case 'folder': + // Remember the 'Import from Directory' path. + $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory'); + $package = $this->_getPackageFromFolder(); + break; + + case 'upload': + $package = $this->_getPackageFromUpload(); + break; + + case 'url': + $package = $this->_getPackageFromUrl(); + break; + + case 'continue': + $continue = true; + $package = $session->get('package', null); + $package = json_decode($package, true); + // clear session + $session->clear('package'); + $session->clear('dataType'); + $session->clear('hasPackage'); + break; + + default: + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND')); + + return false; + break; + } + } + // Was the package valid? + if (!$package || !$package['type']) + { + if (in_array($this->getType, array('upload', 'url'))) + { + $this->remove($package['packagename']); + } + + $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE')); + return false; + } + + // first link data to table headers + if(!$continue){ + $package = json_encode($package); + $session->set('package', $package); + $session->set('dataType', $this->dataType); + $session->set('hasPackage', true); + return true; + } + + // set the data + $headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true); + if (!$this->setData($package,$this->dataType,$headerList)) + { + // There was an error importing the package + $msg = Text::_('COM_###COMPONENT###_IMPORT_ERROR'); + $back = $session->get('backto_VDM_IMPORT', NULL); + if ($back) + { + $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); + $session->clear('backto_VDM_IMPORT'); + } + $result = false; + } + else + { + // Package imported sucessfully + $msg = Text::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']); + $back = $session->get('backto_VDM_IMPORT', NULL); + if ($back) + { + $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back); + $session->clear('backto_VDM_IMPORT'); + } + $result = true; + } + + // Set some model state values + $app->enqueueMessage($msg); + + // remove file after import + $this->remove($package['packagename']); + $session->clear($this->getType.'_VDM_IMPORTHEADERS'); + + return $result; + } + + /** + * Works out an importation spreadsheet from a HTTP upload + * + * @return spreadsheet definition or false on failure + */ + protected function _getPackageFromUpload() + { + // Get the uploaded file information + $app = Factory::getApplication(); + $input = $app->input; + + // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. + $userfile = $input->files->get('import_package', null, 'raw'); + + // Make sure that file uploads are enabled in php + if (!(bool) ini_get('file_uploads')) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + return false; + } + + // If there is no uploaded file, we have a problem... + if (!is_array($userfile)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + return false; + } + + // Check if there was a problem uploading the file. + if ($userfile['error'] || $userfile['size'] < 1) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + return false; + } + + // Build the appropriate paths + $config = Factory::getConfig(); + $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; + $tmp_src = $userfile['tmp_name']; + + // Move uploaded file + $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); + + // Was the package downloaded? + if (!$p_file) + { + $session = Factory::getSession(); + $session->clear('package'); + $session->clear('dataType'); + $session->clear('hasPackage'); + // was not uploaded + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($userfile['name']); + + return $package; + } + + /** + * Import an spreadsheet from a directory + * + * @return array Spreadsheet details or false on failure + * + */ + protected function _getPackageFromFolder() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the path to the package to import + $p_dir = $input->getString('import_directory'); + $p_dir = Path::clean($p_dir); + // Did you give us a valid path? + if (!file_exists($p_dir)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + return false; + } + + // Detect the package type + $type = $this->getType; + + // Did you give us a valid package? + if (!$type) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + } + + // check the extention + if(!$this->checkExtension($p_dir)) + { + // set error message + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $package['packagename'] = null; + $package['dir'] = $p_dir; + $package['type'] = $type; + + return $package; + } + + /** + * Import an spreadsheet from a URL + * + * @return Package details or false on failure + * + */ + protected function _getPackageFromUrl() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the URL of the package to import + $url = $input->getString('import_url'); + + // Did you give us a URL? + if (!$url) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + return false; + } + + // Download the package at the URL given + $p_file = InstallerHelper::downloadPackage($url); + + // Was the package downloaded? + if (!$p_file) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($p_file); + + return $package; + } + + /** + * Check a file and verifies it as a spreadsheet file + * Supports .csv .xlsx .xls and .ods + * + * @param string $p_filename The uploaded package filename or import directory + * + * @return array of elements + * + */ + protected function check($archivename) + { + $app = Factory::getApplication(); + // Clean the name + $archivename = Path::clean($archivename); + + // check the extention + if(!$this->checkExtension($archivename)) + { + // Cleanup the import files + $this->remove($archivename); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $config = Factory::getConfig(); + // set Package Name + $check['packagename'] = $archivename; + + // set directory + $check['dir'] = $config->get('tmp_path'). '/' .$archivename; + + // set type + $check['type'] = $this->getType; + + return $check; + }###IMPORT_EXT_METHOD### + + /** + * Clean up temporary uploaded spreadsheet + * + * @param string $package Name of the uploaded spreadsheet file + * + * @return boolean True on success + * + */ + protected function remove($package) + { + jimport('joomla.filesystem.file'); + + $config = Factory::getConfig(); + $package = $config->get('tmp_path'). '/' .$package; + + // Is the package file a valid file? + if (is_file($package)) + { + File::delete($package); + } + elseif (is_file(Path::clean($package))) + { + // It might also be just a base filename + File::delete(Path::clean($package)); + } + }###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD### + + protected function getAlias($name,$type = false) + { + // sanitize the name to an alias + if (Factory::getConfig()->get('unicodeslugs') == 1) + { + $alias = OutputFilter::stringURLUnicodeSlug($name); + } + else + { + $alias = OutputFilter::stringURLSafe($name); + } + // must be a uniqe alias + if ($type) + { + return $this->getUniqe($alias,'alias',$type); + } + return $alias; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * @param string $type table. + * + * @return string New value. + */ + protected function getUniqe($value,$field,$type) + { + // insure the filed is always uniqe + while (isset($this->uniqeValueArray[$type][$field][$value])) + { + $value = StringHelper::increment($value, 'dash'); + } + $this->uniqeValueArray[$type][$field][$value] = $value; + return $value; + } + + protected function getAliasesUsed($table) + { + // Get a db connection. + $db = $this->getDatabase(); + // first we check if there is a alias column + $columns = $db->getTableColumns('#__###component###_'.$table); + if(isset($columns['alias'])){ + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('alias'))); + $query->from($db->quoteName('#__###component###_'.$table)); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $aliases = $db->loadColumn(); + foreach($aliases as $alias) + { + $this->uniqeValueArray[$table]['alias'][$alias] = $alias; + } + } + return true; + } + return false; + } +} diff --git a/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL_CUSTOM.php b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL_CUSTOM.php new file mode 100644 index 000000000..7b3b58651 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_IMPORT_MODEL_CUSTOM.php @@ -0,0 +1,351 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###IMPORT_CUSTOM_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Base Database Model + * + * @since 1.6 + */ +class ###View###importModel extends BaseDatabaseModel +{ + // set uploading values + protected $use_streams = false; + protected $allow_unsafe = false; + protected $safeFileOptions = []; + + /** + * @var object JTable object + */ + protected $_table = null; + + /** + * @var object JTable object + */ + protected $_url = null; + + /** + * Model context string. + * + * @var string + */ + protected $_context = 'com_###component###.###view###'; + + /** + * Import Settings + */ + protected $getType = NULL; + protected $dataType = NULL; + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * + */ + protected function populateState() + { + $app = Factory::getApplication('administrator'); + + $this->setState('message', $app->getUserState('com_###component###.message')); + $app->setUserState('com_###component###.message', ''); + + // Recall the 'Import from Directory' path. + $path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path')); + $this->setState('import.directory', $path); + parent::populateState(); + } + ###IMPORT_METHOD_CUSTOM### + + /** + * Works out an importation spreadsheet from a HTTP upload + * + * @return spreadsheet definition or false on failure + */ + protected function _getPackageFromUpload() + { + // Get the uploaded file information + $app = Factory::getApplication(); + $input = $app->input; + + // Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get. + $userfile = $input->files->get('import_package', null, 'raw'); + + // Make sure that file uploads are enabled in php + if (!(bool) ini_get('file_uploads')) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); + return false; + } + + // If there is no uploaded file, we have a problem... + if (!is_array($userfile)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning'); + return false; + } + + // Check if there was a problem uploading the file. + if ($userfile['error'] || $userfile['size'] < 1) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); + return false; + } + + // Build the appropriate paths + $config = Factory::getConfig(); + $tmp_dest = $config->get('tmp_path') . '/' . $userfile['name']; + $tmp_src = $userfile['tmp_name']; + + // Move uploaded file + $p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions); + + // Was the package downloaded? + if (!$p_file) + { + $session = Factory::getSession(); + $session->clear('package'); + $session->clear('dataType'); + $session->clear('hasPackage'); + // was not uploaded + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($userfile['name']); + + return $package; + } + + /** + * Import an spreadsheet from a directory + * + * @return array Spreadsheet details or false on failure + * + */ + protected function _getPackageFromFolder() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the path to the package to import + $p_dir = $input->getString('import_directory'); + $p_dir = Path::clean($p_dir); + // Did you give us a valid path? + if (!file_exists($p_dir)) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); + return false; + } + + // Detect the package type + $type = $this->getType; + + // Did you give us a valid package? + if (!$type) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); + } + + // check the extention + if(!$this->checkExtension($p_dir)) + { + // set error message + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $package['packagename'] = null; + $package['dir'] = $p_dir; + $package['type'] = $type; + + return $package; + } + + /** + * Import an spreadsheet from a URL + * + * @return Package details or false on failure + * + */ + protected function _getPackageFromUrl() + { + $app = Factory::getApplication(); + $input = $app->input; + + // Get the URL of the package to import + $url = $input->getString('import_url'); + + // Did you give us a URL? + if (!$url) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); + return false; + } + + // Download the package at the URL given + $p_file = InstallerHelper::downloadPackage($url); + + // Was the package downloaded? + if (!$p_file) + { + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); + return false; + } + + // check that this is a valid spreadsheet + $package = $this->check($p_file); + + return $package; + } + + /** + * Check a file and verifies it as a spreadsheet file + * Supports .csv .xlsx .xls and .ods + * + * @param string $p_filename The uploaded package filename or import directory + * + * @return array of elements + * + */ + protected function check($archivename) + { + $app = Factory::getApplication(); + // Clean the name + $archivename = Path::clean($archivename); + + // check the extention + if(!$this->checkExtension($archivename)) + { + // Cleanup the import files + $this->remove($archivename); + $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); + return false; + } + + $config = Factory::getConfig(); + // set Package Name + $check['packagename'] = $archivename; + + // set directory + $check['dir'] = $config->get('tmp_path'). '/' .$archivename; + + // set type + $check['type'] = $this->getType; + + return $check; + } + ###IMPORT_EXT_METHOD### + + /** + * Clean up temporary uploaded spreadsheet + * + * @param string $package Name of the uploaded spreadsheet file + * + * @return boolean True on success + * + */ + protected function remove($package) + { + $config = Factory::getConfig(); + $package = $config->get('tmp_path'). '/' .$package; + + // Is the package file a valid file? + if (is_file($package)) + { + File::delete($package); + } + elseif (is_file(Path::clean($package))) + { + // It might also be just a base filename + File::delete(Path::clean($package)); + } + } + ###IMPORT_SETDATA_METHOD### + ###IMPORT_SAVE_METHOD### + + protected function getAlias($name,$type = false) + { + // sanitize the name to an alias + if (Factory::getConfig()->get('unicodeslugs') == 1) + { + $alias = OutputFilter::stringURLUnicodeSlug($name); + } + else + { + $alias = OutputFilter::stringURLSafe($name); + } + // must be a uniqe alias + if ($type) + { + return $this->getUniqe($alias,'alias',$type); + } + return $alias; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * @param string $type table. + * + * @return string New value. + */ + protected function getUniqe($value,$field,$type) + { + // insure the filed is always uniqe + while (isset($this->uniqeValueArray[$type][$field][$value])) + { + $value = StringHelper::increment($value, 'dash'); + } + $this->uniqeValueArray[$type][$field][$value] = $value; + return $value; + } + + protected function getAliasesUsed($table) + { + // Get a db connection. + $db = $this->getDatabase(); + // first we check if there is a alias column + $columns = $db->getTableColumns('#__###component###_'.$table); + if(isset($columns['alias'])){ + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('alias'))); + $query->from($db->quoteName('#__###component###_'.$table)); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $aliases = $db->loadColumn(); + foreach($aliases as $alias) + { + $this->uniqeValueArray[$table]['alias'][$alias] = $alias; + } + } + return true; + } + return false; + } +} diff --git a/admin/compiler/joomla_4/ADMIN_LAYOUT.php b/admin/compiler/joomla_4/ADMIN_LAYOUT.php new file mode 100644 index 000000000..857ae2766 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_LAYOUT.php @@ -0,0 +1,22 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###ADMIN_LAYOUT_CODE### + +?>###ADMIN_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/ADMIN_PROVIDER.php b/admin/compiler/joomla_4/ADMIN_PROVIDER.php new file mode 100644 index 000000000..274892e72 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_PROVIDER.php @@ -0,0 +1,78 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_POWER_HELPER### + +// (soon) use Joomla\CMS\Association\AssociationExtensionInterface; +use Joomla\CMS\Categories\CategoryFactoryInterface; +use Joomla\CMS\Component\Router\RouterFactoryInterface; +use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; +use Joomla\CMS\Extension\ComponentInterface; +use Joomla\CMS\Extension\Service\Provider\CategoryFactory; +use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory; +use Joomla\CMS\Extension\Service\Provider\MVCFactory; +use Joomla\CMS\Extension\Service\Provider\RouterFactory; +use Joomla\CMS\HTML\Registry; +use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Extension\###Component###Component; +// (soon) use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\AssociationsHelper; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * The ###NAMESPACEPREFIX### ###Component### service provider. + * + * @since 4.0.0 + */ +return new class () implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * + * @since 4.0.0 + */ + public function register(Container $container) + { + // (soon) $container->set(AssociationExtensionInterface::class, new AssociationsHelper()); + + $container->registerServiceProvider(new CategoryFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + $container->registerServiceProvider(new MVCFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + $container->registerServiceProvider(new ComponentDispatcherFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + $container->registerServiceProvider(new RouterFactory('\\###NAMESPACEPREFIX###\\Component\\###Component###')); + + $container->set( + ComponentInterface::class, + function (Container $container) { + $component = new ###Component###Component($container->get(ComponentDispatcherFactoryInterface::class)); + + $component->setRegistry($container->get(Registry::class)); + $component->setMVCFactory($container->get(MVCFactoryInterface::class)); + $component->setCategoryFactory($container->get(CategoryFactoryInterface::class)); + // (soon) $component->setAssociationExtension($container->get(AssociationExtensionInterface::class)); + $component->setRouterFactory($container->get(RouterFactoryInterface::class)); + + return $component; + } + ); + } +}; diff --git a/admin/compiler/joomla_4/ADMIN_VIEW.php b/admin/compiler/joomla_4/ADMIN_VIEW.php new file mode 100644 index 000000000..1790e1989 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW.php @@ -0,0 +1,27 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die; + +?> +###EDITBODYFADEIN### +

+###EDITBODY### +
+
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS.php b/admin/compiler/joomla_4/ADMIN_VIEWS.php new file mode 100644 index 000000000..90dd4a345 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS.php @@ -0,0 +1,28 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###ADMIN_VIEWS_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_###component###&task=###views###.saveOrderAjax&tmpl=component'; + Html::_('sortablelist.sortable', '###view###List', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} +?> +###VIEWS_DEFAULT_BODY######VIEWS_FOOTER_SCRIPT### diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_VIEWS_CONTROLLER.php new file mode 100644 index 000000000..28bede844 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_CONTROLLER.php @@ -0,0 +1,53 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +###ADMIN_VIEWS_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Views### Admin Controller + * + * @since 1.6 + */ +class ###Views###Controller extends AdminController +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###VIEWS###'; + + /** + * Proxy for getModel. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * + * @since 1.6 + */ + public function getModel($name = '###View###', $prefix = 'Administrator', $config = ['ignore_request' => true]) + { + return parent::getModel($name, $prefix, $config); + }###CONTROLLEREXIMPORTMETHOD######CUSTOM_ADMIN_DYNAMIC_BUTTONS_CONTROLLER######ADMIN_CUSTOM_BUTTONS_CONTROLLER_LIST### +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_EMPTYSTATE.php b/admin/compiler/joomla_4/ADMIN_VIEWS_EMPTYSTATE.php new file mode 100644 index 000000000..7169372a0 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_EMPTYSTATE.php @@ -0,0 +1,33 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Layout\LayoutHelper; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +$displayData = [ + 'textPrefix' => 'COM_###COMPONENT###_###VIEWS###', + 'formURL' => 'index.php?option=com_###component###&view=###views###', + 'icon' => 'icon-###ICOMOON###', +]; + +if ($this->user->authorise('###view###.create', 'com_###component###')) +{ + $displayData['createURL'] = 'index.php?option=com_###component###&task=###view###.add'; +} + +echo LayoutHelper::render('joomla.content.emptystate', $displayData); diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_HTML.php b/admin/compiler/joomla_4/ADMIN_VIEWS_HTML.php new file mode 100644 index 000000000..2ae71fed7 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_HTML.php @@ -0,0 +1,188 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###Views###; + +###ADMIN_VIEWS_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###Views### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * ###Views### view display method + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + $this->user ??= Factory::getApplication()->getIdentity();###ADMIN_DIPLAY_METHOD### + $this->saveOrder = $this->listOrder == 'a.ordering'; + // set the return here value + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); + // get global action permissions + $this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO### + + // If we don't have items we load the empty state + if (is_array($this->items) && !count((array) $this->items) && $this->isEmptyState = $this->get('IsEmptyState')) + { + $this->setLayout('emptystate'); + } + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###'); + + if ($this->canCreate) + { + ToolbarHelper::addNew('###view###.add'); + } + + // Only load if there are items + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->items)) + { + if ($this->canEdit) + { + ToolbarHelper::editList('###view###.edit'); + } + + if ($this->canState) + { + ToolbarHelper::publishList('###views###.publish'); + ToolbarHelper::unpublishList('###views###.unpublish'); + ToolbarHelper::archiveList('###views###.archive'); + + if ($this->canDo->get('core.admin')) + { + ToolbarHelper::checkin('###views###.checkin'); + } + }###CUSTOM_ADMIN_DYNAMIC_BUTTONS######ADMIN_CUSTOM_BUTTONS_LIST### + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + ToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + ToolbarHelper::trash('###views###.trash'); + }###EXPORTBUTTON### + }###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###views###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + }###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER### + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###JQUERY### + $this->getDocument()->setTitle(Text::_('COM_###COMPONENT###_###VIEWS###')); + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + } + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###ADMIN_ADD_JAVASCRIPT_FILE### + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = true, int $length = 50) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array containing the field name to sort by as the key and display text as value + * @since 1.6 + */ + protected function getSortFields() + { + ###SORTFIELDS### + }###FILTERFUNCTIONS### +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEWS_MODEL.php b/admin/compiler/joomla_4/ADMIN_VIEWS_MODEL.php new file mode 100644 index 000000000..7431385d4 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEWS_MODEL.php @@ -0,0 +1,189 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###ADMIN_VIEWS_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Views### List Model + * + * @since 1.6 + */ +class ###Views###Model extends ListModel +{ + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###views###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js' + ]; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + ###FILTER_FIELDS### + ); + } + + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + }###ADMIN_CUSTOM_BUTTONS_METHOD_LIST### + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * + * @return void + * @since 1.7.0 + */ + protected function populateState($ordering = null, $direction = null) + { + $app = $this->app; + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + }###POPULATESTATE### + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * @since 1.6 + */ + public function getItems() + {###LICENSE_LOCKED_CHECK######CHECKINCALL### + // load parent items + $items = parent::getItems();###GET_ITEMS_METHOD_STRING_FIX######SELECTIONTRANSLATIONFIX######GET_ITEMS_METHOD_AFTER_ALL### + + // return items + return $items; + }###SELECTIONTRANSLATIONFIXFUNC### + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + * @since 1.6 + */ + protected function getListQuery() + {###LICENSE_LOCKED_CHECK### + ###LISTQUERY### + }###MODELEXPORTMETHOD######LICENSE_LOCKED_SET_BOOL### + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * @since 1.6 + */ + protected function getStoreId($id = '') + { + ###STOREDID### + + return parent::getStoreId($id); + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###AUTOCHECKIN### +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php new file mode 100644 index 000000000..f5150bf72 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_CONTROLLER.php @@ -0,0 +1,274 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +###ADMIN_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###View### Form Controller + * + * @since 1.6 + */ +class ###View###Controller extends FormController +{ + use VersionableControllerTrait; + + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###VIEW###'; + + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * The URL view list variable. + * + * @var string + * @since 1.6 + */ + protected $view_list = '###views###';###ADMIN_CUSTOM_BUTTONS_CONTROLLER### + + /** + * 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 = []) + {###JCONTROLLERFORM_ALLOWADD### + } + + /** + * 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 = [], $key = 'id') + {###JCONTROLLERFORM_ALLOWEDIT### + } + + /** + * 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) + { + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('###View###', '', []); + + // Preset the redirect + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $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');###JCONTROLLERFORM_BEFORECANCEL### + + $cancel = parent::cancel($key); + + if (!is_null($return) && Uri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + Route::_( + $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( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + }###JCONTROLLERFORM_AFTERCANCEL### + 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) && Uri::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( + Route::_( + $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( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string) $this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + '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 BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) + {###POSTSAVEHOOK### + } +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_HTML.php b/admin/compiler/joomla_4/ADMIN_VIEW_HTML.php new file mode 100644 index 000000000..5e4b702cf --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_HTML.php @@ -0,0 +1,144 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###View###; + +###ADMIN_VIEW_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###View### Html View class + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * ###View### view display method + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // set params + $this->params = ComponentHelper::getParams('com_###component###'); + $this->useCoreUI = true; + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ###Component###Helper::getActions('###view###', $this->item); + // get input + $jinput = Factory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string) $this->ref . '&refid=' . (int) $this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string) $this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string) $return; + }###LINKEDVIEWITEMS### + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ###ADDTOOLBAR### + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = true, int $length = 30) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###JQUERY### + $isNew = ($this->item->id < 1); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###DOCUMENT_CUSTOM_PHP### + } +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_MODEL.php b/admin/compiler/joomla_4/ADMIN_VIEW_MODEL.php new file mode 100644 index 000000000..b425ecfb7 --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_MODEL.php @@ -0,0 +1,491 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###ADMIN_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Admin Model + * + * @since 1.6 + */ +class ###View###Model extends AdminModel +{ + use VersionableModelTrait; + + /** + * The tab layout fields array. + * + * @var array + * @since 3.0.0 + */ + protected $tabLayoutFields = ###TABLAYOUTFIELDSARRAY###; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###view###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js', + 'media/com_###component###/js/###view###.js' + ]; + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_###component###.###view###'; + + /** + * 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 Table A database object + * @since 3.0 + * @throws \Exception + */ + public function getTable($type = '###view###', $prefix = 'Administrator', $config = []) + { + // get instance of the table + return parent::getTable($type, $prefix, $config); + }###ADMIN_CUSTOM_BUTTONS_METHOD### + + /** + * 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) + {###LICENSE_LOCKED_CHECK### + 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(); + }###METHOD_GET_ITEM### + }###LINKEDVIEWGLOBAL### + + return $item; + }###LINKEDVIEWMETHODS######LICENSE_LOCKED_SET_BOOL### + + /** + * 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 Form|boolean A Form object on success, false on failure + * @since 1.6 + */ + public function getForm($data = [], $loadData = true, $options = ['control' => 'jform']) + { + // set load data option + $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + } + + /** + * 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) + {###JMODELADMIN_CANDELETE### + } + + /** + * 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) + {###JMODELADMIN_CANEDITSTATE### + } + + /** + * 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 = [], $key = 'id') + {###JMODELADMIN_ALLOWEDIT### + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param Table $table A Table object. + * + * @return void + * @since 1.6 + */ + protected function prepareTable($table) + {###LICENSE_TABLE_LOCKED_CHECK### + $date = Factory::getDate(); + $user = $this->getCurrentUser(); + + 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 = $this->getDatabase(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__###component###_###view###')); + $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 = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); + + if (empty($data)) + { + $data = $this->getItem(); + } + + // run the perprocess of the data + $this->preprocessData('com_###component###.###view###', $data); + + return $data; + }###VALIDATIONFIX######UNIQUEFIELDS### + + /** + * 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) + {###JMODELADMIN_BEFORE_DELETE### + if (!parent::delete($pks)) + { + return false; + }###JMODELADMIN_AFTER_DELETE### + + 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) + {###JMODELADMIN_BEFORE_PUBLISH### + if (!parent::publish($pks, $value)) + { + return false; + }###JMODELADMIN_AFTER_PUBLISH### + + 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); + ArrayHelper::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(Text::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user ??= $this->getCurrentUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new UCMType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = ArrayHelper::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(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### + + /** + * 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 = Factory::getApplication()->getInput(); + $filter = InputFilter::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 Registry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new Registry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + }###TITLEALIASFIX### + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a unique value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * @since 3.0 + */ + protected function generateUnique($field, $value) + { + // set field value unique + $table = $this->getTable(); + + while ($table->load([$field => $value])) + { + $value = StringHelper::increment($value); + } + + return $value; + }###GENERATENEWTITLE### +} diff --git a/admin/compiler/joomla_4/ADMIN_VIEW_TABLE.php b/admin/compiler/joomla_4/ADMIN_VIEW_TABLE.php new file mode 100644 index 000000000..0a38769fe --- /dev/null +++ b/admin/compiler/joomla_4/ADMIN_VIEW_TABLE.php @@ -0,0 +1,372 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Table; + +use Joomla\CMS\Factory; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Language\Text; +use Joomla\CMS\String\PunycodeHelper; +use Joomla\CMS\Access\Access as AccessRules; +use Joomla\CMS\Access\Rules; +use Joomla\CMS\Tag\TaggableTableInterface; +use Joomla\CMS\Tag\TaggableTableTrait; +use Joomla\CMS\User\CurrentUserInterface; +use Joomla\CMS\User\CurrentUserTrait; +use Joomla\CMS\Versioning\VersionableTableInterface; +use Joomla\CMS\Application\ApplicationHelper; +use Joomla\Database\DatabaseInterface; +use Joomla\Registry\Registry; +use Joomla\Database\DatabaseDriver; +use Joomla\Event\DispatcherInterface; +use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Views### Table class + * + * @since 1.6 + */ +class ###View###Table extends Table implements VersionableTableInterface, TaggableTableInterface, CurrentUserInterface +{ + use TaggableTableTrait; + use CurrentUserTrait; + + /** + * Constructor + * + * @param DatabaseDriver $db Database connector object + * @param ?DispatcherInterface $dispatcher Event dispatcher for this table + * + * @param object Database connector object + * @since 4.0 + */ + function __construct(DatabaseDriver $db, ?DispatcherInterface $dispatcher = null) + { + // The type alias generally is the internal component name with the + // content type. Ex.: com_content.article + $this->typeAlias = 'com_###component###.###view###'; + + // Ensure the params and metadata in json encoded in the bind method + $this->_jsonEncode = ['params', 'metadata']; + + // Indicates that columns fully support the NULL value in the database + // $this->_supportNullValue = true; // hmmm will keep an eye on this ;) + + parent::__construct('#__###component###_###view###', 'id', $db, $dispatcher);###LICENSE_LOCKED_CHECK### + } + + /** + * Method to bind an associative array or object to the Table instance.This + * method only binds properties that are publicly accessible and optionally + * takes an array of properties to ignore when binding. + * + * @param array|object $src An associative array or object to bind to the Table instance. + * @param array|string $ignore An optional array or space separated list of properties to ignore while binding. + * + * @return boolean True on success. + * + * @since 1.7.0 + * @throws \InvalidArgumentException + */ + public function bind($array, $ignore = '') + { + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new AccessRules($array['rules']); + $this->setRules($rules); + } + + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the ###View### table. + * + * @param boolean Toggle whether null values should be updated. + * + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = Factory::getDate()->toSql(); + $userId = $this->getCurrentUser()->id; + + if ($this->id) + { + // Existing item + $this->modified = $date; + $this->modified_by = $userId; + } + else + { + // New ###view###. A ###view### created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date; + } + if (empty($this->created_by)) + { + $this->created_by = $userId; + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = new self($this->getDbo(), $this->getDispatcher()); + + if ($table->load(['alias' => $this->alias###JTABLEALIASCATEGORY###]) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS')); + + if ($table->published === -2) + { + $this->setError(Text::_('COM_###COMPONENT###_###VIEW###_ERROR_UNIQUE_ALIAS_TRASHED')); + } + + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = PunycodeHelper::urlToPunycode($this->url); + } + + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = PunycodeHelper::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + * + * @see \Joomla\CMS\Table\Table::check + * @since 1.5 + */ + public function check() + { + try { + parent::check(); + } catch (\Exception $e) { + $this->setError($e->getMessage()); + return false; + } + + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = new self($this->getDbo(), $this->getDispatcher()); + + while ($table->load(['alias' => $this->alias]) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = StringHelper::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = StringHelper::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = []; + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = StringHelper::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty AccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_###component###.###view###.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + }###LICENSE_LOCKED_SET_BOOL### + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return AccessRules The AccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = Factory::getContainer()->get(DatabaseInterface::class); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset already set so use saved rules + $assetId = (int) $db->loadResult(); + return AccessRules::getAssetRules($assetId); // (TODO) instead of keeping inherited Allowed it becomes Allowed. + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof AccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = []; + } + } + // check if there are any view values remaining + if (count( (array) $_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return AccessRules::getAssetRules(0); + } + + /** + * Get the type alias for the history table + * + * The type alias generally is the internal component name with the + * content type. Ex.: com_content.article + * + * @return string The alias as described above + * + * @since 3.10.0 + */ + public function getTypeAlias() + { + return $this->typeAlias; + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form table_name.id + * where id is the value of the primary key of the table. + * + * @return string + * + * @since 1.7.0 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + + return $this->getTypeAlias() . '.' . (int) $this->$k; + } + + /** + * Method to get the parent asset under which to register this one. + * + * By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists. + * An extended class can define a table and ID to lookup. If the asset does not exist it will be created. + * + * @param Table $table A Table object for the asset parent. + * @param integer $id Id to look up + * + * @return integer + * + * @since 1.7.0 + */ + protected function _getAssetParentId(Table $table = null, $id = null) + { + /** @var Asset $assets */ + $assets = self::getInstance('Asset', 'JTable', ['dbo' => $this->getDbo()]); + $rootId = $assets->getRootId(); + + // load the ###component### asset + $assets->loadByName('com_###component###'); + + return $assets->id ?? $rootId ?? 1; + }###GENERATENEWALIAS### +} diff --git a/admin/compiler/joomla_4/CHANGELOG.md b/admin/compiler/joomla_4/CHANGELOG.md new file mode 100644 index 000000000..def8704dd --- /dev/null +++ b/admin/compiler/joomla_4/CHANGELOG.md @@ -0,0 +1 @@ +###CHANGELOG### \ No newline at end of file diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_LAYOUT.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_LAYOUT.php new file mode 100644 index 000000000..c3981e98e --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_LAYOUT.php @@ -0,0 +1,22 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###CUSTOM_ADMIN_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###CUSTOM_ADMIN_LAYOUT_CODE### + +?>###CUSTOM_ADMIN_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW.php new file mode 100644 index 000000000..47e384fe5 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW.php @@ -0,0 +1,28 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###CUSTOM_ADMIN_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_CODE_BODY### + +?> +canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### +item->id)) ? '&id='. (int) $this->item->id : ''; ?> +###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### + +

+ diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS.php new file mode 100644 index 000000000..6b23540da --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS.php @@ -0,0 +1,27 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###CUSTOM_ADMIN_VIEWS_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_CODE_BODY### + +?> +canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT### +###CUSTOM_ADMIN_TOP_FORM######CUSTOM_ADMIN_BODY######CUSTOM_ADMIN_BOTTOM_FORM### + +

+ diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_CONTROLLER.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_CONTROLLER.php new file mode 100644 index 000000000..0fbe25922 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_CONTROLLER.php @@ -0,0 +1,65 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +###CUSTOM_ADMIN_VIEWS_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###SViews### Admin Controller + * + * @since 1.6 + */ +class ###SViews###Controller extends AdminController +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###SVIEWS###'; + + /** + * Proxy for getModel. + * + * @param string $name The model name. Optional. + * @param string $prefix The class prefix. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * + * @since 1.6 + */ + public function getModel($name = '###View###', $prefix = 'Administrator', $config = ['ignore_request' => true]) + { + return parent::getModel($name, $prefix, $config); + } + + /** + * Adds option to redirect back to the dashboard. + * + * @return void + * + * @since 3.0 + */ + public function dashboard(): void + { + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); + }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_HTML.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_HTML.php new file mode 100644 index 000000000..c8d70e3ac --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_HTML.php @@ -0,0 +1,119 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###SViews###; + +###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SViews### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get component params + $this->params = ComponentHelper::getParams('com_###component###'); + // get the application + $this->app ??= Factory::getApplication(); + // get the user object + $this->user ??= $this->app->getIdentity(); + // get global action permissions + $this->canDo = ###Component###Helper::getActions('###sview###'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts');###CUSTOM_ADMIN_DIPLAY_METHOD### + + // Set the html view document stuff + $this->_prepareDocument(); + }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###HIDEMAINMENU### + // add title to the page + ToolbarHelper::title(Text::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + }###CUSTOM_ADMIN_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_MODEL.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_MODEL.php new file mode 100644 index 000000000..584eb6b38 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEWS_MODEL.php @@ -0,0 +1,220 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###CUSTOM_ADMIN_VIEWS_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### List Model for ###SViews### + * + * @since 1.6 + */ +class ###SViews###Model extends ListModel +{ + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###sviews###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js' + ]; + + /** + * A custom property for UIKit components. (not used unless you load v2) + */ + protected $uikitComp; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $this->userId = $this->user->get('id'); + $this->guest = $this->user->get('guest'); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->levels = $this->user->getAuthorisedViewLevels(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + * @since 1.6 + */ + protected function getListQuery() + {###CUSTOM_ADMIN_GET_LIST_QUERY### + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * @since 1.6 + */ + public function getItems() + { + $user = $this->user; + // check if this user has permission to access items + if (!$user->authorise('###sviews###.access', 'com_###component###')) + { + $this->app->enqueueMessage(Text::_('Not authorised!'), 'error'); + // redirect away if not a correct to default view + $this->app->redirect('index.php?option=com_###component###'); + return false; + }###LICENSE_LOCKED_CHECK######CUSTOM_ADMIN_BEFORE_GET_ITEMS### + // load parent items + $items = parent::getItems(); + + // Get the global params + $globalParams = ComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS### + + // return items + return $items; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###CUSTOM_ADMIN_CUSTOM_METHODS######LICENSE_LOCKED_SET_BOOL######CUSTOM_ADMIN_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_CONTROLLER.php new file mode 100644 index 000000000..b7fa6648b --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_CONTROLLER.php @@ -0,0 +1,56 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +###CUSTOM_ADMIN_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Base Controller + * + * @since 1.6 + */ +class ###SView###Controller extends BaseController +{ + /** + * The context for storing internal data, e.g. record. + * + * @var string + * @since 1.6 + */ + protected $context = '###sview###'; + + /** + * The URL view item variable. + * + * @var string + * @since 1.6 + */ + protected $view_item = '###sview###'; + + /** + * Adds option to redirect back to the dashboard. + * + * @return void + * @since 3.0 + */ + public function dashboard(): void + { + $this->setRedirect(Route::_('index.php?option=com_###component###', false)); + }###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER### +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_HTML.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_HTML.php new file mode 100644 index 000000000..6fe4459f2 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_HTML.php @@ -0,0 +1,129 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###SView###; + +###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die; ###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SView### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get component params + $this->params = ComponentHelper::getParams('com_###component###'); + // get the application + $this->app ??= Factory::getApplication(); + // get the user object + $this->user ??= Factory::getApplication()->getIdentity(); + // get global action permissions + $this->canDo = ###Component###Helper::getActions('###sview###'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts');###CUSTOM_ADMIN_DIPLAY_METHOD### + + // Set the html view document stuff + $this->_prepareDocument(); + }###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###HIDEMAINMENU### + // set the title + if (isset($this->item->name) && $this->item->name) + { + $title = $this->item->name; + } + // Check for empty title and add view name if param is set + if (empty($title)) + { + $title = Text::_('COM_###COMPONENT###_###SVIEW###'); + } + // add title to the page + ToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + }###CUSTOM_ADMIN_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_MODEL.php b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_MODEL.php new file mode 100644 index 000000000..f71b26864 --- /dev/null +++ b/admin/compiler/joomla_4/CUSTOM_ADMIN_VIEW_MODEL.php @@ -0,0 +1,267 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###CUSTOM_ADMIN_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Item Model + * + * @since 1.6 + */ +class ###SView###Model extends ItemModel +{ + /** + * Model context string. + * + * @var string + * @since 1.6 + */ + protected $_context = 'com_###component###.###sview###'; + + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'administrator/components/com_###component###/assets/css/admin.css', + 'administrator/components/com_###component###/assets/css/###sview###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'administrator/components/com_###component###/assets/js/admin.js' + ]; + + /** + * A custom property for UI Kit components. + * + * @var array|null Property for storing UI Kit component-related data or objects. + * @since 3.2.0 + */ + protected ?array $uikitComp; + + /** + * @var object item + * @since 1.6 + */ + protected $item; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 3.0 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $this->userId = $this->user->get('id'); + $this->guest = $this->user->get('guest'); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->levels = $this->user->getAuthorisedViewLevels(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * @since 1.6 + */ + protected function populateState() + { + // Get the item main id + $id = $this->input->getInt('id', null); + $this->setState('###sview###.id', $id); + + // Load the parameters. + parent::populateState(); + } + + /** + * Method to get article data. + * + * @param integer $pk The id of the article. + * + * @return mixed Menu item data object on success, false on failure. + * @since 1.6 + */ + public function getItem($pk = null) + { + // check if this user has permission to access item + if (!$this->user->authorise('###sview###.access', 'com_###component###')) + { + $this->app->enqueueMessage(Text::_('Not authorised!'), 'error'); + // redirect away if not a correct to cPanel/default view + $this->app->redirect('index.php?option=com_###component###'); + return false; + } + + $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM### + + if ($this->_item === null) + { + $this->_item = []; + }###LICENSE_LOCKED_CHECK### + + if (!isset($this->_item[$pk])) + { + try + {###CUSTOM_ADMIN_GET_ITEM### + } + catch (\Exception $e) + { + if ($e->getCode() == 404) + { + // Need to go thru the error handler to allow Redirect to work. + throw $e; + } + else + { + $this->setError($e); + $this->_item[$pk] = false; + } + } + }###CUSTOM_ADMIN_AFTER_GET_ITEM### + + return $this->_item[$pk]; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###CUSTOM_ADMIN_CUSTOM_METHODS######LICENSE_LOCKED_SET_BOOL######CUSTOM_ADMIN_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/DASH_CONTROLLER.php b/admin/compiler/joomla_4/DASH_CONTROLLER.php new file mode 100644 index 000000000..564117d8d --- /dev/null +++ b/admin/compiler/joomla_4/DASH_CONTROLLER.php @@ -0,0 +1,31 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Controller; + +###DASH_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Admin Controller + * + * @since 1.6 + */ +class ###Component###Controller extends AdminController +{ + +} diff --git a/admin/compiler/joomla_4/DASH_MODEL.php b/admin/compiler/joomla_4/DASH_MODEL.php new file mode 100644 index 000000000..5e14fff76 --- /dev/null +++ b/admin/compiler/joomla_4/DASH_MODEL.php @@ -0,0 +1,225 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Model; + +###DASH_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### List Model + * + * @since 1.6 + */ +class ###Component###Model extends ListModel +{ + public function getIcons() + { + // load user for access menus + $user = Factory::getApplication()->getIdentity(); + // reset icon array + $icons = []; + // view groups array + $viewGroups = array( + 'main' => array(###DASHBOARDICONS###) + );###DASHBOARDICONACCESS### + // loop over the $views + foreach($viewGroups as $group => $views) + { + $i = 0; + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($views)) + { + foreach($views as $view) + { + $add = false; + // external views (links) + if (strpos($view,'||') !== false) + { + $dwd = explode('||', $view); + if (count($dwd) == 3) + { + list($type, $name, $url) = $dwd; + $viewName = $name; + $alt = $name; + $url = $url; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); + } + } + // internal views + elseif (strpos($view,'.') !== false) + { + $dwd = explode('.', $view); + if (count($dwd) == 3) + { + list($type, $name, $action) = $dwd; + } + elseif (count($dwd) == 2) + { + list($type, $name) = $dwd; + $action = false; + } + if ($action) + { + $viewName = $name; + switch($action) + { + case 'add': + $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit'; + $image = $name . '_' . $action. '.' . $type; + $alt = $name . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_'.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U').'_ADD'; + $add = true; + break; + default: + // check for new convention (more stable) + if (strpos($action, '_qpo0O0oqp_') !== false) + { + list($action, $extension) = (array) explode('_qpo0O0oqp_', $action); + $extension = str_replace('_po0O0oq_', '.', $extension); + } + else + { + $extension = 'com_###component###.' . $name; + } + $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; + $image = $name . '_' . $action . '.' . $type; + $alt = $viewName . ' ' . $action; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U') . '_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($action,'U'); + break; + } + } + else + { + $viewName = $name; + $alt = $name; + $url = 'index.php?option=com_###component###&view=' . $name; + $image = $name . '.' . $type; + $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U'); + $hover = false; + } + } + else + { + $viewName = $view; + $alt = $view; + $url = 'index.php?option=com_###component###&view=' . $view; + $image = $view . '.png'; + $name = ucwords($view).'

'; + $hover = false; + } + // first make sure the view access is set + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($viewAccess)) + { + // setup some defaults + $dashboard_add = false; + $dashboard_list = false; + $accessTo = ''; + $accessAdd = ''; + // access checking start + $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.create']):false; + $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.access']):false; + // set main controllers + $accessDashboard_add = (isset($viewAccess[$viewName.'.dashboard_add'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_add']):false; + $accessDashboard_list = (isset($viewAccess[$viewName.'.dashboard_list'])) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($viewAccess[$viewName.'.dashboard_list']):false; + // check for adding access + if ($add && $accessCreate) + { + $accessAdd = $viewAccess[$viewName.'.create']; + } + elseif ($add) + { + $accessAdd = 'core.create'; + } + // check if access to view is set + if ($accessAccess) + { + $accessTo = $viewAccess[$viewName.'.access']; + } + // set main access controllers + if ($accessDashboard_add) + { + $dashboard_add = $user->authorise($viewAccess[$viewName.'.dashboard_add'], 'com_###component###'); + } + if ($accessDashboard_list) + { + $dashboard_list = $user->authorise($viewAccess[$viewName.'.dashboard_list'], 'com_###component###'); + } + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd) && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) + { + // check access + if($user->authorise($accessAdd, 'com_###component###') && $user->authorise($accessTo, 'com_###component###') && $dashboard_add) + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessTo)) + { + // check access + if($user->authorise($accessTo, 'com_###component###') && $dashboard_list) + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($accessAdd)) + { + // check access + if($user->authorise($accessAdd, 'com_###component###') && $dashboard_add) + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + else + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + } + else + { + $icons[$group][$i] = new \StdClass; + $icons[$group][$i]->url = $url; + $icons[$group][$i]->name = $name; + $icons[$group][$i]->image = $image; + $icons[$group][$i]->alt = $alt; + } + $i++; + } + } + else + { + $icons[$group][$i] = false; + } + } + return $icons; + }###DASH_MODEL_METHODS### +} diff --git a/admin/compiler/joomla_4/DASH_VIEW.php b/admin/compiler/joomla_4/DASH_VIEW.php new file mode 100644 index 000000000..c95d6aeb6 --- /dev/null +++ b/admin/compiler/joomla_4/DASH_VIEW.php @@ -0,0 +1,22 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###DASH_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die; + +?>###DASH_DISPLAY_DATA### \ No newline at end of file diff --git a/admin/compiler/joomla_4/DASH_VIEW_HTML.php b/admin/compiler/joomla_4/DASH_VIEW_HTML.php new file mode 100644 index 000000000..8e6decf8b --- /dev/null +++ b/admin/compiler/joomla_4/DASH_VIEW_HTML.php @@ -0,0 +1,100 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\View\###Component###; + +###DASH_VIEW_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### View class + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * View display method + * @return void + */ + function display($tpl = null) + { + // Assign data to the view + $this->icons = $this->get('Icons'); + $this->contributors = ###Component###Helper::getContributors(); + + // get the manifest details of the component + $this->manifest = ###Component###Helper::manifest();###DASH_GET_CUSTOM_DATA### + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + $canDo = ###Component###Helper::getActions('###component###'); + ToolbarHelper::title(Text::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2'); + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###component###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + + if ($canDo->get('core.admin') || $canDo->get('core.options')) + { + ToolbarHelper::preferences('com_###component###'); + } + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + { + // set page title + $this->getDocument()->setTitle(Text::_('COM_###COMPONENT###_DASHBOARD')); + + // add manifest to page JavaScript + $this->getDocument()->addScriptDeclaration("var manifest = JSON.parse('" . json_encode($this->manifest) . "');", "text/javascript"); + + // add dashboard style sheets + Html::_('stylesheet', "administrator/components/com_###component###/assets/css/dashboard.css", ['version' => 'auto']); + } +} diff --git a/admin/compiler/joomla_4/FORM_CHECKBOXES_FIELD.php b/admin/compiler/joomla_4/FORM_CHECKBOXES_FIELD.php new file mode 100644 index 000000000..007fd3bac --- /dev/null +++ b/admin/compiler/joomla_4/FORM_CHECKBOXES_FIELD.php @@ -0,0 +1,51 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\CheckboxesField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends CheckboxesField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/FORM_CUSTOM_FIELD.php b/admin/compiler/joomla_4/FORM_CUSTOM_FIELD.php new file mode 100644 index 000000000..5afa801f2 --- /dev/null +++ b/admin/compiler/joomla_4/FORM_CUSTOM_FIELD.php @@ -0,0 +1,36 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field; + +###FORM_CUSTOM_FIELD_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ###FORM_EXTENDS### +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###FORM_CUSTOM_FIELD_PHP### +} diff --git a/admin/compiler/joomla_4/FORM_LIST_FIELD.php b/admin/compiler/joomla_4/FORM_LIST_FIELD.php new file mode 100644 index 000000000..72b8880ae --- /dev/null +++ b/admin/compiler/joomla_4/FORM_LIST_FIELD.php @@ -0,0 +1,52 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\ListField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ListField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###ADD_BUTTON### + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + * @since 1.6 + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/FORM_RADIO_FIELD.php b/admin/compiler/joomla_4/FORM_RADIO_FIELD.php new file mode 100644 index 000000000..60460a463 --- /dev/null +++ b/admin/compiler/joomla_4/FORM_RADIO_FIELD.php @@ -0,0 +1,51 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\RadioField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends RadioField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/FORM_RULE.php b/admin/compiler/joomla_4/FORM_RULE.php new file mode 100644 index 000000000..c280db455 --- /dev/null +++ b/admin/compiler/joomla_4/FORM_RULE.php @@ -0,0 +1,37 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Rule; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\Form; +use Joomla\CMS\Form\FormRule; +use Joomla\Registry\Registry; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('JPATH_PLATFORM') or die; + +/** + * Form Rule (###Name###) class for the Joomla Platform. + * + * @since 3.5 + */ +class ###Name###Rule extends FormRule +{###VALIDATION_RULE_METHODS### +} diff --git a/admin/compiler/joomla_4/FORM_USER_FIELD.php b/admin/compiler/joomla_4/FORM_USER_FIELD.php new file mode 100644 index 000000000..9ad457423 --- /dev/null +++ b/admin/compiler/joomla_4/FORM_USER_FIELD.php @@ -0,0 +1,65 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\UserField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends UserField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get the filtering groups (null means no filtering) + * + * @return mixed array of filtering groups or null. + * + * @since 1.6 + */ + protected function getGroups() + { + ###JFORM_GETGROUPS_PHP### + } + + /** + * Method to get the users to exclude from the list of users + * + * @return mixed Array of users to exclude or null to not exclude them + * + * @since 1.6 + */ + protected function getExcluded() + { + ###JFORM_GETEXCLUDED_PHP### + } +} diff --git a/admin/compiler/joomla_4/INSTALLER_SCRIPT.php b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php new file mode 100644 index 000000000..c147a8e72 --- /dev/null +++ b/admin/compiler/joomla_4/INSTALLER_SCRIPT.php @@ -0,0 +1,1099 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Filesystem\File; +use Joomla\CMS\Installer\InstallerAdapter; +use Joomla\CMS\Installer\InstallerScriptInterface; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\Log\Log; +use Joomla\CMS\Version; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\Filesystem\Folder; +use Joomla\Database\DatabaseInterface; + +// No direct access to this file +defined('_JEXEC') or die; + +/** + * Script File of ###Component### Component + * + * @since 3.6 + */ +class Com_###Component###InstallerScript implements InstallerScriptInterface +{ + /** + * The CMS Application. + * + * @var CMSApplication + * @since 4.4.2 + */ + protected CMSApplication $app; + + /** + * The database class. + * + * @since 4.4.2 + */ + protected $db; + + /** + * The version number of the extension. + * + * @var string + * @since 3.6 + */ + protected $release; + + /** + * The table the parameters are stored in. + * + * @var string + * @since 3.6 + */ + protected $paramTable; + + /** + * The extension name. This should be set in the installer script. + * + * @var string + * @since 3.6 + */ + protected $extension; + + /** + * A list of files to be deleted + * + * @var array + * @since 3.6 + */ + protected $deleteFiles = []; + + /** + * A list of folders to be deleted + * + * @var array + * @since 3.6 + */ + protected $deleteFolders = []; + + /** + * A list of CLI script files to be copied to the cli directory + * + * @var array + * @since 3.6 + */ + protected $cliScriptFiles = []; + + /** + * Minimum PHP version required to install the extension + * + * @var string + * @since 3.6 + */ + protected $minimumPhp; + + /** + * Minimum Joomla! version required to install the extension + * + * @var string + * @since 3.6 + */ + protected $minimumJoomla; + + /** + * Extension script constructor. + * + * @since 3.0.0 + */ + public function __construct() + { + $this->minimumJoomla = '4.3'; + $this->minimumPhp = JOOMLA_MINIMUM_PHP; + $this->app ??= Factory::getApplication(); + $this->db = Factory::getContainer()->get(DatabaseInterface::class); + + // check if the files exist + if (is_file(JPATH_ROOT . '/administrator/components/com_###component###/###component###.php')) + { + // remove Joomla 3 files + $this->deleteFiles = [ + '/administrator/components/com_###component###/###component###.php', + '/administrator/components/com_###component###/controller.php', + '/components/com_###component###/###component###.php', + '/components/com_###component###/controller.php', + '/components/com_###component###/router.php', + ]; + } + + // check if the Folders exist + if (is_dir(JPATH_ROOT . '/administrator/components/com_###component###/modules')) + { + // remove Joomla 3 folder + $this->deleteFolders = [ + '/administrator/components/com_###component###/controllers', + '/administrator/components/com_###component###/helpers', + '/administrator/components/com_###component###/modules', + '/administrator/components/com_###component###/tables', + '/administrator/components/com_###component###/views', + '/components/com_###component###/controllers', + '/components/com_###component###/helpers', + '/components/com_###component###/modules', + '/components/com_###component###/views', + ]; + } + } + + /** + * Function called after the extension is installed. + * + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function install(InstallerAdapter $adapter): bool {return true;} + + /** + * Function called after the extension is updated. + * + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function update(InstallerAdapter $adapter): bool {return true;} + + /** + * Function called after the extension is uninstalled. + * + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function uninstall(InstallerAdapter $adapter): bool + {###UNINSTALLSCRIPT### + // little notice as after service, in case of bad experience with component. + echo '
+

Did something go wrong? Are you disappointed?

+

Please let me know at ###AUTHOREMAIL###. +
We at ###COMPANYNAME### are committed to building extensions that performs proficiently! You can help us, really! +
Send me your thoughts on improvements that is needed, trust me, I will be very grateful! +
Visit us at ###AUTHORWEBSITE### today!

'; + + return true; + } + + /** + * Function called before extension installation/update/removal procedure commences. + * + * @param string $type The type of change (install or discover_install, update, uninstall) + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function preflight(string $type, InstallerAdapter $adapter): bool + { + // Check for the minimum PHP version before continuing + if (!empty($this->minimumPhp) && version_compare(PHP_VERSION, $this->minimumPhp, '<')) + { + Log::add(Text::sprintf('JLIB_INSTALLER_MINIMUM_PHP', $this->minimumPhp), Log::WARNING, 'jerror'); + + return false; + } + + // Check for the minimum Joomla version before continuing + if (!empty($this->minimumJoomla) && version_compare(JVERSION, $this->minimumJoomla, '<')) + { + Log::add(Text::sprintf('JLIB_INSTALLER_MINIMUM_JOOMLA', $this->minimumJoomla), Log::WARNING, 'jerror'); + + return false; + } + + // Extension manifest file version + $this->extension = $adapter->getName(); + $this->release = $adapter->getManifest()->version; + + // do any updates needed + if ($type === 'update') + {###PREUPDATESCRIPT### + } + + // do any install needed + if ($type === 'install') + {###PREINSTALLSCRIPT### + } + + return true; + } + + /** + * Function called after extension installation/update/removal procedure commences. + * + * @param string $type The type of change (install or discover_install, update, uninstall) + * @param InstallerAdapter $adapter The adapter calling this method + * + * @return boolean True on success + * + * @since 4.2.0 + */ + public function postflight(string $type, InstallerAdapter $adapter): bool + {###MOVEFOLDERSSCRIPT### + + // set the default component settings + if ($type === 'install') + {###POSTINSTALLSCRIPT### + } + + // do any updates needed + if ($type === 'update') + {###POSTUPDATESCRIPT### + } + + // move CLI files + $this->moveCliFiles(); + + // remove old files and folders + $this->removeFiles(); + + return true; + } + + /** + * Remove the files and folders in the given array from + * + * @return void + * + * @since 3.6 + */ + protected function removeFiles() + { + if (!empty($this->deleteFiles)) + { + foreach ($this->deleteFiles as $file) + { + if (is_file(JPATH_ROOT . $file) && !File::delete(JPATH_ROOT . $file)) + { + echo Text::sprintf('JLIB_INSTALLER_ERROR_FILE_FOLDER', $file) . '
'; + } + } + } + + if (!empty($this->deleteFolders)) + { + foreach ($this->deleteFolders as $folder) + { + if (is_dir(JPATH_ROOT . $folder) && !Folder::delete(JPATH_ROOT . $folder)) + { + echo Text::sprintf('JLIB_INSTALLER_ERROR_FILE_FOLDER', $folder) . '
'; + } + } + } + } + + /** + * Moves the CLI scripts into the CLI folder in the CMS + * + * @return void + * + * @since 3.6 + */ + protected function moveCliFiles() + { + if (!empty($this->cliScriptFiles)) + { + foreach ($this->cliScriptFiles as $file) + { + $name = basename($file); + + if (file_exists(JPATH_ROOT . $file) && !File::move(JPATH_ROOT . $file, JPATH_ROOT . '/cli/' . $name)) + { + echo Text::sprintf('JLIB_INSTALLER_FILE_ERROR_MOVE', $name); + } + } + } + } + + /** + * Set content type integration + * + * @param string $typeTitle + * @param string $typeAlias + * @param string $table + * @param string $rules + * @param string $fieldMappings + * @param string $router + * @param string $contentHistoryOptions + * + * @return void + * @since 4.4.2 + */ + protected function setContentType( + string $typeTitle, + string $typeAlias, + string $table, + string $rules, + string $fieldMappings, + string $router, + string $contentHistoryOptions): void + { + // Create the content type object. + $content = new stdClass(); + $content->type_title = $typeTitle; + $content->type_alias = $typeAlias; + $content->table = $table; + $content->rules = $rules; + $content->field_mappings = $fieldMappings; + $content->router = $router; + $content->content_history_options = $contentHistoryOptions; + + // Check if content type is already in content_type DB. + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(array('type_id'))); + $query->from($this->db->quoteName('#__content_types')); + $query->where($this->db->quoteName('type_alias') . ' LIKE '. $this->db->quote($content->type_alias)); + + $this->db->setQuery($query); + $this->db->execute(); + + // Check if the type alias is already in the content types table. + if ($this->db->getNumRows()) + { + $content->type_id = $this->db->loadResult(); + if ($this->db->updateObject('#__content_types', $content, 'type_id')) + { + // If its successfully update. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was found in the #__content_types table, and updated.', $content->type_alias) + ); + } + } + elseif ($this->db->insertObject('#__content_types', $content)) + { + // If its successfully added. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was added to the #__content_types table.', $content->type_alias) + ); + } + } + + /** + * Set action log config integration + * + * @param string $typeTitle + * @param string $typeAlias + * @param string $idHolder + * @param string $titleHolder + * @param string $tableName + * @param string $textPrefix + * + * @return void + * @since 4.4.2 + */ + protected function setActionLogConfig( + string $typeTitle, + string $typeAlias, + string $idHolder, + string $titleHolder, + string $tableName, + string $textPrefix): void + { + // Create the content action log config object. + $content = new stdClass(); + $content->type_title = $typeTitle; + $content->type_alias = $typeAlias; + $content->id_holder = $idHolder; + $content->title_holder = $titleHolder; + $content->table_name = $tableName; + $content->text_prefix = $textPrefix; + + // Check if the action log config is already in action_log_config DB. + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(['id'])); + $query->from($this->db->quoteName('#__action_log_config')); + $query->where($this->db->quoteName('type_alias') . ' LIKE '. $this->db->quote($content->type_alias)); + + $this->db->setQuery($query); + $this->db->execute(); + + // Check if the type alias is already in the action log config table. + if ($this->db->getNumRows()) + { + $content->id = $this->db->loadResult(); + if ($this->db->updateObject('#__action_log_config', $content, 'id')) + { + // If its successfully update. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was found in the #__action_log_config table, and updated.', $content->type_alias) + ); + } + } + elseif ($this->db->insertObject('#__action_log_config', $content)) + { + // If its successfully added. + $this->app->enqueueMessage( + Text::sprintf('The (%s) was added to the #__action_log_config table.', $content->type_alias) + ); + } + } + + /** + * Set action logs extensions integration + * + * @return void + * @since 4.4.2 + */ + protected function setActionLogsExtensions(): void + { + // Create the extension action logs object. + $data = new stdClass(); + $data->extension = 'com_###component###'; + + // Check if ###component### action log extension is already in action logs extensions DB. + $query = $this->db->getQuery(true); + $query->select($this->db->quoteName(['id'])); + $query->from($this->db->quoteName('#__action_logs_extensions')); + $query->where($this->db->quoteName('extension') . ' = '. $this->db->quote($data->extension)); + + $this->db->setQuery($query); + $this->db->execute(); + + // Set the object into the action logs extensions table if not found. + if ($this->db->getNumRows()) + { + // If its already set don't set it again. + $this->app->enqueueMessage( + Text::_('The (com_###component###) is already in the #__action_logs_extensions table.') + ); + } + elseif ($this->db->insertObject('#__action_logs_extensions', $data)) + { + // give a success message + $this->app->enqueueMessage( + Text::_('The (com_###component###) was successfully added to the #__action_logs_extensions table.') + ); + } + } + + /** + * Set global extension assets permission of this component + * (on install only) + * + * @param string $rules The component rules + * + * @return void + * @since 4.4.2 + */ + protected function setAssetsRules(string $rules): void + { + // Condition. + $conditions = [ + $this->db->quoteName('name') . ' = ' . $this->db->quote('com_###component###') + ]; + + // Field to update. + $fields = [ + $this->db->quoteName('rules') . ' = ' . $this->db->quote($rules), + ]; + + $query = $this->db->getQuery(true); + $query->update( + $this->db->quoteName('#__assets') + )->set($fields)->where($conditions); + + $this->db->setQuery($query); + + $done = $this->db->execute(); + if ($done) + { + // give a success message + $this->app->enqueueMessage( + Text::_('The (com_###component###) rules was successfully added to the #__assets table.') + ); + } + } + + /** + * Set global extension params of this component + * (on install only) + * + * @param string $params The component rules + * + * @return void + * @since 4.4.2 + */ + protected function setExtensionsParams(string $params): void + { + // Condition. + $conditions = [ + $this->db->quoteName('element') . ' = ' . $this->db->quote('com_###component###') + ]; + + // Field to update. + $fields = [ + $this->db->quoteName('params') . ' = ' . $this->db->quote($params), + ]; + + $query = $this->db->getQuery(true); + $query->update( + $this->db->quoteName('#__extensions') + )->set($fields)->where($conditions); + + $this->db->setQuery($query); + + $done = $this->db->execute(); + if ($done) + { + // give a success message + $this->app->enqueueMessage( + Text::_('The (com_###component###) params was successfully added to the #__extensions table.') + ); + } + } + + /** + * Set database fix (if needed) + * => WHY DO WE NEED AN ASSET TABLE FIX? + * https://git.vdm.dev/joomla/Component-Builder/issues/616#issuecomment-12085 + * https://www.mysqltutorial.org/mysql-varchar/ + * https://stackoverflow.com/a/15227917/1429677 + * https://forums.mysql.com/read.php?24,105964,105964 + * + * @param int $accessWorseCase This is the max rules column size com_###component### would needs. + * @param string $dataType This datatype we will change the rules column to if it to small. + * + * @return void + * @since 4.4.2 + */ + protected function setDatabaseAssetsRulesFix(int $accessWorseCase, string $dataType): void + { + // Get the biggest rule column in the assets table at this point. + $length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $this->db->setQuery($length); + if ($this->db->execute()) + { + $rule_length = $this->db->loadResult(); + // Check the size of the rules column + if ($rule_length <= $accessWorseCase) + { + // Fix the assets table rules column size + $fix = "ALTER TABLE `#__assets` CHANGE `rules` `rules` {$dataType} NOT NULL COMMENT 'JSON encoded access control. Enlarged to {$dataType} by ###Component###';"; + $this->db->setQuery($fix); + + $done = $this->db->execute(); + if ($done) + { + $this->app->enqueueMessage( + Text::sprintf('The #__assets table rules column was resized to the %s datatype for the components possible large permission rules.', $dataType) + ); + } + } + } + } + + /** + * Remove remnant data related to this view + * + * @param string $context The view context + * @param bool $fields The switch to also remove related field data + * + * @return void + * @since 4.4.2 + */ + protected function removeViewData(string $context, bool $fields = false): void + { + $this->removeContentTypes($context); + $this->removeViewHistory($context); + $this->removeUcmContent($context); // this might be obsolete... + $this->removeContentItemTagMap($context); + $this->removeActionLogConfig($context); + + if ($fields) + { + $this->removeFields($context); + $this->removeFieldsGroups($context); + } + } + + /** + * Remove content types related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeContentTypes(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select id from content type table + $query->select($this->db->quoteName('type_id')); + $query->from($this->db->quoteName('#__content_types')); + + // Where Item alias is found + $query->where($this->db->quoteName('type_alias') . ' = '. $this->db->quote($context)); + $this->db->setQuery($query); + + // Execute query to see if alias is found + $this->db->execute(); + $found = $this->db->getNumRows(); + + // Now check if there were any rows + if ($found) + { + // Since there are load the needed item type ids + $ids = $this->db->loadColumn(); + + // Remove Item from the content type table + $condition = [ + $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__content_types')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove Item add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__content_type table.', $context) + ); + } + + // Make sure that all the items are cleared from DB + $this->removeUcmBase($ids); + } + } + + /** + * Remove fields related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeFields(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select ids from fields + $query->select($this->db->quoteName('id')); + $query->from($this->db->quoteName('#__fields')); + + // Where context is found + $query->where( + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ); + $this->db->setQuery($query); + + // Execute query to see if context is found + $this->db->execute(); + $found = $this->db->getNumRows(); + + // Now check if there were any rows + if ($found) + { + // Since there are load the needed release_check field ids + $ids = $this->db->loadColumn(); + + // Create a new query object. + $query = $this->db->getQuery(true); + + // Remove context from the field table + $condition = [ + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ]; + + $query->delete($this->db->quoteName('#__fields')); + $query->where($condition); + + $this->db->setQuery($query); + + // Execute the query to remove release_check items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove context add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The fields with context (%s) was removed from the #__fields table.', $context) + ); + } + + // Make sure that all the field values are cleared from DB + $this->removeFieldsValues($context, $ids); + } + } + + /** + * Remove fields values related to fields + * + * @param string $context The view context + * @param array $ids The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeFieldsValues(string $context, array $ids): void + { + $condition = [ + $this->db->quoteName('field_id') . ' IN ('. implode(',', $ids) .')' + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__fields_values')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove field values + $done = $this->db->execute(); + if ($done) + { + // If successfully remove release_check add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The fields values for (%s) was removed from the #__fields_values table.', $context) + ); + } + } + + /** + * Remove fields groups related to fields + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeFieldsGroups(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Select ids from fields + $query->select($this->db->quoteName('id')); + $query->from($this->db->quoteName('#__fields_groups')); + + // Where context is found + $query->where( + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ); + $this->db->setQuery($query); + + // Execute query to see if context is found + $this->db->execute(); + $found = $this->db->getNumRows(); + + // Now check if there were any rows + if ($found) + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Remove context from the field table + $condition = [ + $this->db->quoteName('context') . ' = '. $this->db->quote($context) + ]; + + $query->delete($this->db->quoteName('#__fields_groups')); + $query->where($condition); + + $this->db->setQuery($query); + + // Execute the query to remove release_check items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove context add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The fields with context (%s) was removed from the #__fields_groups table.', $context) + ); + } + } + } + + /** + * Remove history related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeViewHistory(string $context): void + { + // Remove Item items from the ucm content table + $condition = [ + $this->db->quoteName('item_id') . ' LIKE ' . $this->db->quote($context . '.%') + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__history')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully removed Items add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) items were removed from the #__history table.', $context) + ); + } + } + + /** + * Remove ucm base values related to these IDs + * + * @param array $ids The type ids + * + * @return void + * @since 4.4.2 + */ + protected function removeUcmBase(array $ids): void + { + // Make sure that all the items are cleared from DB + foreach ($ids as $type_id) + { + // Remove Item items from the ucm base table + $condition = [ + $this->db->quoteName('ucm_type_id') . ' = ' . $type_id + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__ucm_base')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $this->db->execute(); + } + + $this->app->enqueueMessage( + Text::_('All related items was removed from the #__ucm_base table.') + ); + } + + /** + * Remove ucm content values related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeUcmContent(string $context): void + { + // Remove Item items from the ucm content table + $condition = [ + $this->db->quoteName('core_type_alias') . ' = ' . $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__ucm_content')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully removed Item add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__ucm_content table.', $context) + ); + } + } + + /** + * Remove content item tag map related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeContentItemTagMap(string $context): void + { + // Create a new query object. + $query = $this->db->getQuery(true); + + // Remove Item items from the contentitem tag map table + $condition = [ + $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__contentitem_tag_map')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove Item items + $done = $this->db->execute(); + if ($done) + { + // If successfully remove Item add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__contentitem_tag_map table.', $context) + ); + } + } + + /** + * Remove action log config related to this view + * + * @param string $context The view context + * + * @return void + * @since 4.4.2 + */ + protected function removeActionLogConfig(string $context): void + { + // Remove ###component### view from the action_log_config table + $condition = [ + $this->db->quoteName('type_alias') . ' = '. $this->db->quote($context) + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__action_log_config')); + $query->where($condition); + $this->db->setQuery($query); + + // Execute the query to remove com_###component###.view + $done = $this->db->execute(); + if ($done) + { + // If successfully removed ###component### view add queued success message. + $this->app->enqueueMessage( + Text::sprintf('The (%s) type alias was removed from the #__action_log_config table.', $context) + ); + } + } + + /** + * Remove Asset Table Integrated + * + * @return void + * @since 4.4.2 + */ + protected function removeAssetData(): void + { + // Remove ###component### assets from the assets table + $condition = [ + $this->db->quoteName('name') . ' LIKE ' . $this->db->quote('com_###component###.%') + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__assets')); + $query->where($condition); + $this->db->setQuery($query); + $done = $this->db->execute(); + if ($done) + { + // If successfully removed ###component### add queued success message. + $this->app->enqueueMessage( + Text::_('All related (com_###component###) items was removed from the #__assets table.') + ); + } + } + + /** + * Remove action logs extensions integrated + * + * @return void + * @since 4.4.2 + */ + protected function removeActionLogsExtensions(): void + { + // Remove ###component### from the action_logs_extensions table + $extension = [ + $this->db->quoteName('extension') . ' = ' . $this->db->quote('com_###component###') + ]; + + // Create a new query object. + $query = $this->db->getQuery(true); + $query->delete($this->db->quoteName('#__action_logs_extensions')); + $query->where($extension); + $this->db->setQuery($query); + + // Execute the query to remove ###component### + $done = $this->db->execute(); + if ($done) + { + // If successfully remove ###component### add queued success message. + $this->app->enqueueMessage( + Text::_('The (com_###component###) extension was removed from the #__action_logs_extensions table.') + ); + } + } + + /** + * Remove remove database fix (if possible) + * + * @return void + * @since 4.4.2 + */ + protected function removeDatabaseAssetsRulesFix(): void + { + // Get the biggest rule column in the assets table at this point. + $length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $this->db->setQuery($length); + if ($this->db->execute()) + { + $rule_length = $this->db->loadResult(); + // Check the size of the rules column + if ($rule_length < 5120) + { + // Revert the assets table rules column back to the default + $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';"; + $this->db->setQuery($revert_rule); + $this->db->execute(); + + $this->app->enqueueMessage( + Text::_('Reverted the #__assets table rules column back to its default size of varchar(5120).') + ); + } + else + { + $this->app->enqueueMessage( + Text::_('Could not revert the #__assets table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.') + ); + } + } + }###MOVEFOLDERSMETHOD### +} diff --git a/admin/compiler/joomla_4/LAYOUT_OVERRIDE.php b/admin/compiler/joomla_4/LAYOUT_OVERRIDE.php new file mode 100644 index 000000000..1db124be7 --- /dev/null +++ b/admin/compiler/joomla_4/LAYOUT_OVERRIDE.php @@ -0,0 +1,22 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###OVERRIDE_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###OVERRIDE_LAYOUT_CODE### + +?>###OVERRIDE_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/LICENSE.txt b/admin/compiler/joomla_4/LICENSE.txt new file mode 100644 index 000000000..df50810b8 --- /dev/null +++ b/admin/compiler/joomla_4/LICENSE.txt @@ -0,0 +1,340 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/admin/compiler/joomla_4/README.md b/admin/compiler/joomla_4/README.md new file mode 100644 index 000000000..dbb7b6a53 --- /dev/null +++ b/admin/compiler/joomla_4/README.md @@ -0,0 +1 @@ +###README### \ No newline at end of file diff --git a/admin/compiler/joomla_4/README.txt b/admin/compiler/joomla_4/README.txt new file mode 100644 index 000000000..dbb7b6a53 --- /dev/null +++ b/admin/compiler/joomla_4/README.txt @@ -0,0 +1 @@ +###README### \ No newline at end of file diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW.php new file mode 100644 index 000000000..285eb38ee --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW.php @@ -0,0 +1,28 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_ADMIN_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die; + +?> +
+toolbar->render(); ?> +
+###EDITBODY### +
+
###EDITBODYSCRIPT### diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_CONTROLLER.php new file mode 100644 index 000000000..95af762f1 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_CONTROLLER.php @@ -0,0 +1,291 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller; + +###SITE_ADMIN_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###View### Form Controller + * + * @since 1.6 + */ +class ###View###Controller extends FormController +{ + use VersionableControllerTrait; + + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###_###VIEW###'; + + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * The context for storing internal data, e.g. record. + * + * @var string + * @since 1.6 + */ + protected $context = '###view###'; + + /** + * The URL view item variable. + * + * @var string + * @since 1.6 + */ + protected $view_item = '###view###'; + + /** + * The URL view list variable. + * + * @var string + * @since 1.6 + */ + protected $view_list = '###SITE_DEFAULT_VIEW###';###ADMIN_CUSTOM_BUTTONS_CONTROLLER### + + /** + * 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 = []) + {###JCONTROLLERFORM_ALLOWADD### + } + + /** + * 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 = [], $key = 'id') + {###JCONTROLLERFORM_ALLOWEDIT### + } + + /** + * 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) + { + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('###View###', '', []); + + // Preset the redirect + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $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');###JCONTROLLERFORM_BEFORECANCEL### + + $cancel = parent::cancel($key); + + if (!is_null($return) && Uri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + Route::_( + $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( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string) $this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + }###JCONTROLLERFORM_AFTERCANCEL### + 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) && Uri::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( + Route::_( + $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( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string) $this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + '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 BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) + {###POSTSAVEHOOK### + } + +} diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_HTML.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_HTML.php new file mode 100644 index 000000000..0f3cac219 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_HTML.php @@ -0,0 +1,143 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###View###; + +###SITE_ADMIN_VIEW_HTML_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###View### Html View class + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * ###View### view display method + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // set params + $this->params = ComponentHelper::getParams('com_###component###'); + $this->useCoreUI = true; + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->state = $this->get('State'); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + // get action permissions + $this->canDo = ###Component###Helper::getActions('###view###', $this->item); + // get input + $jinput = Factory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $return = $jinput->get('return', null, 'base64'); + // set the referral string + $this->referral = ''; + if ($this->refid && $this->ref) + { + // return to the item that referred to this item + $this->referral = '&ref=' . (string)$this->ref . '&refid=' . (int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that referred to this item + $this->referral = '&ref=' . (string)$this->ref; + } + // check return value + if (!is_null($return)) + { + // add the return value + $this->referral .= '&return=' . (string)$return; + }###LINKEDVIEWITEMS### + + // Set the toolbar + $this->addToolBar(); + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + throw new \Exception(implode("\n", $errors), 500); + } + + // Set the html view document stuff + $this->_prepareDocument(); + + // Display the template + parent::display($tpl); + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + { + ###ADDTOOLBAR### + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = true, int $length = 30) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###JQUERY### + $isNew = ($this->item->id < 1); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT')); + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###AJAXTOKE######LINKEDVIEWTABLESCRIPTS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###DOCUMENT_CUSTOM_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODEL.php b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODEL.php new file mode 100644 index 000000000..facbcf2c0 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ADMIN_VIEW_MODEL.php @@ -0,0 +1,446 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model; + +###SITE_ADMIN_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###View### Admin Model + * + * @since 1.6 + */ +class ###View###Model extends AdminModel +{ + use VersionableModelTrait; + + /** + * The tab layout fields array. + * + * @var array + */ + protected $tabLayoutFields = ###TABLAYOUTFIELDSARRAY###; + + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_###component###.###view###'; + + /** + * 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 Table A database object + * + * @since 3.0 + * @throws \Exception + */ + public function getTable($type = '###view###', $prefix = 'Administrator', $config = []) + { + // get instance of the table + return parent::getTable($type, $prefix, $config); + }###ADMIN_CUSTOM_BUTTONS_METHOD### + + /** + * 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) + {###LICENSE_LOCKED_CHECK### + 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(); + }###METHOD_GET_ITEM### + }###LINKEDVIEWGLOBAL### + + return $item; + }###LINKEDVIEWMETHODS######LICENSE_LOCKED_SET_BOOL### + + /** + * 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 = [], $loadData = true, $options = array('control' => 'jform')) + { + // set load data option + $options['load_data'] = $loadData;###JMODELADMIN_GETFORM### + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'media/com_###component###/js/###view###.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) + {###JMODELADMIN_CANDELETE### + } + + /** + * 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) + {###JMODELADMIN_CANEDITSTATE### + } + + /** + * 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 = [], $key = 'id') + {###JMODELADMIN_ALLOWEDIT### + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param Table $table A Table object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + {###LICENSE_TABLE_LOCKED_CHECK### + $date = $this->getDatabase(); + $user = $this->getCurrentUser(); + + 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 = $this->getDatabase(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__###component###_###view###')); + $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 = Factory::getApplication()->getUserState('com_###component###.edit.###view###.data', []); + + if (empty($data)) + { + $data = $this->getItem(); + } + + // run the perprocess of the data + $this->preprocessData('com_###component###.###view###', $data); + + return $data; + }###VALIDATIONFIX######UNIQUEFIELDS### + + /** + * 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) + {###JMODELADMIN_BEFORE_DELETE### + if (!parent::delete($pks)) + { + return false; + }###JMODELADMIN_AFTER_DELETE### + + 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) + {###JMODELADMIN_BEFORE_PUBLISH### + if (!parent::publish($pks, $value)) + { + return false; + }###JMODELADMIN_AFTER_PUBLISH### + + 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); + ArrayHelper::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(Text::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user ??= $this->getCurrentUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new UCMType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ###Component###Helper::getActions('###view###'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new UCMType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = ArrayHelper::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(Text::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + }###MODEL_BATCH_COPY######MODEL_BATCH_MOVE### + + /** + * 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 = Factory::getApplication()->input; + $filter = InputFilter::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 Registry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + }###CHECKBOX_SAVE######METHOD_ITEM_SAVE### + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new Registry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + }###TITLEALIASFIX### + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a unique value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUnique($field, $value) + { + // set field value unique + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = StringHelper::increment($value); + } + + return $value; + }###GENERATENEWTITLE### +} diff --git a/admin/compiler/joomla_4/SITE_AJAX_CONTROLLER.php b/admin/compiler/joomla_4/SITE_AJAX_CONTROLLER.php new file mode 100644 index 000000000..423691e92 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_AJAX_CONTROLLER.php @@ -0,0 +1,97 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\Application\CMSApplication; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\MVC\Factory\MVCFactoryInterface; +use Joomla\CMS\Session\Session; +use Joomla\Input\Input; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax Base Controller + * + * @since 1.6 + */ +class AjaxController extends BaseController +{ + /** + * Constructor. + * + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'default_task', 'model_path', and + * 'view_path' (this list is not meant to be comprehensive). + * @param ?MVCFactoryInterface $factory The factory. + * @param ?CMSApplication $app The Application for the dispatcher + * @param ?Input $input Input + * + * @since 3.0 + */ + public function __construct($config = [], ?MVCFactoryInterface $factory = null, ?CMSApplication $app = null, ?Input $input = null) + { + parent::__construct($config, $factory, $app, $input); + + // make sure all json stuff are set + $this->app->getDocument()->setMimeEncoding( 'application/json' ); + $this->app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); + $this->app->setHeader('Access-Control-Allow-Origin', '*'); + // load the tasks ###REGISTER_SITE_AJAX_TASK### + } + + public function ajax() + { + // get the user for later use + $user = $this->app->getIdentity(); + // get the input values + $jinput = $this->input ?? $this->app->input; + // check if we should return raw (DEFAULT TRUE SINCE J4) + $returnRaw = $jinput->get('raw', true, 'BOOLEAN'); + // return to a callback function + $callback = $jinput->get('callback', null, 'CMD'); + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) + { + // get the task + $task = $this->getTask(); + switch($task) + {###AJAX_SITE_INPUT_RETURN### + } + } + else + { + // return to a callback function + if($callback) + { + echo $callback."(".json_encode(['error' => 'There was an error! [139]']).");"; + } + elseif($returnRaw) + { + echo json_encode(['error' => 'There was an error! [139]']); + } + else + { + echo "(".json_encode(['error' => 'There was an error! [139]']).");"; + } + } + } +} diff --git a/admin/compiler/joomla_4/SITE_AJAX_MODEL.php b/admin/compiler/joomla_4/SITE_AJAX_MODEL.php new file mode 100644 index 000000000..b56b2df9c --- /dev/null +++ b/admin/compiler/joomla_4/SITE_AJAX_MODEL.php @@ -0,0 +1,62 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model; + +###AJAX_SITE_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Ajax List Model + * + * @since 1.6 + */ +class AjaxModel extends ListModel +{ + /** + * The component params. + * + * @var Registry + * @since 3.2.0 + */ + protected Registry $app_params; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app_params = ComponentHelper::getParams('com_###component###'); + $this->app ??= Factory::getApplication(); + }###AJAX_SITE_MODEL_METHODS### +} diff --git a/admin/compiler/joomla_4/SITE_DISPATCHER.php b/admin/compiler/joomla_4/SITE_DISPATCHER.php new file mode 100644 index 000000000..c14886997 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_DISPATCHER.php @@ -0,0 +1,41 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Dispatcher; + +use Joomla\CMS\Dispatcher\ComponentDispatcher; + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ComponentDispatcher class for com_###component### + * + * @since 4.0.0 + */ +class Dispatcher extends ComponentDispatcher +{ + /** + * Dispatch a controller task. Redirecting the user if appropriate. + * + * @return void + * + * @since 4.0.0 + */ + public function dispatch() + { + parent::dispatch(); + } +} diff --git a/admin/compiler/joomla_4/SITE_DISPLAY_CONTROLLER.php b/admin/compiler/joomla_4/SITE_DISPLAY_CONTROLLER.php new file mode 100644 index 000000000..704227616 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_DISPLAY_CONTROLLER.php @@ -0,0 +1,132 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; +use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### master site display controller. + * + * @since 4.0 + */ +class DisplayController extends BaseController +{ + /** + * Method to display a view. + * + * @param boolean $cachable If true, the view output will be cached. + * @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link InputFilter::clean()}. + * + * @return DisplayController This object to support chaining. + * @since 1.5 + */ + function display($cachable = false, $urlparams = false) + { + // set default view if not set + $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###'); + $this->input->set('view', $view); + $isEdit = $this->checkEditView($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); + $cachable = true; + + // ensure that the view is not cashable if edit view or if user is logged in + $user = $this->app->getIdentity(); + if ($user->get('id') || $this->input->getMethod() === 'POST' || $isEdit) + { + $cachable = false; + } + + // Check for edit form. + if ($isEdit && !$this->checkEditId('com_###component###.edit.'.$view, $id)) + { + // check if item was opened from other than its own list view + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); + + // set redirect + if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) + { + // redirect to item of ref + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + } + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref)) + { + // redirect to ref + $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false)); + } + else + { + // normal redirect back to the list default site view + $this->setRedirect(Route::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false)); + } + + // Somehow the person just went to the form - we don't allow that. + throw new \Exception(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 403); + } + + // we may need to make this more dynamic in the future. (TODO) + $safeurlparams = array( + 'catid' => 'INT', + 'id' => 'INT', + 'cid' => 'ARRAY', + 'year' => 'INT', + 'month' => 'INT', + 'limit' => 'UINT', + 'limitstart' => 'UINT', + 'showall' => 'INT', + 'return' => 'BASE64', + 'filter' => 'STRING', + 'filter_order' => 'CMD', + 'filter_order_Dir' => 'CMD', + 'filter-search' => 'STRING', + 'print' => 'BOOLEAN', + 'lang' => 'CMD', + 'Itemid' => 'INT'); + + // should these not merge? + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($urlparams)) + { + $safeurlparams = Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge(array($urlparams, $safeurlparams)); + } + + parent::display($cachable, $safeurlparams); + + return $this; + } + + protected function checkEditView($view) + { + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view)) + { + $views = [###SITE_EDIT_VIEW_ARRAY### + ]; + // check if this is a edit view + if (in_array($view,$views)) + { + return true; + } + } + return false; + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_CHECKBOXES_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_CHECKBOXES_FIELD.php new file mode 100644 index 000000000..f6a272785 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_CHECKBOXES_FIELD.php @@ -0,0 +1,51 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\CheckboxesField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends CheckboxesField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_CUSTOM_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_CUSTOM_FIELD.php new file mode 100644 index 000000000..b9562c00b --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_CUSTOM_FIELD.php @@ -0,0 +1,36 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field; + +###SITE_FORM_CUSTOM_FIELD_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ###FORM_EXTENDS### +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###FORM_CUSTOM_FIELD_PHP### +} diff --git a/admin/compiler/joomla_4/SITE_FORM_LIST_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_LIST_FIELD.php new file mode 100644 index 000000000..23cdf9972 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_LIST_FIELD.php @@ -0,0 +1,52 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\ListField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends ListField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###';###ADD_BUTTON### + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + * @since 1.6 + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_RADIO_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_RADIO_FIELD.php new file mode 100644 index 000000000..bab377f5a --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_RADIO_FIELD.php @@ -0,0 +1,51 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\RadioField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends RadioField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get a list of options for a list input. + * + * @return array An array of Html options. + */ + protected function getOptions() + { + ###JFORM_GETOPTIONS_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_FORM_RULE.php b/admin/compiler/joomla_4/SITE_FORM_RULE.php new file mode 100644 index 000000000..8dba963e5 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_RULE.php @@ -0,0 +1,37 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Rule; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\Form; +use Joomla\CMS\Form\FormRule; +use Joomla\Registry\Registry; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('JPATH_PLATFORM') or die; + +/** + * Form Rule (###Name###) class for the Joomla Platform. + * + * @since 3.5 + */ +class ###Name###Rule extends FormRule +{###VALIDATION_RULE_METHODS### +} diff --git a/admin/compiler/joomla_4/SITE_FORM_USER_FIELD.php b/admin/compiler/joomla_4/SITE_FORM_USER_FIELD.php new file mode 100644 index 000000000..fbc1b36d9 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_FORM_USER_FIELD.php @@ -0,0 +1,65 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Field; + +use Joomla\CMS\Factory; +use Joomla\CMS\Form\Field\UserField; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Component\ComponentHelper; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper\###Component###Helper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Type### Form Field class for the ###Component### component + * + * @since 1.6 + */ +class ###Type###Field extends UserField +{ + /** + * The ###type### field type. + * + * @var string + */ + public $type = '###Type###'; + + /** + * Method to get the filtering groups (null means no filtering) + * + * @return mixed array of filtering groups or null. + * + * @since 1.6 + */ + protected function getGroups() + { + ###JFORM_GETGROUPS_PHP### + } + + /** + * Method to get the users to exclude from the list of users + * + * @return mixed Array of users to exclude or null to not exclude them + * + * @since 1.6 + */ + protected function getExcluded() + { + ###JFORM_GETEXCLUDED_PHP### + } +} diff --git a/admin/compiler/joomla_4/SITE_HEADERCHECK.php b/admin/compiler/joomla_4/SITE_HEADERCHECK.php new file mode 100644 index 000000000..55e244ed3 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_HEADERCHECK.php @@ -0,0 +1,135 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Document\Document; +use Joomla\CMS\Application\CMSApplication; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Helper class for checking loaded scripts and styles in the document header. + * + * @since 3.2.0 + */ +class HeaderCheck +{ + /** + * @var CMSApplication Application object + * + * @since 3.2.0 + */ + protected CMSApplication $app; + + /** + * @var Document object + * + * @since 3.2.0 + */ + protected Document $document; + + /** + * Construct the app and document + * + * @since 3.2.0 + */ + public function __construct() + { + // Initializes the application object. + $this->app ??= Factory::getApplication(); + + // Initializes the document object. + $this->document = $this->app->getDocument(); + } + + /** + * Check if a JavaScript file is loaded in the document head. + * + * @param string $scriptName Name of the script to check. + * + * @return bool True if the script is loaded, false otherwise. + * @since 3.2.0 + */ + public function js_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'scripts'); + } + + /** + * Check if a CSS file is loaded in the document head. + * + * @param string $scriptName Name of the stylesheet to check. + * + * @return bool True if the stylesheet is loaded, false otherwise. + * @since 3.2.0 + */ + public function css_loaded(string $scriptName): bool + { + return $this->isLoaded($scriptName, 'styleSheets'); + } + + /** + * Abstract method to check if a given script or stylesheet is loaded. + * + * @param string $scriptName Name of the script or stylesheet. + * @param string $type Type of asset to check ('scripts' or 'styleSheets'). + * + * @return bool True if the asset is loaded, false otherwise. + * @since 3.2.0 + */ + private function isLoaded(string $scriptName, string $type): bool + { + // UIkit specific check + if ($this->isUIkit($scriptName)) + { + return true; + } + + $head_data = $this->document->getHeadData(); + foreach (array_keys($head_data[$type]) as $script) + { + if (stristr($script, $scriptName)) + { + return true; + } + } + + return false; + } + + /** + * Check for UIkit framework specific conditions. + * + * @param string $scriptName Name of the script or stylesheet. + * + * @return bool True if UIkit specific conditions are met, false otherwise. + * @since 3.2.0 + */ + private function isUIkit(string $scriptName): bool + { + if (strpos($scriptName, 'uikit') !== false) + { + $get_template_name = $this->app->getTemplate('template')->template; + if (strpos($get_template_name, 'yoo') !== false) + { + return true; + } + } + return false; + } +} diff --git a/admin/compiler/joomla_3/JCB_Helper_site.php b/admin/compiler/joomla_4/SITE_HELPER_CLASS.php similarity index 55% rename from admin/compiler/joomla_3/JCB_Helper_site.php rename to admin/compiler/joomla_4/SITE_HELPER_CLASS.php index 2d37461ba..12b92f571 100644 --- a/admin/compiler/joomla_3/JCB_Helper_site.php +++ b/admin/compiler/joomla_4/SITE_HELPER_CLASS.php @@ -2,46 +2,46 @@ /** * @package Joomla.Component.Builder * - * @created 30th April, 2015 - * @author Llewellyn van der Merwe - * @github Joomla Component Builder + * @created 4th September 2022 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; ?> ###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper; -// No direct access to this file -defined('_JEXEC') or die('Restricted access');###SITE_POWER_HELPER### +###SITE_POWER_HELPER### ###SITE_HELPER_CLASS_HEADER### +// No direct access to this file +\defined('_JEXEC') or die; + /** * ###Component### component helper + * + * @since 3.0 */ abstract class ###Component###Helper { - /** - * Adding the utilities trait to this class - * - * @deprecated 4.0 - Check the trait methods for details, a legacy implementation - */ - use Utilities; - - /** - * get the Component Code Name - */ - public static $ComponentCodeName = '###component###'; - /** * Composer Switch - * + * * @var array */ - protected static $composer = array();###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### + protected static $composer = []; + + /** + * The Main Active Language + * + * @var string + */ + public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT### /** * Load the Composer Vendors @@ -52,7 +52,7 @@ abstract class ###Component###Helper if (!isset(self::$composer[$target])) { // get the function name - $functionName = self::safeString('compose' . $target); + $functionName = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe('compose' . $target); // check if method exist if (method_exists(__CLASS__, $functionName)) { @@ -63,6 +63,25 @@ abstract class ###Component###Helper return self::$composer[$target]; } + /** + * Convert a json object to a string + * + * @input string $value The json string to convert + * + * @returns a string + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(...); + */ + public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string( + $value, + $sperator, + $table, + $id, + $name + ); + } + /** * Load the Component xml manifest. */ @@ -74,7 +93,7 @@ abstract class ###Component###Helper /** * Joomla version object - */ + */ protected static $JVersion; /** @@ -83,9 +102,9 @@ abstract class ###Component###Helper public static function jVersion() { // check if set - if (!self::checkObject(self::$JVersion)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -96,9 +115,9 @@ abstract class ###Component###Helper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_###component###'); + $params = ComponentHelper::getParams('com_###component###'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) @@ -107,73 +126,77 @@ abstract class ###Component###Helper { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } - elseif($params->get("useContributor".$nr) == 2) - { + elseif($params->get("useContributor".$nr) == 2) + { $link_front = ''; $link_back = ''; } - else - { + else + { $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; }###HELP_SITE### /** - * Get any component's model + * Returns any Model object. + * + * @param string $type The model type to instantiate + * @param string $prefix Prefix for the model class name. Optional. + * @param string $component Component name the model belongs to. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return \Joomla\CMS\MVC\Model\BaseDatabaseModel + * @throws \Exception + * @since 4.4 */ - public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array()) + public static function getModel(string $type, string $prefix = 'Site', + string $component = '###component###', array $config = []) { - // fix the name - $name = self::safeString($name); - // full path to models - $fullPathModels = $path . '/models'; - // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); - // make sure the table path is loaded - if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + // make sure the name is correct + $type = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($type, 'F'); + $component = strtolower($component); + + if ($prefix !== 'Site' && $prefix !== 'Administrator') { - // This is the JCB default path to tables in Joomla 3.x - $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; + $prefix = self::getPrefixFromModelPath($prefix); } - // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); - // if model not found (strange) - if ($model == false) + + // Get the model through the MVCFactory + return Factory::getApplication()->bootComponent('com_' . $component)->getMVCFactory()->createModel($type, $prefix, $config); + } + + /** + * Get the prefix from the model path + * + * @param string $path The model path + * + * @return string The prefix value + * @since 4.4 + */ + protected static function getPrefixFromModelPath(string $path): string + { + // Check if $path starts with JPATH_ADMINISTRATOR path + if (str_starts_with($path, JPATH_ADMINISTRATOR . '/components/')) { - jimport('joomla.filesystem.file'); - // get file path - $filePath = $path . '/' . $name . '.php'; - $fullPathModel = $fullPathModels . '/' . $name . '.php'; - // check if it exists - if (File::exists($filePath)) - { - // get the file - require_once $filePath; - } - elseif (File::exists($fullPathModel)) - { - // get the file - require_once $fullPathModel; - } - // build class names - $modelClass = $Component . 'Model' . $name; - if (class_exists($modelClass)) - { - // initialize the model - return new $modelClass($config); - } + return 'Administrator'; } - return $model; + // Check if $path starts with JPATH_SITE path + elseif (str_starts_with($path, JPATH_SITE . '/components/')) + { + return 'Site'; + } + + return 'Site'; } /** @@ -181,14 +204,14 @@ abstract class ###Component###Helper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_###component###'); - + $parentId = $parent->id; $name = 'com_###component###.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -212,27 +235,27 @@ abstract class ###Component###Helper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_###component###', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else { // Create an asset_id or heal one that is corrupted. - $object = new stdClass(); + $object = new \StdClass(); // Must be a valid primary key value. $object->id = $id; $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id'); } } return false; @@ -249,7 +272,7 @@ abstract class ###Component###Helper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -264,8 +287,8 @@ abstract class ###Component###Helper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -280,7 +303,7 @@ abstract class ###Component###Helper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -288,8 +311,8 @@ abstract class ###Component###Helper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -331,10 +354,10 @@ abstract class ###Component###Helper * @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param array $attributes The attributes to apply to the XML element * - * @return void + * @return null * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes); } @@ -348,7 +371,7 @@ abstract class ###Component###Helper * @return void * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options); } @@ -403,26 +426,78 @@ abstract class ###Component###Helper // button attributes $buttonAttributes = array( 'type' => 'radio', - 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', - 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'name' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); // set the button options $buttonOptions = array( - '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', - '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + '1' => isset($args[3]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[3]) : 'JYES', + '0' => isset($args[4]) ? Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($args[4]) : 'JNO'); // return the input - return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; }###HELPER_UIKIT######HELPER_CREATEUSER### + /** + * Get a variable + * + * @param string $table The table from which to get the variable + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * + * @return mix string/int/float + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(...); + */ + public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = '###component###') + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var( + $table, + $where, + $whereString, + $what, + $operator, + $main + ); + } + + /** + * Get array of variables + * + * @param string $table The table from which to get the variables + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * @param bool $unique The switch to return a unique array + * + * @return array + * @deprecated 3.3 Use Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(...); + */ + public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = '###component###', $unique = true) + { + return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars( + $table, + $where, + $whereString, + $what, + $operator, + $main, + $unique + ); + } + public static function isPublished($id,$type) { if ($type == 'raw') { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__###component###_'.$type.' AS a'); @@ -440,7 +515,7 @@ abstract class ###Component###Helper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getContainer()->get(DatabaseInterface::class); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -465,39 +540,39 @@ abstract class ###Component###Helper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions - * + * @return object The CMSObject of permission/authorised actions + * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null') { // load the user if not given - if (!self::checkObject($user)) + if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getApplication()->getIdentity(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) - $view = self::safeString($view); - if (self::checkString($views)) + $view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views)) { - $views = self::safeString($views); - } + $views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views); + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; } // get created by if not found - if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && !isset($record->created_by) && isset($record->id)) { - $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + $record->created_by = Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var($view, $record->id, 'id', 'created_by', '=', $component); } // set actions only set in component settings $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); @@ -506,12 +581,12 @@ abstract class ###Component###Helper if ($target) { // convert to an array - if (self::checkString($target)) + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($target)) { $target = array($target); } // check if we are good to go - if (self::checkArray($target)) + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($target)) { $checkTarget = true; } @@ -532,7 +607,7 @@ abstract class ###Component###Helper // set area $area = 'comp'; // check if the record has an ID and the action is item related (not a component action) - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + if (Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) { // we are in item @@ -565,7 +640,7 @@ abstract class ###Component###Helper } } } - elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views) && isset($record->catid) && $record->catid > 0) { // we are in item $area = 'category'; @@ -637,7 +712,7 @@ abstract class ###Component###Helper * @param array $targets The array of target actions * * @return boolean true if action should be filtered out - * + * */ protected static function filterActions(&$view, &$action, &$targets) { @@ -653,6 +728,58 @@ abstract class ###Component###Helper return true; } + /** + * Check if have an json string + * + * @input string The json string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + */ + public static function checkJson($string) + { + return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string); + } + + /** + * Check if have an object with a length + * + * @input object The object to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + */ + public static function checkObject($object) + { + return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object); + } + + /** + * Check if have an array with a length + * + * @input array The array to check + * + * @returns bool/int number of items in array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + */ + public static function checkArray($array, $removeEmptyString = false) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString); + } + + /** + * Check if have a string with a length + * + * @input string The string to check + * + * @returns bool true on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); + */ + public static function checkString($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string); + } + /** * Check if we are connected * Thanks https://stackoverflow.com/a/4860432/1429677 @@ -662,8 +789,8 @@ abstract class ###Component###Helper public static function isConnected() { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? - $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -678,9 +805,122 @@ abstract class ###Component###Helper return $is_conn; } + /** + * Merge an array of array's + * + * @input array The arrays you would like to merge + * + * @returns array on success + * @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + */ + public static function mergeArrays($arrays) + { + return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays); + } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) { return self::shorten($string, $length, $addTip); - }###HELPER_SITE_LICENSE_LOCK######GET_CRYPT_KEY### + } + + /** + * Shorten a string + * + * @input string The you would like to shorten + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...); + */ + public static function shorten($string, $length = 40, $addTip = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten($string, $length, $addTip); + } + + /** + * Making strings safe (various ways) + * + * @input string The you would like to make safe + * + * @returns string on success + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...); + */ + public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe( + $string, + $type, + $spacer, + $replaceNumbers, + $keepOnlyCharacters + ); + } + + /** + * Convert none English strings to code usable string + * + * @input an string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + */ + public static function transliterate($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string); + } + + /** + * make sure a string is HTML save + * + * @input an html string + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...); + */ + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html( + $var, + $charset, + $shorten, + $length + ); + }###HELPER_SITE_LICENSE_LOCK### + + /** + * Convert all int in a string to an English word string + * + * @input an string with numbers + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + */ + public static function replaceNumbers($string) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string); + } + + /** + * Convert an integer into an English word string + * Thanks to Tom Nicholson + * + * @input an int + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + */ + public static function numberToString($x) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x); + } + + /** + * Random Key + * + * @returns a string + * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + */ + public static function randomkey($size) + { + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size); + }###GET_CRYPT_KEY### } diff --git a/admin/compiler/joomla_4/SITE_HELPER_CONTROLLER.php b/admin/compiler/joomla_4/SITE_HELPER_CONTROLLER.php new file mode 100644 index 000000000..f4090b346 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_HELPER_CONTROLLER.php @@ -0,0 +1,129 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller; + +use Joomla\CMS\Factory; +use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\Database\DatabaseInterface; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; +use Joomla\Utilities\ArrayHelper; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Help Base Controller + * + * @since 1.6 + */ +class HelpController extends BaseController +{ + public function __construct($config) + { + parent::__construct($config); + // load the tasks + $this->registerTask('getText', 'help'); + } + + public function help() + { + $user = Factory::getApplication()->getIdentity(); + $jinput = Factory::getApplication()->input; + // Check Token! + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) + { + $task = $this->getTask(); + switch($task){ + case 'getText': + try + { + $idValue = $jinput->get('id', 0, 'INT'); + if($idValue) + { + $result = $this->getHelpDocumentText($idValue); + } + else + { + $result = ''; + } + echo $result; + // stop execution gracefully + jexit(); + } + catch(Exception $e) + { + // stop execution gracefully + jexit(); + } + break; + } + } + else + { + // stop execution gracefully + jexit(); + } + } + + protected function getHelpDocumentText($id) + { + $db = Factory::getContainer()->get(DatabaseInterface::class); + $query = $db->getQuery(true); + $query->select(array('a.title','a.content')); + $query->from('#__###component###_help_document AS a'); + $query->where('a.id = '.(int) $id); + $query->where('a.published = 1'); + $query->where('a.location = 2'); + $db->setQuery($query); + $db->execute(); + if($db->getNumRows()) + { + $text = []; + $document = $db->loadObject(); + // fix image issue + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; + // set document template + $text[] = ""; + $text[] = ''; + $text[] = ""; + $text[] = ''; + $text[] = "".$document->title.""; + $text[] = ''; + $text[] = ''; + $text[] = ""; + $text[] = '
'; + $text[] = '
'; + $text[] = '
'; + // build the help text + $text[] = '

'.$document->title."

"; + $text[] = str_replace(array_keys($images),array_values($images),$document->content); + // end template + $text[] = '


'; + $text[] = '
'; + $text[] = ""; + $text[] = ""; + + return implode("\n",$text); + } + return false; + } +} diff --git a/admin/compiler/joomla_4/SITE_LAYOUT.php b/admin/compiler/joomla_4/SITE_LAYOUT.php new file mode 100644 index 000000000..4d22fd308 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_LAYOUT.php @@ -0,0 +1,22 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_LAYOUT_HEADER### + +// No direct access to this file +defined('JPATH_BASE') or die;###SITE_LAYOUT_CODE### + +?>###SITE_LAYOUT_BODY### diff --git a/admin/compiler/joomla_4/SITE_ROUTER.php b/admin/compiler/joomla_4/SITE_ROUTER.php new file mode 100644 index 000000000..4cc195d94 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ROUTER.php @@ -0,0 +1,97 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Service; + +###SITE_ROUTER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * Router class for the ###Component_name### Component + * + * @since 3.10 + */ +class Router extends RouterView +{ + /** + * Flag to remove IDs + * + * @var boolean + * @since 4.0.0 + */ + protected $noIDs = false; + + /** + * The category factory + * + * @var CategoryFactoryInterface + * @since 4.0.0 + */ + private $categoryFactory; + + /** + * The category cache + * + * @var array + * @since 4.0.0 + */ + private $categoryCache = []; + + /** + * The db + * + * @var DatabaseInterface + * @since 4.0.0 + */ + private $db; + + /** + * The component params + * + * @var Registry + * @since 4.0.0 + */ + private $params; + + /** + * ###Component### Component router constructor + * + * @param SiteApplication $app The application object + * @param AbstractMenu $menu The menu object to work with + * @param CategoryFactoryInterface $categoryFactory The category object + * @param DatabaseInterface $db The database object + * + * @since 4.0.0 + */ + public function __construct( + SiteApplication $app, + AbstractMenu $menu, + CategoryFactoryInterface $categoryFactory, + DatabaseInterface $db) + { + $this->categoryFactory = $categoryFactory; + $this->db = $db; + $this->params = ComponentHelper::getParams('com_###component###'); + $this->noIDs = (bool) $this->params->get('sef_ids', false);###SITE_ROUTER_CONSTRUCTOR_BEFORE_PARENT### + + parent::__construct($app, $menu);###SITE_ROUTER_CONSTRUCTOR_AFTER_PARENT### + + $this->attachRule(new MenuRules($this)); + $this->attachRule(new StandardRules($this)); + $this->attachRule(new NomenuRules($this)); + }###SITE_ROUTER_METHODS### +} diff --git a/admin/compiler/joomla_4/SITE_ROUTE_HELPER.php b/admin/compiler/joomla_4/SITE_ROUTE_HELPER.php new file mode 100644 index 000000000..96fdd1822 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_ROUTE_HELPER.php @@ -0,0 +1,141 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Helper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Language\Multilanguage; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Categories\CategoryNode; +use Joomla\CMS\Categories\Categories; + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### Component Route Helper + * + * @since 1.5 + */ +abstract class RouteHelper +{ + protected static $lookup;###ROUTEHELPER### + + protected static function _findItem($needles = null,$type = null) + { + $app = Factory::getApplication(); + $menus = $app->getMenu('site'); + $language = isset($needles['language']) ? $needles['language'] : '*'; + + // Prepare the reverse lookup array. + if (!isset(self::$lookup[$language])) + { + self::$lookup[$language] = []; + + $component = ComponentHelper::getComponent('com_###component###'); + + $attributes = array('component_id'); + $values = array($component->id); + + if ($language != '*') + { + $attributes[] = 'language'; + $values[] = array($needles['language'], '*'); + } + + $items = $menus->getItems($attributes, $values); + + foreach ($items as $item) + { + if (isset($item->query) && isset($item->query['view'])) + { + $view = $item->query['view']; + + if (!isset(self::$lookup[$language][$view])) + { + self::$lookup[$language][$view] = []; + } + + if (isset($item->query['id'])) + { + /** + * Here it will become a bit tricky + * language != * can override existing entries + * language == * cannot override existing entries + */ + if (!isset(self::$lookup[$language][$view][$item->query['id']]) || $item->language != '*') + { + self::$lookup[$language][$view][$item->query['id']] = $item->id; + } + } + else + { + self::$lookup[$language][$view][0] = $item->id; + } + } + } + } + + if ($needles) + { + foreach ($needles as $view => $ids) + { + if (isset(self::$lookup[$language][$view])) + { + if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($ids)) + { + foreach ($ids as $id) + { + if (isset(self::$lookup[$language][$view][(int) $id])) + { + return self::$lookup[$language][$view][(int) $id]; + } + } + } + elseif (isset(self::$lookup[$language][$view][0])) + { + return self::$lookup[$language][$view][0]; + } + } + } + } + + if ($type) + { + // Check if the global menu item has been set. + $params = ComponentHelper::getParams('com_###component###'); + if ($item = $params->get($type.'_menu', 0)) + { + return $item; + } + } + + // Check if the active menuitem matches the requested language + $active = $menus->getActive(); + + if ($active + && $active->component == 'com_###component###' + && ($language == '*' || in_array($active->language, array('*', $language)) || !Multilanguage::isEnabled())) + { + return $active->id; + } + + // If not found, return language specific home link + $default = $menus->getDefault($language); + + return !empty($default->id) ? $default->id : null; + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEW.php b/admin/compiler/joomla_4/SITE_VIEW.php new file mode 100644 index 000000000..baa8a5f8b --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW.php @@ -0,0 +1,23 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_VIEW_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######SITE_CODE_BODY### + +?> +###SITE_TOP_FORM######SITE_TOP_BUTTON######SITE_BODY######SITE_BOTTOM_BUTTON######SITE_BOTTOM_FORM### diff --git a/admin/compiler/joomla_4/SITE_VIEWS.php b/admin/compiler/joomla_4/SITE_VIEWS.php new file mode 100644 index 000000000..c2efa4f45 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEWS.php @@ -0,0 +1,23 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +###SITE_VIEWS_HEADER### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######SITE_CODE_BODY### + +?> +###SITE_TOP_FORM######SITE_TOP_BUTTON######SITE_BODY######SITE_BOTTOM_BUTTON######SITE_BOTTOM_FORM### diff --git a/admin/compiler/joomla_4/SITE_VIEWS_HTML.php b/admin/compiler/joomla_4/SITE_VIEWS_HTML.php new file mode 100644 index 000000000..7cf77c74c --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEWS_HTML.php @@ -0,0 +1,108 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###SViews###; + +###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SViews### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get combined params of both component and menu + $this->app ??= Factory::getApplication(); + $this->params = $this->app->getParams(); + $this->menu = $this->app->getMenu()->getActive(); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + // get the user object + $this->user ??= $this->app->getIdentity();###SITE_DIPLAY_METHOD### + }###SITE_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###SITE_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sviews###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + // now initiate the toolbar + $this->toolbar = Toolbar::getInstance(); + }###SITE_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEWS_MODEL.php b/admin/compiler/joomla_4/SITE_VIEWS_MODEL.php new file mode 100644 index 000000000..20fa13ebd --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEWS_MODEL.php @@ -0,0 +1,212 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model; + +###SITE_VIEWS_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### List Model for ###SViews### + * + * @since 1.6 + */ +class ###SViews###Model extends ListModel +{ + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'components/com_###component###/assets/css/site.css', + 'components/com_###component###/assets/css/###sview###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'components/com_###component###/assets/js/site.js' + ]; + + /** + * A custom property for UIKit components. (not used unless you load v2) + */ + protected $uikitComp; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 1.6 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $this->userId = $this->user->get('id'); + $this->guest = $this->user->get('guest'); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->levels = $this->user->getAuthorisedViewLevels(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + * @since 1.6 + */ + protected function getListQuery() + {###SITE_GET_LIST_QUERY### + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + * @since 1.6 + */ + public function getItems() + { + $user = $this->user;###USER_PERMISSION_CHECK_ACCESS######LICENSE_LOCKED_CHECK######SITE_BEFORE_GET_ITEMS### + // load parent items + $items = parent::getItems(); + + // Get the global params + $globalParams = ComponentHelper::getParams('com_###component###', true);###SITE_GET_ITEMS######SITE_AFTER_GET_ITEMS### + + // return items + return $items; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###LICENSE_LOCKED_SET_BOOL######SITE_CUSTOM_METHODS######SITE_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/SITE_VIEW_CONTROLLER.php b/admin/compiler/joomla_4/SITE_VIEW_CONTROLLER.php new file mode 100644 index 000000000..3dd8a4f9f --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW_CONTROLLER.php @@ -0,0 +1,120 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Controller; + +###SITE_VIEW_CONTROLLER_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Form Controller + * + * @since 1.6 + */ +class ###SView###Controller extends FormController +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_###COMPONENT###'; + + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + /** + * The URL view list variable. + * + * @var string + * @since 1.6 + */ + protected $view_list = '###SITE_DEFAULT_VIEW###';###SITE_CUSTOM_BUTTONS_CONTROLLER### + + /** + * Method to check if you can edit an existing record. + * + * Extended classes can override this if necessary. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key; default is id. + * + * @return boolean + * + * @since 12.2 + */ + protected function allowEdit($data = [], $key = 'id') + { + // to insure no other tampering + return false; + } + + /** + * 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 = []) + { + // to insure no other tampering + return false; + } + + /** + * Method to check if you can save a new or existing record. + * + * Extended classes can override this if necessary. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 12.2 + */ + protected function allowSave($data, $key = 'id') + { + // to insure no other tampering + return false; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModelLegacy $model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 12.2 + */ + protected function postSaveHook(JModelLegacy $model, $validData = []) + { + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEW_HTML.php b/admin/compiler/joomla_4/SITE_VIEW_HTML.php new file mode 100644 index 000000000..56b208d85 --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW_HTML.php @@ -0,0 +1,108 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###SView###; + +###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT### + +// No direct access to this file +\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +/** + * ###Component### Html View class for the ###SView### + * + * @since 1.6 + */ +class HtmlView extends BaseHtmlView +{ + /** + * Display the view + * + * @param string $tpl The name of the template file to parse; automatically searches through the template paths. + * + * @return void + * @since 1.6 + */ + public function display($tpl = null) + { + // get combined params of both component and menu + $this->app ??= Factory::getApplication(); + $this->params = $this->app->getParams(); + $this->menu = $this->app->getMenu()->getActive(); + $this->styles = $this->get('Styles'); + $this->scripts = $this->get('Scripts'); + // get the user object + $this->user ??= $this->app->getIdentity();###SITE_DIPLAY_METHOD### + }###SITE_EXTRA_DIPLAY_METHODS### + + /** + * Prepare some document related stuff. + * + * @return void + * @since 1.6 + */ + protected function _prepareDocument(): void + {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP### + // add styles + foreach ($this->styles as $style) + { + Html::_('stylesheet', $style, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_CSS### + // add scripts + foreach ($this->scripts as $script) + { + Html::_('script', $script, ['version' => 'auto']); + }###SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS### + } + + /** + * Add the page title and toolbar. + * + * @return void + * @since 1.6 + */ + protected function addToolbar(): void + {###SITE_CUSTOM_BUTTONS### + + // set help url for this view if found + $this->help_url = ###Component###Helper::getHelpUrl('###sview###'); + if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url)) + { + ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url); + } + // now initiate the toolbar + $this->toolbar = Toolbar::getInstance(); + }###SITE_GET_MODULE### + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * @param bool $shorten The switch to shorten. + * @param int $length The shorting length. + * + * @return mixed The escaped value. + * @since 1.6 + */ + public function escape($var, bool $shorten = false, int $length = 40) + { + if (!is_string($var)) + { + return $var; + } + + return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length); + } +} diff --git a/admin/compiler/joomla_4/SITE_VIEW_MODEL.php b/admin/compiler/joomla_4/SITE_VIEW_MODEL.php new file mode 100644 index 000000000..e017632af --- /dev/null +++ b/admin/compiler/joomla_4/SITE_VIEW_MODEL.php @@ -0,0 +1,262 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### +namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\Model; + +###SITE_VIEW_MODEL_HEADER### + +// No direct access to this file +\defined('_JEXEC') or die; + +/** + * ###Component### ###SView### Item Model + * + * @since 1.6 + */ +class ###SView###Model extends ItemModel +{ + /** + * Model context string. + * + * @var string + * @since 1.6 + */ + protected $_context = 'com_###component###.###sview###'; + + /** + * Represents the current user object. + * + * @var User The user object representing the current user. + * @since 3.2.0 + */ + protected User $user; + + /** + * The unique identifier of the current user. + * + * @var int|null The ID of the current user. + * @since 3.2.0 + */ + protected ?int $userId; + + /** + * Flag indicating whether the current user is a guest. + * + * @var int 1 if the user is a guest, 0 otherwise. + * @since 3.2.0 + */ + protected int $guest; + + /** + * An array of groups that the current user belongs to. + * + * @var array|null An array of user group IDs. + * @since 3.2.0 + */ + protected ?array $groups; + + /** + * An array of view access levels for the current user. + * + * @var array|null An array of access level IDs. + * @since 3.2.0 + */ + protected ?array $levels; + + /** + * The application object. + * + * @var CMSApplicationInterface The application instance. + * @since 3.2.0 + */ + protected CMSApplicationInterface $app; + + /** + * The input object, providing access to the request data. + * + * @var Input The input object. + * @since 3.2.0 + */ + protected Input $input; + + /** + * The styles array. + * + * @var array + * @since 4.3 + */ + protected array $styles = [ + 'components/com_###component###/assets/css/site.css', + 'components/com_###component###/assets/css/###sview###.css' + ]; + + /** + * The scripts array. + * + * @var array + * @since 4.3 + */ + protected array $scripts = [ + 'components/com_###component###/assets/js/site.js' + ]; + + /** + * A custom property for UI Kit components. + * + * @var array|null Property for storing UI Kit component-related data or objects. + * @since 3.2.0 + */ + protected ?array $uikitComp; + + /** + * @var object item + * @since 1.6 + */ + protected $item; + + /** + * Constructor + * + * @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request). + * @param ?MVCFactoryInterface $factory The factory. + * + * @since 3.0 + * @throws \Exception + */ + public function __construct($config = [], MVCFactoryInterface $factory = null) + { + parent::__construct($config, $factory); + + $this->app ??= Factory::getApplication(); + $this->input ??= $this->app->getInput(); + + // Set the current user for authorisation checks (for those calling this model directly) + $this->user ??= $this->getCurrentUser(); + $this->userId = $this->user->get('id'); + $this->guest = $this->user->get('guest'); + $this->groups = $this->user->get('groups'); + $this->authorisedGroups = $this->user->getAuthorisedGroups(); + $this->levels = $this->user->getAuthorisedViewLevels(); + + // will be removed + $this->initSet = true; + } + + /** + * Method to auto-populate the model state. + * + * Note. Calling getState in this method will result in recursion. + * + * @return void + * @since 1.6 + */ + protected function populateState() + { + // Get the itme main id + $id = $this->input->getInt('id', null); + $this->setState('###sview###.id', $id); + + // Load the parameters. + $params = $this->app->getParams(); + $this->setState('params', $params); + + parent::populateState(); + } + + /** + * Method to get article data. + * + * @param integer $pk The id of the article. + * + * @return mixed Menu item data object on success, false on failure. + * @since 1.6 + */ + public function getItem($pk = null) + {###USER_PERMISSION_CHECK_ACCESS### + + $pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM### + + if ($this->_item === null) + { + $this->_item = []; + }###LICENSE_LOCKED_CHECK### + + if (!isset($this->_item[$pk])) + { + try + {###SITE_GET_ITEM### + } + catch (\Exception $e) + { + if ($e->getCode() == 404) + { + // Need to go thru the error handler to allow Redirect to work. + throw $e; + } + else + { + $this->setError($e); + $this->_item[$pk] = false; + } + } + }###SITE_AFTER_GET_ITEM### + + return $this->_item[$pk]; + } + + /** + * Method to get the styles that have to be included on the view + * + * @return array styles files + * @since 4.3 + */ + public function getStyles(): array + { + return $this->styles; + } + + /** + * Method to set the styles that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setStyles(string $path): void + { + $this->styles[] = $path; + } + + /** + * Method to get the script that have to be included on the view + * + * @return array script files + * @since 4.3 + */ + public function getScripts(): array + { + return $this->scripts; + } + + /** + * Method to set the script that have to be included on the view + * + * @return void + * @since 4.3 + */ + public function setScript(string $path): void + { + $this->scripts[] = $path; + }###LICENSE_LOCKED_SET_BOOL######SITE_CUSTOM_METHODS######SITE_CUSTOM_BUTTONS_METHOD### +} diff --git a/admin/compiler/joomla_4/access.xml b/admin/compiler/joomla_4/access.xml new file mode 100644 index 000000000..95908e259 --- /dev/null +++ b/admin/compiler/joomla_4/access.xml @@ -0,0 +1,4 @@ + + + ###ACCESS_SECTIONS### + \ No newline at end of file diff --git a/admin/compiler/joomla_4/admin.css b/admin/compiler/joomla_4/admin.css new file mode 100644 index 000000000..589b9cd9b --- /dev/null +++ b/admin/compiler/joomla_4/admin.css @@ -0,0 +1,7 @@ +###BOM### + +/* CSS Document */ +.no-click { + pointer-events: none; +} +###ADMINCSS### diff --git a/admin/compiler/joomla_4/admin.js b/admin/compiler/joomla_4/admin.js new file mode 100644 index 000000000..9c701e5be --- /dev/null +++ b/admin/compiler/joomla_4/admin.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###ADMINJS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/component.xml b/admin/compiler/joomla_4/component.xml new file mode 100644 index 000000000..7e1fd7cba --- /dev/null +++ b/admin/compiler/joomla_4/component.xml @@ -0,0 +1,87 @@ + + + COM_###COMPONENT### + ###BUILDDATE### + ###AUTHOR### + ###AUTHOREMAIL### + ###AUTHORWEBSITE### + ###COPYRIGHT### + ###LICENSE### + ###ACTUALVERSION### + ###Component_name### (v.###ACTUALVERSION###) +
+

###DESCRIPTION###

+

Created by ###AUTHOR###
Development started ###CREATIONDATE###

+ ]]>
+ ###NAMESPACEPREFIX###\Component\###ComponentNamespace### + + + + + sql/install.mysql.utf8.sql + + + + + + + sql/uninstall.mysql.utf8.sql + + + + + ###Component###InstallerScript.php + + + index.html###EXSTRA_MEDIA_FILES### + js + css + images###EXSTRA_MEDIA_FOLDERS### + + + + + + sql/updates/mysql/ + + + + + index.html###EXSTRA_SITE_FILES### + assets + forms + layouts + src + tmpl###EXSTRA_SITE_FOLDERS### + + + + ###SITE_LANGUAGES### + + + + COM_###COMPONENT###_MENU + + ###MAINMENUS### + + + access.xml + config.xml + index.html###EXSTRA_ADMIN_FILES### + assets + forms + layouts + presets + services + sql + src + tmpl###EXSTRA_ADMIN_FOLDERS### + + + + ###ADMIN_LANGUAGES### + + + ###UPDATESERVER### +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/config.xml b/admin/compiler/joomla_4/config.xml new file mode 100644 index 000000000..50b98e1fe --- /dev/null +++ b/admin/compiler/joomla_4/config.xml @@ -0,0 +1,19 @@ + + + ###CONFIG_FIELDSETS### +
+ +
+
\ No newline at end of file diff --git a/admin/compiler/joomla_4/dashboard.css b/admin/compiler/joomla_4/dashboard.css new file mode 100644 index 000000000..6502707ff --- /dev/null +++ b/admin/compiler/joomla_4/dashboard.css @@ -0,0 +1,155 @@ +###BOM### + +/* CSS Document */ + +.dashboard-container { + margin-left: 10px; + margin-top: 10px; + width: 100%; +} +.dashboard-container [class*="span"] { + display: block; + float: none; + margin-left: 0; + width: auto; +} +.dashboard-container:before, .dashboard-container:after { + content: ""; + display: table; +} +.dashboard-container:after { + clear: both; +} +.dashboard-container [class*="span"] { + box-sizing: border-box; + display: block; + float: left; + min-height: 145px; + min-width: 96px; + width: 100%; +} +.dashboard-container [class*="span"]:first-child { + margin-left: 0; +} +.dashboard-wraper { + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 5px; + float: left; + margin: 1%; + padding: 3px; + width: 17%; + min-height: 194px; + min-width: 96px; +} +.dashboard-content a { + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + min-height: 89px; + padding: 10px; + text-align: center; + text-decoration: none; +} +.dashboard-content a:hover { + background: linear-gradient(to bottom, hsl(0, 0%, 90%) 0%, hsl(0, 0%, 100%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + color: hsl(200, 100%, 30%); + text-decoration: none; +} +.dashboard-title { + display: block; + padding-top: 5px; +} +.dashboard-info { + background: linear-gradient(to bottom, hsl(0, 0%, 100%) 0%, hsl(0, 0%, 96%) 47%, hsl(0, 0%, 93%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 85%); + border-radius: 4px; + box-shadow: 0 0 3px hsla(0, 0%, 0%, 0.1) inset; + color: hsl(0, 0%, 20%); + display: block; + font-size: 12px; + padding: 10px; + text-align: center; +} +.dashboard-info span { + display: block; + text-align: center; +} +.dashboard-info img { + margin: 0 auto; +} +.dashboard-table { + border-top: 1px solid hsl(0, 0%, 87%); + margin-top: 5px; + width: 100%; +} +.dashboard-info h5 { + font-size: 11px; + font-weight: bold; +} +.dashboard-block { + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border: 1px solid hsl(0, 0%, 76%); + border-radius: 3px; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset; + margin-bottom: 20px; +} +.dashboard-block .dashboard-block-head { + background: linear-gradient(to bottom, hsl(0, 0%, 95%) 0%, hsl(0, 0%, 86%) 100%) repeat scroll 0 0 hsla(0, 0%, 0%, 0); + border-bottom: 1px solid hsl(0, 0%, 76%); + border-radius: 3px 3px 0 0; + box-shadow: 0 1px 0 hsl(0, 0%, 98%) inset, 0 0 3px hsl(0, 0%, 87%); + height: 40px; + position: relative; +} +.dashboard-block .dashboard-block-head h5 { + font-size: 12px; + margin: 0; + padding-left: 10px; + padding-top: 11px; + text-transform: uppercase; +} +.dashboard-block .dashboard-block-content { + background: none repeat scroll 0 0 hsl(0, 0%, 93%); + border-radius: 0 0 3px 3px; +} +.dashboard-block .dashboard-block-box { + background: none repeat scroll 0 0 hsl(0, 0%, 100%); + border-top: 1px solid hsl(0, 0%, 82%); + box-shadow: 0 0 5px hsl(0, 0%, 87%) inset; +} +.dashboard-block .dashboard-block-content .dashboard-block-box { + margin-top: 0 !important; +} +.dashboard-block .dashboard-block-content .dashboard-block-box .dashboard-block-table { + margin-bottom: 0 !important; +} +.dashboard-block-table { + background-color: hsla(0, 0%, 0%, 0); + border-collapse: collapse; + border-spacing: 0; + margin-bottom: 20px; + max-width: 100%; + width: 100%; +} +.dashboard-block-table th, .dashboard-block-table td { + border-top: 1px solid hsl(0, 0%, 87%); + line-height: 20px; + padding: 5px; + text-align: left; + vertical-align: middle; +} +.dashboard-badge { + background-color: hsl(0, 0%, 60%); + border-radius: 9px; + color: hsl(0, 0%, 100%); + font-size: 11.844px; + font-weight: bold; + line-height: 14px; + padding: 1px 9px 2px; + text-shadow: 0 -1px 0 hsla(0, 0%, 0%, 0.25); + vertical-align: baseline; + white-space: nowrap; +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/default.xml b/admin/compiler/joomla_4/default.xml new file mode 100644 index 000000000..10a8e4742 --- /dev/null +++ b/admin/compiler/joomla_4/default.xml @@ -0,0 +1 @@ +###SITE_MENU_XML### \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_batch_body.php b/admin/compiler/joomla_4/default_batch_body.php new file mode 100644 index 000000000..6ca60b2b1 --- /dev/null +++ b/admin/compiler/joomla_4/default_batch_body.php @@ -0,0 +1,26 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_batch_footer.php b/admin/compiler/joomla_4/default_batch_footer.php new file mode 100644 index 000000000..701e3c69b --- /dev/null +++ b/admin/compiler/joomla_4/default_batch_footer.php @@ -0,0 +1,30 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> + + + + \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_body.php b/admin/compiler/joomla_4/default_body.php new file mode 100644 index 000000000..573c50ac1 --- /dev/null +++ b/admin/compiler/joomla_4/default_body.php @@ -0,0 +1,28 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +$edit = "index.php?option=com_###component###&view=###views###&task=###view###.edit"; + +?> +###LISTBODY### \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_custom_admin_template.php b/admin/compiler/joomla_4/default_custom_admin_template.php new file mode 100644 index 000000000..5601278f7 --- /dev/null +++ b/admin/compiler/joomla_4/default_custom_admin_template.php @@ -0,0 +1,24 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_TEMPLATE_CODE_BODY### + +?>###CUSTOM_ADMIN_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_4/default_foot.php b/admin/compiler/joomla_4/default_foot.php new file mode 100644 index 000000000..b5c0121af --- /dev/null +++ b/admin/compiler/joomla_4/default_foot.php @@ -0,0 +1,23 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_head.php b/admin/compiler/joomla_4/default_head.php new file mode 100644 index 000000000..c21d39531 --- /dev/null +++ b/admin/compiler/joomla_4/default_head.php @@ -0,0 +1,24 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> +###LISTHEAD### \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_import.php b/admin/compiler/joomla_4/default_import.php new file mode 100644 index 000000000..05ff76fe1 --- /dev/null +++ b/admin/compiler/joomla_4/default_import.php @@ -0,0 +1,199 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + +?> + + +
+
+
+ + hasPackage && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headerList) && Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->headers)) : ?> +
+ +
+ +
+ +
+
+ headerList as $name => $title): ?> +
+ +
+ +
+
+ +
+ +
+
+ + + 'upload')); ?> + + +
+ +
+ +
+ +
+
+
+     (.csv .xls .ods) +
+
+ + + +
+ +
+ +
+ +
+
+
+     (.csv .xls .ods) +
+
+ + + +
+ +
+ +
+ +
+
+
+     (.csv .xls .ods) +
+
+ + + + + + + +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/default_import_custom.php b/admin/compiler/joomla_4/default_import_custom.php new file mode 100644 index 000000000..91b71fce6 --- /dev/null +++ b/admin/compiler/joomla_4/default_import_custom.php @@ -0,0 +1,30 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + +?>###IMPORT_DEFAULT_VIEW_CUSTOM### diff --git a/admin/compiler/joomla_4/default_list.xml b/admin/compiler/joomla_4/default_list.xml new file mode 100644 index 000000000..5f42db0d7 --- /dev/null +++ b/admin/compiler/joomla_4/default_list.xml @@ -0,0 +1,6 @@ + + + + COM_###COMPONENT###_MENU_###VIEWS###_DESC + + \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_main.php b/admin/compiler/joomla_4/default_main.php new file mode 100644 index 000000000..91b3fcb0a --- /dev/null +++ b/admin/compiler/joomla_4/default_main.php @@ -0,0 +1,37 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die; + +?> +icons['main']) && is_array($this->icons['main'])) :?> + icons['main'] as $icon): ?> + + +
+ +

+ \ No newline at end of file diff --git a/admin/compiler/joomla_4/default_site_template.php b/admin/compiler/joomla_4/default_site_template.php new file mode 100644 index 000000000..13daeb11f --- /dev/null +++ b/admin/compiler/joomla_4/default_site_template.php @@ -0,0 +1,24 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED######SITE_TEMPLATE_CODE_BODY### + +?>###SITE_TEMPLATE_BODY### diff --git a/admin/compiler/joomla_4/default_toolbar.php b/admin/compiler/joomla_4/default_toolbar.php new file mode 100644 index 000000000..6fb862f1e --- /dev/null +++ b/admin/compiler/joomla_4/default_toolbar.php @@ -0,0 +1,53 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + +// No direct access to this file +defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED### + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/compiler/joomla_4/default_vdm.php b/admin/compiler/joomla_4/default_vdm.php new file mode 100644 index 000000000..2af4045b4 --- /dev/null +++ b/admin/compiler/joomla_4/default_vdm.php @@ -0,0 +1,45 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die; + +?> +<?php echo Text::_('COM_###COMPONENT###'); ?> + +
+contributors)): ?> + contributors) > 1): ?> +

+ +

+ +
    + contributors as $contributor): ?> +
  • :
  • + +
+
+ \ No newline at end of file diff --git a/admin/compiler/joomla_4/edit.xml b/admin/compiler/joomla_4/edit.xml new file mode 100644 index 000000000..10a8e4742 --- /dev/null +++ b/admin/compiler/joomla_4/edit.xml @@ -0,0 +1 @@ +###SITE_MENU_XML### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_admin.ini b/admin/compiler/joomla_4/en-GB.com_admin.ini new file mode 100644 index 000000000..e5b382a4a --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_admin.ini @@ -0,0 +1 @@ +###LANG_ADMIN### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_admin.sys.ini b/admin/compiler/joomla_4/en-GB.com_admin.sys.ini new file mode 100644 index 000000000..fc07f9846 --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_admin.sys.ini @@ -0,0 +1 @@ +###LANG_ADMIN_SYS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_site.ini b/admin/compiler/joomla_4/en-GB.com_site.ini new file mode 100644 index 000000000..7a78b98b2 --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_site.ini @@ -0,0 +1 @@ +###LANG_SITE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/en-GB.com_site.sys.ini b/admin/compiler/joomla_4/en-GB.com_site.sys.ini new file mode 100644 index 000000000..7e16bfbe8 --- /dev/null +++ b/admin/compiler/joomla_4/en-GB.com_site.sys.ini @@ -0,0 +1 @@ +###LANG_SITE_SYS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/filter_forms.xml b/admin/compiler/joomla_4/filter_forms.xml new file mode 100644 index 000000000..62a188dfb --- /dev/null +++ b/admin/compiler/joomla_4/filter_forms.xml @@ -0,0 +1,9 @@ + +
+###FIELDFILTERSETS### + +###FIELDLISTSETS### +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/import.gif b/admin/compiler/joomla_4/import.gif new file mode 100644 index 000000000..10bcb8569 Binary files /dev/null and b/admin/compiler/joomla_4/import.gif differ diff --git a/admin/helpers/compiler/index.html b/admin/compiler/joomla_4/index.html similarity index 100% rename from admin/helpers/compiler/index.html rename to admin/compiler/joomla_4/index.html diff --git a/admin/compiler/joomla_4/install.mysql.utf8.sql b/admin/compiler/joomla_4/install.mysql.utf8.sql new file mode 100644 index 000000000..50bd3de50 --- /dev/null +++ b/admin/compiler/joomla_4/install.mysql.utf8.sql @@ -0,0 +1 @@ +###INSTALL### diff --git a/admin/compiler/joomla_4/layout.php b/admin/compiler/joomla_4/layout.php new file mode 100644 index 000000000..e5970ef27 --- /dev/null +++ b/admin/compiler/joomla_4/layout.php @@ -0,0 +1,47 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// 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( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/compiler/joomla_4/layoutfull.php b/admin/compiler/joomla_4/layoutfull.php new file mode 100644 index 000000000..695619600 --- /dev/null +++ b/admin/compiler/joomla_4/layoutfull.php @@ -0,0 +1,49 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// 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( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/compiler/joomla_4/layoutitems.php b/admin/compiler/joomla_4/layoutitems.php new file mode 100644 index 000000000..e5970ef27 --- /dev/null +++ b/admin/compiler/joomla_4/layoutitems.php @@ -0,0 +1,47 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// 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( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/compiler/joomla_4/layoutlinkedview.php b/admin/compiler/joomla_4/layoutlinkedview.php new file mode 100644 index 000000000..9617296d8 --- /dev/null +++ b/admin/compiler/joomla_4/layoutlinkedview.php @@ -0,0 +1,34 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator\Helper\###Component###Helper; + +// No direct access to this file +defined('_JEXEC') or die; + +// set the defaults +$items = $displayData->###LAYOUTITEMS###; +$user = Factory::getApplication()->getIdentity(); +$id = $displayData->item->id; +###LAYOUTITEMSHEADER### + +?> +
+###LAYOUTITEMSTABLE### +
diff --git a/admin/compiler/joomla_4/layoutmetadata.php b/admin/compiler/joomla_4/layoutmetadata.php new file mode 100644 index 000000000..80877adb6 --- /dev/null +++ b/admin/compiler/joomla_4/layoutmetadata.php @@ -0,0 +1,48 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +use Joomla\CMS\Language\Text; + +// No direct access to this file +defined('_JEXEC') or die; + +$form = $displayData->getForm(); + +// JLayout for standard handling of metadata fields in the administrator content edit screens. +$fieldSets = $form->getFieldsets('metadata'); +?> + + $fieldSet) : ?> + description) && trim($fieldSet->description)) : ?> +

escape(Text::_($fieldSet->description)); ?>

+ + + renderField('metadesc'); + echo $form->renderField('metakey'); + } + + foreach ($form->getFieldset($name) as $field) + { + if ($field->name != 'jform[metadata][tags][]') + { + echo $field->renderField(); + } + } ?> + diff --git a/admin/compiler/joomla_4/layoutpublished.php b/admin/compiler/joomla_4/layoutpublished.php new file mode 100644 index 000000000..e5970ef27 --- /dev/null +++ b/admin/compiler/joomla_4/layoutpublished.php @@ -0,0 +1,47 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// 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( + ###LAYOUTITEMS### +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/compiler/joomla_4/layouttitle.php b/admin/compiler/joomla_4/layouttitle.php new file mode 100644 index 000000000..becaaccda --- /dev/null +++ b/admin/compiler/joomla_4/layouttitle.php @@ -0,0 +1,57 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// 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) ?: [ + ###LAYOUTITEMS### +]; + +// Ensure $fields is treated as an array and count its size. +$size = count((array) $fields); + +// Use a ternary operator to determine the class. +// If there are 1 to 4 fields, set the class to divide the 12-grid column equally among the fields. +// For more than 4 fields, default to four columns (3-grid each) for medium and larger screens. +$css_class = ($size > 0 && $size <= 4) ? 'col-12 col-md-' . round(12 / $size) : 'col-12 col-md-3'; + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, ['class' => $css_class . ' control-wrapper-' . $field]); ?> + +
+ diff --git a/admin/compiler/joomla_4/module_forms.js b/admin/compiler/joomla_4/module_forms.js new file mode 100644 index 000000000..4bf5019bf --- /dev/null +++ b/admin/compiler/joomla_4/module_forms.js @@ -0,0 +1,3 @@ +###BOM### + +###VIEW_SCRIPT### diff --git a/admin/compiler/joomla_4/module_forms.xml b/admin/compiler/joomla_4/module_forms.xml new file mode 100644 index 000000000..029fa5197 --- /dev/null +++ b/admin/compiler/joomla_4/module_forms.xml @@ -0,0 +1,12 @@ + +
+ + + + ###FIELDSETS### + + ###ACCESSCONTROL### +
\ No newline at end of file diff --git a/admin/compiler/joomla_4/settings.json b/admin/compiler/joomla_4/settings.json new file mode 100644 index 000000000..4cc56d0f4 --- /dev/null +++ b/admin/compiler/joomla_4/settings.json @@ -0,0 +1,824 @@ +{ + "create": { + "admin": { + "assets": { + "css": "css", + "images": { + "icons": "icons" + }, + "js": "js" + }, + "forms": "forms", + "language": { + "en-GB": "en-GB" + }, + "presets": "presets", + "services": "services", + "src": { + "Controller": "Controller", + "Extension": "Extension", + "Rule": "Rule", + "Field": "Field", + "Helper": "Helper", + "Model": "Model", + "Service": "Service", + "Table": "Table", + "View": "View" + }, + "sql": { + "updates": { + "mysql": "mysql" + }, + "xml": "xml" + }, + "tmpl": "tmpl" + }, + "site": { + "assets": { + "css": "css", + "images": "images", + "js": "js" + }, + "language": { + "en-GB": "en-GB" + }, + "forms": "forms", + "src": { + "Controller": "Controller", + "Dispatcher": "Dispatcher", + "Rule": "Rule", + "Field": "Field", + "Helper": "Helper", + "Model": "Model", + "Service": "Service", + "View": "View" + }, + "tmpl": "tmpl" + }, + "media": { + "css": "css", + "images": "images", + "js": "js" + } + }, + "move": { + "static": { + "ADMIN_PROVIDER.php": { + "naam": "ADMIN_PROVIDER.php", + "path": "c0mp0n3nt/admin/services", + "rename": "new", + "newName": "provider.php", + "type": "file" + }, + "ADMIN_EXTENSION_COMPONENT.php": { + "naam": "ADMIN_EXTENSION_COMPONENT.php", + "path": "c0mp0n3nt/admin/src/Extension", + "rename": "new", + "newName": "[[[Component]]]Component.php", + "type": "file" + }, + "ADMIN_DISPLAY_CONTROLLER.php": { + "naam": "ADMIN_DISPLAY_CONTROLLER.php", + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "DisplayController.php", + "type": "file" + }, + "SITE_DISPLAY_CONTROLLER.php": { + "naam": "SITE_DISPLAY_CONTROLLER.php", + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "DisplayController.php", + "type": "file" + }, + "access.xml": { + "naam": "access.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "config.xml": { + "naam": "config.xml", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "component.xml": { + "naam": "component.xml", + "path": "c0mp0n3nt/", + "rename": "component", + "type": "file" + }, + "admin.css": { + "naam": "admin.css", + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "file" + }, + "admin.js": { + "naam": "admin.js", + "path": "c0mp0n3nt/admin/assets/js", + "rename": false, + "type": "file" + }, + "site.css": { + "naam": "site.css", + "path": "c0mp0n3nt/site/assets/css", + "rename": false, + "type": "file" + }, + "site.js": { + "naam": "site.js", + "path": "c0mp0n3nt/site/assets/js", + "rename": false, + "type": "file" + }, + "SITE_ROUTER.php": { + "naam": "SITE_ROUTER.php", + "path": "c0mp0n3nt/site/src/Service", + "rename": "new", + "newName": "Router.php", + "type": "file" + }, + "SITE_ROUTE_HELPER.php": { + "naam": "SITE_ROUTE_HELPER.php", + "path": "c0mp0n3nt/site/src/Helper", + "rename": "new", + "newName": "RouteHelper.php", + "type": "file" + }, + "ADMIN_HELPER_CLASS.php": { + "naam": "ADMIN_HELPER_CLASS.php", + "path": "c0mp0n3nt/admin/src/Helper", + "rename": "new", + "newName": "[[[Component]]]Helper.php", + "type": "file" + }, + "SITE_HELPER_CLASS.php": { + "naam": "SITE_HELPER_CLASS.php", + "path": "c0mp0n3nt/site/src/Helper", + "rename": "new", + "newName": "[[[Component]]]Helper.php", + "type": "file" + }, + "INSTALLER_SCRIPT.php": { + "naam": "INSTALLER_SCRIPT.php", + "path": "c0mp0n3nt/", + "rename": "new", + "newName": "[[[Component]]]InstallerScript.php", + "type": "file" + }, + "SITE_DISPATCHER.php": { + "naam": "SITE_DISPATCHER.php", + "path": "c0mp0n3nt/site/src/Dispatcher", + "rename": "new", + "newName": "Dispatcher.php", + "type": "file" + }, + "install.mysql.utf8.sql": { + "naam": "install.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "uninstall.mysql.utf8.sql": { + "naam": "uninstall.mysql.utf8.sql", + "path": "c0mp0n3nt/admin/sql", + "rename": false, + "type": "file" + }, + "ADMIN_HEADERCHECK.php": { + "naam": "ADMIN_HEADERCHECK.php", + "path": "c0mp0n3nt/admin/src/Helper", + "rename": "new", + "newName": "HeaderCheck.php", + "type": "file" + }, + "LICENSE.txt": { + "naam": "LICENSE.txt", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "README.txt": { + "naam": "README.txt", + "path": "c0mp0n3nt/admin", + "rename": false, + "type": "file" + }, + "README.md": { + "naam": "README.md", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "CHANGELOG.md": { + "naam": "CHANGELOG.md", + "path": "c0mp0n3nt/", + "rename": false, + "type": "file" + }, + "SITE_HEADERCHECK.php": { + "naam": "SITE_HEADERCHECK.php", + "path": "c0mp0n3nt/site/src/Helper", + "rename": "new", + "newName": "HeaderCheck.php", + "type": "file" + }, + "import.gif": { + "naam": "import.gif", + "path": "c0mp0n3nt/admin/assets/images", + "rename": false, + "type": "file" + } + }, + "dynamic": { + "admin": { + "ADMIN_HELPER_EMAIL.php": { + "naam": "ADMIN_HELPER_EMAIL.php", + "path": "c0mp0n3nt/admin/src/Helper", + "rename": "new", + "newName": "[[[Component]]]Email.php", + "type": "emailer" + }, + "DASH_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Component]]]Controller.php", + "type": "dashboard" + }, + "DASH_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Component]]]Model.php", + "type": "dashboard" + }, + "DASH_VIEW_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Component]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "dashboard" + }, + "default_vdm.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[component]]]", + "rename": false, + "type": "dashboard" + }, + "default_main.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[component]]]", + "rename": false, + "type": "dashboard" + }, + "DASH_VIEW.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[component]]]", + "rename": "new", + "newName": "default.php", + "type": "dashboard" + }, + "dashboard.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": false, + "type": "dashboard" + }, + "filter_forms.xml": { + "path": "c0mp0n3nt/admin/forms", + "rename": "filter_forms", + "type": "filter" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/admin/forms", + "rename": "module_forms", + "type": "single" + }, + "module_forms.js": { + "path": "c0mp0n3nt/media/js", + "rename": "module_forms", + "type": "single" + }, + "ADMIN_VIEW.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "ADMIN_VIEW_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "single" + }, + "ADMIN_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "single" + }, + "ADMIN_VIEW_TABLE.php": { + "path": "c0mp0n3nt/admin/src/Table", + "rename": "new", + "newName": "[[[Name]]]Table.php", + "type": "single" + }, + "ADMIN_VIEW_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "single" + }, + "view.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view", + "type": "single" + }, + "ADMIN_VIEWS_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "list" + }, + "ADMIN_VIEWS_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "list" + }, + "views.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views", + "type": "list" + }, + "ADMIN_VIEWS_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "list" + }, + "ADMIN_VIEWS.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "ADMIN_VIEWS_EMPTYSTATE.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "emptystate.php", + "type": "list" + }, + "default_toolbar.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "default_head.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "default_body.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "default_foot.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": false, + "type": "list" + }, + "FORM_RULE.php": { + "path": "c0mp0n3nt/admin/src/Rule", + "rename": "new", + "newName": "[[[Key]]]Rule.php", + "type": "rule" + }, + "ADMIN_LAYOUT.php": { + "path": "c0mp0n3nt/admin/layouts", + "rename": "ADMIN_LAYOUT", + "type": "layout" + }, + "LAYOUT_OVERRIDE.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "LAYOUT_OVERRIDE", + "type": "layoutoverride" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/admin/layouts/[[[name]]]", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "FORM_CUSTOM_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcustom" + }, + "FORM_LIST_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldlist" + }, + "FORM_RADIO_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldradio" + }, + "FORM_CHECKBOXES_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcheckboxes" + }, + "FORM_USER_FIELD.php": { + "path": "c0mp0n3nt/admin/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fielduser" + }, + "ADMIN_AJAX_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "AjaxController.php", + "type": "ajax" + }, + "ADMIN_AJAX_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "AjaxModel.php", + "type": "ajax" + }, + "ADMIN_IMPORT_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "ImportController.php", + "type": "import" + }, + "ADMIN_IMPORT_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "ImportModel.php", + "type": "import" + }, + "ADMIN_IMPORT_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/Import", + "rename": "new", + "newName": "HtmlView.php", + "type": "import" + }, + "default_import.php": { + "path": "c0mp0n3nt/admin/tmpl/import", + "rename": "new", + "newName": "default.php", + "type": "import" + }, + "ADMIN_IMPORT_CONTROLLER_CUSTOM.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]importController.php", + "type": "customimport" + }, + "ADMIN_IMPORT_MODEL_CUSTOM.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]importModel.php", + "type": "customimport" + }, + "ADMIN_IMPORT_HTML_CUSTOM.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]import", + "rename": "new", + "newName": "HtmlView.php", + "type": "customimport" + }, + "default_import_custom.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]import", + "rename": "new", + "newName": "default.php", + "type": "customimport" + }, + "ADMIN_HELPER_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "HelpController.php", + "type": "help" + }, + "1.0.0.sql": { + "path": "c0mp0n3nt/admin/sql/updates/mysql", + "rename": "1.0.0", + "type": "sql_update" + }, + "update_server.xml": { + "path": "c0mp0n3nt/", + "rename": "update_server", + "type": "update_server" + }, + "viewFile.js": { + "path": "c0mp0n3nt/admin/assets/js", + "rename": "viewFile", + "type": "javascript_file" + } + }, + "site": { + "SITE_VIEWS_HTML.php": { + "path": "c0mp0n3nt/site/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "list" + }, + "SITE_VIEWS_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "list" + }, + "views_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "views_site", + "type": "list" + }, + "SITE_VIEWS.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "SITE_VIEW_HTML.php": { + "path": "c0mp0n3nt/site/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "single" + }, + "view_site.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site", + "type": "single" + }, + "SITE_VIEW_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "single" + }, + "SITE_VIEW.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "default_site_template.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "site_template", + "type": "template" + }, + "SITE_LAYOUT.php": { + "path": "c0mp0n3nt/site/layouts", + "rename": "SITE_LAYOUT", + "type": "layout" + }, + "LAYOUT_OVERRIDE.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "LAYOUT_OVERRIDE", + "type": "layoutoverride" + }, + "layoutitems.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutitems", + "type": "layoutitems" + }, + "layoutfull.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutfull", + "type": "layoutfull" + }, + "layoutlinkedview.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutlinkedview", + "type": "layoutlinkedview" + }, + "layouttitle.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layouttitle", + "type": "layouttitle" + }, + "layoutpublished.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutpublished", + "type": "layoutpublished" + }, + "layoutmetadata.php": { + "path": "c0mp0n3nt/site/layouts/[[[name]]]", + "rename": "layoutmetadata", + "type": "layoutmetadata" + }, + "default.xml": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": false, + "type": "menu" + }, + "edit.xml": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": false, + "type": "admin_menu" + }, + "module_forms.xml": { + "path": "c0mp0n3nt/site/forms", + "rename": "module_forms", + "type": "edit" + }, + "module_forms.js": { + "path": "c0mp0n3nt/site/forms", + "rename": "module_forms", + "type": "edit" + }, + "SITE_ADMIN_VIEW.php": { + "path": "c0mp0n3nt/site/tmpl/[[[name]]]", + "rename": "new", + "newName": "edit.php", + "type": "edit" + }, + "SITE_ADMIN_VIEW_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "edit" + }, + "SITE_ADMIN_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "edit" + }, + "SITE_ADMIN_VIEW_HTML.php": { + "path": "c0mp0n3nt/site/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "edit" + }, + "view_site_edit.css": { + "path": "c0mp0n3nt/site/assets/css", + "rename": "view_site_edit", + "type": "edit" + }, + "SITE_FORM_CUSTOM_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcustom" + }, + "SITE_FORM_LIST_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldlist" + }, + "SITE_FORM_RADIO_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldradio" + }, + "SITE_FORM_CHECKBOXES_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fieldcheckboxes" + }, + "SITE_FORM_USER_FIELD.php": { + "path": "c0mp0n3nt/site/src/Field", + "rename": "new", + "newName": "[[[Key]]]Field.php", + "type": "fielduser" + }, + "SITE_AJAX_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "AjaxController.php", + "type": "ajax" + }, + "SITE_AJAX_MODEL.php": { + "path": "c0mp0n3nt/site/src/Model", + "rename": "new", + "newName": "AjaxModel.php", + "type": "ajax" + }, + "SITE_HELPER_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "HelpController.php", + "type": "help" + }, + "SITE_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/site/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "custom_form" + }, + "viewFileSite.js": { + "path": "c0mp0n3nt/site/assets/js", + "rename": "viewFileSite", + "type": "javascript_file" + } + }, + "custom_admin": { + "CUSTOM_ADMIN_VIEWS_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "list" + }, + "CUSTOM_ADMIN_VIEWS_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "list" + }, + "CUSTOM_ADMIN_VIEWS.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "list" + }, + "CUSTOM_ADMIN_VIEWS_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "list" + }, + "views_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "views_custom_admin", + "type": "list" + }, + "view_custom_admin.css": { + "path": "c0mp0n3nt/admin/assets/css", + "rename": "view_custom_admin", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW_HTML.php": { + "path": "c0mp0n3nt/admin/src/View/[[[Name]]]", + "rename": "new", + "newName": "HtmlView.php", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW_MODEL.php": { + "path": "c0mp0n3nt/admin/src/Model", + "rename": "new", + "newName": "[[[Name]]]Model.php", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "new", + "newName": "default.php", + "type": "single" + }, + "CUSTOM_ADMIN_VIEW_CONTROLLER.php": { + "path": "c0mp0n3nt/admin/src/Controller", + "rename": "new", + "newName": "[[[Name]]]Controller.php", + "type": "single" + }, + "default_custom_admin_template.php": { + "path": "c0mp0n3nt/admin/tmpl/[[[name]]]", + "rename": "custom_admin_template", + "type": "template" + }, + "CUSTOM_ADMIN_LAYOUT.php": { + "path": "c0mp0n3nt/admin/layouts", + "rename": "CUSTOM_ADMIN_LAYOUT", + "type": "layout" + }, + "viewFileCustomAdmin.js": { + "path": "c0mp0n3nt/admin/assets/js", + "rename": "viewFileCustomAdmin", + "type": "javascript_file" + } + } + } + } +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/site.css b/admin/compiler/joomla_4/site.css new file mode 100644 index 000000000..b26522089 --- /dev/null +++ b/admin/compiler/joomla_4/site.css @@ -0,0 +1,7 @@ +###BOM### + +/* CSS Document */ +.no-click { + pointer-events: none; +} +###SITECSS### diff --git a/admin/compiler/joomla_4/site.js b/admin/compiler/joomla_4/site.js new file mode 100644 index 000000000..813632b9a --- /dev/null +++ b/admin/compiler/joomla_4/site.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###SITEJS### \ No newline at end of file diff --git a/admin/compiler/joomla_4/submitbutton.js b/admin/compiler/joomla_4/submitbutton.js new file mode 100644 index 000000000..cd10493cd --- /dev/null +++ b/admin/compiler/joomla_4/submitbutton.js @@ -0,0 +1,17 @@ +###BOM### + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('###view###, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/submitbutton_site.js b/admin/compiler/joomla_4/submitbutton_site.js new file mode 100644 index 000000000..40938b445 --- /dev/null +++ b/admin/compiler/joomla_4/submitbutton_site.js @@ -0,0 +1,17 @@ +###BOM### + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var action = task.split('.'); + if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ + Joomla.submitform(task, document.getElementById("adminForm")); + return true; + } else { + alert(Joomla.JText._('###sview###, some values are not acceptable.','Some values are unacceptable')); + return false; + } + } +} \ No newline at end of file diff --git a/admin/compiler/joomla_4/uninstall.mysql.utf8.sql b/admin/compiler/joomla_4/uninstall.mysql.utf8.sql new file mode 100644 index 000000000..b8b61a080 --- /dev/null +++ b/admin/compiler/joomla_4/uninstall.mysql.utf8.sql @@ -0,0 +1 @@ +###UNINSTALL### diff --git a/admin/compiler/joomla_4/update_server.xml b/admin/compiler/joomla_4/update_server.xml new file mode 100644 index 000000000..8120c1923 --- /dev/null +++ b/admin/compiler/joomla_4/update_server.xml @@ -0,0 +1 @@ +###UPDATE_SERVER_XML### \ No newline at end of file diff --git a/admin/compiler/joomla_4/view.css b/admin/compiler/joomla_4/view.css new file mode 100644 index 000000000..4144e5a3c --- /dev/null +++ b/admin/compiler/joomla_4/view.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###VIEWCSS### diff --git a/admin/compiler/joomla_4/viewFile.js b/admin/compiler/joomla_4/viewFile.js new file mode 100644 index 000000000..d855708a8 --- /dev/null +++ b/admin/compiler/joomla_4/viewFile.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###ADMIN_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/viewFileCustomAdmin.js b/admin/compiler/joomla_4/viewFileCustomAdmin.js new file mode 100644 index 000000000..8abce3885 --- /dev/null +++ b/admin/compiler/joomla_4/viewFileCustomAdmin.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###CUSTOM_ADMIN_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/viewFileSite.js b/admin/compiler/joomla_4/viewFileSite.js new file mode 100644 index 000000000..12ed97db2 --- /dev/null +++ b/admin/compiler/joomla_4/viewFileSite.js @@ -0,0 +1,4 @@ +###BOM### + +/* JS Document */ +###SITE_JAVASCRIPT_FILE### \ No newline at end of file diff --git a/admin/compiler/joomla_4/view_custom_admin.css b/admin/compiler/joomla_4/view_custom_admin.css new file mode 100644 index 000000000..291066442 --- /dev/null +++ b/admin/compiler/joomla_4/view_custom_admin.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###CUSTOM_ADMIN_VIEWCSS### diff --git a/admin/compiler/joomla_4/view_site.css b/admin/compiler/joomla_4/view_site.css new file mode 100644 index 000000000..17a8824ae --- /dev/null +++ b/admin/compiler/joomla_4/view_site.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###SITE_VIEWCSS### diff --git a/admin/compiler/joomla_4/view_site_edit.css b/admin/compiler/joomla_4/view_site_edit.css new file mode 100644 index 000000000..17a8824ae --- /dev/null +++ b/admin/compiler/joomla_4/view_site_edit.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###SITE_VIEWCSS### diff --git a/admin/compiler/joomla_4/views.css b/admin/compiler/joomla_4/views.css new file mode 100644 index 000000000..d79fcb92b --- /dev/null +++ b/admin/compiler/joomla_4/views.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###VIEWSCSS### diff --git a/admin/compiler/joomla_4/views_custom_admin.css b/admin/compiler/joomla_4/views_custom_admin.css new file mode 100644 index 000000000..291066442 --- /dev/null +++ b/admin/compiler/joomla_4/views_custom_admin.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###CUSTOM_ADMIN_VIEWCSS### diff --git a/admin/compiler/joomla_4/views_site.css b/admin/compiler/joomla_4/views_site.css new file mode 100644 index 000000000..17a8824ae --- /dev/null +++ b/admin/compiler/joomla_4/views_site.css @@ -0,0 +1,5 @@ +###BOM### + +/* CSS Document */ + +###SITE_VIEWCSS### diff --git a/admin/compiler/joomla_4/whmcs.php b/admin/compiler/joomla_4/whmcs.php new file mode 100644 index 000000000..ac7524f0e --- /dev/null +++ b/admin/compiler/joomla_4/whmcs.php @@ -0,0 +1,20 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this JCB template file (EVER) +defined('_JCB_TEMPLATE') or die; +?> +###BOM### + +// No direct access to this file +defined('_JEXEC') or die; + +// NO MORE... \ No newline at end of file diff --git a/admin/componentbuilder.php b/admin/componentbuilder.php index 53857eff6..7983508e4 100644 --- a/admin/componentbuilder.php +++ b/admin/componentbuilder.php @@ -19,8 +19,8 @@ if (file_exists($composer_autoloader)) require_once $composer_autoloader; } -// register this component namespace -spl_autoload_register(function ($class) { +// register additional namespace +\spl_autoload_register(function ($class) { // project-specific base directories and namespace prefix $search = [ 'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai', @@ -67,32 +67,35 @@ spl_autoload_register(function ($class) { } }); - +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Access\Exception\NotAllowed; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\MVC\Controller\BaseController; // Access check. -if (!JFactory::getUser()->authorise('core.manage', 'com_componentbuilder')) +if (!Factory::getUser()->authorise('core.manage', 'com_componentbuilder')) { - throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); -}; + throw new NotAllowed(Text::_('JERROR_ALERTNOAUTHOR'), 403); +} // Add CSS file for all pages -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_componentbuilder/assets/css/admin.css'); -$document->addScript('components/com_componentbuilder/assets/js/admin.js'); +Html::_('stylesheet', 'components/com_componentbuilder/assets/css/admin.css', ['version' => 'auto']); +Html::_('script', 'components/com_componentbuilder/assets/js/admin.js', ['version' => 'auto']); // require helper files JLoader::register('ComponentbuilderHelper', __DIR__ . '/helpers/componentbuilder.php'); -JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php'); +\JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php'); JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php'); // Trigger the Global Admin Event -ComponentbuilderHelper::globalEvent($document); +ComponentbuilderHelper::globalEvent(Factory::getDocument()); // Get an instance of the controller prefixed by Componentbuilder -$controller = JControllerLegacy::getInstance('Componentbuilder'); +$controller = BaseController::getInstance('Componentbuilder'); // Perform the Request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/admin/config.xml b/admin/config.xml index 75fbfed59..58d0b3513 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -970,6 +970,24 @@ /> + + + + COM_COMPONENTBUILDER_CONFIG_NO - - + + @@ -994,6 +1012,7 @@ name="language" label="COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL" class="list_class" + layout="joomla.form.field.list-fancy-select" multiple="false" default="en-GB" required="true" @@ -1012,8 +1031,8 @@ max="100" step="10" /> - - + + input->getCmd('view', 'componentbuilder'); - $data = $this->getViewRelation($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); + $view = $this->input->getCmd('view', 'componentbuilder'); + $data = $this->getViewRelation($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); // Check for edit form. - if(ComponentbuilderHelper::checkArray($data)) + if(UtilitiesArrayHelper::check($data)) { if ($data['edit'] && $layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$data['view'], $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) + if ($refid > 0 && StringHelper::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (ComponentbuilderHelper::checkString($ref)) + elseif (StringHelper::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); } else { // normal redirect back to the list view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.$data['views'], false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.$data['views'], false)); } return false; @@ -89,7 +93,7 @@ class ComponentbuilderController extends BaseController protected function getViewRelation($view) { // check the we have a value - if (ComponentbuilderHelper::checkString($view)) + if (StringHelper::check($view)) { // the view relationships $views = array( @@ -126,6 +130,7 @@ class ComponentbuilderController extends BaseController 'component_updates' => 'components_updates', 'component_mysql_tweaks' => 'components_mysql_tweaks', 'component_custom_admin_menus' => 'components_custom_admin_menus', + 'component_router' => 'components_routers', 'component_config' => 'components_config', 'component_dashboard' => 'components_dashboard', 'component_files_folders' => 'components_files_folders', diff --git a/admin/controllers/admin_custom_tabs.php b/admin/controllers/admin_custom_tabs.php index 51f8b1d9e..7f6e4bfce 100644 --- a/admin/controllers/admin_custom_tabs.php +++ b/admin/controllers/admin_custom_tabs.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_custom_tabs Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_custom_tabs'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_custom_tabs.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_custom_tabs', '', array()); + $model = $this->getModel('Admin_custom_tabs', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_custom_tabs' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_custom_tabs' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_custom_tabs extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_fields.php b/admin/controllers/admin_fields.php index 89e3cb48b..98309de8b 100644 --- a/admin/controllers/admin_fields.php +++ b/admin/controllers/admin_fields.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_fields Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_fields extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_fields'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_fields extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_fields.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_fields extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_fields extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_fields extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_fields', '', array()); + $model = $this->getModel('Admin_fields', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_fields' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_fields extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_fields extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_fields extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_fields_conditions.php b/admin/controllers/admin_fields_conditions.php index f5034ec93..361a81a0e 100644 --- a/admin/controllers/admin_fields_conditions.php +++ b/admin/controllers/admin_fields_conditions.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_fields_conditions Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_fields_conditions'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_fields_conditions.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_fields_conditions', '', array()); + $model = $this->getModel('Admin_fields_conditions', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_conditions' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_fields_conditions' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_fields_conditions extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_fields_relations.php b/admin/controllers/admin_fields_relations.php index dbc285ddd..b775c6e7e 100644 --- a/admin/controllers/admin_fields_relations.php +++ b/admin/controllers/admin_fields_relations.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Admin_fields_relations Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admins_fields_relations'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_fields_relations.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_fields_relations', '', array()); + $model = $this->getModel('Admin_fields_relations', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admins_fields_relations' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerAdmin_fields_relations extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/admin_view.php b/admin/controllers/admin_view.php index daa98d2be..1359388c3 100644 --- a/admin/controllers/admin_view.php +++ b/admin/controllers/admin_view.php @@ -12,8 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Utilities\GetHelper; /** * Admin_view Form Controller @@ -36,13 +43,13 @@ class ComponentbuilderControllerAdmin_view extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Admin_views'; // 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. @@ -51,10 +58,10 @@ class ComponentbuilderControllerAdmin_view extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('admin_view.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +83,10 @@ class ComponentbuilderControllerAdmin_view extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +157,12 @@ class ComponentbuilderControllerAdmin_view extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +179,13 @@ class ComponentbuilderControllerAdmin_view extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Admin_view', '', array()); + $model = $this->getModel('Admin_view', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admin_views' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admin_views' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +210,13 @@ class ComponentbuilderControllerAdmin_view extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +227,7 @@ class ComponentbuilderControllerAdmin_view extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +238,7 @@ class ComponentbuilderControllerAdmin_view extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +264,7 @@ class ComponentbuilderControllerAdmin_view extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +282,29 @@ class ComponentbuilderControllerAdmin_view extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,14 +316,14 @@ class ComponentbuilderControllerAdmin_view extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // get the state object (Joomla\CMS\Object\CMSObject) $state = $model->get('state'); @@ -337,7 +344,7 @@ class ComponentbuilderControllerAdmin_view extends FormController foreach($_tablesArray as $_updateTable) { // get the linked ID - if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, 'admin_view', 'id')) + if ($_value = GetHelper::var($_updateTable, $oldID, 'admin_view', 'id')) { // copy fields to new admin view ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array('admin_view' => $newID)); @@ -347,5 +354,4 @@ class ComponentbuilderControllerAdmin_view extends FormController return; } - } diff --git a/admin/controllers/admin_views.php b/admin/controllers/admin_views.php index 4bd01f895..8b95dbb06 100644 --- a/admin/controllers/admin_views.php +++ b/admin/controllers/admin_views.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -48,13 +54,13 @@ class ComponentbuilderControllerAdmin_views extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('admin_view.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -62,16 +68,16 @@ class ComponentbuilderControllerAdmin_views extends AdminController $model = $this->getModel('Admin_views'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Admin_views_'.$date->format('jS_F_Y'),'Admin views exported ('.$date->format('jS F, Y').')','admin views'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); return; } @@ -79,32 +85,32 @@ class ComponentbuilderControllerAdmin_views extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('admin_view.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Admin_views'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('admin_view_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'admin_views'); $session->set('dataType_VDM_IMPORTINTO', 'admin_view'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_ADMIN_VIEWS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_ADMIN_VIEWS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=admin_views', false), $message, 'error'); return; } @@ -117,20 +123,20 @@ class ComponentbuilderControllerAdmin_views extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=admin_views', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('admin_views.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -139,7 +145,7 @@ class ComponentbuilderControllerAdmin_views extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } diff --git a/admin/controllers/admins_custom_tabs.php b/admin/controllers/admins_custom_tabs.php index 790c6e069..61e43cc65 100644 --- a/admin/controllers/admins_custom_tabs.php +++ b/admin/controllers/admins_custom_tabs.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_custom_tabs Admin Controller diff --git a/admin/controllers/admins_fields.php b/admin/controllers/admins_fields.php index cf77f2fba..d8c328777 100644 --- a/admin/controllers/admins_fields.php +++ b/admin/controllers/admins_fields.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_fields Admin Controller diff --git a/admin/controllers/admins_fields_conditions.php b/admin/controllers/admins_fields_conditions.php index 9a54b55a1..a832d2864 100644 --- a/admin/controllers/admins_fields_conditions.php +++ b/admin/controllers/admins_fields_conditions.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_fields_conditions Admin Controller diff --git a/admin/controllers/admins_fields_relations.php b/admin/controllers/admins_fields_relations.php index 2a3804873..c14541e43 100644 --- a/admin/controllers/admins_fields_relations.php +++ b/admin/controllers/admins_fields_relations.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Admins_fields_relations Admin Controller diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index e27dd76da..2ae49345c 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -12,7 +12,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -24,9 +26,9 @@ class ComponentbuilderControllerAjax extends BaseController { parent::__construct($config); // make sure all json stuff are set - JFactory::getDocument()->setMimeEncoding( 'application/json' ); + Factory::getDocument()->setMimeEncoding( 'application/json' ); // get the application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $app->setHeader('Content-Disposition','attachment;filename="getajax.json"'); $app->setHeader('Access-Control-Allow-Origin', '*'); // load the tasks @@ -80,16 +82,16 @@ class ComponentbuilderControllerAjax extends BaseController public function ajax() { // get the user for later use - $user = JFactory::getUser(); + $user = Factory::getUser(); // get the input values - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; // check if we should return raw - $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); // return to a callback function - $callback = $jinput->get('callback', null, 'CMD'); + $callback = $jinput->get('callback', null, 'CMD'); // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); if($jinput->get($token, 0, 'ALNUM') || $token === $call_token) { // get the task @@ -102,7 +104,15 @@ class ComponentbuilderControllerAjax extends BaseController $noticeValue = $jinput->get('notice', NULL, 'STRING'); if($noticeValue && $user->id != 0) { - $result = $this->getModel('ajax')->isNew($noticeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->isNew($noticeValue); + } + else + { + $result = false; + } } else { @@ -121,7 +131,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -143,7 +153,15 @@ class ComponentbuilderControllerAjax extends BaseController $noticeValue = $jinput->get('notice', NULL, 'STRING'); if($noticeValue && $user->id != 0) { - $result = $this->getModel('ajax')->isRead($noticeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->isRead($noticeValue); + } + else + { + $result = false; + } } else { @@ -162,7 +180,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -184,7 +202,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getComponentDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getComponentDetails($idValue); + } + else + { + $result = false; + } } else { @@ -203,7 +229,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -225,7 +251,15 @@ class ComponentbuilderControllerAjax extends BaseController $getTypeValue = $jinput->get('getType', NULL, 'WORD'); if($getTypeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getCronPath($getTypeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getCronPath($getTypeValue); + } + else + { + $result = false; + } } else { @@ -244,7 +278,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -266,7 +300,15 @@ class ComponentbuilderControllerAjax extends BaseController $nameValue = $jinput->get('name', NULL, 'WORD'); if($nameValue && $user->id != 0) { - $result = $this->getModel('ajax')->getWiki($nameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getWiki($nameValue); + } + else + { + $result = false; + } } else { @@ -285,7 +327,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -307,7 +349,15 @@ class ComponentbuilderControllerAjax extends BaseController $versionValue = $jinput->get('version', NULL, 'INT'); if($versionValue && $user->id != 0) { - $result = $this->getModel('ajax')->getVersion($versionValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getVersion($versionValue); + } + else + { + $result = false; + } } else { @@ -326,7 +376,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -348,7 +398,15 @@ class ComponentbuilderControllerAjax extends BaseController $packageValue = $jinput->get('package', NULL, 'BASE64'); if($packageValue && $user->id != 0) { - $result = $this->getModel('ajax')->getJCBpackageInfo($packageValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getJCBpackageInfo($packageValue); + } + else + { + $result = false; + } } else { @@ -367,7 +425,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -390,7 +448,15 @@ class ComponentbuilderControllerAjax extends BaseController $keyValue = $jinput->get('key', NULL, 'ALNUM'); if($identifierValue && $user->id != 0 && $keyValue) { - $result = $this->getModel('ajax')->getCrowdinDetails($identifierValue, $keyValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getCrowdinDetails($identifierValue, $keyValue); + } + else + { + $result = false; + } } else { @@ -409,7 +475,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -431,7 +497,15 @@ class ComponentbuilderControllerAjax extends BaseController $dataValue = $jinput->get('data', NULL, 'STRING'); if($dataValue && $user->id != 0) { - $result = $this->getModel('ajax')->getModuleCode($dataValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getModuleCode($dataValue); + } + else + { + $result = false; + } } else { @@ -450,7 +524,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -473,7 +547,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($idValue && $user->id != 0 && $typeValue) { - $result = $this->getModel('ajax')->getClassCode($idValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getClassCode($idValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -492,7 +574,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -516,7 +598,15 @@ class ComponentbuilderControllerAjax extends BaseController $keyValue = $jinput->get('key', 1, 'INT'); if($idValue && $user->id != 0 && $typeValue) { - $result = $this->getModel('ajax')->getClassCodeIds($idValue, $typeValue, $keyValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getClassCodeIds($idValue, $typeValue, $keyValue); + } + else + { + $result = false; + } } else { @@ -535,7 +625,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -558,7 +648,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($idValue && $user->id != 0 && $typeValue) { - $result = $this->getModel('ajax')->getClassHeaderCode($idValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getClassHeaderCode($idValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -577,7 +675,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -599,7 +697,15 @@ class ComponentbuilderControllerAjax extends BaseController $tableValue = $jinput->get('table', NULL, 'WORD'); if($tableValue && $user->id != 0) { - $result = $this->getModel('ajax')->getTableColumns($tableValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getTableColumns($tableValue); + } + else + { + $result = false; + } } else { @@ -618,7 +724,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -640,7 +746,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getFieldSelectOptions($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getFieldSelectOptions($idValue); + } + else + { + $result = false; + } } else { @@ -659,7 +773,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -681,7 +795,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getDynamicScripts($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getDynamicScripts($typeValue); + } + else + { + $result = false; + } } else { @@ -700,7 +822,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -723,7 +845,15 @@ class ComponentbuilderControllerAjax extends BaseController $sizeValue = $jinput->get('size', NULL, 'INT'); if($typeValue && $user->id != 0 && $sizeValue) { - $result = $this->getModel('ajax')->getButton($typeValue, $sizeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getButton($typeValue, $sizeValue); + } + else + { + $result = false; + } } else { @@ -742,7 +872,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -765,7 +895,15 @@ class ComponentbuilderControllerAjax extends BaseController $sizeValue = $jinput->get('size', NULL, 'INT'); if($typeValue && $user->id != 0 && $sizeValue) { - $result = $this->getModel('ajax')->getButtonID($typeValue, $sizeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getButtonID($typeValue, $sizeValue); + } + else + { + $result = false; + } } else { @@ -784,7 +922,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -806,7 +944,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'WORD'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getAjaxDisplay($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getAjaxDisplay($typeValue); + } + else + { + $result = false; + } } else { @@ -825,7 +971,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -847,7 +993,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'ALNUM'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->getLinked($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getLinked($typeValue); + } + else + { + $result = false; + } } else { @@ -866,7 +1020,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -888,7 +1042,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'ALNUM'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->checkAliasField($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkAliasField($typeValue); + } + else + { + $result = false; + } } else { @@ -907,7 +1069,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -929,7 +1091,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'ALNUM'); if($typeValue && $user->id != 0) { - $result = $this->getModel('ajax')->checkCategoryField($typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkCategoryField($typeValue); + } + else + { + $result = false; + } } else { @@ -948,7 +1118,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -970,7 +1140,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', null, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getTemplateDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getTemplateDetails($idValue); + } + else + { + $result = false; + } } else { @@ -989,7 +1167,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1011,7 +1189,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getLayoutDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getLayoutDetails($idValue); + } + else + { + $result = false; + } } else { @@ -1030,7 +1216,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1054,7 +1240,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'INT'); if($nameValue && $user->id != 0 && $asValue && $typeValue) { - $result = $this->getModel('ajax')->getDbTableColumns($nameValue, $asValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getDbTableColumns($nameValue, $asValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -1073,7 +1267,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1097,7 +1291,15 @@ class ComponentbuilderControllerAjax extends BaseController $typeValue = $jinput->get('type', NULL, 'INT'); if($idValue && $user->id != 0 && $asValue && $typeValue) { - $result = $this->getModel('ajax')->getViewTableColumns($idValue, $asValue, $typeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getViewTableColumns($idValue, $asValue, $typeValue); + } + else + { + $result = false; + } } else { @@ -1116,7 +1318,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1139,7 +1341,15 @@ class ComponentbuilderControllerAjax extends BaseController $viewValue = $jinput->get('view', NULL, 'WORD'); if($idValue && $user->id != 0 && $viewValue) { - $result = $this->getModel('ajax')->getDynamicValues($idValue, $viewValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getDynamicValues($idValue, $viewValue); + } + else + { + $result = false; + } } else { @@ -1158,7 +1368,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1181,7 +1391,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($functioNameValue && $user->id != 0 && $idValue) { - $result = $this->getModel('ajax')->checkFunctionName($functioNameValue, $idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkFunctionName($functioNameValue, $idValue); + } + else + { + $result = false; + } } else { @@ -1200,7 +1418,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1224,7 +1442,15 @@ class ComponentbuilderControllerAjax extends BaseController $targetValue = $jinput->get('target', NULL, 'WORD'); if($functioNameValue && $user->id != 0 && $idValue && $targetValue) { - $result = $this->getModel('ajax')->usedin($functioNameValue, $idValue, $targetValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->usedin($functioNameValue, $idValue, $targetValue); + } + else + { + $result = false; + } } else { @@ -1243,7 +1469,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1265,7 +1491,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getEditCustomCodeButtons($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getEditCustomCodeButtons($idValue); + } + else + { + $result = false; + } } else { @@ -1284,7 +1518,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1308,7 +1542,15 @@ class ComponentbuilderControllerAjax extends BaseController $targetValue = $jinput->get('target', NULL, 'WORD'); if($placeholderValue && $user->id != 0 && $idValue && $targetValue) { - $result = $this->getModel('ajax')->placedin($placeholderValue, $idValue, $targetValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->placedin($placeholderValue, $idValue, $targetValue); + } + else + { + $result = false; + } } else { @@ -1327,7 +1569,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1350,7 +1592,15 @@ class ComponentbuilderControllerAjax extends BaseController $placeholderNameValue = $jinput->get('placeholderName', NULL, 'STRING'); if($idValue && $user->id != 0 && $placeholderNameValue) { - $result = $this->getModel('ajax')->checkPlaceholderName($idValue, $placeholderNameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkPlaceholderName($idValue, $placeholderNameValue); + } + else + { + $result = false; + } } else { @@ -1369,7 +1619,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1391,7 +1641,15 @@ class ComponentbuilderControllerAjax extends BaseController $nameValue = $jinput->get('name', NULL, 'WORD'); if($nameValue && $user->id != 0) { - $result = $this->getModel('ajax')->getExistingValidationRuleCode($nameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getExistingValidationRuleCode($nameValue); + } + else + { + $result = false; + } } else { @@ -1410,7 +1668,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1432,7 +1690,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getValidationRulesTable($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getValidationRulesTable($idValue); + } + else + { + $result = false; + } } else { @@ -1451,7 +1717,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1474,7 +1740,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($nameValue && $user->id != 0 && $idValue) { - $result = $this->getModel('ajax')->checkRuleName($nameValue, $idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->checkRuleName($nameValue, $idValue); + } + else + { + $result = false; + } } else { @@ -1493,7 +1767,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1515,7 +1789,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue) { - $result = $this->getModel('ajax')->getFieldTypeProperties($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getFieldTypeProperties($idValue); + } + else + { + $result = false; + } } else { @@ -1534,7 +1816,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1557,7 +1839,15 @@ class ComponentbuilderControllerAjax extends BaseController $fieldtypeValue = $jinput->get('fieldtype', NULL, 'ALNUM'); if($propertyValue && $user->id != 0 && $fieldtypeValue) { - $result = $this->getModel('ajax')->getFieldPropertyDesc($propertyValue, $fieldtypeValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getFieldPropertyDesc($propertyValue, $fieldtypeValue); + } + else + { + $result = false; + } } else { @@ -1576,7 +1866,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1601,7 +1891,15 @@ class ComponentbuilderControllerAjax extends BaseController $areaValue = $jinput->get('area', NULL, 'INT'); if($listfieldValue && $user->id != 0 && $joinfieldsValue && $typeValue && $areaValue) { - $result = $this->getModel('ajax')->getCodeGlueOptions($listfieldValue, $joinfieldsValue, $typeValue, $areaValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getCodeGlueOptions($listfieldValue, $joinfieldsValue, $typeValue, $areaValue); + } + else + { + $result = false; + } } else { @@ -1620,7 +1918,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1648,7 +1946,15 @@ class ComponentbuilderControllerAjax extends BaseController $component_idValue = $jinput->get('component_id', 0, 'INT'); if($table_nameValue && $user->id != 0 && $type_searchValue && $search_valueValue) { - $result = $this->getModel('ajax')->doSearch($table_nameValue, $type_searchValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->doSearch($table_nameValue, $type_searchValue, $search_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + } + else + { + $result = false; + } } else { @@ -1667,7 +1973,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1695,7 +2001,15 @@ class ComponentbuilderControllerAjax extends BaseController $component_idValue = $jinput->get('component_id', 0, 'INT'); if($table_nameValue && $user->id != 0 && $search_valueValue) { - $result = $this->getModel('ajax')->replaceAll($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->replaceAll($table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue, $component_idValue); + } + else + { + $result = false; + } } else { @@ -1714,7 +2028,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1743,7 +2057,15 @@ class ComponentbuilderControllerAjax extends BaseController $regex_searchValue = $jinput->get('regex_search', 0, 'INT'); if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue && $search_valueValue) { - $result = $this->getModel('ajax')->getSearchValue($field_nameValue, $row_idValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getSearchValue($field_nameValue, $row_idValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + } + else + { + $result = false; + } } else { @@ -1762,7 +2084,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1792,7 +2114,15 @@ class ComponentbuilderControllerAjax extends BaseController $regex_searchValue = $jinput->get('regex_search', 0, 'INT'); if($field_nameValue && $user->id != 0 && $row_idValue && $table_nameValue && $search_valueValue) { - $result = $this->getModel('ajax')->getReplaceValue($field_nameValue, $row_idValue, $line_nrValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getReplaceValue($field_nameValue, $row_idValue, $line_nrValue, $table_nameValue, $search_valueValue, $replace_valueValue, $match_caseValue, $whole_wordValue, $regex_searchValue); + } + else + { + $result = false; + } } else { @@ -1811,7 +2141,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1836,7 +2166,15 @@ class ComponentbuilderControllerAjax extends BaseController $table_nameValue = $jinput->get('table_name', NULL, 'WORD'); if($valueValue && $user->id != 0 && $row_idValue && $field_nameValue && $table_nameValue) { - $result = $this->getModel('ajax')->setValue($valueValue, $row_idValue, $field_nameValue, $table_nameValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->setValue($valueValue, $row_idValue, $field_nameValue, $table_nameValue); + } + else + { + $result = false; + } } else { @@ -1855,7 +2193,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1877,7 +2215,15 @@ class ComponentbuilderControllerAjax extends BaseController $idValue = $jinput->get('id', NULL, 'INT'); if($idValue && $user->id != 0) { - $result = $this->getModel('ajax')->getSnippetDetails($idValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getSnippetDetails($idValue); + } + else + { + $result = false; + } } else { @@ -1896,7 +2242,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1919,7 +2265,15 @@ class ComponentbuilderControllerAjax extends BaseController $statusValue = $jinput->get('status', NULL, 'WORD'); if($pathValue && $user->id != 0 && $statusValue) { - $result = $this->getModel('ajax')->setSnippetGithub($pathValue, $statusValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->setSnippetGithub($pathValue, $statusValue); + } + else + { + $result = false; + } } else { @@ -1938,7 +2292,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { @@ -1960,7 +2314,15 @@ class ComponentbuilderControllerAjax extends BaseController $librariesValue = $jinput->get('libraries', NULL, 'STRING'); if($librariesValue && $user->id != 0) { - $result = $this->getModel('ajax')->getSnippets($librariesValue); + $ajaxModule = $this->getModel('ajax'); + if ($ajaxModule) + { + $result = $ajaxModule->getSnippets($librariesValue); + } + else + { + $result = false; + } } else { @@ -1979,7 +2341,7 @@ class ComponentbuilderControllerAjax extends BaseController echo "(".json_encode($result).");"; } } - catch(Exception $e) + catch(\Exception $e) { if($callback) { diff --git a/admin/controllers/class_extendings.php b/admin/controllers/class_extendings.php index db9896b75..d5487f11f 100644 --- a/admin/controllers/class_extendings.php +++ b/admin/controllers/class_extendings.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Class_extendings Admin Controller diff --git a/admin/controllers/class_extends.php b/admin/controllers/class_extends.php index 5926cf210..7308076f2 100644 --- a/admin/controllers/class_extends.php +++ b/admin/controllers/class_extends.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Class_extends Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerClass_extends extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Class_extendings'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerClass_extends extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('class_extends.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerClass_extends extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerClass_extends extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerClass_extends extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Class_extends', '', array()); + $model = $this->getModel('Class_extends', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_extendings' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_extendings' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerClass_extends extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerClass_extends extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerClass_extends extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerClass_extends extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerClass_extends extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerClass_extends extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/class_method.php b/admin/controllers/class_method.php index 1f492caaa..467e1839e 100644 --- a/admin/controllers/class_method.php +++ b/admin/controllers/class_method.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Class_method Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerClass_method extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Class_methods'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerClass_method extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('class_method.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerClass_method extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerClass_method extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerClass_method extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Class_method', '', array()); + $model = $this->getModel('Class_method', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerClass_method extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerClass_method extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerClass_method extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerClass_method extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerClass_method extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerClass_method extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/class_methods.php b/admin/controllers/class_methods.php index eb8a7660b..274d4cf16 100644 --- a/admin/controllers/class_methods.php +++ b/admin/controllers/class_methods.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Class_methods Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerClass_methods extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_method.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerClass_methods extends AdminController $model = $this->getModel('Class_methods'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Class_methods_'.$date->format('jS_F_Y'),'Class methods exported ('.$date->format('jS F, Y').')','class methods'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerClass_methods extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_method.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Class_methods'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('class_method_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'class_methods'); $session->set('dataType_VDM_IMPORTINTO', 'class_method'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_METHODS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_METHODS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/class_properties.php b/admin/controllers/class_properties.php index 76242b346..3b3a5fd32 100644 --- a/admin/controllers/class_properties.php +++ b/admin/controllers/class_properties.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Class_properties Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerClass_properties extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_property.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerClass_properties extends AdminController $model = $this->getModel('Class_properties'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Class_properties_'.$date->format('jS_F_Y'),'Class properties exported ('.$date->format('jS F, Y').')','class properties'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerClass_properties extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('class_property.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Class_properties'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('class_property_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'class_properties'); $session->set('dataType_VDM_IMPORTINTO', 'class_property'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_PROPERTIES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CLASS_PROPERTIES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/class_property.php b/admin/controllers/class_property.php index 8729a395e..098d702ee 100644 --- a/admin/controllers/class_property.php +++ b/admin/controllers/class_property.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Class_property Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerClass_property extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Class_properties'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerClass_property extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('class_property.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerClass_property extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerClass_property extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerClass_property extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Class_property', '', array()); + $model = $this->getModel('Class_property', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerClass_property extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerClass_property extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerClass_property extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerClass_property extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerClass_property extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerClass_property extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/compiler.php b/admin/controllers/compiler.php index 1314e6d02..e46145a32 100644 --- a/admin/controllers/compiler.php +++ b/admin/controllers/compiler.php @@ -12,9 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use Joomla\CMS\Version; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -33,9 +38,9 @@ class ComponentbuilderControllerCompiler extends AdminController /** * Proxy for getModel. - * @since 2.5 + * @since 2.5 */ - public function getModel($name = 'Compiler', $prefix = 'ComponentbuilderModel', $config = array()) + public function getModel($name = 'Compiler', $prefix = 'ComponentbuilderModel', $config = []) { $model = parent::getModel($name, $prefix, array('ignore_request' => true)); @@ -44,7 +49,7 @@ class ComponentbuilderControllerCompiler extends AdminController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder', false)); return; } @@ -56,12 +61,12 @@ class ComponentbuilderControllerCompiler extends AdminController public function getDynamicContent() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::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_DOWNLOAD_THE_COMPILER_ANIMATIONS'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_DOWNLOAD_THE_COMPILER_ANIMATIONS'); // currently only those with permissions can get these images if($user->authorise('compiler.compiler_animations', 'com_componentbuilder')) { @@ -69,7 +74,7 @@ class ComponentbuilderControllerCompiler extends AdminController $model = $this->getModel('compiler'); if ($model->getDynamicContent($message)) { - $message = JText::_('COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB'); + $message = Text::_('COM_COMPONENTBUILDER_BALL_THE_COMPILER_ANIMATIONS_WERE_SUCCESSFULLY_DOWNLOADED_TO_THIS_JOOMLA_INSTALLB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -86,18 +91,16 @@ class ComponentbuilderControllerCompiler extends AdminController public function compiler() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // currently only those with admin access can compile a component if($user->authorise('core.manage', 'com_componentbuilder')) { - // include component compiler - require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/compiler.php'; $model = $this->getModel('compiler'); if ($model->builder()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } @@ -111,7 +114,7 @@ class ComponentbuilderControllerCompiler extends AdminController $add_plugin_install = false; $add_module_install = false; // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // set redirection URL $redirect_url = $app->getUserState('com_componentbuilder.redirect_url'); // get system messages @@ -121,10 +124,10 @@ class ComponentbuilderControllerCompiler extends AdminController // start new message $message = array(); // update the redirection URL - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); if (($pos = strpos($model->compiler->filepath['component'], "/tmp/")) !== FALSE) { - $url = JURI::root() . substr($model->compiler->filepath['component'], $pos + 1); + $url = \JUri::root() . substr($model->compiler->filepath['component'], $pos + 1); } // check if we have plugins $add_plugin_install = UtilitiesArrayHelper::check($model->compiler->filepath['plugins'], true); @@ -144,32 +147,36 @@ class ComponentbuilderControllerCompiler extends AdminController // Message of successful build $message[] = '

The (' . $model->compiler->filepath['component-folder'] . ') was Successfully Compiled!

'; } - $message[] = '

'; - // check if we have modules - if ($add_module_install) + + if (CFactory::_('Config')->joomla_version == Version::MAJOR_VERSION) { - foreach ($model->compiler->filepath['modules-folder'] as $module_id => $module_folder) + $message[] = '

'; + // check if we have modules + if ($add_module_install) { - $message[] = '

'; + foreach ($model->compiler->filepath['modules-folder'] as $module_id => $module_folder) + { + $message[] = '

'; + } } - } - // check if we have plugins - if ($add_plugin_install) - { - foreach ($model->compiler->filepath['plugins-folder'] as $plugin_id => $plugin_folder) + // check if we have plugins + if ($add_plugin_install) { - $message[] = '

'; + foreach ($model->compiler->filepath['plugins-folder'] as $plugin_id => $plugin_folder) + { + $message[] = '

'; + } + } + // set multi install button + if ($add_multi_install) + { + $message[] = '

You can install all compiled extensions!

'; + $message[] = '

'; } - } - // set multi install button - if ($add_multi_install) - { - $message[] = '

You can install all compiled extensions!

'; - $message[] = '

'; } $message[] = '

Total time saved

'; $message[] = '
    '; @@ -203,7 +210,7 @@ class ComponentbuilderControllerCompiler extends AdminController $message[] = 'Module Path: ' . $module_path . '
    '; if (($pos = strpos($module_path, "/tmp/")) !== FALSE) { - $module_urls[$module_id] = JURI::root() . substr($module_path, $pos + 1); + $module_urls[$module_id] = \JUri::root() . substr($module_path, $pos + 1); $message[] = 'Module URL: ' . $module_urls[$module_id] . '
    '; } } @@ -219,7 +226,7 @@ class ComponentbuilderControllerCompiler extends AdminController $message[] = 'Plugin Path: ' . $plugin_path . '
    '; if (($pos = strpos($plugin_path, "/tmp/")) !== FALSE) { - $plugin_urls[$plugin_id] = JURI::root() . substr($plugin_path, $pos + 1); + $plugin_urls[$plugin_id] = \JUri::root() . substr($plugin_path, $pos + 1); $message[] = 'Plugin URL: ' . $plugin_urls[$plugin_id] . '
    '; } } @@ -304,18 +311,18 @@ class ComponentbuilderControllerCompiler extends AdminController public function installCompiledExtensions() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::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_THESE_EXTENSIONS'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THESE_EXTENSIONS'); // currently only those with admin access can install a component via JCB if($user->authorise('core.manage')) { - $message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_EXTENSIONS'); + $message = Text::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_EXTENSIONS'); $_message = array('success' => array(), 'error' => array()); - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // start file name array $fileNames = array(); $fileNames[] = $app->getUserState('com_componentbuilder.component_folder_name', null); @@ -335,11 +342,11 @@ class ComponentbuilderControllerCompiler extends AdminController { if ($this->installExtension($fileName)) { - $_message['success'][] = JText::sprintf('COM_COMPONENTBUILDER_SZIP_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileName); + $_message['success'][] = Text::sprintf('COM_COMPONENTBUILDER_SZIP_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileName); } else { - $_message['error'][] = JText::sprintf('COM_COMPONENTBUILDER_SZIP_COULD_NOT_BE_INSTALLED', $fileName); + $_message['error'][] = Text::sprintf('COM_COMPONENTBUILDER_SZIP_COULD_NOT_BE_INSTALLED', $fileName); } } // catch errors @@ -366,17 +373,17 @@ class ComponentbuilderControllerCompiler extends AdminController public function installCompiledComponent() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::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_COMPONENT'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_COMPONENT'); // currently only those with admin access can install a component via JCB if($user->authorise('core.manage')) { - $message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_COMPONENT'); - $app = JFactory::getApplication(); + $message = Text::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_COMPONENT'); + $app = Factory::getApplication(); $fileName = $app->getUserState('com_componentbuilder.component_folder_name'); // wipe out the user c-m-p since we are done with them all @@ -387,7 +394,7 @@ class ComponentbuilderControllerCompiler extends AdminController if ($this->installExtension($fileName)) { - $message = JText::sprintf('COM_COMPONENTBUILDER_ONLY_SZIP_FILE_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileName); + $message = Text::sprintf('COM_COMPONENTBUILDER_ONLY_SZIP_FILE_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileName); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -404,17 +411,17 @@ class ComponentbuilderControllerCompiler extends AdminController public function installCompiledModule() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::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'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_MODULE'); // currently only those with admin access can install a molule via JCB if($user->authorise('core.manage')) { - $message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_MODULE'); - $app = JFactory::getApplication(); + $message = Text::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_MODULE'); + $app = Factory::getApplication(); $fileNames = $app->getUserState('com_componentbuilder.modules_folder_name'); // wipe out the user c-m-p since we are done with them all @@ -423,13 +430,13 @@ class ComponentbuilderControllerCompiler extends AdminController $app->setUserState('com_componentbuilder.plugins_folder_name', ''); $app->setUserState('com_componentbuilder.success_message', ''); - if (ComponentbuilderHelper::checkArray($fileNames)) + if (UtilitiesArrayHelper::check($fileNames)) { - $jinput = JFactory::getApplication()->input; + $jinput = Factory::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]); + $message = Text::sprintf('COM_COMPONENTBUILDER_ONLY_SZIP_FILE_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileNames[$moduleId]); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -447,17 +454,17 @@ class ComponentbuilderControllerCompiler extends AdminController public function installCompiledPlugin() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::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_PLUGIN'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INSTALL_THE_PLUGIN'); // currently only those with admin access can install a plugin via JCB if($user->authorise('core.manage')) { - $message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_PLUGIN'); - $app = JFactory::getApplication(); + $message = Text::_('COM_COMPONENTBUILDER_COULD_NOT_INSTALL_PLUGIN'); + $app = Factory::getApplication(); $fileNames = $app->getUserState('com_componentbuilder.plugins_folder_name'); // wipe out the user c-m-p since we are done with them all @@ -466,13 +473,13 @@ class ComponentbuilderControllerCompiler extends AdminController $app->setUserState('com_componentbuilder.plugins_folder_name', ''); $app->setUserState('com_componentbuilder.success_message', ''); - if (ComponentbuilderHelper::checkArray($fileNames)) + if (UtilitiesArrayHelper::check($fileNames)) { - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $pluginId = $jinput->post->get('install_item_id', 0, 'INT'); if ($pluginId > 0 && isset($fileNames[$pluginId]) && $this->installExtension($fileNames[$pluginId])) { - $message = JText::sprintf('COM_COMPONENTBUILDER_ONLY_SZIP_FILE_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileNames[$pluginId]); + $message = Text::sprintf('COM_COMPONENTBUILDER_ONLY_SZIP_FILE_WAS_REMOVED_THE_FROM_TMP_FOLDER_DURING_INSTALLATION', $fileNames[$pluginId]); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -498,7 +505,7 @@ class ComponentbuilderControllerCompiler extends AdminController // set the language if not set if (!isset($this->_installer_lang)) { - $this->_installer_lang = JFactory::getLanguage(); + $this->_installer_lang = Factory::getLanguage(); $extension = 'com_installer'; $base_dir = JPATH_ADMINISTRATOR; $language_tag = 'en-GB'; @@ -506,7 +513,7 @@ class ComponentbuilderControllerCompiler extends AdminController $this->_installer_lang->load($extension, $base_dir, $language_tag, $reload); } // make sure we have a string - if (ComponentbuilderHelper::checkString($fileName)) + if (StringHelper::check($fileName)) { return $this->_compiler_model->install($fileName.'.zip'); } @@ -521,20 +528,20 @@ class ComponentbuilderControllerCompiler extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('compiler.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -543,7 +550,7 @@ class ComponentbuilderControllerCompiler extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -561,25 +568,25 @@ class ComponentbuilderControllerCompiler extends AdminController public function clearTmp() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); - $message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); + $message = Text::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER'); if($user->authorise('compiler.clear_tmp', 'com_componentbuilder') && $user->authorise('core.manage', 'com_componentbuilder')) { // get the model $model = $this->getModel('compiler'); // get tmp folder - $comConfig = JFactory::getConfig(); + $comConfig = Factory::getConfig(); $tmp = $comConfig->get('tmp_path'); if ($model->emptyFolder($tmp)) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB'); $this->setRedirect($redirect_url, $message, 'message'); // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // 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', ''); @@ -602,20 +609,20 @@ class ComponentbuilderControllerCompiler extends AdminController public function runTranslator() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=compiler', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=compiler', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_TRANSLATOR_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_TRANSLATOR_MODULE'); // check if this user has the right to run expansion if($user->authorise('compiler.run_translator', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_TRANSLATION_FAILED_SINCE_THERE_ARE_NO_COMPONENTS_LINKED_WITH_TRANSLATION_TOOLS'); + $message = Text::_('COM_COMPONENTBUILDER_TRANSLATION_FAILED_SINCE_THERE_ARE_NO_COMPONENTS_LINKED_WITH_TRANSLATION_TOOLS'); // run translator via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.translator'); + $result = ComponentbuilderHelper::getFileContents(Uri::root() . 'index.php?option=com_componentbuilder&task=api.translator'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { diff --git a/admin/controllers/component_admin_views.php b/admin/controllers/component_admin_views.php index 9547d38b6..849782168 100644 --- a/admin/controllers/component_admin_views.php +++ b/admin/controllers/component_admin_views.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_admin_views Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_admin_views extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_admin_views'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_admin_views extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_admin_views.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_admin_views extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_admin_views extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_admin_views extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_admin_views', '', array()); + $model = $this->getModel('Component_admin_views', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_admin_views' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_admin_views' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_admin_views extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_admin_views extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_admin_views extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_admin_views extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_config.php b/admin/controllers/component_config.php index 1f17b4a44..b2eda749d 100644 --- a/admin/controllers/component_config.php +++ b/admin/controllers/component_config.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_config Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_config extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_config'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_config extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_config.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_config extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_config extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_config extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_config', '', array()); + $model = $this->getModel('Component_config', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_config' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_config' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_config extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_config extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_config extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_config extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_config extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_config extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_custom_admin_menus.php b/admin/controllers/component_custom_admin_menus.php index b922f0bfc..984002456 100644 --- a/admin/controllers/component_custom_admin_menus.php +++ b/admin/controllers/component_custom_admin_menus.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_custom_admin_menus Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_custom_admin_menus'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_custom_admin_menus', '', array()); + $model = $this->getModel('Component_custom_admin_menus', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_custom_admin_menus' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_custom_admin_menus' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_custom_admin_menus extends FormControl * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_custom_admin_views.php b/admin/controllers/component_custom_admin_views.php index 250633a03..de68e7781 100644 --- a/admin/controllers/component_custom_admin_views.php +++ b/admin/controllers/component_custom_admin_views.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_custom_admin_views Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_custom_admin_views'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_custom_admin_views', '', array()); + $model = $this->getModel('Component_custom_admin_views', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_custom_admin_views' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_custom_admin_views' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_custom_admin_views extends FormControl * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_dashboard.php b/admin/controllers/component_dashboard.php index d8bb79183..64ad4706b 100644 --- a/admin/controllers/component_dashboard.php +++ b/admin/controllers/component_dashboard.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_dashboard Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_dashboard extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_dashboard'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_dashboard extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_dashboard.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_dashboard extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_dashboard extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_dashboard extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_dashboard', '', array()); + $model = $this->getModel('Component_dashboard', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_dashboard' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_dashboard' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_dashboard extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_dashboard extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_dashboard extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_dashboard extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_files_folders.php b/admin/controllers/component_files_folders.php index c647375e2..45aa98fe0 100644 --- a/admin/controllers/component_files_folders.php +++ b/admin/controllers/component_files_folders.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_files_folders Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_files_folders extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_files_folders'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_files_folders extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_files_folders.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_files_folders extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_files_folders extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_files_folders extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_files_folders', '', array()); + $model = $this->getModel('Component_files_folders', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_files_folders' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_files_folders' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_files_folders extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_files_folders extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_files_folders extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_files_folders extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_modules.php b/admin/controllers/component_modules.php index 7cbbb2097..39c166696 100644 --- a/admin/controllers/component_modules.php +++ b/admin/controllers/component_modules.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_modules Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_modules extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_modules extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_modules.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_modules extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_modules extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_modules extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_modules', '', array()); + $model = $this->getModel('Component_modules', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_modules' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_modules' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_modules extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_modules extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_modules extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_modules extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_modules extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_modules extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_mysql_tweaks.php b/admin/controllers/component_mysql_tweaks.php index 1b7ab9801..b15bc8f42 100644 --- a/admin/controllers/component_mysql_tweaks.php +++ b/admin/controllers/component_mysql_tweaks.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_mysql_tweaks Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_mysql_tweaks'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_mysql_tweaks', '', array()); + $model = $this->getModel('Component_mysql_tweaks', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_mysql_tweaks' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_mysql_tweaks' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_mysql_tweaks extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_placeholders.php b/admin/controllers/component_placeholders.php index bfb7a4ebe..6b0b6afbf 100644 --- a/admin/controllers/component_placeholders.php +++ b/admin/controllers/component_placeholders.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_placeholders Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_placeholders extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_placeholders'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_placeholders extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_placeholders.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_placeholders extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_placeholders extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_placeholders extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_placeholders', '', array()); + $model = $this->getModel('Component_placeholders', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_placeholders' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_placeholders' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_placeholders extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_placeholders extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_placeholders extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_placeholders extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_plugins.php b/admin/controllers/component_plugins.php index d3fa83894..90d60dda1 100644 --- a/admin/controllers/component_plugins.php +++ b/admin/controllers/component_plugins.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_plugins Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_plugins extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_plugins'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_plugins extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_plugins.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_plugins extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_plugins extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_plugins extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_plugins', '', array()); + $model = $this->getModel('Component_plugins', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_plugins' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_plugins' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_plugins extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_plugins extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_plugins extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_plugins extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_router.php b/admin/controllers/component_router.php new file mode 100644 index 000000000..6598f476c --- /dev/null +++ b/admin/controllers/component_router.php @@ -0,0 +1,329 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; + +/** + * Component_router Form Controller + */ +class ComponentbuilderControllerComponent_router extends FormController +{ + /** + * 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 = []) + { + $this->view_list = 'Components_routers'; // 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 = []) + { + // Get user object. + $user = Factory::getUser(); + // Access check. + $access = $user->authorise('component_router.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + + // In the absence of better information, revert to the component permissions. + return $user->authorise('component_router.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 = [], $key = 'id') + { + // get user object. + $user = Factory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('component_router.access', 'com_componentbuilder.component_router.' . (int) $recordId) && $user->authorise('component_router.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('component_router.edit', 'com_componentbuilder.component_router.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('component_router.edit.own', 'com_componentbuilder.component_router.' . $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_router.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('component_router.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) + { + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Component_router', '', []); + + // Preset the redirect + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_routers' . $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) && Uri::isInternal(base64_decode($return))) + { + $redirect = base64_decode($return); + + // Redirect to the return value. + $this->setRedirect( + Route::_( + $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( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + '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) && Uri::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( + Route::_( + $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( + Route::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view=' . (string) $this->ref; + + // Redirect to the list screen. + $this->setRedirect( + Route::_( + '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 BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) + { + return; + } +} diff --git a/admin/controllers/component_site_views.php b/admin/controllers/component_site_views.php index 3ecb3c6c5..8ea494663 100644 --- a/admin/controllers/component_site_views.php +++ b/admin/controllers/component_site_views.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Component_site_views Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerComponent_site_views extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_site_views'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerComponent_site_views extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_site_views.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerComponent_site_views extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerComponent_site_views extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerComponent_site_views extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_site_views', '', array()); + $model = $this->getModel('Component_site_views', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_site_views' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_site_views' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerComponent_site_views extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerComponent_site_views extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerComponent_site_views extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerComponent_site_views extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/component_updates.php b/admin/controllers/component_updates.php index dfd3b0b3d..6b6767be7 100644 --- a/admin/controllers/component_updates.php +++ b/admin/controllers/component_updates.php @@ -12,8 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -38,13 +45,13 @@ class ComponentbuilderControllerComponent_updates extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Components_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. @@ -53,10 +60,10 @@ class ComponentbuilderControllerComponent_updates extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('component_updates.access', 'com_componentbuilder'); if (!$access) @@ -78,10 +85,10 @@ class ComponentbuilderControllerComponent_updates extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -152,12 +159,12 @@ class ComponentbuilderControllerComponent_updates extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -174,13 +181,13 @@ class ComponentbuilderControllerComponent_updates extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Component_updates', '', array()); + $model = $this->getModel('Component_updates', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=components_updates' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=components_updates' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -205,13 +212,13 @@ class ComponentbuilderControllerComponent_updates extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -222,7 +229,7 @@ class ComponentbuilderControllerComponent_updates extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -233,7 +240,7 @@ class ComponentbuilderControllerComponent_updates extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -259,7 +266,7 @@ class ComponentbuilderControllerComponent_updates extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -277,29 +284,29 @@ class ComponentbuilderControllerComponent_updates extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -311,20 +318,20 @@ class ComponentbuilderControllerComponent_updates extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // update the component version to match the updated last version if (isset($validData['joomla_component']) && is_numeric($validData['joomla_component']) && $validData['joomla_component'] > 0) { // we must load the data (since if changed in the saved method, the $validData will not reflect this change) - if (($version_update = ComponentbuilderHelper::getVar( + if (($version_update = GetHelper::var( 'component_updates', $validData['joomla_component'], 'joomla_component', @@ -332,7 +339,7 @@ class ComponentbuilderControllerComponent_updates extends FormController { $version_update = json_decode($version_update, true); - $objectUpdate = new stdClass(); + $objectUpdate = new \stdClass(); $objectUpdate->id = (int) $validData['joomla_component']; if (UtilitiesArrayHelper::check($version_update) && ($component_version = end($version_update)['version']) @@ -343,12 +350,11 @@ class ComponentbuilderControllerComponent_updates extends FormController // be sure to update the table if we have a value if (isset($objectUpdate->component_version)) { - JFactory::getDbo()->updateObject('#__componentbuilder_joomla_component', $objectUpdate, 'id'); + Factory::getDbo()->updateObject('#__componentbuilder_joomla_component', $objectUpdate, 'id'); } } } return; } - } diff --git a/admin/controllers/componentbuilder.php b/admin/controllers/componentbuilder.php index 9c3e5cc7c..15f0eb8c7 100644 --- a/admin/controllers/componentbuilder.php +++ b/admin/controllers/componentbuilder.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Componentbuilder Admin Controller diff --git a/admin/controllers/components_admin_views.php b/admin/controllers/components_admin_views.php index fc6ed3241..849100b6e 100644 --- a/admin/controllers/components_admin_views.php +++ b/admin/controllers/components_admin_views.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_admin_views Admin Controller diff --git a/admin/controllers/components_config.php b/admin/controllers/components_config.php index 9209371e9..3a60bdb63 100644 --- a/admin/controllers/components_config.php +++ b/admin/controllers/components_config.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_config Admin Controller diff --git a/admin/controllers/components_custom_admin_menus.php b/admin/controllers/components_custom_admin_menus.php index effb4eea4..fc762a335 100644 --- a/admin/controllers/components_custom_admin_menus.php +++ b/admin/controllers/components_custom_admin_menus.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_custom_admin_menus Admin Controller diff --git a/admin/controllers/components_custom_admin_views.php b/admin/controllers/components_custom_admin_views.php index 8f5f7f0ca..5930a193e 100644 --- a/admin/controllers/components_custom_admin_views.php +++ b/admin/controllers/components_custom_admin_views.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_custom_admin_views Admin Controller diff --git a/admin/controllers/components_dashboard.php b/admin/controllers/components_dashboard.php index a968864f7..7fba49bae 100644 --- a/admin/controllers/components_dashboard.php +++ b/admin/controllers/components_dashboard.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_dashboard Admin Controller diff --git a/admin/controllers/components_files_folders.php b/admin/controllers/components_files_folders.php index 736d73283..ca0d9eaa4 100644 --- a/admin/controllers/components_files_folders.php +++ b/admin/controllers/components_files_folders.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_files_folders Admin Controller diff --git a/admin/controllers/components_modules.php b/admin/controllers/components_modules.php index 1269e6b7f..2177bf5cb 100644 --- a/admin/controllers/components_modules.php +++ b/admin/controllers/components_modules.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_modules Admin Controller diff --git a/admin/controllers/components_mysql_tweaks.php b/admin/controllers/components_mysql_tweaks.php index fd13fc84d..0b4022c63 100644 --- a/admin/controllers/components_mysql_tweaks.php +++ b/admin/controllers/components_mysql_tweaks.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_mysql_tweaks Admin Controller diff --git a/admin/controllers/components_placeholders.php b/admin/controllers/components_placeholders.php index e8c17eb5e..e795ec55e 100644 --- a/admin/controllers/components_placeholders.php +++ b/admin/controllers/components_placeholders.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_placeholders Admin Controller diff --git a/admin/controllers/components_plugins.php b/admin/controllers/components_plugins.php index b69af5fb3..5374ba57c 100644 --- a/admin/controllers/components_plugins.php +++ b/admin/controllers/components_plugins.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_plugins Admin Controller diff --git a/admin/controllers/components_routers.php b/admin/controllers/components_routers.php new file mode 100644 index 000000000..8dc0a851b --- /dev/null +++ b/admin/controllers/components_routers.php @@ -0,0 +1,50 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Controller\AdminController; +use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; + +/** + * Components_routers Admin Controller + */ +class ComponentbuilderControllerComponents_routers extends AdminController +{ + /** + * The prefix to use with controller messages. + * + * @var string + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER_COMPONENTS_ROUTERS'; + + /** + * 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_router', $prefix = 'ComponentbuilderModel', $config = array('ignore_request' => true)) + { + return parent::getModel($name, $prefix, $config); + } +} \ No newline at end of file diff --git a/admin/controllers/components_site_views.php b/admin/controllers/components_site_views.php index 118d38176..3b49a8a52 100644 --- a/admin/controllers/components_site_views.php +++ b/admin/controllers/components_site_views.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_site_views Admin Controller diff --git a/admin/controllers/components_updates.php b/admin/controllers/components_updates.php index 13d949a72..a48749ac1 100644 --- a/admin/controllers/components_updates.php +++ b/admin/controllers/components_updates.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Components_updates Admin Controller diff --git a/admin/controllers/custom_admin_view.php b/admin/controllers/custom_admin_view.php index f693798eb..8eea4f9d8 100644 --- a/admin/controllers/custom_admin_view.php +++ b/admin/controllers/custom_admin_view.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Custom_admin_view Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerCustom_admin_view extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Custom_admin_views'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerCustom_admin_view extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('custom_admin_view.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerCustom_admin_view extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerCustom_admin_view extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerCustom_admin_view extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Custom_admin_view', '', array()); + $model = $this->getModel('Custom_admin_view', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_admin_views' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerCustom_admin_view extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerCustom_admin_view extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerCustom_admin_view extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerCustom_admin_view extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/custom_admin_views.php b/admin/controllers/custom_admin_views.php index 7cc3ad9c5..d0cbb28d7 100644 --- a/admin/controllers/custom_admin_views.php +++ b/admin/controllers/custom_admin_views.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Custom_admin_views Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerCustom_admin_views extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('custom_admin_view.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerCustom_admin_views extends AdminController $model = $this->getModel('Custom_admin_views'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Custom_admin_views_'.$date->format('jS_F_Y'),'Custom admin views exported ('.$date->format('jS F, Y').')','custom admin views'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false), $message, 'error'); return; } @@ -78,41 +84,41 @@ class ComponentbuilderControllerCustom_admin_views extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('custom_admin_view.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Custom_admin_views'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('custom_admin_view_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'custom_admin_views'); $session->set('dataType_VDM_IMPORTINTO', 'custom_admin_view'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CUSTOM_ADMIN_VIEWS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CUSTOM_ADMIN_VIEWS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false), $message, 'error'); return; } public function getSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the import snippets custom admin view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false)); return; } } \ No newline at end of file diff --git a/admin/controllers/custom_code.php b/admin/controllers/custom_code.php index 8106c6d01..e36a7b905 100644 --- a/admin/controllers/custom_code.php +++ b/admin/controllers/custom_code.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Custom_code Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerCustom_code extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Custom_codes'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerCustom_code extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('custom_code.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerCustom_code extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerCustom_code extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerCustom_code extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Custom_code', '', array()); + $model = $this->getModel('Custom_code', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_codes' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_codes' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerCustom_code extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerCustom_code extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerCustom_code extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerCustom_code extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerCustom_code extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerCustom_code extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/custom_codes.php b/admin/controllers/custom_codes.php index 3e341a31d..efa3af237 100644 --- a/admin/controllers/custom_codes.php +++ b/admin/controllers/custom_codes.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -48,13 +54,13 @@ class ComponentbuilderControllerCustom_codes extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('custom_code.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -62,16 +68,16 @@ class ComponentbuilderControllerCustom_codes extends AdminController $model = $this->getModel('Custom_codes'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Custom_codes_'.$date->format('jS_F_Y'),'Custom codes exported ('.$date->format('jS F, Y').')','custom codes'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_codes', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_codes', false), $message, 'error'); return; } @@ -79,32 +85,32 @@ class ComponentbuilderControllerCustom_codes extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('custom_code.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Custom_codes'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('custom_code_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'custom_codes'); $session->set('dataType_VDM_IMPORTINTO', 'custom_code'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CUSTOM_CODES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_CUSTOM_CODES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_codes', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_codes', false), $message, 'error'); return; } @@ -117,20 +123,20 @@ class ComponentbuilderControllerCustom_codes extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=custom_codes', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=custom_codes', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('custom_codes.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -139,7 +145,7 @@ class ComponentbuilderControllerCustom_codes extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } diff --git a/admin/controllers/dynamic_get.php b/admin/controllers/dynamic_get.php index ef4873b20..2588bf32a 100644 --- a/admin/controllers/dynamic_get.php +++ b/admin/controllers/dynamic_get.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Dynamic_get Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerDynamic_get extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Dynamic_gets'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerDynamic_get extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('dynamic_get.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerDynamic_get extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerDynamic_get extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerDynamic_get extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Dynamic_get', '', array()); + $model = $this->getModel('Dynamic_get', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=dynamic_gets' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=dynamic_gets' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerDynamic_get extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerDynamic_get extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerDynamic_get extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerDynamic_get extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerDynamic_get extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerDynamic_get extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/dynamic_gets.php b/admin/controllers/dynamic_gets.php index d23bcf2bb..8c49894be 100644 --- a/admin/controllers/dynamic_gets.php +++ b/admin/controllers/dynamic_gets.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -48,13 +54,13 @@ class ComponentbuilderControllerDynamic_gets extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('dynamic_get.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -62,16 +68,16 @@ class ComponentbuilderControllerDynamic_gets extends AdminController $model = $this->getModel('Dynamic_gets'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Dynamic_gets_'.$date->format('jS_F_Y'),'Dynamic gets exported ('.$date->format('jS F, Y').')','dynamic gets'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=dynamic_gets', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false), $message, 'error'); return; } @@ -79,32 +85,32 @@ class ComponentbuilderControllerDynamic_gets extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('dynamic_get.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Dynamic_gets'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('dynamic_get_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'dynamic_gets'); $session->set('dataType_VDM_IMPORTINTO', 'dynamic_get'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_DYNAMIC_GETS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_DYNAMIC_GETS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=dynamic_gets', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=dynamic_gets', false), $message, 'error'); return; } @@ -117,20 +123,20 @@ class ComponentbuilderControllerDynamic_gets extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=dynamic_gets', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=dynamic_gets', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('dynamic_gets.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -139,7 +145,7 @@ class ComponentbuilderControllerDynamic_gets extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } diff --git a/admin/controllers/field.php b/admin/controllers/field.php index 18d96d5ab..29ddf3f36 100644 --- a/admin/controllers/field.php +++ b/admin/controllers/field.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Field Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerField extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Fields'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerField extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('field.access', 'com_componentbuilder'); if (!$access) @@ -76,9 +82,9 @@ class ComponentbuilderControllerField extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -149,12 +155,12 @@ class ComponentbuilderControllerField extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -171,13 +177,13 @@ class ComponentbuilderControllerField extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Field', '', array()); + $model = $this->getModel('Field', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fields' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fields' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -202,13 +208,13 @@ class ComponentbuilderControllerField extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -219,7 +225,7 @@ class ComponentbuilderControllerField extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -230,7 +236,7 @@ class ComponentbuilderControllerField extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -256,7 +262,7 @@ class ComponentbuilderControllerField extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -274,29 +280,29 @@ class ComponentbuilderControllerField extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -308,16 +314,15 @@ class ComponentbuilderControllerField extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/fields.php b/admin/controllers/fields.php index 3d07dbc8d..acaa65876 100644 --- a/admin/controllers/fields.php +++ b/admin/controllers/fields.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -48,13 +54,13 @@ class ComponentbuilderControllerFields extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('field.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -62,16 +68,16 @@ class ComponentbuilderControllerFields extends AdminController $model = $this->getModel('Fields'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Fields_'.$date->format('jS_F_Y'),'Fields exported ('.$date->format('jS F, Y').')','fields'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fields', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fields', false), $message, 'error'); return; } @@ -79,32 +85,32 @@ class ComponentbuilderControllerFields extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('field.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Fields'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('field_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'fields'); $session->set('dataType_VDM_IMPORTINTO', 'field'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fields', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fields', false), $message, 'error'); return; } @@ -117,20 +123,20 @@ class ComponentbuilderControllerFields extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=fields', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=fields', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('fields.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -139,7 +145,7 @@ class ComponentbuilderControllerFields extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } diff --git a/admin/controllers/fieldtype.php b/admin/controllers/fieldtype.php index 638f581a7..8823ffe89 100644 --- a/admin/controllers/fieldtype.php +++ b/admin/controllers/fieldtype.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Fieldtype Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerFieldtype extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Fieldtypes'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerFieldtype extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('fieldtype.access', 'com_componentbuilder'); if (!$access) @@ -76,9 +82,9 @@ class ComponentbuilderControllerFieldtype extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -149,12 +155,12 @@ class ComponentbuilderControllerFieldtype extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -171,13 +177,13 @@ class ComponentbuilderControllerFieldtype extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Fieldtype', '', array()); + $model = $this->getModel('Fieldtype', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fieldtypes' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fieldtypes' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -202,13 +208,13 @@ class ComponentbuilderControllerFieldtype extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -219,7 +225,7 @@ class ComponentbuilderControllerFieldtype extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -230,7 +236,7 @@ class ComponentbuilderControllerFieldtype extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -256,7 +262,7 @@ class ComponentbuilderControllerFieldtype extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -274,29 +280,29 @@ class ComponentbuilderControllerFieldtype extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -308,16 +314,15 @@ class ComponentbuilderControllerFieldtype extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/fieldtypes.php b/admin/controllers/fieldtypes.php index 07ce1f60f..aa23f161b 100644 --- a/admin/controllers/fieldtypes.php +++ b/admin/controllers/fieldtypes.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Fieldtypes Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerFieldtypes extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('fieldtype.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerFieldtypes extends AdminController $model = $this->getModel('Fieldtypes'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Fieldtypes_'.$date->format('jS_F_Y'),'Fieldtypes exported ('.$date->format('jS F, Y').')','fieldtypes'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerFieldtypes extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('fieldtype.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Fieldtypes'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('fieldtype_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'fieldtypes'); $session->set('dataType_VDM_IMPORTINTO', 'fieldtype'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDTYPES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDTYPES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=fieldtypes', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/get_snippets.php b/admin/controllers/get_snippets.php index 3761e39e9..ef8c41611 100644 --- a/admin/controllers/get_snippets.php +++ b/admin/controllers/get_snippets.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Get_snippets Admin Controller @@ -30,9 +34,9 @@ class ComponentbuilderControllerGet_snippets extends AdminController /** * Proxy for getModel. - * @since 2.5 + * @since 2.5 */ - public function getModel($name = 'Get_snippets', $prefix = 'ComponentbuilderModel', $config = array()) + public function getModel($name = 'Get_snippets', $prefix = 'ComponentbuilderModel', $config = []) { $model = parent::getModel($name, $prefix, array('ignore_request' => true)); @@ -41,61 +45,61 @@ class ComponentbuilderControllerGet_snippets extends AdminController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder', false)); return; } public function openLibraries() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the libraries - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=libraries', false)); return; } public function openSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the snippets - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false)); return; } public function openSiteViews() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the site views - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=site_views', false)); return; } public function openCustomAdminViews() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the custom admin views - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=custom_admin_views', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=custom_admin_views', false)); return; } public function openTemplates() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the templates - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=templates', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=templates', false)); return; } public function openLayouts() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the layouts - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=layouts', false)); return; } } diff --git a/admin/controllers/help.php b/admin/controllers/help.php index c917da3fa..185ce0acd 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -29,12 +32,12 @@ class ComponentbuilderControllerHelp extends BaseController public function help() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); - if($user->id != 0 && $token == $call_token) + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) { $task = $this->getTask(); switch($task){ @@ -62,7 +65,7 @@ class ComponentbuilderControllerHelp extends BaseController break; } } - else + else { // stop execution gracefully jexit(); @@ -71,8 +74,8 @@ class ComponentbuilderControllerHelp extends BaseController protected function getHelpDocumentText($id) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true); + $db = Factory::getDbo(); + $query = $db->getQuery(true); $query->select(array('a.title','a.content')); $query->from('#__componentbuilder_help_document AS a'); $query->where('a.id = '.(int) $id); @@ -81,21 +84,21 @@ class ComponentbuilderControllerHelp extends BaseController $db->execute(); if($db->getNumRows()) { - $text = array(); + $text = []; $document = $db->loadObject(); // fix image issue - $images['src="images'] = 'src="'.JURI::root().'images'; - $images["src='images"] = "src='".JURI::root()."images"; - $images['src="/images'] = 'src="'.JURI::root().'images'; - $images["src='/images"] = "src='".JURI::root()."images"; + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; // set document template $text[] = ""; $text[] = ''; $text[] = ""; $text[] = ''; $text[] = "".$document->title.""; - $text[] = ''; - $text[] = ''; + $text[] = ''; + $text[] = ''; $text[] = ""; $text[] = '
    '; $text[] = '
    '; diff --git a/admin/controllers/help_document.php b/admin/controllers/help_document.php index 07a4c41f9..c9d1c5f29 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Help_document Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerHelp_document extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Help_documents'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerHelp_document extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('help_document.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerHelp_document extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerHelp_document extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerHelp_document extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Help_document', '', array()); + $model = $this->getModel('Help_document', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=help_documents' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=help_documents' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerHelp_document extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerHelp_document extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerHelp_document extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerHelp_document extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerHelp_document extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerHelp_document extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/help_documents.php b/admin/controllers/help_documents.php index 21f3ffdd2..8d4157993 100644 --- a/admin/controllers/help_documents.php +++ b/admin/controllers/help_documents.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Help_documents Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerHelp_documents extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('help_document.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerHelp_documents extends AdminController $model = $this->getModel('Help_documents'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Help_documents_'.$date->format('jS_F_Y'),'Help documents exported ('.$date->format('jS F, Y').')','help documents'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=help_documents', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=help_documents', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerHelp_documents extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('help_document.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Help_documents'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('help_document_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'help_documents'); $session->set('dataType_VDM_IMPORTINTO', 'help_document'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=help_documents', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=help_documents', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 61cf94794..537e57eca 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -12,7 +12,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -28,21 +32,21 @@ class ComponentbuilderControllerImport extends BaseController public function import() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $model = $this->getModel('import'); if ($model->import()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $redirect_url = $app->getUserState('com_componentbuilder.redirect_url'); if (empty($redirect_url)) { - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=import', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=import', false); } else { diff --git a/admin/controllers/import_joomla_components.php b/admin/controllers/import_joomla_components.php index e3fb93ce6..cde528a4d 100644 --- a/admin/controllers/import_joomla_components.php +++ b/admin/controllers/import_joomla_components.php @@ -12,7 +12,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory; @@ -29,21 +33,21 @@ class ComponentbuilderControllerImport_joomla_components extends BaseController public function import() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $model = $this->getModel('Import_joomla_components'); if ($model->import()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $redirect_url = $app->getUserState('com_componentbuilder.redirect_url'); if (empty($redirect_url)) { - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=import_joomla_components', false); } else { diff --git a/admin/controllers/import_language_translations.php b/admin/controllers/import_language_translations.php index b01381ec9..c907d8efe 100644 --- a/admin/controllers/import_language_translations.php +++ b/admin/controllers/import_language_translations.php @@ -12,7 +12,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -28,21 +32,21 @@ class ComponentbuilderControllerImport_language_translations extends BaseControl public function import() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); $model = $this->getModel('Import_language_translations'); if ($model->import()) { - $cache = JFactory::getCache('mod_menu'); + $cache = Factory::getCache('mod_menu'); $cache->clean(); // TODO: Reset the users acl here as well to kill off any missing bits } - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $redirect_url = $app->getUserState('com_componentbuilder.redirect_url'); if (empty($redirect_url)) { - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=import_language_translations', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=import_language_translations', false); } else { diff --git a/admin/controllers/joomla_component.php b/admin/controllers/joomla_component.php index c5b5f3cbf..6283588d9 100644 --- a/admin/controllers/joomla_component.php +++ b/admin/controllers/joomla_component.php @@ -12,8 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Utilities\GetHelper; /** * Joomla_component Form Controller @@ -36,7 +43,7 @@ class ComponentbuilderControllerJoomla_component extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Joomla_components'; // safeguard for setting the return view listing to the main view. parent::__construct($config); @@ -45,29 +52,29 @@ class ComponentbuilderControllerJoomla_component extends FormController public function refresh() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('joomla_component.import_jcb_packages', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { - $session = JFactory::getSession(); + $session = Factory::getSession(); $session->set('backto_VDM_IMPORT', 'joomla_components'); $session->set('dataType_VDM_IMPORTINTO', 'smart_package'); // clear the session ComponentbuilderHelper::set('vdmGithubPackages', null); ComponentbuilderHelper::set('communityGithubPackages', null); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message); return; } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -76,10 +83,10 @@ class ComponentbuilderControllerJoomla_component extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_component.access', 'com_componentbuilder'); if (!$access) @@ -101,10 +108,10 @@ class ComponentbuilderControllerJoomla_component extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -175,12 +182,12 @@ class ComponentbuilderControllerJoomla_component extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -197,13 +204,13 @@ class ComponentbuilderControllerJoomla_component extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_component', '', array()); + $model = $this->getModel('Joomla_component', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -228,13 +235,13 @@ class ComponentbuilderControllerJoomla_component extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -245,7 +252,7 @@ class ComponentbuilderControllerJoomla_component extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -256,7 +263,7 @@ class ComponentbuilderControllerJoomla_component extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -282,7 +289,7 @@ class ComponentbuilderControllerJoomla_component extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -300,29 +307,29 @@ class ComponentbuilderControllerJoomla_component extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -334,14 +341,14 @@ class ComponentbuilderControllerJoomla_component extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // get the state object (Joomla\CMS\Object\CMSObject) $state = $model->get('state'); @@ -364,12 +371,13 @@ class ComponentbuilderControllerJoomla_component extends FormController 'component_dashboard' => 'joomla_component', 'component_files_folders' => 'joomla_component', 'component_placeholders' => 'joomla_component', - 'custom_code' => 'component' + 'custom_code' => 'component', + 'component_router' => 'joomla_component' ); foreach($_tablesArray as $_updateTable => $_key) { // get the linked ID - if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, $_key, 'id')) + if ($_value = GetHelper::var($_updateTable, $oldID, $_key, 'id')) { // copy fields to new linked table ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array($_key => $newID)); @@ -379,5 +387,4 @@ class ComponentbuilderControllerJoomla_component extends FormController return; } - } diff --git a/admin/controllers/joomla_components.php b/admin/controllers/joomla_components.php index e950b96dc..42091f0b5 100644 --- a/admin/controllers/joomla_components.php +++ b/admin/controllers/joomla_components.php @@ -12,13 +12,16 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use VDM\Joomla\Componentbuilder\Package\Factory as PackageFactory; -use VDM\Joomla\Utilities\ArrayHelper as JCBArrayHelper; -use VDM\Joomla\Utilities\StringHelper; -use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Joomla_components Admin Controller @@ -52,13 +55,13 @@ class ComponentbuilderControllerJoomla_components extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('joomla_component.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -66,16 +69,16 @@ class ComponentbuilderControllerJoomla_components extends AdminController $model = $this->getModel('Joomla_components'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Joomla_components_'.$date->format('jS_F_Y'),'Joomla components exported ('.$date->format('jS F, Y').')','joomla components'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } @@ -83,32 +86,32 @@ class ComponentbuilderControllerJoomla_components extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('joomla_component.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Joomla_components'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('joomla_component_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'joomla_components'); $session->set('dataType_VDM_IMPORTINTO', 'joomla_component'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_COMPONENTS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_COMPONENTS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import_joomla_components', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } @@ -121,20 +124,20 @@ class ComponentbuilderControllerJoomla_components extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('joomla_components.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -143,7 +146,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -161,25 +164,25 @@ class ComponentbuilderControllerJoomla_components extends AdminController public function clearTmp() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false); - $message = JText::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER'); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=joomla_components', false); + $message = Text::_('COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER'); if($user->authorise('joomla_components.clear_tmp', 'com_componentbuilder') && $user->authorise('core.manage', 'com_componentbuilder')) { // get the model $model = $this->getModel('compiler'); // get tmp folder - $comConfig = JFactory::getConfig(); + $comConfig = Factory::getConfig(); $tmp = $comConfig->get('tmp_path'); if ($model->emptyFolder($tmp)) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_TMP_FOLDER_HAS_BEEN_CLEAR_SUCCESSFULLYB'); $this->setRedirect($redirect_url, $message, 'message'); // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // 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', ''); @@ -196,44 +199,44 @@ class ComponentbuilderControllerJoomla_components extends AdminController public function smartImport() { // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('joomla_component.import_jcb_packages', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { - $session = JFactory::getSession(); + $session = Factory::getSession(); $session->set('backto_VDM_IMPORT', 'joomla_components'); $session->set('dataType_VDM_IMPORTINTO', 'smart_package'); // Redirect to import view. $message = Text::_('COM_COMPONENTBUILDER_YOU_CAN_NOW_SELECT_THE_COMPONENT_BZIPB_PACKAGE_YOU_WOULD_LIKE_TO_IMPORTBR_SMALLPLEASE_NOTE_THAT_SMART_COMPONENT_IMPORT_ONLY_WORKS_WITH_THE_FOLLOWING_FORMAT_BZIPBSMALL'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import_joomla_components&target=smartPackage', false), $message); return; } // Redirect to the list screen with error. $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_IMPORT_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } public function smartExport() { // Check for request forgeries - JSession::checkToken() or die(Text::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // Get the model $model = $this->getModel('Joomla_components'); // check if export is allowed for this user. - $model->user = JFactory::getUser(); + $model->user = Factory::getUser(); if ($model->user->authorise('joomla_component.export_jcb_packages', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - JArrayHelper::toInteger($pks); + ArrayHelper::toInteger($pks); // check if there is any selections if (!JCBArrayHelper::check($pks)) { // Redirect to the list screen with error. $message = Text::_('COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } // set auto loader @@ -268,8 +271,8 @@ class ComponentbuilderControllerJoomla_components extends AdminController // Redirect to the list screen with success. $message = array(); $message[] = '

    ' . Text::_('COM_COMPONENTBUILDER_EXPORT_COMPLETED') . '

    '; - $message[] = '

    ' . JText::sprintf('COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S', $model->zipPath, $keyNotice, $ownerDetails) . '

    '; - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode('', $message), 'Success'); + $message[] = '

    ' . Text::sprintf('COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S', $model->zipPath, $keyNotice, $ownerDetails) . '

    '; + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode('', $message), 'Success'); return; } else @@ -282,13 +285,13 @@ class ComponentbuilderControllerJoomla_components extends AdminController if (StringHelper::check($model->zipPath)) { // clear all if not successful - JFile::delete($model->zipPath); + File::delete($model->zipPath); } } } // Redirect to the list screen with error. $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED_PLEASE_TRY_AGAIN_LATTER'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } @@ -297,7 +300,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController // get params first if (!isset($this->params) || !ObjectHelper::check($this->params)) { - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); } // Get the model $model = componentbuilderHelper::getModel('joomla_components', JPATH_ADMINISTRATOR . '/components/com_componentbuilder'); @@ -313,83 +316,83 @@ class ComponentbuilderControllerJoomla_components extends AdminController // set auto loader ComponentbuilderHelper::autoLoader('smart'); // manual backup message - $backupNotice = array(); + $backupNotice = []; // get the data to export - if (JCBArrayHelper::check($pks) && $model->getSmartExport($pks)) + if (UtilitiesArrayHelper::check($pks) && $model->getSmartExport($pks)) { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY'); $backupNoticeStatus = 'Success'; // set the key string if (StringHelper::check($model->key) && strlen($model->key) == 32) { $textNotice = array(); - $keyNotice = '

    ' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '

    '; - $keyNotice .= '

    ' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '

    '; - $textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key); + $keyNotice = '

    ' . Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '

    '; + $keyNotice .= '

    ' . Text::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '

    '; + $textNotice[] = Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key); // set the package owner info if ((isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner']))) { - $ownerDetails = '

    ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '

    '; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); + $ownerDetails = '

    ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '

    '; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); $ownerDetails .= '
      '; if (isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) { - $ownerDetails .= '
    • ' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '
    • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']); + $ownerDetails .= '
    • ' . Text::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '
    • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']); } // add value only if set if (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner'])) { - $ownerDetails .= '
    • ' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '
    • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']); + $ownerDetails .= '
    • ' . Text::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '
    • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']); } // add value only if set if (isset($model->info['getKeyFrom']['website']) && StringHelper::check($model->info['getKeyFrom']['website'])) { - $ownerDetails .= '
    • ' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '
    • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']); + $ownerDetails .= '
    • ' . Text::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '
    • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']); } // add value only if set if (isset($model->info['getKeyFrom']['email']) && StringHelper::check($model->info['getKeyFrom']['email'])) { - $ownerDetails .= '
    • ' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '
    • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']); + $ownerDetails .= '
    • ' . Text::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '
    • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']); } // add value only if set if (isset($model->info['getKeyFrom']['license']) && StringHelper::check($model->info['getKeyFrom']['license'])) { - $ownerDetails .= '
    • ' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '
    • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']); + $ownerDetails .= '
    • ' . Text::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '
    • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']); } // add value only if set if (isset($model->info['getKeyFrom']['copyright']) && StringHelper::check($model->info['getKeyFrom']['copyright'])) { - $ownerDetails .= '
    • ' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '
    • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']); + $ownerDetails .= '
    • ' . Text::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '
    • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']); } $ownerDetails .= '
    '; - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET'); } else { - $ownerDetails = '

    ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '

    '; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); - $ownerDetails .= JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '
    '; - $textNotice[] = JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); - $ownerDetails .= '

    ' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '

    '; - $textNotice[] = '## ' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS'); - $ownerDetails .= JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '
    '; - $textNotice[] = JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT'); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); + $ownerDetails = '

    ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '

    '; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); + $ownerDetails .= Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '
    '; + $textNotice[] = Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); + $ownerDetails .= '

    ' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '

    '; + $textNotice[] = '## ' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS'); + $ownerDetails .= Text::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '
    '; + $textNotice[] = Text::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); } } else { - $keyNotice = '

    ' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '

    '; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY'); - $ownerDetails = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '
    '; - $textNotice[] = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); + $keyNotice = '

    ' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '

    '; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY'); + $ownerDetails = Text::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '
    '; + $textNotice[] = Text::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); } // get email if ($email = $this->params->get('backup_email', null)) @@ -403,20 +406,20 @@ class ComponentbuilderControllerJoomla_components extends AdminController // Build final massage. $message = $keyNotice . $ownerDetails . '
    HASH: ' . $hashTracker . ''; // set the subject - $subject = JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY'); + $subject = Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY'); // email the message componentbuilderEmail::send($email, $subject, componentbuilderEmail::setTableBody($message, $subject), $plainText, 1); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT'); } else { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED'); } } } else { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR'); $backupNoticeStatus = 'Error'; if (StringHelper::check($model->packagePath)) { @@ -426,7 +429,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController if (StringHelper::check($model->zipPath)) { // clear all if not successful - JFile::delete($model->zipPath); + File::delete($model->zipPath); } } // quite only if auto backup (adding this script from custom code :) @@ -434,45 +437,45 @@ class ComponentbuilderControllerJoomla_components extends AdminController { echo "# " . $backupNoticeStatus . "\n" .implode("\n", $backupNotice); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("
    ", $backupNotice), $backupNoticeStatus); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("
    ", $backupNotice), $backupNoticeStatus); return; } // quite only if auto backup (adding this script from custom code :) if ('backup' === $model->activeType) { - echo "# Error\n" . JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'); + echo "# Error\n" . Text::_('COM_COMPONENTBUILDER_ACCESS_DENIED'); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), Text::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); return; } public function cloner() { // Check for request forgeries - JSession::checkToken() or die(Text::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // Get the model $model = $this->getModel('Joomla_components'); // check if export is allowed for this user. - $model->user = JFactory::getUser(); + $model->user = Factory::getUser(); if ($model->user->authorise('joomla_component.clone', 'com_componentbuilder') && $model->user->authorise('core.copy', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - JArrayHelper::toInteger($pks); + ArrayHelper::toInteger($pks); // check if there is any selections if (!JCBArrayHelper::check($pks)) { // Redirect to the list screen with error. $message = Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_COMPONENT_AND_TRY_AGAIN'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } // only one component allowed at this time @@ -480,7 +483,7 @@ class ComponentbuilderControllerJoomla_components extends AdminController { // Redirect to the list screen with error. $message = Text::_('COM_COMPONENTBUILDER_ONLY_ONE_COMPONENT_CAN_BE_CLONED_AT_A_TIME_PLEASE_SELECT_ONE_AND_TRY_AGAIN'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } // set the active type @@ -490,24 +493,24 @@ class ComponentbuilderControllerJoomla_components extends AdminController { // clone was successful $message = Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message); return; } // Redirect to the list screen with error. $message = Text::_('COM_COMPONENTBUILDER_CLONE_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } // Redirect to the list screen with error. $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_CLONE_A_COMPONENT_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), $message, 'error'); return; } protected function getApiUser() { // admin area does not have API user, only front-end (so we fallback on login user) - return JFactory::getUser(); + return Factory::getUser(); } } \ No newline at end of file diff --git a/admin/controllers/joomla_module.php b/admin/controllers/joomla_module.php index 9c1a5636d..5d9744fc6 100644 --- a/admin/controllers/joomla_module.php +++ b/admin/controllers/joomla_module.php @@ -12,8 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Utilities\GetHelper; /** * Joomla_module Form Controller @@ -36,13 +43,13 @@ class ComponentbuilderControllerJoomla_module extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $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. @@ -51,10 +58,10 @@ class ComponentbuilderControllerJoomla_module extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_module.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +83,10 @@ class ComponentbuilderControllerJoomla_module extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +157,12 @@ class ComponentbuilderControllerJoomla_module extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +179,13 @@ class ComponentbuilderControllerJoomla_module extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_module', '', array()); + $model = $this->getModel('Joomla_module', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_modules' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +210,13 @@ class ComponentbuilderControllerJoomla_module extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +227,7 @@ class ComponentbuilderControllerJoomla_module extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +238,7 @@ class ComponentbuilderControllerJoomla_module extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +264,7 @@ class ComponentbuilderControllerJoomla_module extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +282,29 @@ class ComponentbuilderControllerJoomla_module extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,14 +316,14 @@ class ComponentbuilderControllerJoomla_module extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // get the state object (Joomla\CMS\Object\CMSObject) $state = $model->get('state'); @@ -335,7 +342,7 @@ class ComponentbuilderControllerJoomla_module extends FormController foreach($_tablesArray as $_updateTable => $_key) { // get the linked ID - if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, $_key, 'id')) + if ($_value = GetHelper::var($_updateTable, $oldID, $_key, 'id')) { // copy fields to new linked table ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array($_key => $newID)); @@ -346,5 +353,4 @@ class ComponentbuilderControllerJoomla_module extends FormController return; } - } diff --git a/admin/controllers/joomla_module_files_folders_urls.php b/admin/controllers/joomla_module_files_folders_urls.php index 403b2dab4..071c10a6b 100644 --- a/admin/controllers/joomla_module_files_folders_urls.php +++ b/admin/controllers/joomla_module_files_folders_urls.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Joomla_module_files_folders_urls Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_module_files_folders_urls.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_module_files_folders_urls', '', array()); + $model = $this->getModel('Joomla_module_files_folders_urls', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules_files_folders_urls' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_modules_files_folders_urls' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerJoomla_module_files_folders_urls extends FormCon * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/joomla_module_updates.php b/admin/controllers/joomla_module_updates.php index dcc8d6c5a..832fd538f 100644 --- a/admin/controllers/joomla_module_updates.php +++ b/admin/controllers/joomla_module_updates.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -38,13 +44,13 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $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. @@ -53,10 +59,10 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_module_updates.access', 'com_componentbuilder'); if (!$access) @@ -78,10 +84,10 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -152,12 +158,12 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -174,13 +180,13 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_module_updates', '', array()); + $model = $this->getModel('Joomla_module_updates', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules_updates' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_modules_updates' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -205,13 +211,13 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -222,7 +228,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -233,7 +239,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -259,7 +265,7 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -277,29 +283,29 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -311,19 +317,19 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // 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 = new \stdClass(); $objectUpdate->id = (int) $validData['joomla_plugin']; if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update']) && ($plugin_version = end($validData['version_update'])['version']) @@ -334,11 +340,10 @@ class ComponentbuilderControllerJoomla_module_updates extends FormController // be sure to update the table if we have a value if (isset($objectUpdate->plugin_version)) { - JFactory::getDbo()->updateObject('#__componentbuilder_joomla_plugin', $objectUpdate, 'id'); + Factory::getDbo()->updateObject('#__componentbuilder_joomla_plugin', $objectUpdate, 'id'); } } return; } - } diff --git a/admin/controllers/joomla_modules.php b/admin/controllers/joomla_modules.php index 4ba53b413..fe221da9f 100644 --- a/admin/controllers/joomla_modules.php +++ b/admin/controllers/joomla_modules.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Joomla_modules Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerJoomla_modules extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('joomla_module.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerJoomla_modules extends AdminController $model = $this->getModel('Joomla_modules'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Joomla_modules_'.$date->format('jS_F_Y'),'Joomla modules exported ('.$date->format('jS F, Y').')','joomla modules'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false), $message, 'error'); return; } @@ -78,41 +84,41 @@ class ComponentbuilderControllerJoomla_modules extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('joomla_module.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Joomla_modules'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('joomla_module_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'joomla_modules'); $session->set('dataType_VDM_IMPORTINTO', 'joomla_module'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_MODULES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_MODULES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_modules', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_modules', false), $message, 'error'); return; } public function getSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the import snippets custom admin view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false)); return; } } \ No newline at end of file diff --git a/admin/controllers/joomla_modules_files_folders_urls.php b/admin/controllers/joomla_modules_files_folders_urls.php index 27d9a53c6..35d70ba08 100644 --- a/admin/controllers/joomla_modules_files_folders_urls.php +++ b/admin/controllers/joomla_modules_files_folders_urls.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Joomla_modules_files_folders_urls Admin Controller diff --git a/admin/controllers/joomla_modules_updates.php b/admin/controllers/joomla_modules_updates.php index db28e620c..f51c39553 100644 --- a/admin/controllers/joomla_modules_updates.php +++ b/admin/controllers/joomla_modules_updates.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Joomla_modules_updates Admin Controller diff --git a/admin/controllers/joomla_plugin.php b/admin/controllers/joomla_plugin.php index 23639480f..2282b33da 100644 --- a/admin/controllers/joomla_plugin.php +++ b/admin/controllers/joomla_plugin.php @@ -12,8 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Utilities\GetHelper; /** * Joomla_plugin Form Controller @@ -36,13 +43,13 @@ class ComponentbuilderControllerJoomla_plugin extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Joomla_plugins'; // 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. @@ -51,10 +58,10 @@ class ComponentbuilderControllerJoomla_plugin extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_plugin.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +83,10 @@ class ComponentbuilderControllerJoomla_plugin extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +157,12 @@ class ComponentbuilderControllerJoomla_plugin extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +179,13 @@ class ComponentbuilderControllerJoomla_plugin extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_plugin', '', array()); + $model = $this->getModel('Joomla_plugin', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_plugins' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +210,13 @@ class ComponentbuilderControllerJoomla_plugin extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +227,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +238,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +264,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +282,29 @@ class ComponentbuilderControllerJoomla_plugin extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,14 +316,14 @@ class ComponentbuilderControllerJoomla_plugin extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // get the state object (Joomla\CMS\Object\CMSObject) $state = $model->get('state'); @@ -335,7 +342,7 @@ class ComponentbuilderControllerJoomla_plugin extends FormController foreach($_tablesArray as $_updateTable => $_key) { // get the linked ID - if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, $_key, 'id')) + if ($_value = GetHelper::var($_updateTable, $oldID, $_key, 'id')) { // copy fields to new linked table ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array($_key => $newID)); @@ -346,5 +353,4 @@ class ComponentbuilderControllerJoomla_plugin extends FormController return; } - } diff --git a/admin/controllers/joomla_plugin_files_folders_urls.php b/admin/controllers/joomla_plugin_files_folders_urls.php index 8953cfd21..e3c7e0897 100644 --- a/admin/controllers/joomla_plugin_files_folders_urls.php +++ b/admin/controllers/joomla_plugin_files_folders_urls.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Joomla_plugin_files_folders_urls Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Joomla_plugins_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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_plugin_files_folders_urls.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_plugin_files_folders_urls', '', array()); + $model = $this->getModel('Joomla_plugin_files_folders_urls', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins_files_folders_urls' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_plugins_files_folders_urls' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerJoomla_plugin_files_folders_urls extends FormCon * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/joomla_plugin_group.php b/admin/controllers/joomla_plugin_group.php index c2a179534..236866595 100644 --- a/admin/controllers/joomla_plugin_group.php +++ b/admin/controllers/joomla_plugin_group.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Joomla_plugin_group Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Joomla_plugin_groups'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_plugin_group.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -143,12 +149,12 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -165,13 +171,13 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_plugin_group', '', array()); + $model = $this->getModel('Joomla_plugin_group', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugin_groups' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_plugin_groups' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -196,13 +202,13 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -213,7 +219,7 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -224,7 +230,7 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -250,7 +256,7 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -268,29 +274,29 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -302,16 +308,15 @@ class ComponentbuilderControllerJoomla_plugin_group extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/joomla_plugin_groups.php b/admin/controllers/joomla_plugin_groups.php index 2961669d3..28fba99ac 100644 --- a/admin/controllers/joomla_plugin_groups.php +++ b/admin/controllers/joomla_plugin_groups.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Joomla_plugin_groups Admin Controller diff --git a/admin/controllers/joomla_plugin_updates.php b/admin/controllers/joomla_plugin_updates.php index be329f3a7..c2fed92dc 100644 --- a/admin/controllers/joomla_plugin_updates.php +++ b/admin/controllers/joomla_plugin_updates.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -38,13 +44,13 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Joomla_plugins_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. @@ -53,10 +59,10 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('joomla_plugin_updates.access', 'com_componentbuilder'); if (!$access) @@ -78,10 +84,10 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -152,12 +158,12 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -174,13 +180,13 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Joomla_plugin_updates', '', array()); + $model = $this->getModel('Joomla_plugin_updates', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins_updates' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_plugins_updates' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -205,13 +211,13 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -222,7 +228,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -233,7 +239,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -259,7 +265,7 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -277,29 +283,29 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -311,19 +317,19 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // 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 = new \stdClass(); $objectUpdate->id = (int) $validData['joomla_plugin']; if (isset($validData['version_update']) && UtilitiesArrayHelper::check($validData['version_update']) && ($plugin_version = end($validData['version_update'])['version']) @@ -334,11 +340,10 @@ class ComponentbuilderControllerJoomla_plugin_updates extends FormController // be sure to update the table if we have a value if (isset($objectUpdate->plugin_version)) { - JFactory::getDbo()->updateObject('#__componentbuilder_joomla_plugin', $objectUpdate, 'id'); + Factory::getDbo()->updateObject('#__componentbuilder_joomla_plugin', $objectUpdate, 'id'); } } return; } - } diff --git a/admin/controllers/joomla_plugins.php b/admin/controllers/joomla_plugins.php index 67c7ebc02..bdc218298 100644 --- a/admin/controllers/joomla_plugins.php +++ b/admin/controllers/joomla_plugins.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use VDM\Joomla\Utilities\StringHelper; /** @@ -54,20 +58,20 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('joomla_plugins.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -76,7 +80,7 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -94,24 +98,24 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController public function getBoilerplate() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=joomla_plugins', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_GET_BOILERPLATE_MODULE'); // check if this user has the right to run expansion if($user->authorise('joomla_plugin.get_boilerplate', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_FAILED_IF_THE_ISSUE_CONTINUES_INFORM_YOUR_SYSTEM_ADMINISTRATOR'); + $message = Text::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_FAILED_IF_THE_ISSUE_CONTINUES_INFORM_YOUR_SYSTEM_ADMINISTRATOR'); // Get the model $model = $this->getModel('joomla_plugins'); // check if there is any selections if (!$model->getBoilerplate()) { - $message = '' . JText::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_WAS_SUCCESSFULLY') . ''; + $message = '' . Text::_('COM_COMPONENTBUILDER_GETTING_JOOMLA_PLUGIN_BOILERPLATE_WAS_SUCCESSFULLY') . ''; $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -123,18 +127,18 @@ class ComponentbuilderControllerJoomla_plugins extends AdminController public function openClassMethods() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the libraries - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_methods', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_methods', false)); return; } public function openClassProperties() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the libraries - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=class_properties', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=class_properties', false)); return; } } \ No newline at end of file diff --git a/admin/controllers/joomla_plugins_files_folders_urls.php b/admin/controllers/joomla_plugins_files_folders_urls.php index fd9b6b0a3..b2dc26860 100644 --- a/admin/controllers/joomla_plugins_files_folders_urls.php +++ b/admin/controllers/joomla_plugins_files_folders_urls.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Joomla_plugins_files_folders_urls Admin Controller diff --git a/admin/controllers/joomla_plugins_updates.php b/admin/controllers/joomla_plugins_updates.php index b8a1a74e3..bfb00f0fe 100644 --- a/admin/controllers/joomla_plugins_updates.php +++ b/admin/controllers/joomla_plugins_updates.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Joomla_plugins_updates Admin Controller diff --git a/admin/controllers/language.php b/admin/controllers/language.php index 8c0547099..57dc4a8bb 100644 --- a/admin/controllers/language.php +++ b/admin/controllers/language.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Language Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerLanguage extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Languages'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerLanguage extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('language.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerLanguage extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerLanguage extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerLanguage extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Language', '', array()); + $model = $this->getModel('Language', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=languages' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerLanguage extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerLanguage extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerLanguage extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerLanguage extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerLanguage extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerLanguage extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/language_translation.php b/admin/controllers/language_translation.php index ead250d61..621a8ba84 100644 --- a/admin/controllers/language_translation.php +++ b/admin/controllers/language_translation.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Language_translation Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerLanguage_translation extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Language_translations'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerLanguage_translation extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('language_translation.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerLanguage_translation extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerLanguage_translation extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerLanguage_translation extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Language_translation', '', array()); + $model = $this->getModel('Language_translation', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=language_translations' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerLanguage_translation extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerLanguage_translation extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerLanguage_translation extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerLanguage_translation extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/language_translations.php b/admin/controllers/language_translations.php index 3298e2523..a2d9af457 100644 --- a/admin/controllers/language_translations.php +++ b/admin/controllers/language_translations.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Language_translations Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerLanguage_translations extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('language_translation.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerLanguage_translations extends AdminController $model = $this->getModel('Language_translations'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Language_translations_'.$date->format('jS_F_Y'),'Language translations exported ('.$date->format('jS F, Y').')','language translations'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerLanguage_translations extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('language_translation.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Language_translations'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('language_translation_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'language_translations'); $session->set('dataType_VDM_IMPORTINTO', 'language_translation'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import_language_translations', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import_language_translations', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/languages.php b/admin/controllers/languages.php index 78dbc782e..4da4d46a6 100644 --- a/admin/controllers/languages.php +++ b/admin/controllers/languages.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Languages Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerLanguages extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('language.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerLanguages extends AdminController $model = $this->getModel('Languages'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Languages_'.$date->format('jS_F_Y'),'Languages exported ('.$date->format('jS F, Y').')','languages'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error'); return; } @@ -78,41 +84,41 @@ class ComponentbuilderControllerLanguages extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('language.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Languages'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('language_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'languages'); $session->set('dataType_VDM_IMPORTINTO', 'language'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error'); return; } public function buildLanguages() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); if($user->authorise('core.create', 'com_componentbuilder')) { // get the model @@ -120,16 +126,16 @@ class ComponentbuilderControllerLanguages extends AdminController if ($model->buildLanguages()) { // set success message - $message = '

    '.JText::_('COM_COMPONENTBUILDER_IMPORT_SUCCESS').'

    '; - $message .= '

    '.JText::_('COM_COMPONENTBUILDER_ALL_THE_LANGUAGES_FOUND_IN_JOOMLA_WERE_SUCCESSFULLY_IMPORTED').'

    '; + $message = '

    '.Text::_('COM_COMPONENTBUILDER_IMPORT_SUCCESS').'

    '; + $message .= '

    '.Text::_('COM_COMPONENTBUILDER_ALL_THE_LANGUAGES_FOUND_IN_JOOMLA_WERE_SUCCESSFULLY_IMPORTED').'

    '; // set redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=languages', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=languages', false); $this->setRedirect($redirect_url, $message); return true; } } // set redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=languages', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=languages', false); $this->setRedirect($redirect_url); return false; } diff --git a/admin/controllers/layout.php b/admin/controllers/layout.php index f10b523b8..b3acdcc5a 100644 --- a/admin/controllers/layout.php +++ b/admin/controllers/layout.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Layout Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerLayout extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Layouts'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerLayout extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('layout.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerLayout extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerLayout extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerLayout extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Layout', '', array()); + $model = $this->getModel('Layout', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=layouts' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerLayout extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerLayout extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerLayout extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerLayout extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerLayout extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerLayout extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/layouts.php b/admin/controllers/layouts.php index 424d4f05a..518c0fe03 100644 --- a/admin/controllers/layouts.php +++ b/admin/controllers/layouts.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Layouts Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerLayouts extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('layout.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerLayouts extends AdminController $model = $this->getModel('Layouts'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Layouts_'.$date->format('jS_F_Y'),'Layouts exported ('.$date->format('jS F, Y').')','layouts'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=layouts', false), $message, 'error'); return; } @@ -78,41 +84,41 @@ class ComponentbuilderControllerLayouts extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('layout.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Layouts'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('layout_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'layouts'); $session->set('dataType_VDM_IMPORTINTO', 'layout'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LAYOUTS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LAYOUTS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=layouts', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=layouts', false), $message, 'error'); return; } public function getSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the import snippets custom admin view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false)); return; } } \ No newline at end of file diff --git a/admin/controllers/libraries.php b/admin/controllers/libraries.php index 65f8a664b..40bb378f2 100644 --- a/admin/controllers/libraries.php +++ b/admin/controllers/libraries.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Libraries Admin Controller @@ -47,9 +51,9 @@ class ComponentbuilderControllerLibraries extends AdminController public function getSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the import snippets custom admin view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false)); return; } } \ No newline at end of file diff --git a/admin/controllers/libraries_config.php b/admin/controllers/libraries_config.php index ee88d885c..12ea4ecae 100644 --- a/admin/controllers/libraries_config.php +++ b/admin/controllers/libraries_config.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Libraries_config Admin Controller diff --git a/admin/controllers/libraries_files_folders_urls.php b/admin/controllers/libraries_files_folders_urls.php index 0b3b88967..66f309580 100644 --- a/admin/controllers/libraries_files_folders_urls.php +++ b/admin/controllers/libraries_files_folders_urls.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Libraries_files_folders_urls Admin Controller diff --git a/admin/controllers/library.php b/admin/controllers/library.php index 3378e079b..19befdc49 100644 --- a/admin/controllers/library.php +++ b/admin/controllers/library.php @@ -12,8 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Utilities\GetHelper; /** * Library Form Controller @@ -36,13 +43,13 @@ class ComponentbuilderControllerLibrary extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Libraries'; // 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. @@ -51,10 +58,10 @@ class ComponentbuilderControllerLibrary extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('library.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +83,10 @@ class ComponentbuilderControllerLibrary extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +157,12 @@ class ComponentbuilderControllerLibrary extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +179,13 @@ class ComponentbuilderControllerLibrary extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Library', '', array()); + $model = $this->getModel('Library', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=libraries' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +210,13 @@ class ComponentbuilderControllerLibrary extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +227,7 @@ class ComponentbuilderControllerLibrary extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +238,7 @@ class ComponentbuilderControllerLibrary extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +264,7 @@ class ComponentbuilderControllerLibrary extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +282,29 @@ class ComponentbuilderControllerLibrary extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,14 +316,14 @@ class ComponentbuilderControllerLibrary extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { // get the state object (Joomla\CMS\Object\CMSObject) $state = $model->get('state'); @@ -335,7 +342,7 @@ class ComponentbuilderControllerLibrary extends FormController foreach($_tablesArray as $_updateTable) { // get the linked ID - if ($_value = ComponentbuilderHelper::getVar($_updateTable, $oldID, 'library', 'id')) + if ($_value = GetHelper::var($_updateTable, $oldID, 'library', 'id')) { // copy fields to new linked table ComponentbuilderHelper::copyItem(/*id->*/ $_value, /*table->*/ $_updateTable, /*change->*/ array('library' => $newID)); @@ -345,5 +352,4 @@ class ComponentbuilderControllerLibrary extends FormController return; } - } diff --git a/admin/controllers/library_config.php b/admin/controllers/library_config.php index ad2c27e2b..9a6d06398 100644 --- a/admin/controllers/library_config.php +++ b/admin/controllers/library_config.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Library_config Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerLibrary_config extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Libraries_config'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerLibrary_config extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('library_config.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerLibrary_config extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerLibrary_config extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerLibrary_config extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Library_config', '', array()); + $model = $this->getModel('Library_config', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries_config' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=libraries_config' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerLibrary_config extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerLibrary_config extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerLibrary_config extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerLibrary_config extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerLibrary_config extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerLibrary_config extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/library_files_folders_urls.php b/admin/controllers/library_files_folders_urls.php index 593f4d980..635ac12ea 100644 --- a/admin/controllers/library_files_folders_urls.php +++ b/admin/controllers/library_files_folders_urls.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Library_files_folders_urls Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Libraries_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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('library_files_folders_urls.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Library_files_folders_urls', '', array()); + $model = $this->getModel('Library_files_folders_urls', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=libraries_files_folders_urls' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=libraries_files_folders_urls' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerLibrary_files_folders_urls extends FormControlle * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/placeholder.php b/admin/controllers/placeholder.php index dc841ef33..f0cb767aa 100644 --- a/admin/controllers/placeholder.php +++ b/admin/controllers/placeholder.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Placeholder Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerPlaceholder extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Placeholders'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerPlaceholder extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('placeholder.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerPlaceholder extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerPlaceholder extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerPlaceholder extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Placeholder', '', array()); + $model = $this->getModel('Placeholder', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=placeholders' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=placeholders' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerPlaceholder extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerPlaceholder extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerPlaceholder extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerPlaceholder extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerPlaceholder extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerPlaceholder extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/placeholders.php b/admin/controllers/placeholders.php index d59a5cfc1..f55a0fed3 100644 --- a/admin/controllers/placeholders.php +++ b/admin/controllers/placeholders.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Placeholders Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerPlaceholders extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('placeholder.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerPlaceholders extends AdminController $model = $this->getModel('Placeholders'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Placeholders_'.$date->format('jS_F_Y'),'Placeholders exported ('.$date->format('jS F, Y').')','placeholders'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=placeholders', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=placeholders', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerPlaceholders extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('placeholder.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Placeholders'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('placeholder_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'placeholders'); $session->set('dataType_VDM_IMPORTINTO', 'placeholder'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_PLACEHOLDERS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_PLACEHOLDERS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=placeholders', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=placeholders', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/power.php b/admin/controllers/power.php index 4b4ebadad..bec57a81d 100644 --- a/admin/controllers/power.php +++ b/admin/controllers/power.php @@ -12,9 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Componentbuilder\Power\Factory; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use VDM\Joomla\Componentbuilder\Power\Factory as PowerFactory; /** * Power Form Controller @@ -37,7 +43,7 @@ class ComponentbuilderControllerPower extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Powers'; // safeguard for setting the return view listing to the main view. parent::__construct($config); @@ -46,17 +52,17 @@ class ComponentbuilderControllerPower extends FormController public function resetPowers() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // get Item posted $item = $this->input->post->get('jform', array(), 'array'); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set default error message - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '

    '; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_POWER') . '

    '; + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '

    '; + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_THIS_POWER') . '

    '; $status = 'error'; $success = false; @@ -68,28 +74,28 @@ class ComponentbuilderControllerPower extends FormController if ($id === null || $guid === null) { // set error message - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_NOT_SAVED') . '

    '; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '

    '; + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_NOT_SAVED') . '

    '; + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_YOU_MUST_FIRST_SAVE_THE_POWER_BEFORE_YOU_CAN_USE_THIS_FEATURE') . '

    '; } elseif($user->authorise('power.reset', 'com_componentbuilder')) { - if (Factory::_('Superpower')->reset([$guid])) + if (PowerFactory::_('Superpower')->reset([$guid])) { // set success message - $message = '

    '.JText::_('COM_COMPONENTBUILDER_SUCCESS').'

    '; - $message .= '

    '.JText::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'

    '; + $message = '

    '.Text::_('COM_COMPONENTBUILDER_SUCCESS').'

    '; + $message .= '

    '.Text::_('COM_COMPONENTBUILDER_THE_POWER_HAS_SUCCESSFULLY_BEEN_RESET').'

    '; $status = 'success'; $success = true; } else { - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_RESET_FAILED') . '

    '; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED') . '

    '; + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_RESET_FAILED') . '

    '; + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_THE_RESET_OF_THIS_POWER_HAS_FAILED') . '

    '; } } // set redirect - $redirect_url = \JRoute::_( + $redirect_url = Route::_( 'index.php?option=com_componentbuilder&view=power' . $this->getRedirectToItemAppend($id), $success ); @@ -99,7 +105,7 @@ class ComponentbuilderControllerPower extends FormController return $success; } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -108,10 +114,10 @@ class ComponentbuilderControllerPower extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('power.access', 'com_componentbuilder'); if (!$access) @@ -133,10 +139,10 @@ class ComponentbuilderControllerPower extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -207,12 +213,12 @@ class ComponentbuilderControllerPower extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -229,13 +235,13 @@ class ComponentbuilderControllerPower extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Power', '', array()); + $model = $this->getModel('Power', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=powers' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=powers' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -260,13 +266,13 @@ class ComponentbuilderControllerPower extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -277,7 +283,7 @@ class ComponentbuilderControllerPower extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -288,7 +294,7 @@ class ComponentbuilderControllerPower extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -314,7 +320,7 @@ class ComponentbuilderControllerPower extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -332,29 +338,29 @@ class ComponentbuilderControllerPower extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -366,16 +372,15 @@ class ComponentbuilderControllerPower extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/powers.php b/admin/controllers/powers.php index c7eac403a..14beb09e3 100644 --- a/admin/controllers/powers.php +++ b/admin/controllers/powers.php @@ -12,10 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Componentbuilder\Power\Factory; +use VDM\Joomla\Componentbuilder\Power\Factory as PowerFactory; /** * Powers Admin Controller @@ -55,20 +59,20 @@ class ComponentbuilderControllerPowers extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=powers', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('powers.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -77,7 +81,7 @@ class ComponentbuilderControllerPowers extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } @@ -89,37 +93,37 @@ class ComponentbuilderControllerPowers extends AdminController public function initPowers() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set default error message - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '

    '; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_POWERS') . '

    '; + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_PERMISSION_DENIED') . '

    '; + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_INITIALIZE_POWERS') . '

    '; $status = 'error'; $success = false; if($user->authorise('power.init', 'com_componentbuilder')) { - if (Factory::_('Superpower')->init()) + if (PowerFactory::_('Superpower')->init()) { // set success message - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_POWERS') . '

    '; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '

    '; + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_SUCCESSFULLY_INITIALIZED_ALL_REMOTE_POWERS') . '

    '; + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_THE_LOCAL_DATABASE_POWERS_HAS_SUCCESSFULLY_BEEN_SYNCED_WITH_THE_REMOTE_REPOSITORIES') . '

    '; $status = 'success'; $success = true; } else { - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '

    '; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED') . '

    '; + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_INITIALIZATION_FAILED') . '

    '; + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_THE_INITIALIZATION_OF_THIS_POWERS_HAS_FAILED') . '

    '; } } // set redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', $success); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', $success); $this->setRedirect($redirect_url, $message, $status); return $success; @@ -128,40 +132,40 @@ class ComponentbuilderControllerPowers extends AdminController public function resetPowers() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // get IDS of the selected powers $pks = $this->input->post->get('cid', [], 'array'); // Sanitize the input - JArrayHelper::toInteger($pks); + ArrayHelper::toInteger($pks); // check if there is any selections if ($pks == []) { // set error message - $message = '

    '.JText::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'

    '; - $message .= '

    '.JText::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'

    '; + $message = '

    '.Text::_('COM_COMPONENTBUILDER_NO_SELECTION_DETECTED').'

    '; + $message .= '

    '.Text::_('COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST').'

    '; // set redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false); $this->setRedirect($redirect_url, $message, 'error'); return false; } // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); if($user->authorise('power.reset', 'com_componentbuilder')) { // set success message - $message = '

    '.JText::_('COM_COMPONENTBUILDER_THIS_RESET_FEATURE_IS_STILL_UNDER_DEVELOPMENT').'

    '; - $message .= '

    '.JText::sprintf('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA', '').'

    '; + $message = '

    '.Text::_('COM_COMPONENTBUILDER_THIS_RESET_FEATURE_IS_STILL_UNDER_DEVELOPMENT').'

    '; + $message .= '

    '.Text::sprintf('COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA', '').'

    '; // set redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false); $this->setRedirect($redirect_url, $message); return true; } // set redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=powers', false); + $redirect_url = Route::_('index.php?option=com_componentbuilder&view=powers', false); $this->setRedirect($redirect_url); return false; } diff --git a/admin/controllers/search.php b/admin/controllers/search.php index 041c25ecd..0a2009ebc 100644 --- a/admin/controllers/search.php +++ b/admin/controllers/search.php @@ -12,7 +12,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -27,16 +31,16 @@ class ComponentbuilderControllerSearch extends BaseController public function dashboard() { - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder', false)); return; } public function openCompiler() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the libraries - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=compiler', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=compiler', false)); return; } } diff --git a/admin/controllers/server.php b/admin/controllers/server.php index fe4552756..146952d2f 100644 --- a/admin/controllers/server.php +++ b/admin/controllers/server.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Server Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerServer extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Servers'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerServer extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('server.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerServer extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerServer extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerServer extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Server', '', array()); + $model = $this->getModel('Server', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=servers' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=servers' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerServer extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerServer extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerServer extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerServer extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerServer extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerServer extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/servers.php b/admin/controllers/servers.php index d18d9b162..64bdcb258 100644 --- a/admin/controllers/servers.php +++ b/admin/controllers/servers.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Servers Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerServers extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('server.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerServers extends AdminController $model = $this->getModel('Servers'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Servers_'.$date->format('jS_F_Y'),'Servers exported ('.$date->format('jS F, Y').')','servers'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=servers', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=servers', false), $message, 'error'); return; } @@ -78,32 +84,32 @@ class ComponentbuilderControllerServers extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('server.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Servers'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('server_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'servers'); $session->set('dataType_VDM_IMPORTINTO', 'server'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SERVERS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SERVERS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=servers', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=servers', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/site_view.php b/admin/controllers/site_view.php index 902fab2ef..34ee5d62f 100644 --- a/admin/controllers/site_view.php +++ b/admin/controllers/site_view.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Site_view Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerSite_view extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Site_views'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerSite_view extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('site_view.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerSite_view extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerSite_view extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerSite_view extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Site_view', '', array()); + $model = $this->getModel('Site_view', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=site_views' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerSite_view extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerSite_view extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerSite_view extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerSite_view extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerSite_view extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerSite_view extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/site_views.php b/admin/controllers/site_views.php index 1816faab1..c98a8db08 100644 --- a/admin/controllers/site_views.php +++ b/admin/controllers/site_views.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Site_views Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerSite_views extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('site_view.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerSite_views extends AdminController $model = $this->getModel('Site_views'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Site_views_'.$date->format('jS_F_Y'),'Site views exported ('.$date->format('jS F, Y').')','site views'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=site_views', false), $message, 'error'); return; } @@ -78,41 +84,41 @@ class ComponentbuilderControllerSite_views extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('site_view.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Site_views'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('site_view_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'site_views'); $session->set('dataType_VDM_IMPORTINTO', 'site_view'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SITE_VIEWS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SITE_VIEWS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=site_views', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=site_views', false), $message, 'error'); return; } public function getSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the import snippets custom admin view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false)); return; } } \ No newline at end of file diff --git a/admin/controllers/snippet.php b/admin/controllers/snippet.php index 914cf7a12..23aeb0363 100644 --- a/admin/controllers/snippet.php +++ b/admin/controllers/snippet.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Snippet Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerSnippet extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Snippets'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerSnippet extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('snippet.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerSnippet extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerSnippet extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerSnippet extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Snippet', '', array()); + $model = $this->getModel('Snippet', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerSnippet extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerSnippet extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerSnippet extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerSnippet extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerSnippet extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerSnippet extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/snippet_type.php b/admin/controllers/snippet_type.php index b94c8a784..a9f3be233 100644 --- a/admin/controllers/snippet_type.php +++ b/admin/controllers/snippet_type.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Snippet_type Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerSnippet_type extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Snippet_types'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerSnippet_type extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('snippet_type.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerSnippet_type extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerSnippet_type extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerSnippet_type extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Snippet_type', '', array()); + $model = $this->getModel('Snippet_type', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippet_types' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippet_types' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerSnippet_type extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerSnippet_type extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerSnippet_type extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerSnippet_type extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerSnippet_type extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerSnippet_type extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/snippet_types.php b/admin/controllers/snippet_types.php index 5efe65113..6d24ce438 100644 --- a/admin/controllers/snippet_types.php +++ b/admin/controllers/snippet_types.php @@ -12,8 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; /** * Snippet_types Admin Controller diff --git a/admin/controllers/snippets.php b/admin/controllers/snippets.php index e0fe12a80..8bf46a20c 100644 --- a/admin/controllers/snippets.php +++ b/admin/controllers/snippets.php @@ -12,9 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Snippets Admin Controller @@ -48,13 +53,13 @@ class ComponentbuilderControllerSnippets extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('snippet.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -62,16 +67,16 @@ class ComponentbuilderControllerSnippets extends AdminController $model = $this->getModel('Snippets'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Snippets_'.$date->format('jS_F_Y'),'Snippets exported ('.$date->format('jS F, Y').')','snippets'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); return; } @@ -79,56 +84,56 @@ class ComponentbuilderControllerSnippets extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('snippet.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Snippets'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('snippet_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'snippets'); $session->set('dataType_VDM_IMPORTINTO', 'snippet'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SNIPPETS'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SNIPPETS'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); return; } public function getSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the import snippets custom admin view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false)); return; } public function shareSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // Get the model $model = $this->getModel('snippets'); // check if import is allowed for this user. - $model->user = JFactory::getUser(); + $model->user = Factory::getUser(); if ($model->user->authorise('snippet.import', 'com_componentbuilder') && $model->user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input JArrayHelper::toInteger($pks); @@ -136,8 +141,8 @@ class ComponentbuilderControllerSnippets extends AdminController if (!UtilitiesArrayHelper::check($pks)) { // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_NO_SNIPPETS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_NO_SNIPPETS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); return; } // set auto loader @@ -148,36 +153,36 @@ class ComponentbuilderControllerSnippets extends AdminController // Message of successful build if (count($pks) > 1) { - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED') . '

    '; - $message .= '

    ' . JText::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THESE_SNIPPETS_WITH_THE_REST_OF_THE_JCB_COMMUNITY'); + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_THE_SNIPPETS_WERE_SUCCESSFULLY_EXPORTED') . '

    '; + $message .= '

    ' . Text::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THESE_SNIPPETS_WITH_THE_REST_OF_THE_JCB_COMMUNITY'); } else { - $message = '

    ' . JText::_('COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED') . '

    '; - $message .= '

    ' . JText::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THIS_SNIPPET_WITH_THE_REST_OF_THE_JCB_COMMUNITY'); + $message = '

    ' . Text::_('COM_COMPONENTBUILDER_THE_SNIPPET_WAS_SUCCESSFULLY_EXPORTED') . '

    '; + $message .= '

    ' . Text::sprintf('COM_COMPONENTBUILDER_TO_SHARE_THIS_SNIPPET_WITH_THE_REST_OF_THE_JCB_COMMUNITY'); } - $message .= JText::sprintf('COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB', + $message .= Text::sprintf('COM_COMPONENTBUILDER_YOU_WILL_NEED_TO_KNOW_HOW_S_WORKS_BASIC_YOU_WILL_ALSO_NEED_A_S_ACCOUNT_AND_KNOW_HOW_TO_MAKE_A_PULL_REQUEST_ON_GITHUB', 'git', 'github.com') . '

    '; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_NEED_HELP') . '

    '; + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_NEED_HELP') . '

    '; $message .= ''; - $message .= '

    ' . JText::_('COM_COMPONENTBUILDER_ZIPPED_FILE_LOCATION') . '

    '; - $message .= '

    ' . JText::sprintf('COM_COMPONENTBUILDER_PATH_CODESCODE', $model->zipPath). '

    '; - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false), $message); + $message .= '

    ' . Text::_('COM_COMPONENTBUILDER_ZIPPED_FILE_LOCATION') . '

    '; + $message .= '

    ' . Text::sprintf('COM_COMPONENTBUILDER_PATH_CODESCODE', $model->zipPath). '

    '; + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_SHARE_THE_SNIPPETS_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_SHARE_THE_SNIPPETS_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=snippets', false), $message, 'error'); return; } } \ No newline at end of file diff --git a/admin/controllers/template.php b/admin/controllers/template.php index 619dd4ccb..b8aca99e2 100644 --- a/admin/controllers/template.php +++ b/admin/controllers/template.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Template Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerTemplate extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Templates'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerTemplate extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('template.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerTemplate extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerTemplate extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerTemplate extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Template', '', array()); + $model = $this->getModel('Template', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=templates' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=templates' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerTemplate extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerTemplate extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerTemplate extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerTemplate extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerTemplate extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerTemplate extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/templates.php b/admin/controllers/templates.php index eaa9eba37..2bf65c8e1 100644 --- a/admin/controllers/templates.php +++ b/admin/controllers/templates.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; /** * Templates Admin Controller @@ -47,13 +53,13 @@ class ComponentbuilderControllerTemplates extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('template.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -61,16 +67,16 @@ class ComponentbuilderControllerTemplates extends AdminController $model = $this->getModel('Templates'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Templates_'.$date->format('jS_F_Y'),'Templates exported ('.$date->format('jS F, Y').')','templates'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=templates', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=templates', false), $message, 'error'); return; } @@ -78,41 +84,41 @@ class ComponentbuilderControllerTemplates extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('template.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Templates'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('template_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'templates'); $session->set('dataType_VDM_IMPORTINTO', 'template'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_TEMPLATES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_TEMPLATES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=templates', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=templates', false), $message, 'error'); return; } public function getSnippets() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // redirect to the import snippets custom admin view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=get_snippets', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=get_snippets', false)); return; } } \ No newline at end of file diff --git a/admin/controllers/validation_rule.php b/admin/controllers/validation_rule.php index e1dba43ac..638eee596 100644 --- a/admin/controllers/validation_rule.php +++ b/admin/controllers/validation_rule.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; /** * Validation_rule Form Controller @@ -36,13 +42,13 @@ class ComponentbuilderControllerValidation_rule extends FormController * * @since 1.6 */ - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = 'Validation_rules'; // 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. @@ -51,10 +57,10 @@ class ComponentbuilderControllerValidation_rule extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // Get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // Access check. $access = $user->authorise('validation_rule.access', 'com_componentbuilder'); if (!$access) @@ -76,10 +82,10 @@ class ComponentbuilderControllerValidation_rule extends FormController * * @since 1.6 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // get user object. - $user = JFactory::getUser(); + $user = Factory::getUser(); // get record id. $recordId = (int) isset($data[$key]) ? $data[$key] : 0; @@ -150,12 +156,12 @@ class ComponentbuilderControllerValidation_rule extends FormController // set the referral options if ($refid && $ref) - { - $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append; + { + $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append; } elseif ($ref) { - $append = '&ref='. (string)$ref . $append; + $append = '&ref='. (string) $ref . $append; } return $append; @@ -172,13 +178,13 @@ class ComponentbuilderControllerValidation_rule extends FormController */ public function batch($model = null) { - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or jexit(Text::_('JINVALID_TOKEN')); // Set the model - $model = $this->getModel('Validation_rule', '', array()); + $model = $this->getModel('Validation_rule', '', []); // Preset the redirect - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=validation_rules' . $this->getRedirectToListAppend(), false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=validation_rules' . $this->getRedirectToListAppend(), false)); return parent::batch($model); } @@ -203,13 +209,13 @@ class ComponentbuilderControllerValidation_rule extends FormController $cancel = parent::cancel($key); - if (!is_null($return) && JUri::isInternal(base64_decode($return))) + if (!is_null($return) && Uri::isInternal(base64_decode($return))) { $redirect = base64_decode($return); // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); @@ -220,7 +226,7 @@ class ComponentbuilderControllerValidation_rule extends FormController // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -231,7 +237,7 @@ class ComponentbuilderControllerValidation_rule extends FormController // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -257,7 +263,7 @@ class ComponentbuilderControllerValidation_rule extends FormController // Check if there is a return value $return = $this->input->get('return', null, 'base64'); - $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return))); + $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return))); if ($this->ref || $this->refid || $canReturn) { @@ -275,29 +281,29 @@ class ComponentbuilderControllerValidation_rule extends FormController // Redirect to the return value. $this->setRedirect( - JRoute::_( + Route::_( $redirect, false ) ); } elseif ($this->refid && $this->ref) { - $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid; + $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid; // Redirect to the item screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); } elseif ($this->ref) { - $redirect = '&view=' . (string)$this->ref; + $redirect = '&view=' . (string) $this->ref; // Redirect to the list screen. $this->setRedirect( - JRoute::_( + Route::_( 'index.php?option=' . $this->option . $redirect, false ) ); @@ -309,16 +315,15 @@ class ComponentbuilderControllerValidation_rule extends FormController * 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. + * @param BaseDatabaseModel &$model The data model object. + * @param array $validData The validated data. * * @return void * * @since 11.1 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(BaseDatabaseModel $model, $validData = []) { return; } - } diff --git a/admin/controllers/validation_rules.php b/admin/controllers/validation_rules.php index 1e87bae50..69c81f4d9 100644 --- a/admin/controllers/validation_rules.php +++ b/admin/controllers/validation_rules.php @@ -12,8 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\AdminController; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -48,13 +54,13 @@ class ComponentbuilderControllerValidation_rules extends AdminController public function exportData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if export is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('validation_rule.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) { // Get the input - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input $pks = ArrayHelper::toInteger($pks); @@ -62,16 +68,16 @@ class ComponentbuilderControllerValidation_rules extends AdminController $model = $this->getModel('Validation_rules'); // get the data to export $data = $model->getExportData($pks); - if (ComponentbuilderHelper::checkArray($data)) + if (UtilitiesArrayHelper::check($data)) { // now set the data to the spreadsheet - $date = JFactory::getDate(); + $date = Factory::getDate(); ComponentbuilderHelper::xls($data,'Validation_rules_'.$date->format('jS_F_Y'),'Validation rules exported ('.$date->format('jS F, Y').')','validation rules'); } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=validation_rules', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=validation_rules', false), $message, 'error'); return; } @@ -79,32 +85,32 @@ class ComponentbuilderControllerValidation_rules extends AdminController public function importData() { // Check for request forgeries - JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + Session::checkToken() or die(Text::_('JINVALID_TOKEN')); // check if import is allowed for this user. - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->authorise('validation_rule.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) { // Get the import model $model = $this->getModel('Validation_rules'); // get the headers to import $headers = $model->getExImPortHeaders(); - if (ComponentbuilderHelper::checkObject($headers)) + if (ObjectHelper::check($headers)) { // Load headers to session. - $session = JFactory::getSession(); + $session = Factory::getSession(); $headers = json_encode($headers); $session->set('validation_rule_VDM_IMPORTHEADERS', $headers); $session->set('backto_VDM_IMPORT', 'validation_rules'); $session->set('dataType_VDM_IMPORTINTO', 'validation_rule'); // Redirect to import view. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_VALIDATION_RULES'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_VALIDATION_RULES'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=import', false), $message); return; } } // Redirect to the list screen with error. - $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=validation_rules', false), $message, 'error'); + $message = Text::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=validation_rules', false), $message, 'error'); return; } @@ -117,20 +123,20 @@ class ComponentbuilderControllerValidation_rules extends AdminController public function runExpansion() { // Check for request forgeries - JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + Session::checkToken() or \jexit(Text::_('JINVALID_TOKEN')); // check if user has the right - $user = JFactory::getUser(); + $user = Factory::getUser(); // set page redirect - $redirect_url = JRoute::_('index.php?option=com_componentbuilder&view=validation_rules', false); + $redirect_url = \JRoute::_('index.php?option=com_componentbuilder&view=validation_rules', false); // set massage - $message = JText::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); + $message = Text::_('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_RUN_THE_EXPANSION_MODULE'); // check if this user has the right to run expansion if($user->authorise('validation_rules.run_expansion', 'com_componentbuilder')) { // set massage - $message = JText::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); + $message = Text::_('COM_COMPONENTBUILDER_EXPANSION_FAILED_PLEASE_CHECK_YOUR_SETTINGS_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TAB'); // run expansion via API - $result = ComponentbuilderHelper::getFileContents(JURI::root() . 'index.php?option=com_componentbuilder&task=api.expand'); + $result = ComponentbuilderHelper::getFileContents(\JUri::root() . 'index.php?option=com_componentbuilder&task=api.expand'); // is there a message returned if (!is_numeric($result) && StringHelper::check($result)) { @@ -139,7 +145,7 @@ class ComponentbuilderControllerValidation_rules extends AdminController } elseif (is_numeric($result) && 1 == $result) { - $message = JText::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); + $message = Text::_('COM_COMPONENTBUILDER_BTHE_EXPANSION_WAS_SUCCESSFULLYB_TO_SEE_MORE_INFORMATION_CHANGE_THE_BRETURN_OPTIONS_FOR_BUILDB_TO_BDISPLAY_MESSAGEB_IN_THE_GLOBAL_OPTIONS_OF_JCB_UNDER_THE_DEVELOPMENT_METHOD_TABB'); $this->setRedirect($redirect_url, $message, 'message'); return true; } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 32ea59243..c93b3278d 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -19,8 +19,8 @@ if (file_exists($composer_autoloader)) require_once $composer_autoloader; } -// register this component namespace -spl_autoload_register(function ($class) { +// register additional namespace +\spl_autoload_register(function ($class) { // project-specific base directories and namespace prefix $search = [ 'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai', @@ -67,19 +67,29 @@ spl_autoload_register(function ($class) { } }); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Access\Access; +use Joomla\CMS\Access\Rules as AccessRules; +use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Language\Language; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Version; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; -use VDM\Joomla\Utilities; use Joomla\Archive\Archive; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\Path; -use VDM\Joomla\Componentbuilder\Compiler\Factory; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Openai\Factory as OpenaiFactory; use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; @@ -87,8 +97,17 @@ use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Componentbuilder\Compiler\Utilities\FieldHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CompilerFactory; use VDM\Joomla\Utilities\Base64Helper; use VDM\Joomla\FOF\Encrypt\AES; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\FieldHelper as StringFieldHelper; +use VDM\Joomla\Utilities\String\TypeHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Utilities\MathHelper; +use VDM\Joomla\Utilities\String\PluginHelper; +use VDM\Joomla\Utilities\GuidHelper; +use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Utilities\FormHelper; /** @@ -96,24 +115,19 @@ use VDM\Joomla\Utilities\FormHelper; */ abstract class ComponentbuilderHelper { - /** - * Adding the utilities trait to this class - * - * @deprecated 4.0 - Check the trait methods for details, a legacy implementation - */ - use Utilities; - - /** - * get the Component Code Name - */ - public static $ComponentCodeName = 'componentbuilder'; - /** * Composer Switch - * + * * @var array */ - protected static $composer = array(); + protected static $composer = []; + + /** + * The Main Active Language + * + * @var string + */ + public static $langTag; /** * The Global Admin Event Method. @@ -127,7 +141,7 @@ abstract class ComponentbuilderHelper /** * Just to Add the OPEN AI api to JCB (soon) - * Factory + * OpenaiFactory **/ /** @@ -248,9 +262,9 @@ abstract class ComponentbuilderHelper if ('property' === $type || 'method' === $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Get user object - $user = JFactory::getUser(); + $user = Factory::getUser(); // Create a new query object. $query = $db->getQuery(true); // get method @@ -654,7 +668,7 @@ abstract class ComponentbuilderHelper if ('property' === $table || 'method' === $table) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); // get method @@ -840,7 +854,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // get the global company details if (!UtilitiesArrayHelper::check(self::$localCompany)) @@ -868,7 +882,7 @@ abstract class ComponentbuilderHelper // get the library files, folders, and urls $files = array(); // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('b.name','a.addurls','a.addfolders','a.addfiles'))); @@ -920,13 +934,13 @@ abstract class ComponentbuilderHelper if (isset($url['path'])) { // load document script - $files[md5($url['path'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LOCAL'); + $files[md5($url['path'])] = '(' . Text::_('URL') . ') ' . basename($url['url']) . ' - ' . Text::_('COM_COMPONENTBUILDER_LOCAL'); } // check if link must be added if (isset($url['url']) && ((isset($url['type']) && $url['type'] == 1) || (isset($url['type']) && $url['type'] == 3) || !isset($url['type']))) { // load url also if not building document - $files[md5($url['url'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LINK'); + $files[md5($url['url'])] = '(' . Text::_('URL') . ') ' . basename($url['url']) . ' - ' . Text::_('COM_COMPONENTBUILDER_LINK'); } } } @@ -950,12 +964,12 @@ abstract class ComponentbuilderHelper if (isset($pathInfo['extension']) && $pathInfo['extension']) { // load document script - $files[md5($path)] = '(' . JText::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; + $files[md5($path)] = '(' . Text::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; } else { // load document script - $files[md5($path.'/'.trim($file['file'],'/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; + $files[md5($path.'/'.trim($file['file'],'/'))] = '(' . Text::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; } } } @@ -972,7 +986,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // reset bucket $bucket = array(); @@ -1010,7 +1024,7 @@ abstract class ComponentbuilderHelper // load per path foreach($paths as $path) { - $files[md5($root.'/'.trim($path, '/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path) . ' - ' . basename($root); + $files[md5($root.'/'.trim($path, '/'))] = '(' . Text::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path) . ' - ' . basename($root); } } } @@ -1065,7 +1079,7 @@ abstract class ComponentbuilderHelper public static function getComponentIDs() { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('id'))); @@ -1109,15 +1123,6 @@ abstract class ComponentbuilderHelper jimport('joomla.application'); } - /** - * The dynamic builder of views, tables and fields - **/ - public static function dynamicBuilder(&$data, $type) - { - self::autoLoader('extrusion'); - $extruder = new Extrusion($data); - } - /* * Convert repeatable field to subform * @@ -1207,7 +1212,7 @@ abstract class ComponentbuilderHelper $target = trim($_table) . '.' . trim($_key) . '.' . trim($_value); if (!isset(self::$globalUpdater[$target])) { - self::$globalUpdater[$target] = new stdClass; + self::$globalUpdater[$target] = new \stdClass; self::$globalUpdater[$target]->{$_key} = (int) $_value; } // load the new subform values to global updater @@ -1242,7 +1247,7 @@ abstract class ComponentbuilderHelper if (UtilitiesArrayHelper::check(self::$globalUpdater)) { // get the database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); foreach (self::$globalUpdater as $tableKeyID => $object) { // get the table @@ -1272,7 +1277,7 @@ abstract class ComponentbuilderHelper { // get the model $model = self::getModel($type); - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); // get item if ($item = $model->getItem($id)) { @@ -1454,14 +1459,14 @@ abstract class ComponentbuilderHelper public static function getPackageOwnerDetailsDisplay(&$info, $trust = false) { $hasOwner = false; - $ownerDetails = ''; + $ownerDetails = ''; $ownerDetails .= '
    '; // load the list items foreach (self::$pkOwnerSearch as $key => $dd) { if ($value = self::getPackageOwnerValue($key, $info)) { - $ownerDetails .= JText::sprintf($dd, $value); + $ownerDetails .= Text::sprintf($dd, $value); // check if we have a owner/source name if (('owner' === $key || 'company' === $key) && !$hasOwner) { @@ -1476,7 +1481,7 @@ abstract class ComponentbuilderHelper if ($hasOwner && isset($info['getKeyFrom']['buy_link']) && UtilitiesStringHelper::check($info['getKeyFrom']['buy_link'])) { $ownerDetails .= '
    '; - $ownerDetails .= JText::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA', 'class="btn btn-primary" href="'.$info['getKeyFrom']['buy_link'].'" target="_blank" title="get a key from '.$owner.'"', $owner); + $ownerDetails .= Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA', 'class="btn btn-primary" href="'.$info['getKeyFrom']['buy_link'].'" target="_blank" title="get a key from '.$owner.'"', $owner); } // add more custom links elseif ($hasOwner && isset($info['getKeyFrom']['buy_links']) && UtilitiesArrayHelper::check($info['getKeyFrom']['buy_links'])) @@ -1484,7 +1489,7 @@ abstract class ComponentbuilderHelper $buttons = array(); foreach ($info['getKeyFrom']['buy_links'] as $keyName => $link) { - $buttons[] = JText::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA', $owner, 'class="btn btn-primary" href="'.$link.'" target="_blank" title="get a key from '.$owner.'"', $keyName); + $buttons[] = Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA', $owner, 'class="btn btn-primary" href="'.$link.'" target="_blank" title="get a key from '.$owner.'"', $keyName); } $ownerDetails .= '
    '; $ownerDetails .= implode('
    ', $buttons); @@ -1492,10 +1497,10 @@ abstract class ComponentbuilderHelper // return the owner details if (!$hasOwner) { - $ownerDetails = '

    ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '

    '; + $ownerDetails = '

    ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '

    '; if (!$trust) { - $ownerDetails .= '

    ' . JText::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '

    '; + $ownerDetails .= '

    ' . Text::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '

    '; } } return '
    '.$ownerDetails.'
    '; @@ -1577,11 +1582,11 @@ abstract class ComponentbuilderHelper $display[] = $name; if ($needKey) { - $display[] = ' - ' . JText::sprintf('COM_COMPONENTBUILDER_PAIDLOCKED') . ''; + $display[] = ' - ' . Text::sprintf('COM_COMPONENTBUILDER_PAIDLOCKED') . ''; } else { - $display[] = ' - ' . JText::sprintf('COM_COMPONENTBUILDER_FREEOPEN') . ''; + $display[] = ' - ' . Text::sprintf('COM_COMPONENTBUILDER_FREEOPEN') . ''; } $display[] = '

    '; $display[] = $info['short_description'][$key]; @@ -1592,7 +1597,7 @@ abstract class ComponentbuilderHelper { if (isset($info[$li]) && isset($info[$li][$key])) { - $display[] = '
  • '.JText::sprintf($value, $info[$li][$key]).'
  • '; + $display[] = '
  • '.Text::sprintf($value, $info[$li][$key]).'
  • '; } } $display[] = '

'; @@ -1606,7 +1611,7 @@ abstract class ComponentbuilderHelper { if (isset($info[$other]) && isset($info[$other][$key])) { - $display[] = JText::sprintf($value, $info[$other][$key]); + $display[] = Text::sprintf($value, $info[$other][$key]); } } $display[] = '
'; @@ -1620,7 +1625,7 @@ abstract class ComponentbuilderHelper } return implode("\n",$display); } - return '
'.JText::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
'; + return '
'.Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
'; } /** @@ -1629,7 +1634,7 @@ abstract class ComponentbuilderHelper public static function getDbTableColumns($tableName, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // get the columns $columns = $db->getTableColumns("#__" . $tableName); // set the type (multi or single) @@ -1657,7 +1662,7 @@ abstract class ComponentbuilderHelper public static function getViewTableColumns($admin_view, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1737,7 +1742,7 @@ abstract class ComponentbuilderHelper public static function getFieldNameAndType($id, $spacers = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1805,7 +1810,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), 'status' => 'danger'); } return false; @@ -1818,7 +1823,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), 'status' => 'danger'); } return false; @@ -1828,7 +1833,7 @@ abstract class ComponentbuilderHelper { return array ( 'name' => $name, - 'message' => JText::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), + 'message' => Text::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), 'status' => 'success'); } return true; @@ -1860,7 +1865,7 @@ abstract class ComponentbuilderHelper protected static function getPlaceholderTarget($id, $name) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('id', 'target'))); @@ -1889,7 +1894,7 @@ abstract class ComponentbuilderHelper if (!isset(self::$exPowers[$id])) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('a.id'))); @@ -2147,7 +2152,7 @@ abstract class ComponentbuilderHelper } } // return found content - return str_replace('[[[ROOT-URL]]]', JURI::root(), $target['html']); + return str_replace('[[[ROOT-URL]]]', Uri::root(), $target['html']); } } return $default; @@ -2206,7 +2211,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set the defaults self::setSessionDefaults(); @@ -2219,7 +2224,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set to local memory to speed up program self::$localSession[$key] = $value; @@ -2234,7 +2239,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // check if in local memory if (!isset(self::$localSession[$key])) @@ -2255,7 +2260,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $dbDefaults = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2297,7 +2302,7 @@ abstract class ComponentbuilderHelper // value to check since there are false and null values even 0 in the values returned $confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB'; // set the headers - $field['values_description'] .= '' . JText::_('COM_COMPONENTBUILDER_PROPERTY') . '' . JText::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . JText::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; + $field['values_description'] .= '' . Text::_('COM_COMPONENTBUILDER_PROPERTY') . '' . Text::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . Text::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; foreach ($properties as $property) { $example = (isset($property['example']) && UtilitiesStringHelper::check($property['example'])) ? $property['example'] : ''; @@ -2428,7 +2433,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypesProperties($targets = array(), $filter = array(), $exclude = array(), $type = 'id', $operator = 'IN') { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2662,7 +2667,7 @@ abstract class ComponentbuilderHelper if (isset($errorMessage['error']) && UtilitiesStringHelper::check($errorMessage['error'])) { // set the error in the application - JFactory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); + Factory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $errorMessage['error']; } @@ -2671,9 +2676,9 @@ abstract class ComponentbuilderHelper elseif (UtilitiesStringHelper::check($target)) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2682,9 +2687,9 @@ abstract class ComponentbuilderHelper elseif ('nomemory' !== $type) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2693,9 +2698,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2705,9 +2710,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2717,9 +2722,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2767,7 +2772,7 @@ abstract class ComponentbuilderHelper $type = 'data'; } // add little more help if it is an access token issue - $errorMessage = JText::sprintf('COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S', $errorMessage, $type); + $errorMessage = Text::sprintf('COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S', $errorMessage, $type); } // set error notice $message['error'] = $errorMessage; @@ -2794,7 +2799,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } self::$gitHubAccessToken = self::$params->get('github_access_token', null); } @@ -2857,7 +2862,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "// Include helper submenu"; $script['display'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::addSubmenu('import');"; $script['display'][] = self::_t(2) . "}"; - $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new stdClass;"; + $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new \stdClass;"; $script['display'][] = self::_t(2) . "\$paths->first = '';"; $script['display'][] = self::_t(2) . "\$state = \$this->get('state');"; $script['display'][] = PHP_EOL . self::_t(2) . "\$this->paths = &\$paths;"; @@ -2871,7 +2876,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "\$this->sidebar = JHtmlSidebar::render();"; $script['display'][] = self::_t(2) . "}"; $script['display'][] = PHP_EOL . self::_t(2) . "// get the session object"; - $script['display'][] = self::_t(2) . "\$session = JFactory::getSession();"; + $script['display'][] = self::_t(2) . "\$session = Factory::getSession();"; $script['display'][] = self::_t(2) . "// check if it has package"; $script['display'][] = self::_t(2) . "\$this->hasPackage" . self::_t(1) . "= \$session->get('hasPackage', false);"; $script['display'][] = self::_t(2) . "\$this->dataType" . self::_t(1) . "= \$session->get('dataType', false);"; @@ -2904,11 +2909,11 @@ abstract class ComponentbuilderHelper $script['setdata'][] = self::_t(1) . "**/"; $script['setdata'][] = self::_t(1) . "protected function setData(\$package,\$table,\$target_headers)"; $script['setdata'][] = self::_t(1) . "{"; - $script['setdata'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$target_headers))"; + $script['setdata'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$target_headers))"; $script['setdata'][] = self::_t(2) . "{"; $script['setdata'][] = self::_t(3) . "// make sure the file is loaded"; $script['setdata'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::composerAutoload('phpspreadsheet');"; - $script['setdata'][] = self::_t(3) . "\$jinput = JFactory::getApplication()->input;"; + $script['setdata'][] = self::_t(3) . "\$jinput = Factory::getApplication()->input;"; $script['setdata'][] = self::_t(3) . "foreach(\$target_headers as \$header)"; $script['setdata'][] = self::_t(3) . "{"; $script['setdata'][] = self::_t(4) . "if ((\$column = \$jinput->getString(\$header, false)) !== false ||"; @@ -2948,16 +2953,16 @@ abstract class ComponentbuilderHelper $script['headers'][] = self::_t(1) . "public function getExImPortHeaders()"; $script['headers'][] = self::_t(1) . "{"; $script['headers'][] = self::_t(2) . "// Get a db connection."; - $script['headers'][] = self::_t(2) . "\$db = JFactory::getDbo();"; + $script['headers'][] = self::_t(2) . "\$db = Factory::getDbo();"; $script['headers'][] = self::_t(2) . "// get the columns"; $script['headers'][] = self::_t(2) . "\$columns = \$db->getTableColumns(\"#__[[[-#-#-component]]]_[[[-#-#-view]]]\");"; - $script['headers'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$columns))"; + $script['headers'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$columns))"; $script['headers'][] = self::_t(2) . "{"; $script['headers'][] = self::_t(3) . "// remove the headers you don't import/export."; $script['headers'][] = self::_t(3) . "unset(\$columns['asset_id']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out_time']);"; - $script['headers'][] = self::_t(3) . "\$headers = new stdClass();"; + $script['headers'][] = self::_t(3) . "\$headers = new \stdClass();"; $script['headers'][] = self::_t(3) . "foreach (\$columns as \$column => \$type)"; $script['headers'][] = self::_t(3) . "{"; $script['headers'][] = self::_t(4) . "\$headers->{\$column} = \$column;"; @@ -2981,10 +2986,10 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(1) . "protected function save(\$data,\$table)"; $script['save'][] = self::_t(1) . "{"; $script['save'][] = self::_t(2) . "// import the data if there is any"; - $script['save'][] = self::_t(2) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']))"; + $script['save'][] = self::_t(2) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']))"; $script['save'][] = self::_t(2) . "{"; $script['save'][] = self::_t(3) . "// get user object"; - $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= JFactory::getUser();"; + $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= Factory::getUser();"; $script['save'][] = self::_t(3) . "// remove header if it has headers"; $script['save'][] = self::_t(3) . "\$id_key" . self::_t(1) . "= \$data['target_headers']['id'];"; $script['save'][] = self::_t(3) . "\$published_key" . self::_t(1) . "= \$data['target_headers']['published'];"; @@ -2999,14 +3004,14 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(3) . "}"; $script['save'][] = self::_t(3) . ""; $script['save'][] = self::_t(3) . "// make sure there is still values in array and that it was not only headers"; - $script['save'][] = self::_t(3) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; + $script['save'][] = self::_t(3) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; $script['save'][] = self::_t(3) . "{"; $script['save'][] = self::_t(4) . "// set target."; $script['save'][] = self::_t(4) . "\$target" . self::_t(1) . "= array_flip(\$data['target_headers']);"; $script['save'][] = self::_t(4) . "// Get a db connection."; - $script['save'][] = self::_t(4) . "\$db = JFactory::getDbo();"; + $script['save'][] = self::_t(4) . "\$db = Factory::getDbo();"; $script['save'][] = self::_t(4) . "// set some defaults"; - $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= JFactory::getDate()->toSql();"; + $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= Factory::getDate()->toSql();"; $script['save'][] = self::_t(4) . "// get global action permissions"; $script['save'][] = self::_t(4) . "\$canDo" . self::_t(3) . "= [[[-#-#-Component]]]Helper::getActions(\$table);"; $script['save'][] = self::_t(4) . "\$canEdit" . self::_t(2) . "= \$canDo->get('core.edit');"; @@ -3194,7 +3199,7 @@ abstract class ComponentbuilderHelper { $script['view'] = array(); $script['view'][] = ""; $script['view'][] = ""; $script['view'][] = PHP_EOL . "
"; - $script['view'][] = "
\" method=\"post\" name=\"adminForm\" id=\"adminForm\" class=\"form-horizontal form-validate\">"; + $script['view'][] = "\" method=\"post\" name=\"adminForm\" id=\"adminForm\" class=\"form-horizontal form-validate\">"; $script['view'][] = ""; $script['view'][] = PHP_EOL . self::_t(1) . "sidebar)) : ?>"; $script['view'][] = self::_t(2) . "
"; @@ -3308,7 +3313,7 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(2) . "
"; $script['view'][] = self::_t(1) . ""; $script['view'][] = ""; - $script['view'][] = PHP_EOL . self::_t(1) . "hasPackage && [[[-#-#-Component]]]Helper::checkArray(\$this->headerList) && [[[-#-#-Component]]]Helper::checkArray(\$this->headers)) : ?>"; + $script['view'][] = PHP_EOL . self::_t(1) . "hasPackage && Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$this->headerList) && Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$this->headers)) : ?>"; $script['view'][] = self::_t(2) . "
"; $script['view'][] = self::_t(3) . ""; $script['view'][] = self::_t(3) . "
"; @@ -3338,9 +3343,9 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(2) . "
"; $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(1) . ""; - $script['view'][] = self::_t(2) . " 'upload')); ?>"; + $script['view'][] = self::_t(2) . " 'upload')); ?>"; $script['view'][] = self::_t(2) . ""; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(3) . "
"; $script['view'][] = self::_t(4) . ""; $script['view'][] = self::_t(4) . "
"; @@ -3353,9 +3358,9 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(5) . "\" onclick=\"Joomla.submitbutton()\" />    (.csv .xls .ods)"; $script['view'][] = self::_t(4) . "
"; $script['view'][] = self::_t(3) . "
"; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(2) . ""; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(3) . "
"; $script['view'][] = self::_t(4) . ""; $script['view'][] = self::_t(4) . "
"; @@ -3368,9 +3373,9 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(5) . "\" onclick=\"Joomla.submitbutton3()\" />    (.csv .xls .ods)"; $script['view'][] = self::_t(4) . "
"; $script['view'][] = self::_t(4) . "
"; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = ""; - $script['view'][] = PHP_EOL . self::_t(2) . ""; + $script['view'][] = PHP_EOL . self::_t(2) . ""; $script['view'][] = self::_t(3) . "
"; $script['view'][] = self::_t(4) . ""; $script['view'][] = self::_t(4) . "
"; @@ -3383,12 +3388,12 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(5) . "\" onclick=\"Joomla.submitbutton4()\" />    (.csv .xls .ods)"; $script['view'][] = self::_t(4) . "
"; $script['view'][] = self::_t(3) . "
"; - $script['view'][] = self::_t(2) . ""; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(1) . ""; $script['view'][] = self::_t(1) . ""; - $script['view'][] = self::_t(1) . ""; + $script['view'][] = self::_t(1) . ""; $script['view'][] = ""; $script['view'][] = "
"; } @@ -3404,8 +3409,8 @@ abstract class ComponentbuilderHelper $script['import'][] = self::_t(1) . "public function import()"; $script['import'][] = self::_t(1) . "{"; $script['import'][] = self::_t(2) . "\$this->setState('action', 'import');"; - $script['import'][] = self::_t(2) . "\$app" . self::_t(2) . "= JFactory::getApplication();"; - $script['import'][] = self::_t(2) . "\$session" . self::_t(1) . "= JFactory::getSession();"; + $script['import'][] = self::_t(2) . "\$app" . self::_t(2) . "= Factory::getApplication();"; + $script['import'][] = self::_t(2) . "\$session" . self::_t(1) . "= Factory::getSession();"; $script['import'][] = self::_t(2) . "\$package" . self::_t(1) . "= null;"; $script['import'][] = self::_t(2) . "\$continue" . self::_t(1) . "= false;"; $script['import'][] = self::_t(2) . "// get import type"; @@ -3593,44 +3598,44 @@ abstract class ComponentbuilderHelper * @param boolean $option The field grouping * * @return boolean if the field was found - * @deprecated 3.3 Use Factory::_('Field.Groups')->check($type, $option); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->check($type, $option); */ public static function fieldCheck($type, $option = 'default') { - return Factory::_('Field.Groups')->check($type, $option); + return CompilerFactory::_('Field.Groups')->check($type, $option); } /** * get the field types id -> name of a group or groups * * @return array ids of the spacer field types - * @deprecated 3.3 Use Factory::_('Field.Groups')->types($groups); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->types($groups); */ public static function getFieldTypesByGroup($groups = array()) { - return Factory::_('Field.Groups')->types($groups); + return CompilerFactory::_('Field.Groups')->types($groups); } /** * get the field types IDs of a group or groups * * @return array ids of the spacer field types - * @deprecated 3.3 Use Factory::_('Field.Groups')->typesIds($groups); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->typesIds($groups); */ public static function getFieldTypesIdsByGroup($groups = array()) { - return Factory::_('Field.Groups')->typesIds($groups); + return CompilerFactory::_('Field.Groups')->typesIds($groups); } /** * get the spacer IDs * * @return array ids of the spacer field types - * @deprecated 3.3 Use Factory::_('Field.Groups')->spacerIds(); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->spacerIds(); */ public static function getSpacerIds() { - return Factory::_('Field.Groups')->spacerIds(); + return CompilerFactory::_('Field.Groups')->spacerIds(); } @@ -3700,7 +3705,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } $folderPath = self::$params->get($target, $default); // create the folder if it does not exist @@ -3714,10 +3719,10 @@ abstract class ComponentbuilderHelper if (strpos($folderPath, JPATH_SITE) !== false) { $folderPath = trim( str_replace( JPATH_SITE, '', $folderPath), '/'); - return JURI::root() . $folderPath . '/'; + return Uri::root() . $folderPath . '/'; } // since the path is behind the root folder of the site, return only the root url (may be used to build the link) - return JURI::root(); + return Uri::root(); } // sanitize the path return '/' . trim( $folderPath, '/' ) . '/'; @@ -3772,7 +3777,7 @@ abstract class ComponentbuilderHelper if (!class_exists($CLASS)) { // class not in place so send out error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', $CLASS), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', $CLASS), 'Error'); return false; } // does this crypt class use mode @@ -3809,7 +3814,7 @@ abstract class ComponentbuilderHelper break; default: // No valid mode has been specified - JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_NO_VALID_MODE_HAS_BEEN_SPECIFIED'), 'Error'); + Factory::getApplication()->enqueueMessage(Text::_('COM_COMPONENTBUILDER_NO_VALID_MODE_HAS_BEEN_SPECIFIED'), 'Error'); return false; break; } @@ -3845,7 +3850,7 @@ abstract class ComponentbuilderHelper // now move the file if (!$server->store($localPath, $fileName)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER', $fileName, $server->jcb_remote_server_name[(int) $serverID]), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER', $fileName, $server->jcb_remote_server_name[(int) $serverID]), 'Error'); return false; } // close the connection @@ -3859,7 +3864,7 @@ abstract class ComponentbuilderHelper // now move the file if (!$server->put($remote_path, FileHelper::getContent($localPath, null))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER', $fileName, $server->jcb_remote_server_path[(int) $serverID], $server->jcb_remote_server_name[(int) $serverID]), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER', $fileName, $server->jcb_remote_server_path[(int) $serverID], $server->jcb_remote_server_name[(int) $serverID]), 'Error'); return false; } } @@ -3929,7 +3934,7 @@ abstract class ComponentbuilderHelper if (!class_exists('\phpseclib\Net\SFTP')) { // class not in place so send out error - JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error'); + Factory::getApplication()->enqueueMessage(Text::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error'); return false; } // insure the port is set @@ -3944,7 +3949,7 @@ abstract class ComponentbuilderHelper case 1: // password if (!self::$sftp[$server->cache]->login($server->username, $server->password)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -3960,14 +3965,14 @@ abstract class ComponentbuilderHelper // now load the key file if (!self::crypt('RSA')->loadKey(FileHelper::getContent($server->private, null))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -3984,14 +3989,14 @@ abstract class ComponentbuilderHelper // now load the key file if (!self::crypt('RSA')->loadKey(FileHelper::getContent($server->private, null))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -4008,14 +4013,14 @@ abstract class ComponentbuilderHelper // now load the key field if (!self::crypt('RSA')->loadKey($server->private_key)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -4032,14 +4037,14 @@ abstract class ComponentbuilderHelper // now load the key file if (!self::crypt('RSA')->loadKey($server->private_key)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -4130,7 +4135,7 @@ abstract class ComponentbuilderHelper else { // load error to indicate signature was in error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); return false; } // check if we are connected @@ -4152,7 +4157,7 @@ abstract class ComponentbuilderHelper unset(self::$ftp[$server->cache]); } // load error to indicate signature was in error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); } return false; } @@ -4169,17 +4174,17 @@ abstract class ComponentbuilderHelper public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export') { // check if this user has permission to access items - if (!JFactory::getUser()->authorise($permission, 'com_componentbuilder')) + if (!Factory::getUser()->authorise($permission, 'com_componentbuilder')) { // set message to inform the user that permission was denied - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', UtilitiesStringHelper::safe($permission, 'w')), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', UtilitiesStringHelper::safe($permission, 'w')), 'Error'); return false; } // now insure we have correct values if (is_int($serverID) && is_int($protocol)) { // Get a db connection - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // start the query $query = $db->getQuery(true); // select based to protocol @@ -4241,7 +4246,7 @@ abstract class ComponentbuilderHelper return $server; } } - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); return false; } @@ -4260,39 +4265,42 @@ abstract class ComponentbuilderHelper /** - * the locker - * - * @var array - **/ - protected static $locker = array(); + * the locker + * + * @var array + * @since 3.1 + */ + protected static array $locker = []; /** - * the dynamic replacement salt - * - * @var array - **/ - protected static $globalSalt = array(); + * the dynamic replacement salt + * + * @var array + * @since 3.1 + */ + protected static array $globalSalt = []; /** - * the timer - * - * @var object - **/ + * the timer + * + * @var object + * @since 3.1 + */ protected static $keytimer; /** - * To Lock string - * - * @param string $string The string/array to lock - * @param string $key The custom key to use - * @param int $salt The switch to add salt and type of salt - * @param int $dynamic The dynamic replacement array of salt build string - * @param int $urlencode The switch to control url encoding - * - * @return string Encrypted String - * - **/ - public static function lock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true) + * To Lock string + * + * @param string $string The string/array to lock + * @param string|null $key The custom key to use + * @param int $salt The switch to add salt and type of salt + * @param int|null $dynamic The dynamic replacement array of salt build string + * @param int $urlencode The switch to control url encoding + * + * @return string Encrypted String + * @since 3.1 + */ + public static function lock(string $string, ?string $key = null, int $salt = 2, ?int $dynamic = null, $urlencode = true): string { // get the global settings if (!$key || !UtilitiesStringHelper::check($key)) @@ -4337,18 +4345,18 @@ abstract class ComponentbuilderHelper } /** - * To un-Lock string - * - * @param string $string The string to unlock - * @param string $key The custom key to use - * @param int $salt The switch to add salt and type of salt - * @param int $dynamic The dynamic replacement array of salt build string - * @param int $urlencode The switch to control url decoding - * - * @return string Decrypted String - * - **/ - public static function unlock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true) + * To un-Lock string + * + * @param string $string The string to unlock + * @param string $key The custom key to use + * @param int $salt The switch to add salt and type of salt + * @param int $dynamic The dynamic replacement array of salt build string + * @param int $urlencode The switch to control url decoding + * + * @return string Decrypted String + * @since 3.1 + */ + public static function unlock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true): string { // get the global settings if (!$key || !UtilitiesStringHelper::check($key)) @@ -4394,19 +4402,20 @@ abstract class ComponentbuilderHelper $string = unserialize($string); } } + return $string; } /** - * The Salt - * - * @param int $type The type of length the salt should be valid - * @param int $dynamic The dynamic replacement array of salt build string - * - * @return string - * - **/ - public static function salt($type = 1, $dynamic = null) + * The Salt + * + * @param int $type The type of length the salt should be valid + * @param int $dynamic The dynamic replacement array of salt build string + * + * @return string + * @since 3.1 + */ + public static function salt(int $type = 1, $dynamic = null): string { // get dynamic replacement salt $dynamic = self::getDynamicSalt($dynamic); @@ -4449,31 +4458,33 @@ abstract class ComponentbuilderHelper } /** - * The function to insure the salt is valid within the given period (third try) - * - * @param int $main The main number - */ - protected static function periodFix($main) + * The function to insure the salt is valid within the given period (third try) + * + * @param int $main The main number + * @since 3.1 + */ + protected static function periodFix(int $main): int { return round($main / 3) * 3; } /** - * Check if a string is serialized - * - * @param string $string - * - * @return Boolean - * - */ - public static function is_serial($string) + * Check if a string is serialized + * + * @param string $string + * + * @return Boolean + * @since 3.1 + */ + public static function is_serial(string $string): bool { return (@unserialize($string) !== false); } /** - * Get dynamic replacement salt - */ + * Get dynamic replacement salt + * @since 3.1 + */ public static function getDynamicSalt($dynamic = null) { // load global if not manually set @@ -4489,8 +4500,9 @@ abstract class ComponentbuilderHelper } /** - * The random or dynamic secret salt - */ + * The random or dynamic secret salt + * @since 3.1 + */ public static function getSecretSalt($string = null, $size = 9) { // set the string @@ -4512,8 +4524,9 @@ abstract class ComponentbuilderHelper } /** - * Get global replacement salt - */ + * Get global replacement salt + * @since 3.1 + */ public static function getGlobalSalt() { // load from memory if found @@ -4522,7 +4535,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // check if we have a global dynamic replacement array available (format --> ' 1->!,3->E,4->A') $tmp = self::$params->get('dynamic_salt', null); @@ -4552,8 +4565,9 @@ abstract class ComponentbuilderHelper } /** - * Close public protocol - */ + * Close public protocol + * @since 3.1 + */ public static function closePublicProtocol($id, $public) { // get secret salt @@ -4579,8 +4593,9 @@ abstract class ComponentbuilderHelper } /** - * Open public protocol - */ + * Open public protocol + * @since 3.1 + */ public static function openPublicProtocol($SECRET, $ID, $PUBLIC) { // get secret salt @@ -4604,42 +4619,46 @@ abstract class ComponentbuilderHelper } /** - * Workers to load tasks - * - * @var array - */ - protected static $worker = array(); + * Workers to load tasks + * + * @var array + * @since 3.1 + */ + protected static array $worker = []; /** - * Set a worker dynamic URLs - * - * @var array - */ - protected static $workerURL = array(); + * Set a worker dynamic URLs + * + * @var array + * @since 3.1 + */ + protected static array $workerURL = []; /** - * Set a worker dynamic HEADERs - * - * @var array - */ - protected static $workerHEADER = array(); + * Set a worker dynamic HEADERs + * + * @var array + * @since 3.1 + */ + protected static array $workerHEADER = []; /** - * Curl Error Notice - * - * @var bool - */ - protected static $curlErrorLoaded = false; + * Curl Error Notice + * + * @var bool + * @since 3.1 + */ + protected static bool $curlErrorLoaded = false; /** - * check if a worker has more work - * - * @param string $function The function to target to perform the task - * - * @return bool - * - */ - public static function hasWork(&$function) + * check if a worker has more work + * + * @param string $function The function to target to perform the task + * + * @return bool + * @since 3.1 + */ + public static function hasWork(string $function): bool { if (isset(self::$worker[$function]) && UtilitiesArrayHelper::check(self::$worker[$function])) { @@ -4649,15 +4668,15 @@ abstract class ComponentbuilderHelper } /** - * Set a worker url - * - * @param string $function The function to target to perform the task - * @param string $url The url of where the task is to be performed - * - * @return void - * - */ - public static function setWorkerUrl(&$function, &$url) + * Set a worker url + * + * @param string $function The function to target to perform the task + * @param string $url The url of where the task is to be performed + * + * @return void + * @since 3.1 + */ + public static function setWorkerUrl(string $function, string $url): void { // set the URL if found if (UtilitiesStringHelper::check($url)) @@ -4668,15 +4687,15 @@ abstract class ComponentbuilderHelper } /** - * Set a worker headers - * - * @param string $function The function to target to perform the task - * @param array $headers The headers needed for these workers/function - * - * @return void - * - */ - public static function setWorkerHeaders(&$function, &$headers) + * Set a worker headers + * + * @param string $function The function to target to perform the task + * @param array|null $headers The headers needed for these workers/function + * + * @return void + * @since 3.1 + */ + public static function setWorkerHeaders(string $function, ?array $headers): void { // set the Headers if found if (UtilitiesArrayHelper::check($headers)) @@ -4687,30 +4706,33 @@ abstract class ComponentbuilderHelper } /** - * Set a worker that needs to perform a task - * - * @param mixed $data The data to pass to the task - * @param string $function The function to target to perform the task - * @param string $url The url of where the task is to be performed - * @param array $headers The headers needed for these workers/function - * - * @return void - * - */ - public static function setWorker($data, $function, $url = null, $headers = null) + * Set a worker that needs to perform a task + * + * @param mixed $data The data to pass to the task + * @param string $function The function to target to perform the task + * @param string $url The url of where the task is to be performed + * @param array $headers The headers needed for these workers/function + * + * @return void + * @since 3.1 + */ + public static function setWorker($data, string $function, ?string $url = null, ?array $headers = null) { // make sure task function is up if (!isset(self::$worker[$function])) { - self::$worker[$function] = array(); + self::$worker[$function] = []; } + // load the task self::$worker[$function][] = self::lock($data); + // set the Headers if found if ($headers && !isset(self::$workerHEADER[$function])) { self::setWorkerHeaders($function, $headers); } + // set the URL if found if ($url && !isset(self::$workerURL[$function])) { @@ -4719,17 +4741,17 @@ abstract class ComponentbuilderHelper } /** - * Run set Workers - * - * @param string $function The function to target to perform the task - * @param string $perTask The amount of task per worker - * @param function $callback The option to do a call back when task is completed - * @param int $threadSize The size of the thread - * - * @return bool true On success - * - */ - public static function runWorker($function, $perTask = 50, $callback = null, $threadSize = 20) + * Run set Workers + * + * @param string $function The function to target to perform the task + * @param string $perTask The amount of task per worker + * @param function $callback The option to do a call back when task is completed + * @param int $threadSize The size of the thread + * + * @return bool true On success + * @since 3.1 + */ + public static function runWorker(string $function, $perTask = 50, $callback = null, $threadSize = 20): bool { // set task $task = self::lock($function); @@ -4783,7 +4805,7 @@ abstract class ComponentbuilderHelper } else { - $url = JURI::root() . '/index.php?option=com_componentbuilder&task=api.worker'; + $url = Uri::root() . '/index.php?option=com_componentbuilder&task=api.worker'; } return self::curlMultiExec($url, $options, $callback, $threadSize); } @@ -4791,16 +4813,16 @@ abstract class ComponentbuilderHelper } /** - * Do a multi curl execution of tasks - * - * @param string $url The url of where the task is to be performed - * @param array $_options The array of curl options/headers to set - * @param function $callback The option to do a call back when task is completed - * @param int $threadSize The size of the thread - * - * @return bool true On success - * - */ + * Do a multi curl execution of tasks + * + * @param string $url The url of where the task is to be performed + * @param array $_options The array of curl options/headers to set + * @param function $callback The option to do a call back when task is completed + * @param int $threadSize The size of the thread + * + * @return bool true On success + * @since 3.1 + */ public static function curlMultiExec(&$url, &$_options, $callback = null, $threadSize = 20) { // make sure we have curl available @@ -4809,7 +4831,7 @@ abstract class ComponentbuilderHelper if (!self::$curlErrorLoaded) { // set the notice - JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP'), 'Error'); + Factory::getApplication()->enqueueMessage(Text::_('COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP'), 'Error'); // load the notice only once self::$curlErrorLoaded = true; } @@ -4912,7 +4934,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } // get UIKIT version $uikit = self::$params->get('uikit_version', 2); @@ -4946,17 +4968,17 @@ abstract class ComponentbuilderHelper $checked_out = self::getVar($view, $item, 'id', 'checked_out', '=', str_replace('com_', '', $component)); } // set the link title - $title = UtilitiesStringHelper::safe(JText::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); + $title = UtilitiesStringHelper::safe(Text::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); // check that there is a check message if (UtilitiesStringHelper::check($headsup)) { if (3 == $uikit) { - $href = 'onclick="UIkit.modal.confirm(\''.JText::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; + $href = 'onclick="UIkit.modal.confirm(\''.Text::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; } else { - $href = 'onclick="UIkit2.modal.confirm(\''.JText::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; + $href = 'onclick="UIkit2.modal.confirm(\''.Text::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; } } else @@ -4970,11 +4992,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' '; } - return ' '; + return ' '; } // return normal edit link return ' '; @@ -4983,11 +5005,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' '; } - return ' '; + return ' '; } // return normal edit link return ' '; @@ -5024,7 +5046,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } // get UIKIT version $uikit = self::$params->get('uikit_version', 2); @@ -5058,17 +5080,17 @@ abstract class ComponentbuilderHelper $checked_out = self::getVar($view, $item, 'id', 'checked_out', '=', str_replace('com_', '', $component)); } // set the link title - $title = UtilitiesStringHelper::safe(JText::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); + $title = UtilitiesStringHelper::safe(Text::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); // check that there is a check message if (UtilitiesStringHelper::check($headsup)) { if (3 == $uikit) { - $href = 'onclick="UIkit.modal.confirm(\''.JText::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; + $href = 'onclick="UIkit.modal.confirm(\''.Text::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; } else { - $href = 'onclick="UIkit2.modal.confirm(\''.JText::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; + $href = 'onclick="UIkit2.modal.confirm(\''.Text::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; } } else @@ -5082,11 +5104,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' ' . $text . ''; } - return ' ' . $text . ''; + return ' ' . $text . ''; } // return normal edit link return ' ' . $text . ''; @@ -5095,11 +5117,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' ' . $text . ''; } - return ' ' . $text . ''; + return ' ' . $text . ''; } // return normal edit link return ' ' . $text . ''; @@ -5123,14 +5145,14 @@ abstract class ComponentbuilderHelper public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $jRoute = true) { // build record - $record = new stdClass(); + $record = new \stdClass(); // check if user can edit if (self::canEditItem($record, $item, $view, $views, $component)) { // set the edit link if ($jRoute) { - return JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref); + return \JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref); } return "index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref; } @@ -5151,7 +5173,7 @@ abstract class ComponentbuilderHelper public static function allowEdit(&$item, $view, $views, $component = 'com_componentbuilder') { // build record - $record = new stdClass(); + $record = new \stdClass(); return self::canEditItem($record, $item, $view, $views, $component); } @@ -5170,7 +5192,7 @@ abstract class ComponentbuilderHelper protected static function canEditItem(&$record, &$item, $view, $views, $component = 'com_componentbuilder') { // make sure the user has access to view - if (!JFactory::getUser()->authorise($view. '.access', $component)) + if (!Factory::getUser()->authorise($view. '.access', $component)) { return false; } @@ -5461,7 +5483,7 @@ abstract class ComponentbuilderHelper // get global values if (self::$subformLayouts === false) { - self::$subformLayouts = JComponentHelper::getParams('com_componentbuilder')->get('subform_layouts', false); + self::$subformLayouts = ComponentHelper::getParams('com_componentbuilder')->get('subform_layouts', false); } // check what we found (else) return default if (ObjectHelper::check(self::$subformLayouts)) @@ -5497,7 +5519,7 @@ abstract class ComponentbuilderHelper public static function checkExist($table, $where, $what = 'id', $operator = '=', $main = 'componentbuilder') { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array($what))); @@ -5551,6 +5573,384 @@ abstract class ComponentbuilderHelper } return false; } + + + /** + * Making class or function name safe + * + * @input string The name you would like to make safe + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use ClassfunctionHelper::safe($name); + */ + public static function safeClassFunctionName($name) + { + return ClassfunctionHelper::safe($name); + } + + /** + * Making field names safe + * + * @input string The you would like to make safe + * @input boolean The switch to return an ALL UPPER CASE string + * @input string The string to use in white space + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use StringFieldHelper::safe($string, $allcap, $spacer); + */ + public static function safeFieldName($string, $allcap = false, $spacer = '_') + { + // set the local component option + self::setComponentOption(); + + return StringFieldHelper::safe($string, $allcap, $spacer); + } + + /** + * Making field type name safe + * + * @input string The you would like to make safe + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use TypeHelper::safe($string); + */ + public static function safeTypeName($string) + { + // set the local component option + self::setComponentOption(); + + return TypeHelper::safe($string); + } + + /** + * Making namespace safe + * + * @input string The you would like to make safe + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use NamespaceHelper::safe($string); + */ + public static function safeNamespace($string) + { + return NamespaceHelper::safe($string); + } + + /** + * get all strings between two other strings + * + * @param string $content The content to search + * @param string $start The starting value + * @param string $end The ending value + * + * @return array On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GetHelper::allBetween($content, $start, $end); + */ + public static function getAllBetween($content, $start, $end) + { + return GetHelper::allBetween($content, $start, $end); + } + + /** + * get a string between two other strings + * + * @param string $content The content to search + * @param string $start The starting value + * @param string $end The ending value + * @param string $default The default value if none found + * + * @return string On success / empty string on failure + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GetHelper::between($content, $start, $end, $default); + */ + public static function getBetween($content, $start, $end, $default = '') + { + return GetHelper::between($content, $start, $end, $default); + } + + /** + * bc math wrapper (very basic not for accounting) + * + * @param string $type The type bc math + * @param int $val1 The first value + * @param int $val2 The second value + * @param int $scale The scale value + * + * @return float|int + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use MathHelper::bc($type, $val1, $val2, $scale); + */ + public static function bcmath($type, $val1, $val2, $scale = 0) + { + return MathHelper::bc($type, $val1, $val2, $scale); + } + + /** + * Basic sum of an array with more precision + * + * @param array $array The values to sum + * @param int $scale The scale value + * + * @return float|int + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use MathHelper::sum($array, $scale); + */ + public static function bcsum($array, $scale = 4) + { + return MathHelper::sum($array, $scale); + } + + /** + * create plugin class name + * + * @input string The group name + * @input string The name + * + * @return string + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use PluginHelper::safe($name, $group); + */ + public static function createPluginClassName($group, $name) + { + return PluginHelper::safeClassName($name, $group); + } + + /** + * Returns a GUIDv4 string + * + * Thanks to Dave Pearson (and other) + * https://www.php.net/manual/en/function.com-create-guid.php#119168 + * + * Uses the best cryptographically secure method + * for all supported platforms with fallback to an older, + * less secure version. + * + * @param bool $trim + * + * @return string + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GuidHelper::get($trim); + */ + public static function GUID($trim = true) + { + return GuidHelper::get($trim); + } + + /** + * Validate the Globally Unique Identifier ( and check if table already has this identifier) + * + * @param string $guid + * @param string $table + * @param int $id + * @param string|null $component + * + * @return bool + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); + */ + public static function validGUID($guid, $table = null, $id = 0, $component = null) + { + // set the local component option + self::setComponentOption(); + + return GuidHelper::valid($guid, $table, $id, $component); + } + + /** + * get the ITEM of a GUID by table + * + * @param string $guid + * @param string $table + * @param string/array $what + * @param string|null $component + * + * @return mixed + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); + */ + public static function getGUID($guid, $table, $what = 'a.id', $component = null) + { + // set the local component option + self::setComponentOption(); + + return GuidHelper::item($guid, $table, $what, $component); + } + + /** + * Validate the Globally Unique Identifier + * + * Thanks to Lewie + * https://stackoverflow.com/a/1515456/1429677 + * + * @param string $guid + * + * @return bool + * + * @deprecated 4.0 - Use GuidHelper::validate($guid); + */ + protected static function validateGUID($guid) + { + return GuidHelper::valid($guid); + } + + /** + * The zipper method + * + * @param string $workingDIR The directory where the items must be zipped + * @param string $filepath The path to where the zip file must be placed + * + * @return bool true On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::zip($workingDIR, $filepath); + */ + public static function zip($workingDIR, &$filepath) + { + return FileHelper::zip($workingDIR, $filepath); + } + + /** + * get the content of a file + * + * @param string $path The path to the file + * @param mixed $none The return value if no content was found + * + * @return string On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getContent($path, $none); + */ + public static function getFileContents($path, $none = '') + { + return FileHelper::getContent($path, $none); + } + + /** + * Write a file to the server + * + * @param string $path The path and file name where to safe the data + * @param string $data The data to safe + * + * @return bool true On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::write($path, $data); + */ + public static function writeFile($path, $data) + { + return FileHelper::write($path, $data); + } + + /** + * get all the file paths in folder and sub folders + * + * @param string $folder The local path to parse + * @param array $fileTypes The type of files to get + * + * @return array|null + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getPaths($folder, $fileTypes , $recurse, $full); + */ + public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) + { + return FileHelper::getPaths($folder, $fileTypes , $recurse, $full); + } + + /** + * Get the file path or url + * + * @param string $type The (url/path) type to return + * @param string $target The Params Target name (if set) + * @param string $fileType The kind of filename to generate (if not set no file name is generated) + * @param string $key The key to adjust the filename (if not set ignored) + * @param string $default The default path if not set in Params (fallback path) + * @param bool $createIfNotSet The switch to create the folder if not found + * + * @return string On success the path or url is returned based on the type requested + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); + */ + public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) + { + // set the local component option + self::setComponentOption(); + + return FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); + } + + /** + * Check if file exist + * + * @param string $path The url/path to check + * + * @return bool If exist true + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::exists($path); + */ + public static function urlExists($path) + { + return FileHelper::exists($path); + } + + /** + * Set the component option + * + * @param String|null $option The option for the component. + * + * @since 3.0.11 + */ + public static function setComponentOption($option = null) + { + // set the local component option + if (empty($option)) + { + if (empty(Helper::$option) && property_exists(__CLASS__, 'ComponentCodeName')) + { + Helper::$option = 'com_' . self::$ComponentCodeName; + } + } + else + { + Helper::$option = $option; + } + } /** @@ -5562,7 +5962,7 @@ abstract class ComponentbuilderHelper if (!isset(self::$composer[$target])) { // get the function name - $functionName = self::safeString('compose' . $target); + $functionName = UtilitiesStringHelper::safe('compose' . $target); // check if method exist if (method_exists(__CLASS__, $functionName)) { @@ -5584,7 +5984,7 @@ abstract class ComponentbuilderHelper /** * Joomla version object - */ + */ protected static $JVersion; /** @@ -5593,9 +5993,9 @@ abstract class ComponentbuilderHelper public static function jVersion() { // check if set - if (!self::checkObject(self::$JVersion)) + if (!ObjectHelper::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -5606,18 +6006,18 @@ abstract class ComponentbuilderHelper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_componentbuilder'); + $params = ComponentHelper::getParams('com_componentbuilder'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) - { + { if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3)) { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } @@ -5631,8 +6031,8 @@ abstract class ComponentbuilderHelper $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = UtilitiesStringHelper::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.UtilitiesStringHelper::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -5643,9 +6043,9 @@ abstract class ComponentbuilderHelper **/ public static function getHelpUrl($view) { - $user = JFactory::getUser(); + $user = Factory::getUser(); $groups = $user->get('groups'); - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url')); $query->from('#__componentbuilder_help_document AS a'); @@ -5657,7 +6057,7 @@ abstract class ComponentbuilderHelper if($db->getNumRows()) { $helps = $db->loadObjectList(); - if (self::checkArray($helps)) + if (UtilitiesArrayHelper::check($helps)) { foreach ($helps as $nr => $help) { @@ -5698,7 +6098,7 @@ abstract class ComponentbuilderHelper **/ protected static function loadArticleLink($id) { - return JURI::root().'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; + return Uri::root() . 'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; } /** @@ -5706,8 +6106,8 @@ abstract class ComponentbuilderHelper **/ protected static function loadHelpTextLink($id) { - $token = JSession::getFormToken(); - return 'index.php?option=com_componentbuilder&task=help.getText&id=' . (int) $id . '&token=' . $token; + $token = Session::getFormToken(); + return 'index.php?option=com_componentbuilder&task=help.getText&id=' . (int) $id . '&' . $token . '=1'; } /** @@ -5716,109 +6116,109 @@ abstract class ComponentbuilderHelper public static function addSubmenu($submenu) { // load user for access menus - $user = JFactory::getUser(); + $user = Factory::getUser(); // load the submenus to sidebar - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_DASHBOARD'), 'index.php?option=com_componentbuilder&view=componentbuilder', $submenu === 'componentbuilder'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_DASHBOARD'), 'index.php?option=com_componentbuilder&view=componentbuilder', $submenu === 'componentbuilder'); // Access control (compiler.submenu). if ($user->authorise('compiler.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_COMPILER'), 'index.php?option=com_componentbuilder&view=compiler', $submenu === 'compiler'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_COMPILER'), 'index.php?option=com_componentbuilder&view=compiler', $submenu === 'compiler'); } if ($user->authorise('joomla_component.access', 'com_componentbuilder') && $user->authorise('joomla_component.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS'), 'index.php?option=com_componentbuilder&view=joomla_components', $submenu === 'joomla_components'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS'), 'index.php?option=com_componentbuilder&view=joomla_components', $submenu === 'joomla_components'); } if ($user->authorise('joomla_module.access', 'com_componentbuilder') && $user->authorise('joomla_module.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_MODULES'), 'index.php?option=com_componentbuilder&view=joomla_modules', $submenu === 'joomla_modules'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_MODULES'), 'index.php?option=com_componentbuilder&view=joomla_modules', $submenu === 'joomla_modules'); } if ($user->authorise('joomla_plugin.access', 'com_componentbuilder') && $user->authorise('joomla_plugin.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_PLUGINS'), 'index.php?option=com_componentbuilder&view=joomla_plugins', $submenu === 'joomla_plugins'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_JOOMLA_PLUGINS'), 'index.php?option=com_componentbuilder&view=joomla_plugins', $submenu === 'joomla_plugins'); } if ($user->authorise('power.access', 'com_componentbuilder') && $user->authorise('power.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_POWERS'), 'index.php?option=com_componentbuilder&view=powers', $submenu === 'powers'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_POWERS'), 'index.php?option=com_componentbuilder&view=powers', $submenu === 'powers'); } // Access control (search.access && search.submenu). if ($user->authorise('search.access', 'com_componentbuilder') && $user->authorise('search.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SEARCH'), 'index.php?option=com_componentbuilder&view=search', $submenu === 'search'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_SEARCH'), 'index.php?option=com_componentbuilder&view=search', $submenu === 'search'); } if ($user->authorise('admin_view.access', 'com_componentbuilder') && $user->authorise('admin_view.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS'), 'index.php?option=com_componentbuilder&view=admin_views', $submenu === 'admin_views'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS'), 'index.php?option=com_componentbuilder&view=admin_views', $submenu === 'admin_views'); } if ($user->authorise('custom_admin_view.access', 'com_componentbuilder') && $user->authorise('custom_admin_view.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_CUSTOM_ADMIN_VIEWS'), 'index.php?option=com_componentbuilder&view=custom_admin_views', $submenu === 'custom_admin_views'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_CUSTOM_ADMIN_VIEWS'), 'index.php?option=com_componentbuilder&view=custom_admin_views', $submenu === 'custom_admin_views'); } if ($user->authorise('site_view.access', 'com_componentbuilder') && $user->authorise('site_view.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SITE_VIEWS'), 'index.php?option=com_componentbuilder&view=site_views', $submenu === 'site_views'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_SITE_VIEWS'), 'index.php?option=com_componentbuilder&view=site_views', $submenu === 'site_views'); } if ($user->authorise('template.access', 'com_componentbuilder') && $user->authorise('template.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_TEMPLATES'), 'index.php?option=com_componentbuilder&view=templates', $submenu === 'templates'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_TEMPLATES'), 'index.php?option=com_componentbuilder&view=templates', $submenu === 'templates'); } if ($user->authorise('layout.access', 'com_componentbuilder') && $user->authorise('layout.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LAYOUTS'), 'index.php?option=com_componentbuilder&view=layouts', $submenu === 'layouts'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_LAYOUTS'), 'index.php?option=com_componentbuilder&view=layouts', $submenu === 'layouts'); } if ($user->authorise('dynamic_get.access', 'com_componentbuilder') && $user->authorise('dynamic_get.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_DYNAMIC_GETS'), 'index.php?option=com_componentbuilder&view=dynamic_gets', $submenu === 'dynamic_gets'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_DYNAMIC_GETS'), 'index.php?option=com_componentbuilder&view=dynamic_gets', $submenu === 'dynamic_gets'); } if ($user->authorise('custom_code.access', 'com_componentbuilder') && $user->authorise('custom_code.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_CUSTOM_CODES'), 'index.php?option=com_componentbuilder&view=custom_codes', $submenu === 'custom_codes'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_CUSTOM_CODES'), 'index.php?option=com_componentbuilder&view=custom_codes', $submenu === 'custom_codes'); } if ($user->authorise('placeholder.access', 'com_componentbuilder') && $user->authorise('placeholder.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_PLACEHOLDERS'), 'index.php?option=com_componentbuilder&view=placeholders', $submenu === 'placeholders'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_PLACEHOLDERS'), 'index.php?option=com_componentbuilder&view=placeholders', $submenu === 'placeholders'); } if ($user->authorise('library.access', 'com_componentbuilder') && $user->authorise('library.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LIBRARIES'), 'index.php?option=com_componentbuilder&view=libraries', $submenu === 'libraries'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_LIBRARIES'), 'index.php?option=com_componentbuilder&view=libraries', $submenu === 'libraries'); } if ($user->authorise('snippet.access', 'com_componentbuilder') && $user->authorise('snippet.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SNIPPETS'), 'index.php?option=com_componentbuilder&view=snippets', $submenu === 'snippets'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_SNIPPETS'), 'index.php?option=com_componentbuilder&view=snippets', $submenu === 'snippets'); } // Access control (get_snippets.submenu). if ($user->authorise('get_snippets.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_GET_SNIPPETS'), 'index.php?option=com_componentbuilder&view=get_snippets', $submenu === 'get_snippets'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_GET_SNIPPETS'), 'index.php?option=com_componentbuilder&view=get_snippets', $submenu === 'get_snippets'); } if ($user->authorise('validation_rule.access', 'com_componentbuilder') && $user->authorise('validation_rule.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_VALIDATION_RULES'), 'index.php?option=com_componentbuilder&view=validation_rules', $submenu === 'validation_rules'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_VALIDATION_RULES'), 'index.php?option=com_componentbuilder&view=validation_rules', $submenu === 'validation_rules'); } if ($user->authorise('field.access', 'com_componentbuilder') && $user->authorise('field.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDS'), 'index.php?option=com_componentbuilder&view=fields', $submenu === 'fields'); - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.field', $submenu === 'categories.field'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_FIELDS'), 'index.php?option=com_componentbuilder&view=fields', $submenu === 'fields'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.field', $submenu === 'categories.field'); } if ($user->authorise('fieldtype.access', 'com_componentbuilder') && $user->authorise('fieldtype.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES'), 'index.php?option=com_componentbuilder&view=fieldtypes', $submenu === 'fieldtypes'); - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fieldtype', $submenu === 'categories.fieldtype'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES'), 'index.php?option=com_componentbuilder&view=fieldtypes', $submenu === 'fieldtypes'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fieldtype', $submenu === 'categories.fieldtype'); } if ($user->authorise('language_translation.access', 'com_componentbuilder') && $user->authorise('language_translation.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LANGUAGE_TRANSLATIONS'), 'index.php?option=com_componentbuilder&view=language_translations', $submenu === 'language_translations'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_LANGUAGE_TRANSLATIONS'), 'index.php?option=com_componentbuilder&view=language_translations', $submenu === 'language_translations'); } if ($user->authorise('language.access', 'com_componentbuilder') && $user->authorise('language.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LANGUAGES'), 'index.php?option=com_componentbuilder&view=languages', $submenu === 'languages'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_LANGUAGES'), 'index.php?option=com_componentbuilder&view=languages', $submenu === 'languages'); } if ($user->authorise('server.access', 'com_componentbuilder') && $user->authorise('server.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_SERVERS'), 'index.php?option=com_componentbuilder&view=servers', $submenu === 'servers'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_SERVERS'), 'index.php?option=com_componentbuilder&view=servers', $submenu === 'servers'); } if ($user->authorise('help_document.access', 'com_componentbuilder') && $user->authorise('help_document.submenu', 'com_componentbuilder')) { - JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_HELP_DOCUMENTS'), 'index.php?option=com_componentbuilder&view=help_documents', $submenu === 'help_documents'); + \JHtmlSidebar::addEntry(Text::_('COM_COMPONENTBUILDER_SUBMENU_HELP_DOCUMENTS'), 'index.php?option=com_componentbuilder&view=help_documents', $submenu === 'help_documents'); } } @@ -5892,7 +6292,7 @@ abstract class ComponentbuilderHelper if (strpos($content,'class="uk-') !== false) { // reset - $temp = array(); + $temp = []; foreach (self::$uk_components as $looking => $add) { if (strpos($content,$looking) !== false) @@ -5906,10 +6306,10 @@ abstract class ComponentbuilderHelper self::$uikit = true; } // sorter - if (self::checkArray($temp)) + if (UtilitiesArrayHelper::check($temp)) { // merger - if (self::checkArray($classes)) + if (UtilitiesArrayHelper::check($classes)) { $newTemp = array_merge($temp,$classes); $temp = array_unique($newTemp); @@ -5917,7 +6317,7 @@ abstract class ComponentbuilderHelper return $temp; } } - if (self::checkArray($classes)) + if (UtilitiesArrayHelper::check($classes)) { return $classes; } @@ -5930,11 +6330,11 @@ abstract class ComponentbuilderHelper public static function xls($rows, $fileName = null, $title = null, $subjectTab = null, $creator = 'Vast Development Method', $description = null, $category = null,$keywords = null, $modified = null) { // set the user - $user = JFactory::getUser(); + $user = Factory::getUser(); // set fileName if not set if (!$fileName) { - $fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y'); + $fileName = 'exported_'.Factory::getDate()->format('jS_F_Y'); } // set modified if not set if (!$modified) @@ -6006,7 +6406,7 @@ abstract class ComponentbuilderHelper )); // Add some data - if (($size = self::checkArray($rows)) !== false) + if (($size = UtilitiesArrayHelper::check($rows)) !== false) { $i = 1; @@ -6089,7 +6489,7 @@ abstract class ComponentbuilderHelper // make sure we have the composer classes loaded self::composerAutoload('phpspreadsheet'); // get session object - $session = JFactory::getSession(); + $session = Factory::getSession(); $package = $session->get('package', null); $package = json_decode($package, true); // set the headers @@ -6106,7 +6506,7 @@ abstract class ComponentbuilderHelper $excelReader->setReadDataOnly(true); // load the rows (only first three) $excelObj = $excelReader->load($package['dir']); - $headers = array(); + $headers = []; foreach ($excelObj->getActiveSheet()->getRowIterator() as $row) { if($row->getRowIndex() == 1) @@ -6143,13 +6543,84 @@ abstract class ComponentbuilderHelper return true; } + /** + * Get a Variable + * + * @param string $table The table from which to get the variable + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * + * @return mix string/int/float + * @deprecated 3.3 Use GetHelper::var(...); + */ + public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = 'componentbuilder') + { + return GetHelper::var( + $table, + $where, + $whereString, + $what, + $operator, + $main + ); + } + + /** + * Get array of variables + * + * @param string $table The table from which to get the variables + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * @param bool $unique The switch to return a unique array + * + * @return array + * @deprecated 3.3 Use GetHelper::vars(...); + */ + public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = 'componentbuilder', $unique = true) + { + return GetHelper::vars( + $table, + $where, + $whereString, + $what, + $operator, + $main, + $unique + ); + } + + /** + * Convert a json object to a string + * + * @input string $value The json string to convert + * + * @returns a string + * @deprecated 3.3 Use JsonHelper::string(...); + */ + public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') + { + return JsonHelper::string( + $value, + $sperator, + $table, + $id, + $name + ); + } + public static function isPublished($id,$type) { if ($type == 'raw') { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__componentbuilder_'.$type.' AS a'); @@ -6167,7 +6638,7 @@ abstract class ComponentbuilderHelper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -6176,7 +6647,7 @@ abstract class ComponentbuilderHelper $db->execute(); $found = $db->getNumRows(); if($found) - { + { return $db->loadResult(); } return $id; @@ -6192,39 +6663,39 @@ abstract class ComponentbuilderHelper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions - * + * @return object The CMSObject of permission/authorised actions + * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder', $user = 'null') { // load the user if not given - if (!self::checkObject($user)) + if (!ObjectHelper::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) - $view = self::safeString($view); - if (self::checkString($views)) + $view = UtilitiesStringHelper::safe($view); + if (UtilitiesStringHelper::check($views)) { - $views = self::safeString($views); - } + $views = UtilitiesStringHelper::safe($views); + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; } // get created by if not found - if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + if (ObjectHelper::check($record) && !isset($record->created_by) && isset($record->id)) { - $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + $record->created_by = GetHelper::var($view, $record->id, 'id', 'created_by', '=', $component); } // set actions only set in component settings $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); @@ -6233,12 +6704,12 @@ abstract class ComponentbuilderHelper if ($target) { // convert to an array - if (self::checkString($target)) + if (UtilitiesStringHelper::check($target)) { $target = array($target); } // check if we are good to go - if (self::checkArray($target)) + if (UtilitiesArrayHelper::check($target)) { $checkTarget = true; } @@ -6259,7 +6730,7 @@ abstract class ComponentbuilderHelper // set area $area = 'comp'; // check if the record has an ID and the action is item related (not a component action) - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + if (ObjectHelper::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) { // we are in item @@ -6292,7 +6763,7 @@ abstract class ComponentbuilderHelper } } } - elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + elseif (UtilitiesStringHelper::check($views) && isset($record->catid) && $record->catid > 0) { // we are in item $area = 'category'; @@ -6364,7 +6835,7 @@ abstract class ComponentbuilderHelper * @param array $targets The array of target actions * * @return boolean true if action should be filtered out - * + * */ protected static function filterActions(&$view, &$action, &$targets) { @@ -6383,22 +6854,22 @@ abstract class ComponentbuilderHelper /** * Get any component's model */ - public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = 'Componentbuilder', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = 'Componentbuilder', $config = []) { // fix the name - $name = self::safeString($name); + $name = UtilitiesStringHelper::safe($name); // full path to models $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model'); // make sure the table path is loaded - if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + if (!isset($config['table_path']) || !UtilitiesStringHelper::check($config['table_path'])) { // This is the JCB default path to tables in Joomla 3.x $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; } // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { @@ -6433,14 +6904,14 @@ abstract class ComponentbuilderHelper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_componentbuilder'); - + $parentId = $parent->id; $name = 'com_componentbuilder.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -6464,14 +6935,14 @@ abstract class ComponentbuilderHelper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_componentbuilder', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else @@ -6484,7 +6955,7 @@ abstract class ComponentbuilderHelper $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__componentbuilder_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__componentbuilder_'.$table, $object, 'id'); } } return false; @@ -6501,7 +6972,7 @@ abstract class ComponentbuilderHelper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -6516,8 +6987,8 @@ abstract class ComponentbuilderHelper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -6532,7 +7003,7 @@ abstract class ComponentbuilderHelper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -6540,8 +7011,8 @@ abstract class ComponentbuilderHelper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -6586,7 +7057,7 @@ abstract class ComponentbuilderHelper * @return null * @deprecated 3.3 Use FormHelper::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { FormHelper::attributes($xml, $attributes); } @@ -6600,7 +7071,7 @@ abstract class ComponentbuilderHelper * @return void * @deprecated 3.3 Use FormHelper::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { FormHelper::options($xml, $options); } @@ -6655,17 +7126,69 @@ abstract class ComponentbuilderHelper // button attributes $buttonAttributes = array( 'type' => 'radio', - 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', - 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'name' => isset($args[0]) ? UtilitiesStringHelper::html($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? UtilitiesStringHelper::safe(UtilitiesStringHelper::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); // set the button options $buttonOptions = array( - '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', - '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + '1' => isset($args[3]) ? UtilitiesStringHelper::html($args[3]) : 'JYES', + '0' => isset($args[4]) ? UtilitiesStringHelper::html($args[4]) : 'JNO'); // return the input - return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + return FormHelper::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + } + + /** + * Check if have an json string + * + * @input string The json string to check + * + * @returns bool true on success + * @deprecated 3.3 Use JsonHelper::check($string); + */ + public static function checkJson($string) + { + return JsonHelper::check($string); + } + + /** + * Check if have an object with a length + * + * @input object The object to check + * + * @returns bool true on success + * @deprecated 3.3 Use ObjectHelper::check($object); + */ + public static function checkObject($object) + { + return ObjectHelper::check($object); + } + + /** + * Check if have an array with a length + * + * @input array The array to check + * + * @returns bool/int number of items in array on success + * @deprecated 3.3 Use UtilitiesArrayHelper::check($array, $removeEmptyString); + */ + public static function checkArray($array, $removeEmptyString = false) + { + return UtilitiesArrayHelper::check($array, $removeEmptyString); + } + + /** + * Check if have a string with a length + * + * @input string The string to check + * + * @returns bool true on success + * @deprecated 3.3 Use UtilitiesStringHelper::check($string); + */ + public static function checkString($string) + { + return UtilitiesStringHelper::check($string); } /** @@ -6677,8 +7200,8 @@ abstract class ComponentbuilderHelper public static function isConnected() { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? - $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -6693,12 +7216,125 @@ abstract class ComponentbuilderHelper return $is_conn; } + /** + * Merge an array of array's + * + * @input array The arrays you would like to merge + * + * @returns array on success + * @deprecated 3.3 Use UtilitiesArrayHelper::merge($arrays); + */ + public static function mergeArrays($arrays) + { + return UtilitiesArrayHelper::merge($arrays); + } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) { return self::shorten($string, $length, $addTip); } + /** + * Shorten a string + * + * @input string The you would like to shorten + * + * @returns string on success + * @deprecated 3.3 Use UtilitiesStringHelper::shorten(...); + */ + public static function shorten($string, $length = 40, $addTip = true) + { + return UtilitiesStringHelper::shorten($string, $length, $addTip); + } + + /** + * Making strings safe (various ways) + * + * @input string The you would like to make safe + * + * @returns string on success + * @deprecated 3.3 Use UtilitiesStringHelper::safe(...); + */ + public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) + { + return UtilitiesStringHelper::safe( + $string, + $type, + $spacer, + $replaceNumbers, + $keepOnlyCharacters + ); + } + + /** + * Convert none English strings to code usable string + * + * @input an string + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::transliterate($string); + */ + public static function transliterate($string) + { + return UtilitiesStringHelper::transliterate($string); + } + + /** + * make sure a string is HTML save + * + * @input an html string + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::html(...); + */ + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) + { + return UtilitiesStringHelper::html( + $var, + $charset, + $shorten, + $length + ); + } + + /** + * Convert all int in a string to an English word string + * + * @input an string with numbers + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::numbers($string); + */ + public static function replaceNumbers($string) + { + return UtilitiesStringHelper::numbers($string); + } + + /** + * Convert an integer into an English word string + * Thanks to Tom Nicholson + * + * @input an int + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::number($x); + */ + public static function numberToString($x) + { + return UtilitiesStringHelper::number($x); + } + + /** + * Random Key + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::random($size); + */ + public static function randomkey($size) + { + return UtilitiesStringHelper::random($size); + } + /** * Get The Encryption Keys * @@ -6711,12 +7347,12 @@ abstract class ComponentbuilderHelper public static function getCryptKey($type, $default = false) { // Get the global params - $params = JComponentHelper::getParams('com_componentbuilder', true); + $params = ComponentHelper::getParams('com_componentbuilder', true); // Basic Encryption Type if ('basic' === $type) { $basic_key = $params->get('basic_key', $default); - if (self::checkString($basic_key)) + if (UtilitiesStringHelper::check($basic_key)) { return $basic_key; } diff --git a/admin/helpers/componentbuilderemail.php b/admin/helpers/componentbuilderemail.php index d5da051da..762f21866 100644 --- a/admin/helpers/componentbuilderemail.php +++ b/admin/helpers/componentbuilderemail.php @@ -12,6 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Mail\Mail; +use Joomla\Registry\Registry; +use VDM\Joomla\Utilities\ArrayHelper; + /** * Componentbuilder component email helper */ @@ -22,28 +28,28 @@ abstract class ComponentbuilderEmail * * @var activeRecipient (array) */ - public static $active = array(); + public static $active = []; /** * Configuraiton object * - * @var JConfig + * @var Registry */ - public static $config = null; + public static ?Registry $config = null; /** * Mailer object * - * @var JMail + * @var Mail */ - public static $mailer = null; + public static ?Mail $mailer = null; /** * Custom Headers * * @var array */ - protected static $header = array(); + protected static array $header = []; /** * Get a configuration object @@ -53,7 +59,7 @@ abstract class ComponentbuilderEmail { if (!self::$config) { - self::$config = JComponentHelper::getParams('com_componentbuilder'); + self::$config = ComponentHelper::getParams('com_componentbuilder'); } return self::$config; @@ -92,7 +98,7 @@ abstract class ComponentbuilderEmail * @static * @access public */ - public static function validateAddress($address, $patternselect = null) + public static function validateAddress($address, $patternselect = null): bool { return self::getMailerInstance()->validateAddress($address, $patternselect); } @@ -100,13 +106,13 @@ abstract class ComponentbuilderEmail /** * Get a mailer object. * - * Returns the global {@link JMail} object, only creating it if it doesn't already exist. + * Returns the global {@link Mail} object, only creating it if it doesn't already exist. * - * @return JMail object + * @return Mail object * - * @see JMail + * @see Mail */ - public static function getMailer() + public static function getMailer(): Mail { if (!self::$mailer) { @@ -121,58 +127,58 @@ abstract class ComponentbuilderEmail /** * Create a mailer object * - * @return JMail object + * @return Mail object * - * @see JMail + * @see Mail */ - protected static function createMailer() + protected static function createMailer(): Mail { // set component params $conf = self::getConfig(); - + // now load the mailer $mailer = $conf->get('mailer', 'global'); - - // Create a JMail object - $mail = JMail::getInstance(); + + // Create a Mail object + $mail = Mail::getInstance(); // check if set to global if ('global' == $mailer) { // get the global details - $globalConf = JFactory::getConfig(); - - $mailer = $globalConf->get('mailer'); - $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; - $smtpuser = $globalConf->get('smtpuser'); - $smtppass = $globalConf->get('smtppass'); - $smtphost = $globalConf->get('smtphost'); - $smtpsecure = $globalConf->get('smtpsecure'); - $smtpport = $globalConf->get('smtpport'); - $sendmail = $globalConf->get('sendmail'); - $mailfrom = $globalConf->get('mailfrom'); - $fromname = $globalConf->get('fromname'); - $replyto = $globalConf->get('replyto'); - $replytoname = $globalConf->get('replytoname'); + $globalConf = Factory::getConfig(); + + $mailer = $globalConf->get('mailer'); + $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $globalConf->get('smtpuser'); + $smtppass = $globalConf->get('smtppass'); + $smtphost = $globalConf->get('smtphost'); + $smtpsecure = $globalConf->get('smtpsecure'); + $smtpport = $globalConf->get('smtpport'); + $sendmail = $globalConf->get('sendmail'); + $mailfrom = $globalConf->get('mailfrom'); + $fromname = $globalConf->get('fromname'); + $replyto = $globalConf->get('replyto'); + $replytoname = $globalConf->get('replytoname'); } else { - $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; - $smtpuser = $conf->get('smtpuser'); - $smtppass = $conf->get('smtppass'); - $smtphost = $conf->get('smtphost'); - $smtpsecure = $conf->get('smtpsecure'); - $smtpport = $conf->get('smtpport'); - $sendmail = $conf->get('sendmail'); - $mailfrom = $conf->get('emailfrom'); - $fromname = $conf->get('fromname'); - $replyto = $conf->get('replyto'); - $replytoname = $conf->get('replytoname'); + $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1; + $smtpuser = $conf->get('smtpuser'); + $smtppass = $conf->get('smtppass'); + $smtphost = $conf->get('smtphost'); + $smtpsecure = $conf->get('smtpsecure'); + $smtpport = $conf->get('smtpport'); + $sendmail = $conf->get('sendmail'); + $mailfrom = $conf->get('emailfrom'); + $fromname = $conf->get('fromname'); + $replyto = $conf->get('replyto'); + $replytoname = $conf->get('replytoname'); } // Set global sender $mail->setSender(array($mailfrom, $fromname)); - + // set the global reply-to if found if ($replyto && $replytoname) { @@ -221,25 +227,25 @@ abstract class ComponentbuilderEmail */ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null) { - // Get a JMail instance + // Get a Mail instance $mail = self::getMailer(); - + // set component params $conf = self::getConfig(); - + // set if we have override if ($mailfrom && $fromname) { $mail->setSender(array($mailfrom, $fromname)); } - + // load the bounce email as sender if set if (!is_null($bounce_email)) - { + { $mail->Sender = $bounce_email; } - - // Add tag to email to identify it + + // Add tag to email to identify it if (!is_null($idsession)) { $mail->addCustomHeader('X-VDMmethodID:'.$idsession); @@ -257,7 +263,7 @@ abstract class ComponentbuilderEmail // set the subject & Body $mail->setSubject($subject); $mail->setBody($body); - + // Are we sending the email as HTML? if ($mode) { @@ -268,7 +274,7 @@ abstract class ComponentbuilderEmail //embed images if ($embeded) { - if(ComponentbuilderHelper::checkArray($embeds)) + if(ArrayHelper::check($embeds)) { foreach($embeds as $embed) { @@ -303,21 +309,21 @@ abstract class ComponentbuilderEmail { if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) { - $mail->DKIM_domain = $conf->get('dkim_domain'); - $mail->DKIM_selector = $conf->get('dkim_selector'); - $mail->DKIM_identity = $conf->get('dkim_identity'); - $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); - - $tmp = tempnam(sys_get_temp_dir(), 'VDM'); - $h = fopen($tmp, 'w'); + $mail->DKIM_domain = $conf->get('dkim_domain'); + $mail->DKIM_selector = $conf->get('dkim_selector'); + $mail->DKIM_identity = $conf->get('dkim_identity'); + $mail->DKIM_passphrase = $conf->get('dkim_passphrase'); + + $tmp = tempnam(sys_get_temp_dir(), 'VDM'); + $h = fopen($tmp, 'w'); fwrite($h, $conf->get('dkim_private')); fclose($h); - $mail->DKIM_private = $tmp; + $mail->DKIM_private = $tmp; } } $sendmail = $mail->Send(); - + if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public'))) { @unlink($tmp); @@ -346,7 +352,7 @@ abstract class ComponentbuilderEmail /** * Set html text (in a row) and subject (as title) to a email table. * do not use

instead use
- * in your html that you pass to this method + * in your html that you pass to this method * since it is a table row it does not * work well with paragraphs * @@ -355,7 +361,7 @@ abstract class ComponentbuilderEmail */ public static function setBasicBody($html, $subject) { - $body = array(); + $body = []; $body[] = ""; $body[] = ""; $body[] = ""; @@ -392,7 +398,7 @@ abstract class ComponentbuilderEmail /** * Set html text (in a row) and subject (as title) to a email table. * do not use

instead use
- * in your html that you pass to this method + * in your html that you pass to this method * since it is a table row it does not * work well with paragraphs * @@ -401,7 +407,7 @@ abstract class ComponentbuilderEmail */ public static function setTableBody($html, $subject) { - $body = array(); + $body = []; $body[] = ""; $body[] = ""; $body[] = ""; diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index 707708464..edd5ee265 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -12,24 +12,36 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; + class componentbuilderHeaderCheck { + protected $document = null; + protected $app = null; + function js_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['scripts']) as $script) { if (stristr($script, $script_name)) @@ -40,24 +52,30 @@ class componentbuilderHeaderCheck return false; } - + function css_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); - + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['styleSheets']) as $script) { if (stristr($script, $script_name)) @@ -68,4 +86,4 @@ class componentbuilderHeaderCheck return false; } -} \ No newline at end of file +} diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index d35e20b21..4ebc286b5 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -25,7 +25,7 @@ abstract class JHtmlBatch_ * @var array * @since 3.0 */ - protected static $ListSelection = array(); + protected static $ListSelection = []; /** * Render the batch selection options. diff --git a/admin/helpers/indenter.php b/admin/helpers/indenter.php deleted file mode 100644 index 575896cd0..000000000 --- a/admin/helpers/indenter.php +++ /dev/null @@ -1,204 +0,0 @@ - - @github Joomla Component Builder - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ - -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); - -/** - * @link https://github.com/gajus/dindent for the canonical source repository - * @license https://github.com/gajus/dindent/blob/master/LICENSE BSD 3-Clause - */ -class Indenter { - private - $log = array(), - $options = array( - 'indentation_character' => ' ' - ), - $inline_elements = array('b', 'big', 'i', 'small', 'tt', 'abbr', 'acronym', 'cite', 'code', 'dfn', 'em', 'kbd', 'strong', 'samp', 'var', 'a', 'bdo', 'br', 'img', 'span', 'sub', 'sup'), - $temporary_replacements_script = array(), - $temporary_replacements_inline = array(); - - const ELEMENT_TYPE_BLOCK = 0; - const ELEMENT_TYPE_INLINE = 1; - - const MATCH_INDENT_NO = 0; - const MATCH_INDENT_DECREASE = 1; - const MATCH_INDENT_INCREASE = 2; - const MATCH_DISCARD = 3; - - /** - * @param array $options - */ - public function __construct (array $options = array()) { - foreach ($options as $name => $value) { - if (!array_key_exists($name, $this->options)) { - throw new Exception\InvalidArgumentException('Unrecognized option.'); - } - - $this->options[$name] = $value; - } - } - - /** - * @param string $element_name Element name, e.g. "b". - * @param ELEMENT_TYPE_BLOCK|ELEMENT_TYPE_INLINE $type - * @return null - */ - public function setElementType ($element_name, $type) { - if ($type === static::ELEMENT_TYPE_BLOCK) { - $this->inline_elements = array_diff($this->inline_elements, array($element_name)); - } else if ($type === static::ELEMENT_TYPE_INLINE) { - $this->inline_elements[] = $element_name; - } else { - throw new Exception\InvalidArgumentException('Unrecognized element type.'); - } - - $this->inline_elements = array_unique($this->inline_elements); - } - - /** - * @param string $input HTML input. - * @return string Indented HTML. - */ - public function indent ($input) { - $this->log = array(); - - // Dindent does not indent ', $input); - } - } - - // Removing double whitespaces to make the source code easier to read. - // With exception of

/ CSS white-space changing the default behaviour, double whitespace is meaningless in HTML output.
-        // This reason alone is sufficient not to use Dindent in production.
-        $input = str_replace("\t", '', $input);
-        $input = preg_replace('/\s{2,}/', ' ', $input);
-
-        // Remove inline elements and replace them with text entities.
-        if (preg_match_all('/<(' . implode('|', $this->inline_elements) . ')[^>]*>(?:[^<]*)<\/\1>/', $input, $matches)) {
-            $this->temporary_replacements_inline = $matches[0];
-            foreach ($matches[0] as $i => $match) {
-                $input = str_replace($match, 'ᐃ' . ($i + 1) . 'ᐃ', $input);
-            }
-        }
-
-        $subject = $input;
-
-        $output = '';
-
-        $next_line_indentation_level = 0;
-
-        do {
-            $indentation_level = $next_line_indentation_level;
-
-            $patterns = array(
-                // block tag
-                '/^(<([a-z]+)(?:[^>]*)>(?:[^<]*)<\/(?:\2)>)/' => static::MATCH_INDENT_NO,
-                // DOCTYPE
-                '/^]*)>/' => static::MATCH_INDENT_NO,
-                // tag with implied closing
-                '/^<(input|link|meta|base|br|img|hr)([^>]*)>/' => static::MATCH_INDENT_NO,
-                // opening tag
-                '/^<[^\/]([^>]*)>/' => static::MATCH_INDENT_INCREASE,
-                // closing tag
-                '/^<\/([^>]*)>/' => static::MATCH_INDENT_DECREASE,
-                // self-closing tag
-                '/^<(.+)\/>/' => static::MATCH_INDENT_DECREASE,
-                // whitespace
-                '/^(\s+)/' => static::MATCH_DISCARD,
-                // text node
-                '/([^<]+)/' => static::MATCH_INDENT_NO
-            );
-            $rules = array('NO', 'DECREASE', 'INCREASE', 'DISCARD');
-
-            foreach ($patterns as $pattern => $rule) {
-                if ($match = preg_match($pattern, $subject, $matches)) {
-                    $this->log[] = array(
-                        'rule' => $rules[$rule],
-                        'pattern' => $pattern,
-                        'subject' => $subject,
-                        'match' => $matches[0]
-                    );
-
-                    $subject = mb_substr($subject, mb_strlen($matches[0]));
-
-                    if ($rule === static::MATCH_DISCARD) {
-                        break;
-                    }
-
-                    if ($rule === static::MATCH_INDENT_NO) {
-
-                    } else if ($rule === static::MATCH_INDENT_DECREASE) {
-                        $next_line_indentation_level--;
-                        $indentation_level--;
-                    } else {
-                        $next_line_indentation_level++;
-                    }
-
-                    if ($indentation_level < 0) {
-                        $indentation_level = 0;
-                    }
-
-                    $output .= str_repeat($this->options['indentation_character'], $indentation_level) . $matches[0] . "\n";
-
-                    break;
-                }
-            }
-        } while ($match);
-
-        $interpreted_input = '';
-        foreach ($this->log as $e) {
-            $interpreted_input .= $e['match'];
-        }
-
-        if ($interpreted_input !== $input) {
-            throw new Exception\RuntimeException('Did not reproduce the exact input.');
-        }
-
-        $output = preg_replace('/(<(\w+)[^>]*>)\s*(<\/\2>)/', '\\1\\3', $output);
-
-        foreach ($this->temporary_replacements_script as $i => $original) {
-            $output = str_replace('', $original, $output);
-        }
-
-        foreach ($this->temporary_replacements_inline as $i => $original) {
-            $output = str_replace('ᐃ' . ($i + 1) . 'ᐃ', $original, $output);
-        }
-
-        return trim($output);
-    }
-
-    /**
-     * Debugging utility. Get log for the last indent operation.
-     *
-     * @return array
-     */
-    public function getLog () {
-        return $this->log;
-    }
-}
diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini
index 64e38e12e..d28089d84 100644
--- a/admin/language/en-GB/en-GB.com_componentbuilder.ini
+++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini
@@ -199,6 +199,7 @@ COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_CREATED_DATE_DESC="The date this Admin Cu
 COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_CREATED_DATE_LABEL="Created Date"
 COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_EDIT="Editing the Admin Custom Tabs"
 COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ERROR_UNIQUE_ALIAS="Another Admin Custom Tabs has the same alias."
+COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Admin Custom Tabs has the same alias ."
 COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_HTML_HINT="// Add the tab HTML here. To access php values methodname->value; ?>"
 COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_HTML_LABEL="HTML"
 COM_COMPONENTBUILDER_ADMIN_CUSTOM_TABS_ID="Id"
@@ -254,6 +255,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CREATED_DATE_DESC="The date this Ad
 COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_CREATED_DATE_LABEL="Created Date"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EDIT="Editing the Admin Fields Conditions"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ERROR_UNIQUE_ALIAS="Another Admin Fields Conditions has the same alias."
+COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Admin Fields Conditions has the same alias ."
 COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_EXACT_LENGTH_ONLY_4_TEXT_FIELD="Exact Length (only 4 text_field)"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE_ONLY="Hide Only"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_HIDE_TOGGLE="Hide Toggle"
@@ -306,6 +308,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_DEFAULT="Default"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_EDIT="Editing the Admin Fields"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_EDITING="Editing"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_ERROR_UNIQUE_ALIAS="Another Admin Fields has the same alias."
+COM_COMPONENTBUILDER_ADMIN_FIELDS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Admin Fields has the same alias ."
 COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD="Field"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELDS="Fields"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_FIELD_DESCRIPTION="Select a field"
@@ -357,6 +360,7 @@ COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CREATED_DATE_LABEL="Created Date"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_CUSTOM_RAQUO_CODE="Custom » Code"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_EDIT="Editing the Admin Fields Relations"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS="Another Admin Fields Relations has the same alias."
+COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Admin Fields Relations has the same alias ."
 COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_ID="Id"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS="Joinfields"
 COM_COMPONENTBUILDER_ADMIN_FIELDS_RELATIONS_JOINFIELDS_DESCRIPTION="Select the target join fields."
@@ -667,6 +671,7 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_ENVELOPE="Envelope"
 COM_COMPONENTBUILDER_ADMIN_VIEW_ENVELOPE_OPENED="Envelope Opened"
 COM_COMPONENTBUILDER_ADMIN_VIEW_EQUALIZER="Equalizer"
 COM_COMPONENTBUILDER_ADMIN_VIEW_ERROR_UNIQUE_ALIAS="Another Admin View has the same alias."
+COM_COMPONENTBUILDER_ADMIN_VIEW_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Admin View has the same alias ."
 COM_COMPONENTBUILDER_ADMIN_VIEW_EUCJPMS_BIN_CHARSET_EUCJPMS="eucjpms_bin (charset = eucjpms)"
 COM_COMPONENTBUILDER_ADMIN_VIEW_EUCJPMS_JAPANESE_CI_CHARSET_EUCJPMS="eucjpms_japanese_ci (charset = eucjpms)"
 COM_COMPONENTBUILDER_ADMIN_VIEW_EUCJPMS_UJIS_FOR_WINDOWS_JAPANESE_MOST_SUITABLE_COLLATION_EUCJPMS_JAPANESE_CI="eucjpms - UJIS for Windows Japanese (most suitable collation = eucjpms_japanese_ci)"
@@ -1043,9 +1048,10 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_SMILEY_NEUTRAL="Smiley Neutral"
 COM_COMPONENTBUILDER_ADMIN_VIEW_SMILEY_NEUTRAL_2="Smiley Neutral 2"
 COM_COMPONENTBUILDER_ADMIN_VIEW_SMILEY_SAD="Smiley Sad"
 COM_COMPONENTBUILDER_ADMIN_VIEW_SMILEY_SAD_2="Smiley Sad 2"
-COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCEMAP_DESCRIPTION="Map the Source to this view's fields.
// First Table Map.
SourceField => viewField
// Other Tables Map.
firstTableKeySourceField == keySourceField
SourceField => viewField" +COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCEMAP_DESCRIPTION="Map the Source to this view's fields.
// First Table Map.
SourceField => viewField
// Other Tables Map.
firstTableKeySourceField == keySourceField
SourceField => viewField
// Remember to add all fields that has no default value, and is not null." COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCEMAP_HINT="SourceField => viewField" COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCEMAP_LABEL="Source Map" +COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCEMAP_MESSAGE="Please review the Source Map selection, as it appears that certain mandatory fields have been excluded from the (MySQL -> Tables -> Source Map) selection. These specific fields are designated as 'not null' and lack default values. This oversight may lead to errors when installing your component on Joomla 5 and above. To address this issue, you are presented with a few options:

1. Assign a default value to the field. This can be done within the specific field settings under the Database Tab.
2. Modify the field's Null Switch to 'NULL'. This adjustment also takes place in the field settings.3. Alternatively, you could add these fields into the MySQL -> Tables -> Source Map selection. This inclusion ensures that all necessary data parameters are correctly mapped in the MySQL (dump) and available during the Joomla component installation process.

By taking one of these actions, you will prevent potential installation errors and ensure compatibility with the requirements of Joomla 5 and above." COM_COMPONENTBUILDER_ADMIN_VIEW_SOURCE_LABEL="Select MySql Source" COM_COMPONENTBUILDER_ADMIN_VIEW_SQL_DESCRIPTION="Add your MySQL here!" COM_COMPONENTBUILDER_ADMIN_VIEW_SQL_HINT="// Add MySQL Table Dump Here" @@ -1283,9 +1289,10 @@ COM_COMPONENTBUILDER_ALIGNMENT="Alignment" COM_COMPONENTBUILDER_ALL="All" COM_COMPONENTBUILDER_ALLOWS_YOU_TO_OVERRIDE_THE_BUILD_DATE_BY_SELECTING_A_DATE_MANUALLY_FROM_THE_CALENDER="Allows you to override the build date by selecting a date manually from the calender." COM_COMPONENTBUILDER_ALL_FOUND_INSTANCES_IN_S_WHERE_REPLACED="All found instances in %s where replaced" -COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter." +COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATER="All is good, please check again later" COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME="All is good, there is no notice at this time." COM_COMPONENTBUILDER_ALL_OF_THESE_PACKAGES_ARE_A_FULLY_DEVELOPEDMAPPED_COMPONENTS_FOR_JCB_THEY_CAN_BE_SEEN_AS_DEMO_CONTENT_OR_BASE_IMAGES_FROM_WHICH_TO_START_YOUR_PROJECTBR_ALWAYS_MAKE_SURE_YOU_ARE_ON_THE_LATEST_VERSION_OF_JCB_BEFORE_IMPORTING_ANY_OF_THESE_PACKAGES_SHOULD_ANY_OF_THEM_FAIL_TO_IMPORT_A_S_PLEASE_LET_US_KNOWA="All of these packages are a fully developed/mapped components for JCB. They can be seen as demo content, or base images from which to start your project.
Always make sure you are on the latest version of JCB before importing any of these packages, should any of them fail to import please let us know." +COM_COMPONENTBUILDER_ALL_THE_FIELDS_AND_VIEWS_FROM_YOUR_SQL_DUMP_HAS_BEEN_CREATED_AND_LINKED_TO_THIS_COMPONENT="All the fields and views from your sql dump has been created and linked to this component." COM_COMPONENTBUILDER_ALL_THE_LANGUAGES_FOUND_IN_JOOMLA_WERE_SUCCESSFULLY_IMPORTED="All the languages found in Joomla were successfully imported." COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work on this page will be lost, are you sure you want to continue?" COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER="Already selected, try another." @@ -1310,7 +1317,7 @@ COM_COMPONENTBUILDER_AUTHOR_NAME="Author Name" COM_COMPONENTBUILDER_AUTHOR_WEBSITE="Author Website" COM_COMPONENTBUILDER_AUTO_CHECKIN="Auto Check-in" COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES="Available Libraries" -COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED="A method (setDynamicF0ld3rs) was added to the install script.php of this package to insure that the folder(s) are copied into the correct place when this component is installed!" +COM_COMPONENTBUILDER_A_METHOD_S_WAS_ADDED_TO_THE_INSTALL_BSB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED="A method (%s) was added to the install %s of this package to insure that the folder(s) are copied into the correct place when this component is installed!" COM_COMPONENTBUILDER_A_S_SPAN_CLASSICONFLAG_SPANREPORT_BROKEN_PACKAGEA=" Report Broken Package" COM_COMPONENTBUILDER_BACK="Back" COM_COMPONENTBUILDER_BACKUP="Backup" @@ -1328,7 +1335,6 @@ COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR="Become a Contributor" COM_COMPONENTBUILDER_BEHAVIOUR="Behaviour" COM_COMPONENTBUILDER_BEHIND="Behind" COM_COMPONENTBUILDER_BEHIND_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BOLDER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Behind means your local snippet (with the same name, library and type) has a older modified date then the community snippet (with the same name, library and type)." -COM_COMPONENTBUILDER_BETA_RELEASE="Beta Release" COM_COMPONENTBUILDER_BE_A_PART_OF_JCB="Be a Part of JCB" COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE="Be cautious! Do not continue unless you trust the origin of this package!" COM_COMPONENTBUILDER_BFIELD_TYPEB_IDS_MISMATCH_IN_BSB="Field type id:%s mismatch in %s." @@ -1413,6 +1419,7 @@ COM_COMPONENTBUILDER_CLASS_EXTENDS_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_CLASS_EXTENDS_DETAILS="Details" COM_COMPONENTBUILDER_CLASS_EXTENDS_EDIT="Editing the Class Extends" COM_COMPONENTBUILDER_CLASS_EXTENDS_ERROR_UNIQUE_ALIAS="Another Class Extends has the same alias." +COM_COMPONENTBUILDER_CLASS_EXTENDS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Class Extends has the same alias ." COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_DESCRIPTION="The type this class_extends belongs to." COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL="Type" COM_COMPONENTBUILDER_CLASS_EXTENDS_HEAD_DESCRIPTION="The class header to add any header values can be added." @@ -1501,6 +1508,7 @@ COM_COMPONENTBUILDER_CLASS_METHOD_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_CLASS_METHOD_DETAILS="Details" COM_COMPONENTBUILDER_CLASS_METHOD_EDIT="Editing the Class Method" COM_COMPONENTBUILDER_CLASS_METHOD_ERROR_UNIQUE_ALIAS="Another Class Method has the same alias." +COM_COMPONENTBUILDER_CLASS_METHOD_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Class Method has the same alias ." COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_DESCRIPTION="The type this class_method belongs to." COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL="Type" COM_COMPONENTBUILDER_CLASS_METHOD_GUID_DESCRIPTION="Globally Unique Identifier" @@ -1598,6 +1606,7 @@ COM_COMPONENTBUILDER_CLASS_PROPERTY_DEFAULT_MESSAGE="Error! Please add default v COM_COMPONENTBUILDER_CLASS_PROPERTY_DETAILS="Details" COM_COMPONENTBUILDER_CLASS_PROPERTY_EDIT="Editing the Class Property" COM_COMPONENTBUILDER_CLASS_PROPERTY_ERROR_UNIQUE_ALIAS="Another Class Property has the same alias." +COM_COMPONENTBUILDER_CLASS_PROPERTY_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Class Property has the same alias ." COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_DESCRIPTION="The type this class_property belongs to." COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL="Type" COM_COMPONENTBUILDER_CLASS_PROPERTY_GUID_DESCRIPTION="Globally Unique Identifier" @@ -1639,6 +1648,7 @@ COM_COMPONENTBUILDER_CLONE="Clone" COM_COMPONENTBUILDER_CLONE_FAILED="Clone failed!" COM_COMPONENTBUILDER_CLOSE_NEW="Close & New" COM_COMPONENTBUILDER_CODE="Code" +COM_COMPONENTBUILDER_CODESTRINGS="code/strings" COM_COMPONENTBUILDER_COMMUNITY_PACKAGES="Community Packages" COM_COMPONENTBUILDER_COMPANY="Company" COM_COMPONENTBUILDER_COMPANY_NAME="Company Name" @@ -2084,6 +2094,48 @@ COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_N_ITEMS_UNFEATURED="%s Components Plugin COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_N_ITEMS_UNFEATURED_1="%s Component Plugins unfeatured." COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_N_ITEMS_UNPUBLISHED="%s Components Plugins unpublished." COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_N_ITEMS_UNPUBLISHED_1="%s Component Plugins unpublished." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS="Components Routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS="Components Routers Access" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS_DESC="Allows the users in this group to access access components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_OPTIONS="Batch process the selected Components Routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_TIP="All changes will be applied to all selected Components Routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE="Components Routers Batch Use" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE="Components Routers Create" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE_DESC="Allows the users in this group to create create components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE="Components Routers Delete" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE_DESC="Allows the users in this group to delete delete components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT="Components Routers Edit" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY="Components Routers Edit Created By" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE="Components Routers Edit Created Date" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_DESC="Allows the users in this group to edit the component router" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN="Components Routers Edit Own" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components routers created by them" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE="Components Routers Edit State" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component router" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION="Components Routers Edit Version" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_ARCHIVED="%s Components Routers archived." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_ARCHIVED_1="%s Component Router archived." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_CHECKED_IN_0="No Component Router successfully checked in." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_CHECKED_IN_1="%d Component Router successfully checked in." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_CHECKED_IN_MORE="%d Components Routers successfully checked in." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_DELETED="%s Components Routers deleted." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_DELETED_1="%s Component Router deleted." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_FAILED_PUBLISHING="%s Components Routers failed publishing." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_FAILED_PUBLISHING_1="%s Component Router failed publishing." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_FEATURED="%s Components Routers featured." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_FEATURED_1="%s Component Router featured." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_PUBLISHED="%s Components Routers published." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_PUBLISHED_1="%s Component Router published." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_TRASHED="%s Components Routers trashed." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_TRASHED_1="%s Component Router trashed." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_UNFEATURED="%s Components Routers unfeatured." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_UNFEATURED_1="%s Component Router unfeatured." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_UNPUBLISHED="%s Components Routers unpublished." +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_N_ITEMS_UNPUBLISHED_1="%s Component Router unpublished." COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS="Components Site Views" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS="Components Site Views Access" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS_DESC="Allows the users in this group to access access components site views" @@ -2261,6 +2313,7 @@ COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ENVELOPE="Envelope" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ENVELOPE_OPENED="Envelope Opened" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EQUALIZER="Equalizer" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ERROR_UNIQUE_ALIAS="Another Component Admin Views has the same alias." +COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Admin Views has the same alias ." COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EXIT="Exit" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EXPAND="Expand" COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EXPAND_2="Expand 2" @@ -2459,6 +2512,7 @@ COM_COMPONENTBUILDER_COMPONENT_CONFIG_CUSTOM_VALUE_HINT="Custom Value Here" COM_COMPONENTBUILDER_COMPONENT_CONFIG_CUSTOM_VALUE_LABEL="Custom Value" COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT="Editing the Component Config" COM_COMPONENTBUILDER_COMPONENT_CONFIG_ERROR_UNIQUE_ALIAS="Another Component Config has the same alias." +COM_COMPONENTBUILDER_COMPONENT_CONFIG_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Config has the same alias ." COM_COMPONENTBUILDER_COMPONENT_CONFIG_FIELD="Field" COM_COMPONENTBUILDER_COMPONENT_CONFIG_FIELD_DESCRIPTION="Select a field" COM_COMPONENTBUILDER_COMPONENT_CONFIG_FIELD_LABEL="Field" @@ -2499,6 +2553,7 @@ COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_DASHBOARD_LIST_DESCRIPTION="Se COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_DASHBOARD_LIST_LABEL="Dashboard (list of records)" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT="Editing the Component Custom Admin Menus" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_ERROR_UNIQUE_ALIAS="Another Component Custom Admin Menus has the same alias." +COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Custom Admin Menus has the same alias ." COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_ICON_DESCRIPTION="Add the icon to the image folder and select it here (128 x 128px)" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_ICON_LABEL="Icon" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_ID="Id" @@ -2624,6 +2679,7 @@ COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ENVELOPE="Envelope" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ENVELOPE_OPENED="Envelope Opened" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EQUALIZER="Equalizer" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ERROR_UNIQUE_ALIAS="Another Component Custom Admin Views has the same alias." +COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Custom Admin Views has the same alias ." COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EXIT="Exit" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EXPAND="Expand" COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EXPAND_2="Expand 2" @@ -2807,6 +2863,7 @@ COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_DASHBOARD="Dashboard" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_DASHBOARD_TAB_LABEL="Dashboard Tabs" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT="Editing the Component Dashboard" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_ERROR_UNIQUE_ALIAS="Another Component Dashboard has the same alias." +COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Dashboard has the same alias ." COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HEADER_DESCRIPTION="Enter Header Here" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HEADER_HINT="Header Here" COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_HEADER_LABEL="Header" @@ -2857,6 +2914,7 @@ COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_CREATED_DATE_DESC="The date this Co COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT="Editing the Component Files & Folders" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ERROR_UNIQUE_ALIAS="Another Component Files & Folders has the same alias." +COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Files & Folders has the same alias ." COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_FILE="File" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_FILEPATH_DESCRIPTION="Full System Path" COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_FILEPATH_HINT="/home/user/folder/file.php" @@ -2919,6 +2977,7 @@ COM_COMPONENTBUILDER_COMPONENT_MODULES_CREATED_DATE_DESC="The date this Componen COM_COMPONENTBUILDER_COMPONENT_MODULES_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_COMPONENT_MODULES_EDIT="Editing the Component Modules" COM_COMPONENTBUILDER_COMPONENT_MODULES_ERROR_UNIQUE_ALIAS="Another Component Modules has the same alias." +COM_COMPONENTBUILDER_COMPONENT_MODULES_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Modules has the same alias ." COM_COMPONENTBUILDER_COMPONENT_MODULES_EXPORT_ONLY="Export (only)" COM_COMPONENTBUILDER_COMPONENT_MODULES_ID="Id" COM_COMPONENTBUILDER_COMPONENT_MODULES_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component" @@ -2961,6 +3020,7 @@ COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_CREATED_DATE_DESC="The date this Com COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_EDIT="Editing the Component mysql Tweaks" COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_ERROR_UNIQUE_ALIAS="Another Component mysql Tweaks has the same alias." +COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component mysql Tweaks has the same alias ." COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_ID="Id" COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_IDS_DESCRIPTION="if id option selected" COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_IDS_HINT="// 1 => 500 or 1,2,3,4 or 1 => 4,20,40 => 90" @@ -3000,6 +3060,7 @@ COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_DETAILS="Details" COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_EDIT="Editing the Component Placeholders" COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_ERROR_UNIQUE_ALIAS="Another Component Placeholders has the same alias." +COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Placeholders has the same alias ." COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_ID="Id" COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component" COM_COMPONENTBUILDER_COMPONENT_PLACEHOLDERS_JOOMLA_COMPONENT_LABEL="Component" @@ -3038,6 +3099,7 @@ COM_COMPONENTBUILDER_COMPONENT_PLUGINS_CREATED_DATE_DESC="The date this Componen COM_COMPONENTBUILDER_COMPONENT_PLUGINS_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_COMPONENT_PLUGINS_EDIT="Editing the Component Plugins" COM_COMPONENTBUILDER_COMPONENT_PLUGINS_ERROR_UNIQUE_ALIAS="Another Component Plugins has the same alias." +COM_COMPONENTBUILDER_COMPONENT_PLUGINS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Plugins has the same alias ." COM_COMPONENTBUILDER_COMPONENT_PLUGINS_EXPORT_ONLY="Export (only)" COM_COMPONENTBUILDER_COMPONENT_PLUGINS_ID="Id" COM_COMPONENTBUILDER_COMPONENT_PLUGINS_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component" @@ -3063,6 +3125,60 @@ COM_COMPONENTBUILDER_COMPONENT_PLUGINS_TARGET_DESCRIPTION="Association" COM_COMPONENTBUILDER_COMPONENT_PLUGINS_TARGET_LABEL="Target" COM_COMPONENTBUILDER_COMPONENT_PLUGINS_VERSION_DESC="A count of the number of times this Component Plugins has been revised." COM_COMPONENTBUILDER_COMPONENT_PLUGINS_VERSION_LABEL="Version" +COM_COMPONENTBUILDER_COMPONENT_ROUTER="Component Router" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_BASIC="Basic" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CODE="Code" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_AFTER_PARENT_CODE_DESCRIPTION="Here you can add the code to use in the constructor after parent class is called." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_AFTER_PARENT_CODE_LABEL="Constructor After Parent
Code" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_CODE_DESCRIPTION="Here you can add the code to use in the constructor before parent class is called." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_CODE_LABEL="Constructor Before Parent
Code" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_MANUAL_DESCRIPTION="Setup the site views router configuration for this component." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_MANUAL_LABEL="Manual Setup of View Configuration" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CREATED_BY_DESC="The user that created this Component Router." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CREATED_DATE_DESC="The date this Component Router was created." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_DEFAULT="Default" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_DETAILS="Details" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_EDIT="Editing the Component Router" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_ERROR_UNIQUE_ALIAS="Another Component Router has the same alias." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Router has the same alias ." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_ID="Id" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_JOOMLA_COMPONENT_LABEL="Component" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MANUAL="Manual" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_METHODS_CODE_DESCRIPTION="Here you can add the methods to add to the router class." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_METHODS_CODE_LABEL="Methods
Code" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_AFTER_PARENT_DESCRIPTION="You can set your router constructor after parent mode here for only Joomla 4 and above." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_AFTER_PARENT_LABEL="Router Mode
[constructor_after_parent]" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_BEFORE_PARENT_DESCRIPTION="You can set your router constructor before parent mode here for only Joomla 4 and above." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_BEFORE_PARENT_LABEL="Router Mode
[constructor_before_parent]" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_METHODS_DESCRIPTION="You can set your router methods mode here for only Joomla 4 and above." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_METHODS_LABEL="Router Mode
[methods]" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODIFIED_BY_DESC="The last user that modified this Component Router." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODIFIED_DATE_DESC="The date this Component Router was modified." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NEW="A New Component Router" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NONE="None" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NOTE_MODE_CONSTRUCTOR_BEFORE_PARENT_MANUAL_DESCRIPTION="This feature is not yet ready (SOON)" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NOTE_MODE_CONSTRUCTOR_BEFORE_PARENT_MANUAL_LABEL="Manual Mode" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NOTE_ROUTER_SETTINGS_ADVANCE_DESCRIPTION="

The RouterView class in Joomla is designed to manage the routing process, translating human-readable URLs into query variables and vice versa. This functionality is crucial for creating search engine friendly (SEF) URLs and ensuring that requests within the Joomla application are directed to the appropriate components and views.

Key Responsibilities

  • URL Building: Converts query information into SEF URLs. This process involves taking the query parameters associated with a particular route and constructing a URL that is both user-friendly and optimized for search engines.
  • URL Parsing: Interprets SEF URLs back into query parameters. When a request is made to Joomla with an SEF URL, the RouterView class parses this URL to determine the component, view, and other request variables required to fulfill the request.

How to Use RouterView in a 3rd Party Extension

To leverage the RouterView class in a 3rd party Joomla extension, follow these steps:

  1. Extend RouterView: Create a new router class in your component that extends RouterView. This class will define the routing rules specific to your component.
  2. Define Routes: Within your router class, define routes by mapping URL patterns to query parameters. This involves specifying how URL segments correspond to the component’s views and tasks.
  3. Register the Router: Ensure that Joomla is aware of your custom router by registering it with the application. This is typically done within the component’s entry point file.

Benefits of Using RouterView

  • SEO Optimization: By enabling the creation of human-readable URLs, RouterView helps improve the SEO of your Joomla site.
  • Improved User Experience: SEF URLs are easier for users to understand and remember, enhancing the overall user experience.
  • Flexibility: Custom routers allow for granular control over URL structure, making it possible to tailor URLs to match the needs of your extension and its audience.

The basic structure of a custom router class for a Joomla 3rd party extension highlights the need to implement the build and parse methods, which handle the conversion between query parameters and SEF URLs.

" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NOTE_ROUTER_SETTINGS_ADVANCE_LABEL="Understanding the Site RouterView Class." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NOTE_ROUTER_SETTINGS_DESCRIPTION="Extending the `RouterView` class in a Joomla 3rd party extension enables developers to intricately manage and customize URLs, significantly enhancing user navigation and SEO. This approach allows for defining clean, search-engine-friendly routes for component views, dynamic handling of query variables, and seamless integration with Joomla's menu system for automatic route adjustments. Additionally, it supports the implementation of custom routing rules, including support for multilingual sites, and sophisticated error handling and redirects. By leveraging `RouterView`, developers can craft a more intuitive and efficient URL structure, ensuring a smoother user experience and improved visibility on search engines." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_NOTE_ROUTER_SETTINGS_LABEL="Site Router Settings" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_PERMISSION="Permissions" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_ROUTER_SETTINGS_DETAILS_SWITCH_LABEL="Documentation" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Component Router to customise the alias." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_SETTINGS="Settings" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_SITEVIEW="Siteview" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_SITEVIEW_DESCRIPTION="Select a site view" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_SITEVIEW_LABEL="View" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_STATUS="Status" +COM_COMPONENTBUILDER_COMPONENT_ROUTER_VERSION_DESC="A count of the number of times this Component Router has been revised." +COM_COMPONENTBUILDER_COMPONENT_ROUTER_VERSION_LABEL="Version" COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS="Component Site Views" COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ACCESS_DESCRIPTION="Select if this view
should use access." COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ACCESS_LABEL="Add Access" @@ -3078,6 +3194,7 @@ COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_DEFAULT_VIEW_DESCRIPTION="Select only COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_DEFAULT_VIEW_LABEL="Default View" COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_EDIT="Editing the Component Site Views" COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ERROR_UNIQUE_ALIAS="Another Component Site Views has the same alias." +COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Site Views has the same alias ." COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_ID="Id" COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component" COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_JOOMLA_COMPONENT_LABEL="Component" @@ -3121,6 +3238,7 @@ COM_COMPONENTBUILDER_COMPONENT_UPDATES_CREATED_DATE_DESC="The date this Componen COM_COMPONENTBUILDER_COMPONENT_UPDATES_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_COMPONENT_UPDATES_EDIT="Editing the Component Updates" COM_COMPONENTBUILDER_COMPONENT_UPDATES_ERROR_UNIQUE_ALIAS="Another Component Updates has the same alias." +COM_COMPONENTBUILDER_COMPONENT_UPDATES_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Component Updates has the same alias ." COM_COMPONENTBUILDER_COMPONENT_UPDATES_ID="Id" COM_COMPONENTBUILDER_COMPONENT_UPDATES_JOOMLA_COMPONENT_DESCRIPTION="Select a Joomla Component" COM_COMPONENTBUILDER_COMPONENT_UPDATES_JOOMLA_COMPONENT_LABEL="Component" @@ -3199,7 +3317,7 @@ COM_COMPONENTBUILDER_CONFIG_AUTHOR_NAME_DESC="The name of the author of this com COM_COMPONENTBUILDER_CONFIG_AUTHOR_NAME_LABEL="Author Name" COM_COMPONENTBUILDER_CONFIG_AUTO_BACKUP="Auto Backup" COM_COMPONENTBUILDER_CONFIG_AUTO_LOAD="Auto" -COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION="You can run a cronjob that will backup all your components as they are mapped in JCB.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677" +COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_DESCRIPTION="You can run a cronjob that will backup all your components as they are mapped in JCB.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677" COM_COMPONENTBUILDER_CONFIG_BACKUPCRONJOB_NOTE_LABEL="Backup JCB Mapped Components" COM_COMPONENTBUILDER_CONFIG_BACKUP_DESCRIPTION="Should the zipped package of the component be moved to the local backup and remote sales server? This is only applicable if this component has those values set." COM_COMPONENTBUILDER_CONFIG_BACKUP_EMAIL_DESCRIPTION="Enter the email where the backup key should be send. It will only send an email if a key change is detected, and not on every backup." @@ -3324,7 +3442,7 @@ COM_COMPONENTBUILDER_CONFIG_EVERY_MINUTE="Every Minute" COM_COMPONENTBUILDER_CONFIG_EVERY_SESSION="Every Session" COM_COMPONENTBUILDER_CONFIG_EVERY_WEEK="Every Week" COM_COMPONENTBUILDER_CONFIG_EXPANSION="Expansion" -COM_COMPONENTBUILDER_CONFIG_EXPANSIONCRONJOB_NOTE_DESCRIPTION="You must run a cronjob that will trigger the expansion events for JCB.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677" +COM_COMPONENTBUILDER_CONFIG_EXPANSIONCRONJOB_NOTE_DESCRIPTION="You must run a cronjob that will trigger the expansion events for JCB.

USE THE FOLLOWING: loading...

Please note that if your Joomla website has a Firewall installed, it will not allow cronjob via direct URL (most of the time), you will then need to adapt the cornjob request to look like a browser. For more info please read https://stackoverflow.com/a/31597823/1429677" COM_COMPONENTBUILDER_CONFIG_EXPANSIONCRONJOB_NOTE_LABEL="Expansion Cronjob" COM_COMPONENTBUILDER_CONFIG_EXPANSION_DESCRIPTION="Properties for this field" COM_COMPONENTBUILDER_CONFIG_EXPANSION_LABEL="Expansion" @@ -3423,6 +3541,10 @@ COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_LABEL="Prefix
Check out thes COM_COMPONENTBUILDER_CONFIG_MENU_PREFIX_MESSAGE="Error! Please add some text here." COM_COMPONENTBUILDER_CONFIG_MINIFY_DESCRIPTION="Should the JavaScript be minified when compiled." COM_COMPONENTBUILDER_CONFIG_MINIFY_LABEL="Minify JS" +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_DESCRIPTION="Add the namespace prefix. Like your company name in a code formate. So it will have no spaces and starting with an uppercase letter, and only be alphabetical characters.
Example: VastDevelopmentMethod
This will be used as a prefix to namespacing when targeting Joomla 4 and above." +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_HINT="VastDevelopmentMethod" +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_LABEL="Namespace Prefix" +COM_COMPONENTBUILDER_CONFIG_NAMESPACE_PREFIX_MESSAGE="Error! Please add namespace prefix here." COM_COMPONENTBUILDER_CONFIG_NEVER_UPDATE="Never update" COM_COMPONENTBUILDER_CONFIG_NO="No" COM_COMPONENTBUILDER_CONFIG_NONE="None" @@ -3438,7 +3560,7 @@ COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_DEFAULT_DESCRIPTION="

This COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_DEFAULT_LABEL="Default Development Method" COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_EXPANSION_DESCRIPTION="

This method adds easy compile and install of multiple components to the current Joomla system. This automated action is called expansion.

Expansion can be achieved in two ways.

Button Expansion Option

The first and most common way is to click on any of the Run Expansion buttons found at the top of some of the JCB admin views.

Cronjob Expansion Option

The second is by running a cronjob as explained bellow the area of selection in this tab. So you do not need to manually compile and install the selected components any more, the system does all that automatically for you. The latency of the workflow is based on your cronjob frequency and the size of your component.

Expansion is pause for a component in a few ways, one by actually checking out/opening the Joomla Component view of the component in JCB, or changing the state to unpublish, archive or trashed, or simply remove if from the list below.

The Expansion method is there to speedup development testing.

Below you should set the behaviour of a selected set of components that will be auto build and installed when the expansion module is run.

" COM_COMPONENTBUILDER_CONFIG_NOTE_DEVELOPMENT_METHOD_EXPANSION_LABEL="Expansion Development Method" -COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION="

Using the below details, you need to configure your DNS by adding a TXT record on your domain:

" +COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_DESCRIPTION="

Using the below details, you need to configure your DNS by adding a TXT record on your domain:

" COM_COMPONENTBUILDER_CONFIG_NOTE_DKIM_USE_LABEL="Server Configuration" COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_DESCRIPTION="You must set the folder where all the components should be deployed for git. You will have to still do your git commit and other git commands yourself. Each component will create their own folder inside this git folder." COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_LABEL="Adding git to your compiler method" @@ -3546,6 +3668,7 @@ COM_COMPONENTBUILDER_CONTRIBUTORS="Contributors" COM_COMPONENTBUILDER_COPYRIGHT="Copyright" COM_COMPONENTBUILDER_COPYRIGHT_S="Copyright: %s" COM_COMPONENTBUILDER_COULD_NOT_CLEAR_THE_TMP_FOLDER="Could not clear the tmp folder!" +COM_COMPONENTBUILDER_COULD_NOT_FIND_THE_DATA_NEEDED_TO_CONTINUE="Could not find the data needed to continue." COM_COMPONENTBUILDER_COULD_NOT_INSTALL_COMPONENT="Could not install component!" COM_COMPONENTBUILDER_COULD_NOT_INSTALL_EXTENSIONS="Could not install extensions!" COM_COMPONENTBUILDER_COULD_NOT_INSTALL_MODULE="Could not install module!" @@ -3612,8 +3735,8 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JAVASCRIPT_FILE_LABEL="Add JavaScript COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_AJAX_LABEL="Add PHP (AJAX)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_DOCUMENT_LABEL="Add PHP (custom document script)" -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom JViewLegacy display)" -COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom JViewLegacy methods)" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom HtmlView display)" +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom HtmlView methods)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ADD_PHP_VIEW_LABEL="Add PHP (custom view script)" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_AJAX_INPUT_LABEL="Ajax Input" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ALLOW_ZERO_DESCRIPTION="null & zero values" @@ -3723,6 +3846,7 @@ COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ENVELOPE="Envelope" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ENVELOPE_OPENED="Envelope Opened" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EQUALIZER="Equalizer" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ERROR_UNIQUE_ALIAS="Another Custom Admin View has the same alias." +COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Custom Admin View has the same alias ." COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EXIT="Exit" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EXPAND="Expand" COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEW_EXPAND_2="Expand 2" @@ -4040,6 +4164,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_CUSTOM_CODE_DETAILS="Details" COM_COMPONENTBUILDER_CUSTOM_CODE_EDIT="Editing the Custom Code" COM_COMPONENTBUILDER_CUSTOM_CODE_ERROR_UNIQUE_ALIAS="Another Custom Code has the same alias." +COM_COMPONENTBUILDER_CUSTOM_CODE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Custom Code has the same alias ." COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_DESCRIPTION="The line from where to start adding the code." COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_HINT="Only Numbers" COM_COMPONENTBUILDER_CUSTOM_CODE_FROM_LINE_LABEL="From Line (Zero based)" @@ -4059,6 +4184,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_HTML="HTML" COM_COMPONENTBUILDER_CUSTOM_CODE_ID="Id" COM_COMPONENTBUILDER_CUSTOM_CODE_INSERTION="Insertion" COM_COMPONENTBUILDER_CUSTOM_CODE_JCB_MANUAL="JCB (manual)" +COM_COMPONENTBUILDER_CUSTOM_CODE_JOOMLA_VERSION_LABEL="Joomla Version" COM_COMPONENTBUILDER_CUSTOM_CODE_MODIFIED_BY_DESC="The last user that modified this Custom Code." COM_COMPONENTBUILDER_CUSTOM_CODE_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_CUSTOM_CODE_MODIFIED_DATE_DESC="The date this Custom Code was modified." @@ -4153,6 +4279,7 @@ COM_COMPONENTBUILDER_DTEMAILDTDDSDD="
Email
%s
" COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="
License
%s
" COM_COMPONENTBUILDER_DTOWNERDTDDSDD="
Owner
%s
" COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="
Website
%s
" +COM_COMPONENTBUILDER_DYNAMIC_BUTTON_ERROR="Dynamic Button Error" COM_COMPONENTBUILDER_DYNAMIC_GET="Dynamic Get" COM_COMPONENTBUILDER_DYNAMIC_GETS="Dynamic Gets" COM_COMPONENTBUILDER_DYNAMIC_GETS_ACCESS="Dynamic Gets Access" @@ -4214,7 +4341,7 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEMS_LABEL="Add PHP (before COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEM_LABEL="Add PHP (before getting the Item)" COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_GETLISTQUERY_LABEL="Add PHP (getListQuery - JModelList)" COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_DESCRIPTION="The option to override the default JCB implementation of the router parse method for the related view where this dynamicGet is added." -COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL="Add PHP (parse Method) - in Router" +COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL="Add PHP (parse Method) - in Joomla 3 Router" COM_COMPONENTBUILDER_DYNAMIC_GET_ARRAY_VALUE="Array Value" COM_COMPONENTBUILDER_DYNAMIC_GET_ASCENDING="Ascending" COM_COMPONENTBUILDER_DYNAMIC_GET_AS_LABEL="AS" @@ -4251,6 +4378,7 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_EMPTY_LABEL="Allow" COM_COMPONENTBUILDER_DYNAMIC_GET_EQUAL="equal" COM_COMPONENTBUILDER_DYNAMIC_GET_EQUAL_OR_NOT="equal or not" COM_COMPONENTBUILDER_DYNAMIC_GET_ERROR_UNIQUE_ALIAS="Another Dynamic Get has the same alias." +COM_COMPONENTBUILDER_DYNAMIC_GET_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Dynamic Get has the same alias ." COM_COMPONENTBUILDER_DYNAMIC_GET_F="f" COM_COMPONENTBUILDER_DYNAMIC_GET_FF="ff" COM_COMPONENTBUILDER_DYNAMIC_GET_FILTER_DESCRIPTION="Here you can add filters to the query." @@ -4374,7 +4502,9 @@ COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_DESCRIPTION="Add PHP Here that COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_LABEL="PHP getListQuery Method
used to add custom filtering values." COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_DESCRIPTION="Add your PHP here! [Do not add the php tags]
Add the php code to override the default JCB implementation of the router parse method for the related view where this dynamicGet is added." COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_HINT="// PHP Here that should run in the parse Method -> switch | (array) $segments - the segments of the URL to parse | (array) $vars - the URL attributes to be used by the application." -COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_LABEL="PHP" +COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_LABEL="PHP (only for Joomla 3)" +COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_NOTICE_DESCRIPTION="For Joomla 4 and above we move the router related settings to the the Component Site Router area. This can be found in the Joomla Components list view, next to the [add site views button] you will see a button that opens this new Site Router view." +COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_NOTICE_LABEL="Joomla 4++" COM_COMPONENTBUILDER_DYNAMIC_GET_PLEASE_SELECT="Please select" COM_COMPONENTBUILDER_DYNAMIC_GET_PLUGIN_EVENTS_DESCRIPTION="Select the content plugin events you would like to add to the page that uses this dynamic get. Please note that the onContentPrepare event is added to all textarea and editor field types by default, so no need to add it again." COM_COMPONENTBUILDER_DYNAMIC_GET_PLUGIN_EVENTS_LABEL="Content Plugin Events
All events added here can
be accessed in the $this->item->event object.
" @@ -4637,6 +4767,7 @@ COM_COMPONENTBUILDER_FIELDTYPE_DOUBLE="DOUBLE" COM_COMPONENTBUILDER_FIELDTYPE_EDIT="Editing the Fieldtype" COM_COMPONENTBUILDER_FIELDTYPE_ELEVEN="11" COM_COMPONENTBUILDER_FIELDTYPE_ERROR_UNIQUE_ALIAS="Another Fieldtype has the same alias." +COM_COMPONENTBUILDER_FIELDTYPE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Fieldtype has the same alias ." COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_DESCRIPTION="Text Area" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_HINT="Value/Example Here" COM_COMPONENTBUILDER_FIELDTYPE_EXAMPLE_LABEL="Value/Example" @@ -4767,6 +4898,7 @@ COM_COMPONENTBUILDER_FIELD_DOUBLE="DOUBLE" COM_COMPONENTBUILDER_FIELD_EDIT="Editing the Field" COM_COMPONENTBUILDER_FIELD_ELEVEN="11" COM_COMPONENTBUILDER_FIELD_ERROR_UNIQUE_ALIAS="Another Field has the same alias." +COM_COMPONENTBUILDER_FIELD_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Field has the same alias ." COM_COMPONENTBUILDER_FIELD_EXPERT_MODE_CUSTOM="Expert Mode - Custom" COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES="Fields Categories" COM_COMPONENTBUILDER_FIELD_FIELDTYPE_DESCRIPTION="Set the field type" @@ -4868,6 +5000,7 @@ COM_COMPONENTBUILDER_FIELD_XML="Xml" COM_COMPONENTBUILDER_FIELD_YES="Yes" COM_COMPONENTBUILDER_FIELD_ZERO="0" COM_COMPONENTBUILDER_FILE="File" +COM_COMPONENTBUILDER_FILE_BSB_COULD_NOT_BE_STORED="File %s could not be stored!" COM_COMPONENTBUILDER_FILE_BSB_COULD_NOT_BE_UNLOCKED="File %s could not be unlocked!" COM_COMPONENTBUILDER_FILE_BSB_WAS_MOVED_TO_BSB="File %s was moved to %s" COM_COMPONENTBUILDER_FILE_BSB_WAS_NOT_MOVED_TO_BSB="File %s was not moved to %s" @@ -4909,6 +5042,8 @@ COM_COMPONENTBUILDER_FILTER_INDEXES_TYPE_ASCENDING="Indexes Type ascending" COM_COMPONENTBUILDER_FILTER_INDEXES_TYPE_DESCENDING="Indexes Type descending" COM_COMPONENTBUILDER_FILTER_JOOMLA_PLUGIN_GROUP_ASCENDING="Joomla Plugin Group ascending" COM_COMPONENTBUILDER_FILTER_JOOMLA_PLUGIN_GROUP_DESCENDING="Joomla Plugin Group descending" +COM_COMPONENTBUILDER_FILTER_JOOMLA_VERSION_ASCENDING="Joomla Version ascending" +COM_COMPONENTBUILDER_FILTER_JOOMLA_VERSION_DESCENDING="Joomla Version descending" COM_COMPONENTBUILDER_FILTER_LANGUAGE_TAG_ASCENDING="Language Tag ascending" COM_COMPONENTBUILDER_FILTER_LANGUAGE_TAG_DESCENDING="Language Tag descending" COM_COMPONENTBUILDER_FILTER_LIBRARY_ASCENDING="Library ascending" @@ -4954,6 +5089,7 @@ COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_MODULES="Status options for com COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_MYSQL_TWEAKS="Status options for components mysql tweaks" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_PLACEHOLDERS="Status options for components placeholders" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_PLUGINS="Status options for components plugins" +COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_ROUTERS="Status options for components routers" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_SITE_VIEWS="Status options for components site views" COM_COMPONENTBUILDER_FILTER_PUBLISHED_COMPONENTS_UPDATES="Status options for components updates" COM_COMPONENTBUILDER_FILTER_PUBLISHED_CUSTOM_ADMIN_VIEWS="Status options for custom admin views" @@ -5003,6 +5139,7 @@ COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_MODULES="Search the component modu COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_MYSQL_TWEAKS="Search the component mysql tweaks items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_PLACEHOLDERS="Search the component placeholders items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_PLUGINS="Search the component plugins items. Prefix with ID: to search for an item by ID." +COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_ROUTERS="Search the component router items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_SITE_VIEWS="Search the component site views items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_COMPONENTS_UPDATES="Search the component updates items. Prefix with ID: to search for an item by ID." COM_COMPONENTBUILDER_FILTER_SEARCH_CUSTOM_ADMIN_VIEWS="Search the custom admin view items. Prefix with ID: to search for an item by ID." @@ -5062,6 +5199,9 @@ COM_COMPONENTBUILDER_FILTER_SELECT_MODELLING_METHOD="Select Modelling Method" COM_COMPONENTBUILDER_FILTER_SELECT_NAME="Select Name" COM_COMPONENTBUILDER_FILTER_SELECT_NULL_SWITCH="Select Null Switch" COM_COMPONENTBUILDER_FILTER_SELECT_PROTOCOL="Select Protocol" +COM_COMPONENTBUILDER_FILTER_SELECT_ROUTER_MODECONSTRUCTOR_AFTER_PARENT="Select Router Mode[constructor_after_parent]" +COM_COMPONENTBUILDER_FILTER_SELECT_ROUTER_MODECONSTRUCTOR_BEFORE_PARENT="Select Router Mode[constructor_before_parent]" +COM_COMPONENTBUILDER_FILTER_SELECT_ROUTER_MODEMETHODS="Select Router Mode[methods]" COM_COMPONENTBUILDER_FILTER_SELECT_SITE_VIEWS="Select Site Views" COM_COMPONENTBUILDER_FILTER_SELECT_SUPER_POWER="Select Super Power" COM_COMPONENTBUILDER_FILTER_SELECT_TARGET="Select Target" @@ -5216,6 +5356,7 @@ COM_COMPONENTBUILDER_HELP_DOCUMENT_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_HELP_DOCUMENT_DETAILS="Details" COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT="Editing the Help Document" COM_COMPONENTBUILDER_HELP_DOCUMENT_ERROR_UNIQUE_ALIAS="Another Help Document has the same alias." +COM_COMPONENTBUILDER_HELP_DOCUMENT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Help Document has the same alias ." COM_COMPONENTBUILDER_HELP_DOCUMENT_GROUPS_DESCRIPTION="Select a group/s" COM_COMPONENTBUILDER_HELP_DOCUMENT_GROUPS_LABEL="Group/s" COM_COMPONENTBUILDER_HELP_DOCUMENT_ID="Id" @@ -5264,18 +5405,27 @@ COM_COMPONENTBUILDER_HI="Hi" COM_COMPONENTBUILDER_HIDE_ONLY="Hide Only" COM_COMPONENTBUILDER_HIDE_TOGGLE="Hide Toggle" COM_COMPONENTBUILDER_HOW_TO_GET_A_S_FREE_KEYSA_FROM_VDM="How to get free keys from VDM." +COM_COMPONENTBUILDER_HR_HTHREEASSETS_TABLE_NOTICEHTHREE="

Assets Table Notice

" +COM_COMPONENTBUILDER_HR_HTHREEASSETS_TABLE_WARNINGHTHREE="

Assets Table Warning

" +COM_COMPONENTBUILDER_HR_HTHREECONDITIONAL_SCRIPT_WARNINGHTHREE="

Conditional Script Warning

" COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE="

Custom Codes Warning

" +COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODE_WARNINGHTHREE="

Custom Code Warning

" COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP="

c0mp0n3nt issue found

The path (%s) could not be used.

" COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE="

Dashboard Error

" -COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_BUTTON_ERRORHTHREE="

Dynamic Button Error

" COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE="

Dynamic folder(s) were detected.

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="

External Code Error

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="

External Code Notice

" COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE="

External Code Warning

" COM_COMPONENTBUILDER_HR_HTHREEFIELD_NOTICEHTHREE="

Field Notice

" +COM_COMPONENTBUILDER_HR_HTHREEFIELD_WARNINGHTHREE="

Field Warning

" COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE="

File Path Error

" COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE="

Folder Path Error

" +COM_COMPONENTBUILDER_HR_HTHREELANGUAGE_NOTICEHTHREE="

Language Notice

" +COM_COMPONENTBUILDER_HR_HTHREELANGUAGE_WARNINGHTHREE="

Language Warning

" +COM_COMPONENTBUILDER_HR_HTHREEMULTI_FILTER_ERRORHTHREE="

Multi Filter Error

" +COM_COMPONENTBUILDER_HR_HTHREES_WARNINGHTHREE="

%s Warning

" COM_COMPONENTBUILDER_HR_HTHREETIDY_ERRORHTHREE="

Tidy Error

" +COM_COMPONENTBUILDER_HR_HTHREEWHMCS_ERRORHTHREE="

WHMCS Error

" COM_COMPONENTBUILDER_HTHREEPLACEHOLDER_REMOVEDHTHREEPBTHISB_CUSTOM_CODE_CAN_ONLY_BE_USED_IN_BOTHERB_CUSTOM_CODE_NOT_IN_IT_SELF_SINCE_THAT_WILL_CAUSE_A_INFINITE_LOOP_IN_THE_COMPILERP="

Placeholder Removed!

This custom code can only be used in other custom code, not in it self! Since that will cause a infinite loop in the compiler.

" COM_COMPONENTBUILDER_HTHREESHTHREEPCUSTOM_CODE_CAN_ONLY_BE_USED_IN_OTHER_CUSTOM_CODE_IF_SET_AS_BJCB_MANUALB_YOU_CAN_NOT_ADD_THEM_TO_EMHASH_AUTOMATIONEM_CODE_AT_THIS_POINTP="

%s

Custom code can only be used in other custom code if set as JCB (manual), you can not add them to Hash (Automation) code at this point.

" COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

%s namespace error (%s)

You must at-least have two sections in your namespace, you just have one (%s). This is an unacceptable action, please see psr-4 for more info.

This %s was therefore removed, click here to fix this issue.

" @@ -5391,7 +5541,6 @@ COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS="JCB: Invest in Success" COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY="JCB: Invest in the Community" COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE="JCB: Invest in the Future" COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE="JCB: Invest in Your Future" -COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB="JCB is not yet fully ready for Joomla 4, but with your help, we can make the transition faster. Show your support by making a donation today and help us bring JCB to the next level.

Your component will still only be compiled for Joomla 3" COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS="JCB Lowers Development Stress" COM_COMPONENTBUILDER_JCB_NEEDS_YOU="JCB Needs You" COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION="JCB Offers a Stronger Solution" @@ -5497,6 +5646,8 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_DESCRIPTION="Add the option to COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL="Add WHMCS
(license add-on)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_MENU_PREFIX_DESCRIPTION="Would you like to add a prefix to the Joomla menu name of this component" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_MENU_PREFIX_LABEL="Add Menu Prefix" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_NAMESPACE_PREFIX_DESCRIPTION="Override the namespace prefix, or use the global value found under the component builder global option under the compiler tab." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_NAMESPACE_PREFIX_LABEL="Add Namespace Prefix" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_ADMIN_LABEL="Add PHP (helper_admin Class)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL="Add PHP (helper Classes - Both admin & site)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_SITE_LABEL="Add PHP (helper_site Class)" @@ -5606,6 +5757,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_MESSAGE="Error! Please author email COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_DESCRIPTION="Set if a list of empty contributor fields should be added." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_LABEL="Empty Contributor Fields" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ERROR_UNIQUE_ALIAS="Another Joomla Component has the same alias." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Component has the same alias ." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_DESCRIPTION="Enter link where your JCB package key can be bought." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_HINT="http://www.example.com/buy-keys" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_BUY_LINK_LABEL="Buy Link
(to get key)" @@ -5659,6 +5811,10 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_LABEL="Modified Date" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_DESCRIPTION="Here you can tweak the way JCB implements versions in the code commenting of your component." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL="Version Options" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MYSQL="MySQL" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_DESCRIPTION="Add the namespace prefix. Like your company name in a code formate. So it will have no spaces and starting with an uppercase letter, and only be alphabetical characters.
Example: VastDevelopmentMethod
This will be used as a prefix to namespacing when targeting Joomla 4 and above." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_HINT="VastDevelopmentMethod" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_LABEL="Namespace Prefix" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_MESSAGE="Error! Please add namespace prefix here." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_DESCRIPTION="Add Name in Code Here" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_HINT="codename" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL="Name in Code
Naming Conventions" @@ -5703,7 +5859,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_CUSTOM_ADMIN_VIEWS_DESCRIPTION="Do COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_CUSTOM_ADMIN_VIEWS_LABEL="Setting Custom Admin Views" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_SITE_VIEWS_DESCRIPTION="Do not add the same view twice it will not work. Please watch this tutorial for more help." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_ON_SITE_VIEWS_LABEL="Setting Site Views" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_DESCRIPTION="

Need help, visit Markdown-Cheatsheet

# ###Component_name### (###VERSION###)

###DESCRIPTION###

# Build Details

+ *Company*: [###COMPANYNAME###](###AUTHORWEBSITE###)
+ *Author*: [###AUTHOR###](mailto:###AUTHOREMAIL###)
+ *Name*: [###Component_name###](###AUTHORWEBSITE###)
+ *First Build*: ###CREATIONDATE###
+ *Last Build*: ###BUILDDATE###
+ *Version*: ###VERSION###
+ *Copyright*: ###COPYRIGHT###
+ *License*: ###LICENSE###

## Build Time

**###totalHours### Hours** or **###totalDays### Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)

+ *Line count*: **###LINE_COUNT###**
+ *File count*: **###FILE_COUNT###**
+ *Folder count*: **###FOLDER_COUNT###**

**###actualHoursSpent### Hours** or **###actualDaysSpent### Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @###debuggingHours###hours** = codingtime / 4;
> **planning @###planningHours###hours** = codingtime / 7;
> **mapping @###mappingHours###hours** = codingtime / 10;
> **office @###officeHours###hours** = codingtime / 6;)

**###actualTotalHours### Hours** or **###actualTotalDays### Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)

Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### months**

> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

## Donations

If you want to support this project, please consider donating:
* Open Collective: [Joomla-Component-Builder](https://opencollective.com/Joomla-Component-Builder)
" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_DESCRIPTION="

Need help, visit Markdown-Cheatsheet

# ###Component_name### (###VERSION###)

###DESCRIPTION###

# Build Details

+ *Company*: [###COMPANYNAME###](###AUTHORWEBSITE###)
+ *Author*: [###AUTHOR###](mailto:###AUTHOREMAIL###)
+ *Name*: [###Component_name###](###AUTHORWEBSITE###)
+ *First Build*: ###CREATIONDATE###
+ *Last Build*: ###BUILDDATE###
+ *Version*: ###VERSION###
+ *Copyright*: ###COPYRIGHT###
+ *License*: ###LICENSE###

## Build Time

**###totalHours### Hours** or **###totalDays### Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)

+ *Line count*: **###LINE_COUNT###**
+ *File count*: **###FILE_COUNT###**
+ *Folder count*: **###FOLDER_COUNT###**

**###actualHoursSpent### Hours** or **###actualDaysSpent### Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @###debuggingHours###hours** = codingtime / 4;
> **planning @###planningHours###hours** = codingtime / 7;
> **mapping @###mappingHours###hours** = codingtime / 10;
> **office @###officeHours###hours** = codingtime / 6;)

**###actualTotalHours### Hours** or **###actualTotalDays### Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> with the normal everyday realities at the office, that includes the component planning, mapping & debugging.)

Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### months**

> This **component** was build with a Joomla [Automated Component Builder](https://www.joomlacomponentbuilder.com).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)

## Donations

If you want to support this project, please consider donating:
* Open Collective: [Joomla-Component-Builder](https://opencollective.com/Joomla-Component-Builder)
" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_LABEL="Demo README (with all place-holders)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_DESCRIPTION="During compilation the file will be moved to the server. You still need to point the above update server url to the xml file location on your server for it to work correctly." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_LABEL="Select the server used for your update server." @@ -5742,6 +5898,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_DESCRIPTION="PHP scri COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL="PHP Preflight (update)" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_DESCRIPTION="PHP script for the global helper site event method." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL="Global Helper Site Event (method)" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREFERRED_JOOMLA_VERSION_LABEL="Preferred Joomla Version" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUBLISHING="Publishing" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README="Readme" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README_LABEL="README.md" @@ -5822,6 +5979,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_MESSAGE="Error! Please add websi COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP" COM_COMPONENTBUILDER_JOOMLA_FIELDS="Joomla fields" +COM_COMPONENTBUILDER_JOOMLA_FIVE="Joomla 5" COM_COMPONENTBUILDER_JOOMLA_FOUR="Joomla 4" COM_COMPONENTBUILDER_JOOMLA_MODULE="Joomla Module" COM_COMPONENTBUILDER_JOOMLA_MODULES="Joomla Modules" @@ -6004,6 +6162,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_JOOMLA_MODULE_DYNAMIC_INTEGRATION="Dynamic Integration" COM_COMPONENTBUILDER_JOOMLA_MODULE_EDIT="Editing the Joomla Module" COM_COMPONENTBUILDER_JOOMLA_MODULE_ERROR_UNIQUE_ALIAS="Another Joomla Module has the same alias." +COM_COMPONENTBUILDER_JOOMLA_MODULE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Module has the same alias ." COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELD="Field" COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELDSET_DESCRIPTION="Leave default if you don't know what this should be" COM_COMPONENTBUILDER_JOOMLA_MODULE_FIELDSET_HINT="basic" @@ -6037,6 +6196,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_CREATED_DATE_LABEL="Create COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_DEFAULT_LINK="Default (link)" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_EDIT="Editing the Joomla Module Files, Folders & URLs" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS="Another Joomla Module Files, Folders & URLs has the same alias." +COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Module Files, Folders & URLs has the same alias ." COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_FILE="File" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_FILEPATH_DESCRIPTION="Full System Path" COM_COMPONENTBUILDER_JOOMLA_MODULE_FILES_FOLDERS_URLS_FILEPATH_HINT="/home/user/folder/file.php" @@ -6199,6 +6359,7 @@ COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_CREATED_DATE_DESC="The date this Joom COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_EDIT="Editing the Joomla Module Updates" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_ERROR_UNIQUE_ALIAS="Another Joomla Module Updates has the same alias." +COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Module Updates has the same alias ." COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_ID="Id" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_JOOMLA_MODULE_LABEL="Joomla Modules" COM_COMPONENTBUILDER_JOOMLA_MODULE_UPDATES_MODIFIED_BY_DESC="The last user that modified this Joomla Module Updates." @@ -6403,6 +6564,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_DYNAMIC_INTEGRATION="Dynamic Integration" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_EDIT="Editing the Joomla Plugin" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ERROR_UNIQUE_ALIAS="Another Joomla Plugin has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELD="Field" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELDSET_DESCRIPTION="Leave default if you don't know what this should be" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FIELDSET_HINT="basic" @@ -6436,6 +6598,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_CREATED_DATE_LABEL="Create COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_DEFAULT_LINK="Default (link)" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_EDIT="Editing the Joomla Plugin Files, Folders & URLs" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS="Another Joomla Plugin Files, Folders & URLs has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin Files, Folders & URLs has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_FILE="File" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_FILEPATH_DESCRIPTION="Full System Path" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_FILES_FOLDERS_URLS_FILEPATH_HINT="/home/user/folder/file.php" @@ -6534,6 +6697,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_DETAILS="Details" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_EDIT="Editing the Joomla Plugin Group" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ERROR_UNIQUE_ALIAS="Another Joomla Plugin Group has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin Group has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_ID="Id" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_DESC="The last user that modified this Joomla Plugin Group." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_GROUP_MODIFIED_BY_LABEL="Modified By" @@ -6651,6 +6815,7 @@ COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_CREATED_DATE_DESC="The date this Joom COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_EDIT="Editing the Joomla Plugin Updates" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_ERROR_UNIQUE_ALIAS="Another Joomla Plugin Updates has the same alias." +COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Joomla Plugin Updates has the same alias ." COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_ID="Id" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_JOOMLA_PLUGIN_LABEL="Joomla Plugins" COM_COMPONENTBUILDER_JOOMLA_PLUGIN_UPDATES_MODIFIED_BY_DESC="The last user that modified this Joomla Plugin Updates." @@ -6757,6 +6922,7 @@ COM_COMPONENTBUILDER_LANGUAGE_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_LANGUAGE_DETAILS="Details" COM_COMPONENTBUILDER_LANGUAGE_EDIT="Editing the Language" COM_COMPONENTBUILDER_LANGUAGE_ERROR_UNIQUE_ALIAS="Another Language has the same alias." +COM_COMPONENTBUILDER_LANGUAGE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Language has the same alias ." COM_COMPONENTBUILDER_LANGUAGE_ID="Id" COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_DESCRIPTION="Enter the language tag – example: en-GB for English (UK). This should be the exact prefix used for the language installed or to be installed." COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_HINT="en-GB" @@ -6831,6 +6997,7 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_DETAILS="Details" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT="Editing the Language Translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS="Another Language Translation has the same alias." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Language Translation has the same alias ." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ID="Id" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE="Language" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL="Language" @@ -6928,6 +7095,7 @@ COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_VALUES_DESCRIPTION="Only use dynamic get val COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_VALUES_LABEL="Dynamic Values" COM_COMPONENTBUILDER_LAYOUT_EDIT="Editing the Layout" COM_COMPONENTBUILDER_LAYOUT_ERROR_UNIQUE_ALIAS="Another Layout has the same alias." +COM_COMPONENTBUILDER_LAYOUT_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Layout has the same alias ." COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS="Layout Get Snippets Button Access" COM_COMPONENTBUILDER_LAYOUT_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_LAYOUT_ID="Id" @@ -7112,6 +7280,7 @@ COM_COMPONENTBUILDER_LIBRARY_CONFIG_CUSTOM_VALUE_HINT="Custom Value Here" COM_COMPONENTBUILDER_LIBRARY_CONFIG_CUSTOM_VALUE_LABEL="Custom Value" COM_COMPONENTBUILDER_LIBRARY_CONFIG_EDIT="Editing the Library Config" COM_COMPONENTBUILDER_LIBRARY_CONFIG_ERROR_UNIQUE_ALIAS="Another Library Config has the same alias." +COM_COMPONENTBUILDER_LIBRARY_CONFIG_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Library Config has the same alias ." COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD="Field" COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD_DESCRIPTION="Select a field" COM_COMPONENTBUILDER_LIBRARY_CONFIG_FIELD_LABEL="Field" @@ -7145,6 +7314,7 @@ COM_COMPONENTBUILDER_LIBRARY_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_LIBRARY_DESCRIPTION_MESSAGE="Error! Please add description here." COM_COMPONENTBUILDER_LIBRARY_EDIT="Editing the Library" COM_COMPONENTBUILDER_LIBRARY_ERROR_UNIQUE_ALIAS="Another Library has the same alias." +COM_COMPONENTBUILDER_LIBRARY_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Library has the same alias ." COM_COMPONENTBUILDER_LIBRARY_EXACT_LENGTH_ONLY_4_TEXT_FIELD="Exact Length (only 4 text_field)" COM_COMPONENTBUILDER_LIBRARY_EXCLUDE="exclude" COM_COMPONENTBUILDER_LIBRARY_FIELD_OPTIONS_HINT="Options here" @@ -7170,6 +7340,7 @@ COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_CREATED_DATE_LABEL="Created Date COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_DEFAULT_LINK="Default (link)" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_EDIT="Editing the Library Files, Folders & URLs" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS="Another Library Files, Folders & URLs has the same alias." +COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Library Files, Folders & URLs has the same alias ." COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_FILE="File" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_FILEPATH_DESCRIPTION="Full System Path" COM_COMPONENTBUILDER_LIBRARY_FILES_FOLDERS_URLS_FILEPATH_HINT="/home/user/folder/file.php" @@ -7371,9 +7542,11 @@ COM_COMPONENTBUILDER_NO_COMPONENTS_FOUND="No Components Found" COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN="No components were selected, please make a selection and try again!" COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE="No component details found, so it is not safe to continue!" COM_COMPONENTBUILDER_NO_COMPONENT_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_OF_ONE_COMPONENT_AND_TRY_AGAIN="No component was selected, please make a selection of one component and try again!" +COM_COMPONENTBUILDER_NO_CREATE_TABLE_WERE_FOUND_PLEASE_CHECK_YOUR_SQL="No "CREATE TABLE.." were found, please check your sql." COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_FOR_S="No cronjob path found for (%s)" COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cronjob path found since incorrect type requested." COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND="No description found." +COM_COMPONENTBUILDER_NO_FIELDS_WHERE_SELECTED="No fields where selected!" COM_COMPONENTBUILDER_NO_FILES_LINKED="No Files Linked" COM_COMPONENTBUILDER_NO_FOUND="No Found" COM_COMPONENTBUILDER_NO_INSTANCES_WHERE_FOUND_IN_S="No instances where found in %s" @@ -7474,6 +7647,7 @@ COM_COMPONENTBUILDER_PLACEHOLDER_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_PLACEHOLDER_DETAILS="Details" COM_COMPONENTBUILDER_PLACEHOLDER_EDIT="Editing the Placeholder" COM_COMPONENTBUILDER_PLACEHOLDER_ERROR_UNIQUE_ALIAS="Another Placeholder has the same alias." +COM_COMPONENTBUILDER_PLACEHOLDER_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Placeholder has the same alias ." COM_COMPONENTBUILDER_PLACEHOLDER_ID="Id" COM_COMPONENTBUILDER_PLACEHOLDER_MODIFIED_BY_DESC="The last user that modified this Placeholder." COM_COMPONENTBUILDER_PLACEHOLDER_MODIFIED_BY_LABEL="Modified By" @@ -7500,12 +7674,13 @@ COM_COMPONENTBUILDER_PLACEHOLDER_VERSION_LABEL="Version" COM_COMPONENTBUILDER_PLACES_ACROSS_JCB_WHERE_THIS_S_IS_LINKED="Places across JCB where this %s is linked." COM_COMPONENTBUILDER_PLEASE_ADD_FILES_TO_S="Please add files to (%s)" COM_COMPONENTBUILDER_PLEASE_ADD_FOLDERS_TO_S="Please add folders to (%s)" -COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATTER="Please check again latter." +COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATER="Please check again later" COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_SOON_ANDOR_FOLLOW_THE_PROGRESS_ON_SGITVDMDEVA="Please check again soon! and/or follow the progress on %sgit.vdm.dev." COM_COMPONENTBUILDER_PLEASE_FIRST_MAKE_A_SELECTION_FROM_THE_LIST="Please first make a selection from the list." COM_COMPONENTBUILDER_PLEASE_NOTE_THAT_THIS_PACKAGE_BHAS_NOB_CHECKSUM_VALIDATION="Please note that this package has no checksum validation!" COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE="Please select a component that you would like to compile." COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER="Please try again later" +COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_THIS_ERROR_USUALY_HAPPENS_IF_IT_IS_A_NEW_COMPONENT_BEACUES_WE_NEED_A_COMPONENT_ID_TO_DO_THIS_BUILD_WITH_YOUR_SQL_DUMP="Please try again, this error usualy happens if it is a new component, beacues we need a component ID to do this build with your sql dump." COM_COMPONENTBUILDER_PLEASE_WAIT="Please wait!" COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading" COM_COMPONENTBUILDER_PLUGIN="Plugin" @@ -7590,6 +7765,7 @@ COM_COMPONENTBUILDER_POWER_DESCRIPTION_HINT="Add Description Here" COM_COMPONENTBUILDER_POWER_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_POWER_EDIT="Editing the Power" COM_COMPONENTBUILDER_POWER_ERROR_UNIQUE_ALIAS="Another Power has the same alias." +COM_COMPONENTBUILDER_POWER_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Power has the same alias ." COM_COMPONENTBUILDER_POWER_EXTENDS_CUSTOM_DESCRIPTION="The custom class, this class should extend" COM_COMPONENTBUILDER_POWER_EXTENDS_CUSTOM_LABEL="Extends - Custom" COM_COMPONENTBUILDER_POWER_EXTENDS_CUSTOM_MESSAGE="Error! Please add the custom class, this class should extend." @@ -7685,6 +7861,7 @@ COM_COMPONENTBUILDER_POWER_VERSION_DESC="A count of the number of times this Pow COM_COMPONENTBUILDER_POWER_VERSION_LABEL="Version" COM_COMPONENTBUILDER_POWER_YES="Yes" COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP="

Power guid:%s not found!

" +COM_COMPONENTBUILDER_PRE_RELEASE="Pre Release" COM_COMPONENTBUILDER_PROPERTIES="Properties" COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties
Here you can set the properties for this field." COM_COMPONENTBUILDER_PROPERTY="Property" @@ -7707,11 +7884,13 @@ COM_COMPONENTBUILDER_REPLACE="Replace" COM_COMPONENTBUILDER_REPLACED_WITH="replaced with" COM_COMPONENTBUILDER_REPLACE_PROCESS_COMPLETE="replace process complete" COM_COMPONENTBUILDER_REPORT_AN_ISSUE_BSB="Report an issue: %s" +COM_COMPONENTBUILDER_REQUIRED_FIELDS_MISSING_IN_THE_BMYSQL_TABLES_SOURCE_MAPB_SELECTIONBR_S="Required fields missing in the MySQL -> Tables -> Source Map selection:
%s" COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_ENTERED_BE_ONE_OF_THE_OPTIONS_IN_AN_ELEMENT_OF_TYPEQUOTLISTQUOT_THAT_IS_THAT_THE_ELEMENT_IS_A_SELECT_LIST="Requires the value entered be one of the options in an element of type="list": that is, that the element is a select list." COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_TO_BE_A_TELEPHONE_NUMBER_COMPLYING_WITH_THE_STANDARDS_OF_NANPA_ITUT_TRECEONE_HUNDRED_AND_SIXTY_FOUR_OR_IETF_RFCFOUR_THOUSAND_NINE_HUNDRED_AND_THIRTY_THREE="Requires the value to be a Telephone number complying with the standards of nanpa, ITU-T T-REC-E.164 or ietf rfc4933." COM_COMPONENTBUILDER_REQUIRES_THE_VALUE_TO_BE_THE_SAME_AS_THAT_HELD_IN_THE_FIELD_NAMED_QUOTFIELDQUOT_EGS="Requires the value to be the same as that held in the field named "field", eg:%s" COM_COMPONENTBUILDER_RESET="Reset" COM_COMPONENTBUILDER_RESET_FAILED="Reset Failed!" +COM_COMPONENTBUILDER_REVERTED_THE_B_ASSETSB_TABLE_RULES_COLUMN_BACK_TO_ITS_DEFAULT_SIZE_OF_VARCHARFIVE_THOUSAND_ONE_HUNDRED_AND_TWENTY="Reverted the #__assets table rules column back to its default size of varchar(5120)" COM_COMPONENTBUILDER_REVERT_ALL_AHEAD_SNIPPETS="Revert All Ahead Snippets" COM_COMPONENTBUILDER_RIGHT_IN_TAB="Right in Tab" COM_COMPONENTBUILDER_RIGHT_OF_TABS="Right of Tabs" @@ -7817,6 +7996,7 @@ COM_COMPONENTBUILDER_SERVER_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_SERVER_DETAILS="Details" COM_COMPONENTBUILDER_SERVER_EDIT="Editing the Server" COM_COMPONENTBUILDER_SERVER_ERROR_UNIQUE_ALIAS="Another Server has the same alias." +COM_COMPONENTBUILDER_SERVER_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Server has the same alias ." COM_COMPONENTBUILDER_SERVER_FTP="FTP" COM_COMPONENTBUILDER_SERVER_HOST_DESCRIPTION="Add the server host name/IP here" COM_COMPONENTBUILDER_SERVER_HOST_HINT="yourhost.com" @@ -7956,8 +8136,8 @@ COM_COMPONENTBUILDER_SITE_VIEW_ADD_JAVASCRIPT_FILE_LABEL="Add JavaScript (file)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_JS_DOCUMENT_LABEL="Add JS (custom document script)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_AJAX_LABEL="Add PHP (AJAX)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_DOCUMENT_LABEL="Add PHP (custom document script)" -COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom JViewLegacy display)" -COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom JViewLegacy methods)" +COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_DISPLAY_LABEL="Add PHP (custom HtmlView display)" +COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_JVIEW_LABEL="Add PHP (custom HtmlView methods)" COM_COMPONENTBUILDER_SITE_VIEW_ADD_PHP_VIEW_LABEL="Add PHP (custom view script)" COM_COMPONENTBUILDER_SITE_VIEW_AJAX_INPUT_LABEL="Ajax Input" COM_COMPONENTBUILDER_SITE_VIEW_ALLOW_ZERO_DESCRIPTION="null & zero values" @@ -8072,6 +8252,7 @@ COM_COMPONENTBUILDER_SITE_VIEW_ENVELOPE="Envelope" COM_COMPONENTBUILDER_SITE_VIEW_ENVELOPE_OPENED="Envelope Opened" COM_COMPONENTBUILDER_SITE_VIEW_EQUALIZER="Equalizer" COM_COMPONENTBUILDER_SITE_VIEW_ERROR_UNIQUE_ALIAS="Another Site View has the same alias." +COM_COMPONENTBUILDER_SITE_VIEW_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Site View has the same alias ." COM_COMPONENTBUILDER_SITE_VIEW_EXIT="Exit" COM_COMPONENTBUILDER_SITE_VIEW_EXPAND="Expand" COM_COMPONENTBUILDER_SITE_VIEW_EXPAND_2="Expand 2" @@ -8404,6 +8585,7 @@ COM_COMPONENTBUILDER_SNIPPET_DESCRIPTION_LABEL="Description" COM_COMPONENTBUILDER_SNIPPET_DETAILS="Details" COM_COMPONENTBUILDER_SNIPPET_EDIT="Editing the Snippet" COM_COMPONENTBUILDER_SNIPPET_ERROR_UNIQUE_ALIAS="Another Snippet has the same alias." +COM_COMPONENTBUILDER_SNIPPET_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Snippet has the same alias ." COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS="Snippet Get Snippets Button Access" COM_COMPONENTBUILDER_SNIPPET_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_SNIPPET_GUID_DESCRIPTION="Globally Unique Identifier" @@ -8487,6 +8669,7 @@ COM_COMPONENTBUILDER_SNIPPET_TYPE_DESCRIPTION_MESSAGE="Error! Please add descrip COM_COMPONENTBUILDER_SNIPPET_TYPE_DETAILS="Details" COM_COMPONENTBUILDER_SNIPPET_TYPE_EDIT="Editing the Snippet Type" COM_COMPONENTBUILDER_SNIPPET_TYPE_ERROR_UNIQUE_ALIAS="Another Snippet Type has the same alias." +COM_COMPONENTBUILDER_SNIPPET_TYPE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Snippet Type has the same alias ." COM_COMPONENTBUILDER_SNIPPET_TYPE_ID="Id" COM_COMPONENTBUILDER_SNIPPET_TYPE_LABEL="Type" COM_COMPONENTBUILDER_SNIPPET_TYPE_MODIFIED_BY_DESC="The last user that modified this Snippet Type." @@ -8650,6 +8833,7 @@ COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_VALUES_DESCRIPTION="Only use dynamic get v COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_VALUES_LABEL="Dynamic Values" COM_COMPONENTBUILDER_TEMPLATE_EDIT="Editing the Template" COM_COMPONENTBUILDER_TEMPLATE_ERROR_UNIQUE_ALIAS="Another Template has the same alias." +COM_COMPONENTBUILDER_TEMPLATE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Template has the same alias ." COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS="Template Get Snippets Button Access" COM_COMPONENTBUILDER_TEMPLATE_GET_SNIPPETS_BUTTON_ACCESS_DESC="Allows the users in this group to access the get snippets button." COM_COMPONENTBUILDER_TEMPLATE_ID="Id" @@ -8736,6 +8920,7 @@ COM_COMPONENTBUILDER_THE_COMPONENT_MODULES="The component modules" COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS="The component mysql tweaks" COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS="The component placeholders" COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS="The component plugins" +COM_COMPONENTBUILDER_THE_COMPONENT_SITE_ROUTER="The component site router" COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS="The component site views" COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates" COM_COMPONENTBUILDER_THE_COMPONENT_WITH_ALL_LINKED_ADMIN_VIEWS_FIELDS_LINKED_TO_ADMIN_VIEWS_CUSTOM_ADMIN_VIEWS_SITE_VIEWS_TEMPLATES_AND_LAYOUTS_WERE_CLONED_SUCCESSFUL="The Component with all linked admin views, fields linked to admin views, custom admin views, site views, templates and layouts were cloned successful!" @@ -8821,6 +9006,7 @@ COM_COMPONENTBUILDER_TYPE_COMPONENT_MODULES="Component Modules" COM_COMPONENTBUILDER_TYPE_COMPONENT_MYSQL_TWEAKS="Component mysql Tweaks" COM_COMPONENTBUILDER_TYPE_COMPONENT_PLACEHOLDERS="Component Placeholders" COM_COMPONENTBUILDER_TYPE_COMPONENT_PLUGINS="Component Plugins" +COM_COMPONENTBUILDER_TYPE_COMPONENT_ROUTER="Component Router" COM_COMPONENTBUILDER_TYPE_COMPONENT_SITE_VIEWS="Component Site Views" COM_COMPONENTBUILDER_TYPE_COMPONENT_UPDATES="Component Updates" COM_COMPONENTBUILDER_TYPE_CUSTOM_ADMIN_VIEW="Custom Admin View" @@ -8924,6 +9110,7 @@ COM_COMPONENTBUILDER_VALIDATION_RULE_CREATED_DATE_DESC="The date this Validation COM_COMPONENTBUILDER_VALIDATION_RULE_CREATED_DATE_LABEL="Created Date" COM_COMPONENTBUILDER_VALIDATION_RULE_EDIT="Editing the Validation Rule" COM_COMPONENTBUILDER_VALIDATION_RULE_ERROR_UNIQUE_ALIAS="Another Validation Rule has the same alias." +COM_COMPONENTBUILDER_VALIDATION_RULE_ERROR_UNIQUE_ALIAS_TRASHED="A trashed Validation Rule has the same alias ." COM_COMPONENTBUILDER_VALIDATION_RULE_EXTENDS_FORMRULE="Extends FormRule" COM_COMPONENTBUILDER_VALIDATION_RULE_ID="Id" COM_COMPONENTBUILDER_VALIDATION_RULE_INHERIT_DESCRIPTION="Select an existing validation rule that you would like to adapt." @@ -8978,6 +9165,12 @@ COM_COMPONENTBUILDER_WE_FAILED_TO_MOVE_BSB="We failed to move %s!" COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS="We found dynamic code all in one line, and ignored it! Please review (%s) for more details!" COM_COMPONENTBUILDER_WE_FOUND_SOME_INSTANCES_IN_S="We found some instances in %s" COM_COMPONENTBUILDER_WE_SUCCESSFULLY_MOVED_BSB="We successfully moved %s!" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_COMPONENT_TO_THE_GIT_REPOSITORY="We where was unable to transfer the component to the git repository:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_COMPONENT_ZIP_FILE_TO_THE_BACKUP_FOLDER="We where was unable to transfer the component ZIP file to the backup folder:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_MODULE_TO_THE_GIT_REPOSITORY="We where was unable to transfer the (%s) module to the git repository:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_MODULE_ZIP_FILE_TO_THE_BACKUP_FOLDER="We where was unable to transfer the (%s) module zip file to the backup folder:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_PLUGIN_TO_THE_GIT_REPOSITORY="We where was unable to transfer the (%s) plugin to the git repository:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_PLUGIN_ZIP_FILE_TO_THE_BACKUP_FOLDER="We where was unable to transfer the (%s) plugin zip file to the backup folder:" COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET="What version of Joomla would you like to target." COM_COMPONENTBUILDER_WHICH_TYPE_OF_INDENTATION_WOULD_YOU_LIKE_TO_USE_PLEASE_NOTE_THAT_THIS_DOES_NOT_YET_IMPACT_THE_STATIC_TEMPLATES="Which type of indentation would you like to use? Please note that this does not yet impact the static templates." COM_COMPONENTBUILDER_WHILE_WE_DOWNLOAD_ALL_TWENTY_SIX_COMPILER_GIF_ANIMATIONS_RANDOMLY_USED_IN_THE_COMPILER_GUI_DURING_COMPILATION="While we download all 26 compiler GIF animations randomly used in the compiler GUI during compilation" @@ -8993,6 +9186,8 @@ COM_COMPONENTBUILDER_YES="Yes" COM_COMPONENTBUILDER_YES_UPDATE_ALL="Yes! Update ALL" COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE="Your are about to update ALL values that can be found in the database." COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW="Your are about to update row" +COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FIVE="Your component will be compiled to work in Joomla 5" +COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR="Your component will be compiled to work in Joomla 4" COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE="Your component will be compiled to work in Joomla 3" COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 256 bit encryption using the above 32 character key." COM_COMPONENTBUILDER_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items." diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index b1d0e533b..9e13b53fc 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -391,6 +391,26 @@ COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE="Components Plugins Edit Stat COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component plugins" COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION="Components Plugins Edit Version" COM_COMPONENTBUILDER_COMPONENTS_PLUGINS_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version components plugins" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS="Components Routers Access" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_ACCESS_DESC="Allows the users in this group to access access components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE="Components Routers Batch Use" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_BATCH_USE_DESC="Allows the users in this group to use batch copy/update method of batch components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE="Components Routers Create" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_CREATE_DESC="Allows the users in this group to create create components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE="Components Routers Delete" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_DELETE_DESC="Allows the users in this group to delete delete components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT="Components Routers Edit" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY="Components Routers Edit Created By" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE="Components Routers Edit Created Date" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components routers" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_DESC="Allows the users in this group to edit the component router" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN="Components Routers Edit Own" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components routers created by them" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE="Components Routers Edit State" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component router" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION="Components Routers Edit Version" +COM_COMPONENTBUILDER_COMPONENTS_ROUTERS_EDIT_VERSION_DESC="Allows the users in this group to edit versions of version components routers" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS="Components Site Views Access" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS_DESC="Allows the users in this group to access access components site views" COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE="Components Site Views Batch Use" diff --git a/admin/layouts/admin_custom_tabs/publishing.php b/admin/layouts/admin_custom_tabs/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_custom_tabs/publishing.php +++ b/admin/layouts/admin_custom_tabs/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_custom_tabs/publlshing.php b/admin/layouts/admin_custom_tabs/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_custom_tabs/publlshing.php +++ b/admin/layouts/admin_custom_tabs/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_custom_tabs/tabs_above.php b/admin/layouts/admin_custom_tabs/tabs_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_custom_tabs/tabs_above.php +++ b/admin/layouts/admin_custom_tabs/tabs_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_custom_tabs/tabs_fullwidth.php b/admin/layouts/admin_custom_tabs/tabs_fullwidth.php index 8cdb42655..2366ef74f 100644 --- a/admin/layouts/admin_custom_tabs/tabs_fullwidth.php +++ b/admin/layouts/admin_custom_tabs/tabs_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'tabs' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/fields_above.php b/admin/layouts/admin_fields/fields_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_fields/fields_above.php +++ b/admin/layouts/admin_fields/fields_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/fields_fullwidth.php b/admin/layouts/admin_fields/fields_fullwidth.php index ac1636573..9355bbd2f 100644 --- a/admin/layouts/admin_fields/fields_fullwidth.php +++ b/admin/layouts/admin_fields/fields_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfields' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/publishing.php b/admin/layouts/admin_fields/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_fields/publishing.php +++ b/admin/layouts/admin_fields/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields/publlshing.php b/admin/layouts/admin_fields/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_fields/publlshing.php +++ b/admin/layouts/admin_fields/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/conditions_above.php b/admin/layouts/admin_fields_conditions/conditions_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_fields_conditions/conditions_above.php +++ b/admin/layouts/admin_fields_conditions/conditions_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/conditions_fullwidth.php b/admin/layouts/admin_fields_conditions/conditions_fullwidth.php index 6a98583c7..ed2efa434 100644 --- a/admin/layouts/admin_fields_conditions/conditions_fullwidth.php +++ b/admin/layouts/admin_fields_conditions/conditions_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addconditions' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/publishing.php b/admin/layouts/admin_fields_conditions/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_fields_conditions/publishing.php +++ b/admin/layouts/admin_fields_conditions/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_conditions/publlshing.php b/admin/layouts/admin_fields_conditions/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_fields_conditions/publlshing.php +++ b/admin/layouts/admin_fields_conditions/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/publishing.php b/admin/layouts/admin_fields_relations/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/admin_fields_relations/publishing.php +++ b/admin/layouts/admin_fields_relations/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/publlshing.php b/admin/layouts/admin_fields_relations/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_fields_relations/publlshing.php +++ b/admin/layouts/admin_fields_relations/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/relations_above.php b/admin/layouts/admin_fields_relations/relations_above.php index 4e0068392..c779fcdc7 100644 --- a/admin/layouts/admin_fields_relations/relations_above.php +++ b/admin/layouts/admin_fields_relations/relations_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'admin_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_fields_relations/relations_fullwidth.php b/admin/layouts/admin_fields_relations/relations_fullwidth.php index f90e77fef..2bc1f28a3 100644 --- a/admin/layouts/admin_fields_relations/relations_fullwidth.php +++ b/admin/layouts/admin_fields_relations/relations_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addrelations' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/css_fullwidth.php b/admin/layouts/admin_view/css_fullwidth.php index 253eb58bd..96e44de92 100644 --- a/admin/layouts/admin_view/css_fullwidth.php +++ b/admin/layouts/admin_view/css_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/custom_buttons_fullwidth.php b/admin/layouts/admin_view/custom_buttons_fullwidth.php index 4d465133a..b923f43de 100644 --- a/admin/layouts/admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/admin_view/custom_buttons_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_model_list' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/custom_buttons_left.php b/admin/layouts/admin_view/custom_buttons_left.php index 0f09a8578..14e6b3be7 100644 --- a/admin/layouts/admin_view/custom_buttons_left.php +++ b/admin/layouts/admin_view/custom_buttons_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'custom_button' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/custom_import_fullwidth.php b/admin/layouts/admin_view/custom_import_fullwidth.php index 45e9c641c..d7581768d 100644 --- a/admin/layouts/admin_view/custom_import_fullwidth.php +++ b/admin/layouts/admin_view/custom_import_fullwidth.php @@ -38,7 +38,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_import_ext' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_above.php b/admin/layouts/admin_view/details_above.php index 87bb562cb..ca79cda0b 100644 --- a/admin/layouts/admin_view/details_above.php +++ b/admin/layouts/admin_view/details_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'system_name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_fullwidth.php b/admin/layouts/admin_view/details_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/admin_view/details_fullwidth.php +++ b/admin/layouts/admin_view/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_left.php b/admin/layouts/admin_view/details_left.php index ac95961ad..5ba739e4f 100644 --- a/admin/layouts/admin_view/details_left.php +++ b/admin/layouts/admin_view/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'icon_category' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_right.php b/admin/layouts/admin_view/details_right.php index cc8a1136b..08e45d724 100644 --- a/admin/layouts/admin_view/details_right.php +++ b/admin/layouts/admin_view/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_fadein' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/details_under.php b/admin/layouts/admin_view/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/admin_view/details_under.php +++ b/admin/layouts/admin_view/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/fields_fullwidth.php b/admin/layouts/admin_view/fields_fullwidth.php index c0c5e3d13..9ddd4f127 100644 --- a/admin/layouts/admin_view/fields_fullwidth.php +++ b/admin/layouts/admin_view/fields_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_create_edit_display' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/fields_left.php b/admin/layouts/admin_view/fields_left.php index 06e630cfb..94f05ff70 100644 --- a/admin/layouts/admin_view/fields_left.php +++ b/admin/layouts/admin_view/fields_left.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_category_submenu' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/fields_right.php b/admin/layouts/admin_view/fields_right.php index fe2333e2d..d18a73428 100644 --- a/admin/layouts/admin_view/fields_right.php +++ b/admin/layouts/admin_view/fields_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_create_edit_buttons' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/javascript_fullwidth.php b/admin/layouts/admin_view/javascript_fullwidth.php index 4730f04a4..ac14aa1ca 100644 --- a/admin/layouts/admin_view/javascript_fullwidth.php +++ b/admin/layouts/admin_view/javascript_fullwidth.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'javascript_views_footer' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/mysql_fullwidth.php b/admin/layouts/admin_view/mysql_fullwidth.php index e49958274..044a98f0e 100644 --- a/admin/layouts/admin_view/mysql_fullwidth.php +++ b/admin/layouts/admin_view/mysql_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/mysql_left.php b/admin/layouts/admin_view/mysql_left.php index 10141576d..be363eb8f 100644 --- a/admin/layouts/admin_view/mysql_left.php +++ b/admin/layouts/admin_view/mysql_left.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addtables' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/php_fullwidth.php b/admin/layouts/admin_view/php_fullwidth.php index 7f3e7e491..8594c257c 100644 --- a/admin/layouts/admin_view/php_fullwidth.php +++ b/admin/layouts/admin_view/php_fullwidth.php @@ -69,7 +69,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_document' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/publishing.php b/admin/layouts/admin_view/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/admin_view/publishing.php +++ b/admin/layouts/admin_view/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/publlshing.php b/admin/layouts/admin_view/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/admin_view/publlshing.php +++ b/admin/layouts/admin_view/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/admin_view/settings_fullwidth.php b/admin/layouts/admin_view/settings_fullwidth.php index 99653b635..432f6f109 100644 --- a/admin/layouts/admin_view/settings_fullwidth.php +++ b/admin/layouts/admin_view/settings_fullwidth.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addlinked_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 7e45fe25a..e16530a29 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -12,6 +12,7 @@ // No direct access to this file defined('JPATH_BASE') or die; +use Joomla\CMS\Language\Text; JHtmlBehavior::core(); $divWrapper = range(1,120,2); $counter = 0; @@ -19,8 +20,8 @@ $counter = 0; ListSelection) : ?>
ListSelection as $ListSelection) : ?> -
-
+
+
-
+
- +
- - -
+ + +
\ No newline at end of file diff --git a/admin/layouts/class_extends/details_fullwidth.php b/admin/layouts/class_extends/details_fullwidth.php index f7dc8078c..5384b8666 100644 --- a/admin/layouts/class_extends/details_fullwidth.php +++ b/admin/layouts/class_extends/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'head' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/details_left.php b/admin/layouts/class_extends/details_left.php index 978f1cc38..93997fd08 100644 --- a/admin/layouts/class_extends/details_left.php +++ b/admin/layouts/class_extends/details_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'extension_type' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/details_right.php b/admin/layouts/class_extends/details_right.php index 19e2f8dbb..c0a0b9647 100644 --- a/admin/layouts/class_extends/details_right.php +++ b/admin/layouts/class_extends/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'comment' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/publishing.php b/admin/layouts/class_extends/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/class_extends/publishing.php +++ b/admin/layouts/class_extends/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_extends/publlshing.php b/admin/layouts/class_extends/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/class_extends/publlshing.php +++ b/admin/layouts/class_extends/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/details_fullwidth.php b/admin/layouts/class_method/details_fullwidth.php index 8551ba464..61779f18c 100644 --- a/admin/layouts/class_method/details_fullwidth.php +++ b/admin/layouts/class_method/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'code' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/details_left.php b/admin/layouts/class_method/details_left.php index c6ec62819..ac29eeb68 100644 --- a/admin/layouts/class_method/details_left.php +++ b/admin/layouts/class_method/details_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin_group' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/details_right.php b/admin/layouts/class_method/details_right.php index 19e2f8dbb..c0a0b9647 100644 --- a/admin/layouts/class_method/details_right.php +++ b/admin/layouts/class_method/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'comment' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/publishing.php b/admin/layouts/class_method/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/class_method/publishing.php +++ b/admin/layouts/class_method/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_method/publlshing.php b/admin/layouts/class_method/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/class_method/publlshing.php +++ b/admin/layouts/class_method/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/details_left.php b/admin/layouts/class_property/details_left.php index 042b458dd..db307ef39 100644 --- a/admin/layouts/class_property/details_left.php +++ b/admin/layouts/class_property/details_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin_group' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/details_right.php b/admin/layouts/class_property/details_right.php index 19e2f8dbb..c0a0b9647 100644 --- a/admin/layouts/class_property/details_right.php +++ b/admin/layouts/class_property/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'comment' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/publishing.php b/admin/layouts/class_property/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/class_property/publishing.php +++ b/admin/layouts/class_property/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/class_property/publlshing.php b/admin/layouts/class_property/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/class_property/publlshing.php +++ b/admin/layouts/class_property/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/clone_left.php b/admin/layouts/component_admin_views/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_admin_views/clone_left.php +++ b/admin/layouts/component_admin_views/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/publishing.php b/admin/layouts/component_admin_views/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_admin_views/publishing.php +++ b/admin/layouts/component_admin_views/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/publlshing.php b/admin/layouts/component_admin_views/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_admin_views/publlshing.php +++ b/admin/layouts/component_admin_views/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/views_above.php b/admin/layouts/component_admin_views/views_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_admin_views/views_above.php +++ b/admin/layouts/component_admin_views/views_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_admin_views/views_fullwidth.php b/admin/layouts/component_admin_views/views_fullwidth.php index 1673841f2..5c7f56822 100644 --- a/admin/layouts/component_admin_views/views_fullwidth.php +++ b/admin/layouts/component_admin_views/views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addadmin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/clone_left.php b/admin/layouts/component_config/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_config/clone_left.php +++ b/admin/layouts/component_config/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/options_above.php b/admin/layouts/component_config/options_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_config/options_above.php +++ b/admin/layouts/component_config/options_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/options_fullwidth.php b/admin/layouts/component_config/options_fullwidth.php index f05e0e794..3d2a9a8c5 100644 --- a/admin/layouts/component_config/options_fullwidth.php +++ b/admin/layouts/component_config/options_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addconfig' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/publishing.php b/admin/layouts/component_config/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_config/publishing.php +++ b/admin/layouts/component_config/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_config/publlshing.php b/admin/layouts/component_config/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_config/publlshing.php +++ b/admin/layouts/component_config/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/clone_left.php b/admin/layouts/component_custom_admin_menus/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_custom_admin_menus/clone_left.php +++ b/admin/layouts/component_custom_admin_menus/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/menus_above.php b/admin/layouts/component_custom_admin_menus/menus_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_custom_admin_menus/menus_above.php +++ b/admin/layouts/component_custom_admin_menus/menus_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/menus_fullwidth.php b/admin/layouts/component_custom_admin_menus/menus_fullwidth.php index bbc75d620..789f83fb1 100644 --- a/admin/layouts/component_custom_admin_menus/menus_fullwidth.php +++ b/admin/layouts/component_custom_admin_menus/menus_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addcustommenus' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/publishing.php b/admin/layouts/component_custom_admin_menus/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_custom_admin_menus/publishing.php +++ b/admin/layouts/component_custom_admin_menus/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_menus/publlshing.php b/admin/layouts/component_custom_admin_menus/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_custom_admin_menus/publlshing.php +++ b/admin/layouts/component_custom_admin_menus/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/clone_left.php b/admin/layouts/component_custom_admin_views/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_custom_admin_views/clone_left.php +++ b/admin/layouts/component_custom_admin_views/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/publishing.php b/admin/layouts/component_custom_admin_views/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_custom_admin_views/publishing.php +++ b/admin/layouts/component_custom_admin_views/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/publlshing.php b/admin/layouts/component_custom_admin_views/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_custom_admin_views/publlshing.php +++ b/admin/layouts/component_custom_admin_views/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/views_above.php b/admin/layouts/component_custom_admin_views/views_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_custom_admin_views/views_above.php +++ b/admin/layouts/component_custom_admin_views/views_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_custom_admin_views/views_fullwidth.php b/admin/layouts/component_custom_admin_views/views_fullwidth.php index 6a4ad5855..10c57b3c7 100644 --- a/admin/layouts/component_custom_admin_views/views_fullwidth.php +++ b/admin/layouts/component_custom_admin_views/views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addcustom_admin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/clone_left.php b/admin/layouts/component_dashboard/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_dashboard/clone_left.php +++ b/admin/layouts/component_dashboard/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/dashboard_above.php b/admin/layouts/component_dashboard/dashboard_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_dashboard/dashboard_above.php +++ b/admin/layouts/component_dashboard/dashboard_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/dashboard_fullwidth.php b/admin/layouts/component_dashboard/dashboard_fullwidth.php index aade82bb5..c842e18d8 100644 --- a/admin/layouts/component_dashboard/dashboard_fullwidth.php +++ b/admin/layouts/component_dashboard/dashboard_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dashboard_tab' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/publishing.php b/admin/layouts/component_dashboard/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_dashboard/publishing.php +++ b/admin/layouts/component_dashboard/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_dashboard/publlshing.php b/admin/layouts/component_dashboard/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_dashboard/publlshing.php +++ b/admin/layouts/component_dashboard/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/advance_fullwidth.php b/admin/layouts/component_files_folders/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/component_files_folders/advance_fullwidth.php +++ b/admin/layouts/component_files_folders/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/basic_above.php b/admin/layouts/component_files_folders/basic_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_files_folders/basic_above.php +++ b/admin/layouts/component_files_folders/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/basic_fullwidth.php b/admin/layouts/component_files_folders/basic_fullwidth.php index 62e58dc11..223f7bf06 100644 --- a/admin/layouts/component_files_folders/basic_fullwidth.php +++ b/admin/layouts/component_files_folders/basic_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/clone_left.php b/admin/layouts/component_files_folders/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_files_folders/clone_left.php +++ b/admin/layouts/component_files_folders/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/publishing.php b/admin/layouts/component_files_folders/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_files_folders/publishing.php +++ b/admin/layouts/component_files_folders/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_files_folders/publlshing.php b/admin/layouts/component_files_folders/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_files_folders/publlshing.php +++ b/admin/layouts/component_files_folders/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/clone_left.php b/admin/layouts/component_modules/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_modules/clone_left.php +++ b/admin/layouts/component_modules/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/modules_above.php b/admin/layouts/component_modules/modules_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_modules/modules_above.php +++ b/admin/layouts/component_modules/modules_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/modules_fullwidth.php b/admin/layouts/component_modules/modules_fullwidth.php index 41348c16e..463450154 100644 --- a/admin/layouts/component_modules/modules_fullwidth.php +++ b/admin/layouts/component_modules/modules_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addjoomla_modules' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/publishing.php b/admin/layouts/component_modules/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_modules/publishing.php +++ b/admin/layouts/component_modules/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_modules/publlshing.php b/admin/layouts/component_modules/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_modules/publlshing.php +++ b/admin/layouts/component_modules/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/clone_left.php b/admin/layouts/component_mysql_tweaks/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_mysql_tweaks/clone_left.php +++ b/admin/layouts/component_mysql_tweaks/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php b/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php +++ b/admin/layouts/component_mysql_tweaks/mysql_tweaks_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php b/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php index c8066789a..7ea3bdef4 100644 --- a/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php +++ b/admin/layouts/component_mysql_tweaks/mysql_tweaks_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql_tweak' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/publishing.php b/admin/layouts/component_mysql_tweaks/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_mysql_tweaks/publishing.php +++ b/admin/layouts/component_mysql_tweaks/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_mysql_tweaks/publlshing.php b/admin/layouts/component_mysql_tweaks/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_mysql_tweaks/publlshing.php +++ b/admin/layouts/component_mysql_tweaks/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/clone_left.php b/admin/layouts/component_placeholders/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_placeholders/clone_left.php +++ b/admin/layouts/component_placeholders/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/details_above.php b/admin/layouts/component_placeholders/details_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_placeholders/details_above.php +++ b/admin/layouts/component_placeholders/details_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/details_fullwidth.php b/admin/layouts/component_placeholders/details_fullwidth.php index fd57fc4a6..f664fa009 100644 --- a/admin/layouts/component_placeholders/details_fullwidth.php +++ b/admin/layouts/component_placeholders/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addplaceholders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/publishing.php b/admin/layouts/component_placeholders/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_placeholders/publishing.php +++ b/admin/layouts/component_placeholders/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_placeholders/publlshing.php b/admin/layouts/component_placeholders/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_placeholders/publlshing.php +++ b/admin/layouts/component_placeholders/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/clone_left.php b/admin/layouts/component_plugins/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_plugins/clone_left.php +++ b/admin/layouts/component_plugins/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/plugins_above.php b/admin/layouts/component_plugins/plugins_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_plugins/plugins_above.php +++ b/admin/layouts/component_plugins/plugins_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/plugins_fullwidth.php b/admin/layouts/component_plugins/plugins_fullwidth.php index 77bd19357..5c70f9f8d 100644 --- a/admin/layouts/component_plugins/plugins_fullwidth.php +++ b/admin/layouts/component_plugins/plugins_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addjoomla_plugins' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/publishing.php b/admin/layouts/component_plugins/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_plugins/publishing.php +++ b/admin/layouts/component_plugins/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_plugins/publlshing.php b/admin/layouts/component_plugins/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_plugins/publlshing.php +++ b/admin/layouts/component_plugins/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/helpers/extrusion/index.html b/admin/layouts/component_router/index.html similarity index 100% rename from admin/helpers/extrusion/index.html rename to admin/layouts/component_router/index.html diff --git a/admin/layouts/component_router/publishing.php b/admin/layouts/component_router/publishing.php new file mode 100644 index 000000000..e8b5798d7 --- /dev/null +++ b/admin/layouts/component_router/publishing.php @@ -0,0 +1,46 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'title', + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/component_router/publlshing.php b/admin/layouts/component_router/publlshing.php new file mode 100644 index 000000000..9b1e77c16 --- /dev/null +++ b/admin/layouts/component_router/publlshing.php @@ -0,0 +1,47 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + + + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + + diff --git a/admin/layouts/component_router/settings_above.php b/admin/layouts/component_router/settings_above.php new file mode 100644 index 000000000..49a90ad8b --- /dev/null +++ b/admin/layouts/component_router/settings_above.php @@ -0,0 +1,44 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'joomla_component' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/component_router/settings_fullwidth.php b/admin/layouts/component_router/settings_fullwidth.php new file mode 100644 index 000000000..81a7d5be6 --- /dev/null +++ b/admin/layouts/component_router/settings_fullwidth.php @@ -0,0 +1,54 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// get the form +$form = $displayData->getForm(); + +// get the layout fields override method name (from layout path/ID) +$layout_path_array = explode('.', $this->getLayoutId()); +// Since we cannot pass the layout and tab names as parameters to the model method +// this name combination of tab and layout in the method name is the only work around +// seeing that JCB uses those two values (tab_name & layout_name) as the layout file name. +// example of layout name: details_left.php +// example of method name: getFields_details_left() +$fields_tab_layout = 'fields_' . $layout_path_array[1]; + +// get the fields +$fields = $displayData->get($fields_tab_layout) ?: array( + 'router_settings_details_switch', + 'note_router_settings', + 'note_router_settings_advance', + 'mode_constructor_before_parent', + 'note_mode_constructor_before_parent_manual', + 'constructor_before_parent_code', + 'constructor_before_parent_manual', + 'mode_constructor_after_parent', + 'constructor_after_parent_code', + 'mode_methods', + 'methods_code' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: []; + +?> + +
+ + + setFieldAttribute($field, 'type', 'hidden'); ?> + + renderField($field, null, null, array('class' => 'control-wrapper-' . $field)); ?> + +
+ diff --git a/admin/layouts/component_site_views/clone_left.php b/admin/layouts/component_site_views/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_site_views/clone_left.php +++ b/admin/layouts/component_site_views/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/publishing.php b/admin/layouts/component_site_views/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_site_views/publishing.php +++ b/admin/layouts/component_site_views/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/publlshing.php b/admin/layouts/component_site_views/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_site_views/publlshing.php +++ b/admin/layouts/component_site_views/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/views_above.php b/admin/layouts/component_site_views/views_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_site_views/views_above.php +++ b/admin/layouts/component_site_views/views_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_site_views/views_fullwidth.php b/admin/layouts/component_site_views/views_fullwidth.php index 89afa4ba2..b98a52057 100644 --- a/admin/layouts/component_site_views/views_fullwidth.php +++ b/admin/layouts/component_site_views/views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addsite_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/clone_left.php b/admin/layouts/component_updates/clone_left.php index 25c4eb0c1..ff98ff5d9 100644 --- a/admin/layouts/component_updates/clone_left.php +++ b/admin/layouts/component_updates/clone_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'clone_me' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/publishing.php b/admin/layouts/component_updates/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/component_updates/publishing.php +++ b/admin/layouts/component_updates/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/publlshing.php b/admin/layouts/component_updates/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/component_updates/publlshing.php +++ b/admin/layouts/component_updates/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/updates_above.php b/admin/layouts/component_updates/updates_above.php index cf841da92..49a90ad8b 100644 --- a/admin/layouts/component_updates/updates_above.php +++ b/admin/layouts/component_updates/updates_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_component' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/component_updates/updates_fullwidth.php b/admin/layouts/component_updates/updates_fullwidth.php index ccf6866f5..c7b1a2d6c 100644 --- a/admin/layouts/component_updates/updates_fullwidth.php +++ b/admin/layouts/component_updates/updates_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'version_update' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php index 554de9d8c..a0036b262 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_model' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/custom_buttons_left.php b/admin/layouts/custom_admin_view/custom_buttons_left.php index 0f09a8578..14e6b3be7 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_left.php +++ b/admin/layouts/custom_admin_view/custom_buttons_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'custom_button' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_above.php b/admin/layouts/custom_admin_view/details_above.php index 019a14081..f4c751c3f 100644 --- a/admin/layouts/custom_admin_view/details_above.php +++ b/admin/layouts/custom_admin_view/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'context' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_fullwidth.php b/admin/layouts/custom_admin_view/details_fullwidth.php index 8c0c8e83e..4588be130 100644 --- a/admin/layouts/custom_admin_view/details_fullwidth.php +++ b/admin/layouts/custom_admin_view/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'default' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_left.php b/admin/layouts/custom_admin_view/details_left.php index df266c7f1..701581d58 100644 --- a/admin/layouts/custom_admin_view/details_left.php +++ b/admin/layouts/custom_admin_view/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_right.php b/admin/layouts/custom_admin_view/details_right.php index c97f5422e..45fb83312 100644 --- a/admin/layouts/custom_admin_view/details_right.php +++ b/admin/layouts/custom_admin_view/details_right.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_rightside.php b/admin/layouts/custom_admin_view/details_rightside.php index d7ea40a77..41d309d7d 100644 --- a/admin/layouts/custom_admin_view/details_rightside.php +++ b/admin/layouts/custom_admin_view/details_rightside.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dynamic_values' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/details_under.php b/admin/layouts/custom_admin_view/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/custom_admin_view/details_under.php +++ b/admin/layouts/custom_admin_view/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/javascript_css_fullwidth.php b/admin/layouts/custom_admin_view/javascript_css_fullwidth.php index 2d215335d..2b81ca60e 100644 --- a/admin/layouts/custom_admin_view/javascript_css_fullwidth.php +++ b/admin/layouts/custom_admin_view/javascript_css_fullwidth.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/linked_components_fullwidth.php b/admin/layouts/custom_admin_view/linked_components_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/custom_admin_view/linked_components_fullwidth.php +++ b/admin/layouts/custom_admin_view/linked_components_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/php_fullwidth.php b/admin/layouts/custom_admin_view/php_fullwidth.php index deb10e126..84d3fe3d7 100644 --- a/admin/layouts/custom_admin_view/php_fullwidth.php +++ b/admin/layouts/custom_admin_view/php_fullwidth.php @@ -39,7 +39,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_jview' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/publishing.php b/admin/layouts/custom_admin_view/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/custom_admin_view/publishing.php +++ b/admin/layouts/custom_admin_view/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_admin_view/publlshing.php b/admin/layouts/custom_admin_view/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/custom_admin_view/publlshing.php +++ b/admin/layouts/custom_admin_view/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_above.php b/admin/layouts/custom_code/details_above.php index 68ce3e65c..0eb3d4b75 100644 --- a/admin/layouts/custom_code/details_above.php +++ b/admin/layouts/custom_code/details_above.php @@ -28,10 +28,11 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; $fields = $displayData->get($fields_tab_layout) ?: array( 'target', 'system_name', + 'joomla_version', 'function_name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_fullwidth.php b/admin/layouts/custom_code/details_fullwidth.php index 2e431c66e..8729b857b 100644 --- a/admin/layouts/custom_code/details_fullwidth.php +++ b/admin/layouts/custom_code/details_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_placeholders_explained' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_left.php b/admin/layouts/custom_code/details_left.php index 3e3621fab..e93f38b47 100644 --- a/admin/layouts/custom_code/details_left.php +++ b/admin/layouts/custom_code/details_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'hashtarget' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_right.php b/admin/layouts/custom_code/details_right.php index 2e65f13a0..8227678a0 100644 --- a/admin/layouts/custom_code/details_right.php +++ b/admin/layouts/custom_code/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'hashendtarget' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/details_under.php b/admin/layouts/custom_code/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/custom_code/details_under.php +++ b/admin/layouts/custom_code/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/publishing.php b/admin/layouts/custom_code/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/custom_code/publishing.php +++ b/admin/layouts/custom_code/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/custom_code/publlshing.php b/admin/layouts/custom_code/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/custom_code/publlshing.php +++ b/admin/layouts/custom_code/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/abacus_fullwidth.php b/admin/layouts/dynamic_get/abacus_fullwidth.php index 3ab1f0e03..fe4717716 100644 --- a/admin/layouts/dynamic_get/abacus_fullwidth.php +++ b/admin/layouts/dynamic_get/abacus_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_calculation' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/abacus_left.php b/admin/layouts/dynamic_get/abacus_left.php index bbf798601..d4598b9f6 100644 --- a/admin/layouts/dynamic_get/abacus_left.php +++ b/admin/layouts/dynamic_get/abacus_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addcalculation' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/custom_script_fullwidth.php b/admin/layouts/dynamic_get/custom_script_fullwidth.php index d529430e0..35156aedf 100644 --- a/admin/layouts/dynamic_get/custom_script_fullwidth.php +++ b/admin/layouts/dynamic_get/custom_script_fullwidth.php @@ -37,10 +37,11 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_php_after_getitems', 'php_after_getitems', 'add_php_router_parse', + 'php_router_parse_notice', 'php_router_parse' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/joint_fullwidth.php b/admin/layouts/dynamic_get/joint_fullwidth.php index d1c05074c..dd56f9b4c 100644 --- a/admin/layouts/dynamic_get/joint_fullwidth.php +++ b/admin/layouts/dynamic_get/joint_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'join_db_table' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_above.php b/admin/layouts/dynamic_get/main_above.php index d15037af5..9b4cf461f 100644 --- a/admin/layouts/dynamic_get/main_above.php +++ b/admin/layouts/dynamic_get/main_above.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'pagination' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_fullwidth.php b/admin/layouts/dynamic_get/main_fullwidth.php index dd170b76d..a752fe44d 100644 --- a/admin/layouts/dynamic_get/main_fullwidth.php +++ b/admin/layouts/dynamic_get/main_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_left.php b/admin/layouts/dynamic_get/main_left.php index 48761754b..9f5f64a50 100644 --- a/admin/layouts/dynamic_get/main_left.php +++ b/admin/layouts/dynamic_get/main_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'db_selection' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_right.php b/admin/layouts/dynamic_get/main_right.php index a504903ec..6573eab2f 100644 --- a/admin/layouts/dynamic_get/main_right.php +++ b/admin/layouts/dynamic_get/main_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'plugin_events' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/main_under.php b/admin/layouts/dynamic_get/main_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/dynamic_get/main_under.php +++ b/admin/layouts/dynamic_get/main_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/publishing.php b/admin/layouts/dynamic_get/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/dynamic_get/publishing.php +++ b/admin/layouts/dynamic_get/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/publlshing.php b/admin/layouts/dynamic_get/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/dynamic_get/publlshing.php +++ b/admin/layouts/dynamic_get/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/dynamic_get/tweak_fullwidth.php b/admin/layouts/dynamic_get/tweak_fullwidth.php index 9d340c48d..bf3be56ad 100644 --- a/admin/layouts/dynamic_get/tweak_fullwidth.php +++ b/admin/layouts/dynamic_get/tweak_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'global' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/database_fullwidth.php b/admin/layouts/field/database_fullwidth.php index f3dde1361..e1f9066b7 100644 --- a/admin/layouts/field/database_fullwidth.php +++ b/admin/layouts/field/database_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_database_settings_needed' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/database_left.php b/admin/layouts/field/database_left.php index c312abeba..28043f64e 100644 --- a/admin/layouts/field/database_left.php +++ b/admin/layouts/field/database_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'datadefault_other' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/database_right.php b/admin/layouts/field/database_right.php index 644649025..13a86167b 100644 --- a/admin/layouts/field/database_right.php +++ b/admin/layouts/field/database_right.php @@ -39,7 +39,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'on_get_model_field' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/publishing.php b/admin/layouts/field/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/field/publishing.php +++ b/admin/layouts/field/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/publlshing.php b/admin/layouts/field/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/field/publlshing.php +++ b/admin/layouts/field/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/scripts_left.php b/admin/layouts/field/scripts_left.php index 726f3fe4a..2b6ac97dd 100644 --- a/admin/layouts/field/scripts_left.php +++ b/admin/layouts/field/scripts_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/scripts_right.php b/admin/layouts/field/scripts_right.php index 8ff91e5f2..f3d723ecf 100644 --- a/admin/layouts/field/scripts_right.php +++ b/admin/layouts/field/scripts_right.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'javascript_views_footer' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/set_properties_above.php b/admin/layouts/field/set_properties_above.php index a899861d3..dfa26042d 100644 --- a/admin/layouts/field/set_properties_above.php +++ b/admin/layouts/field/set_properties_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'catid' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/set_properties_fullwidth.php b/admin/layouts/field/set_properties_fullwidth.php index 77f331121..4a6aa70e4 100644 --- a/admin/layouts/field/set_properties_fullwidth.php +++ b/admin/layouts/field/set_properties_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_filter_information' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/set_properties_under.php b/admin/layouts/field/set_properties_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/field/set_properties_under.php +++ b/admin/layouts/field/set_properties_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/field/type_info_fullwidth.php b/admin/layouts/field/type_info_fullwidth.php index c310d8d68..beeb5186c 100644 --- a/admin/layouts/field/type_info_fullwidth.php +++ b/admin/layouts/field/type_info_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'xml' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/database_defaults_left.php b/admin/layouts/fieldtype/database_defaults_left.php index b0ea19849..8f786f5e8 100644 --- a/admin/layouts/fieldtype/database_defaults_left.php +++ b/admin/layouts/fieldtype/database_defaults_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'datadefault_other' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/database_defaults_right.php b/admin/layouts/fieldtype/database_defaults_right.php index 0f650d05d..7feeeaac0 100644 --- a/admin/layouts/fieldtype/database_defaults_right.php +++ b/admin/layouts/fieldtype/database_defaults_right.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_whmcs_encryption' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_above.php b/admin/layouts/fieldtype/details_above.php index 4b44cd601..4cf7932ce 100644 --- a/admin/layouts/fieldtype/details_above.php +++ b/admin/layouts/fieldtype/details_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_fullwidth.php b/admin/layouts/fieldtype/details_fullwidth.php index e150a3b3e..e3315a49c 100644 --- a/admin/layouts/fieldtype/details_fullwidth.php +++ b/admin/layouts/fieldtype/details_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_left.php b/admin/layouts/fieldtype/details_left.php index 0e67b869b..e04cc70b7 100644 --- a/admin/layouts/fieldtype/details_left.php +++ b/admin/layouts/fieldtype/details_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'short_description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/details_right.php b/admin/layouts/fieldtype/details_right.php index 37215496b..bd0ef9952 100644 --- a/admin/layouts/fieldtype/details_right.php +++ b/admin/layouts/fieldtype/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index badb9937b..af8e274a3 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -12,22 +12,28 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; + // set the defaults $items = $displayData->vycfields; -$user = JFactory::getUser(); +$user = Factory::getUser(); $id = $displayData->item->id; // set the edit URL $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; // set a return value $return = ($id) ? "index.php?option=com_componentbuilder&view=fieldtype&layout=edit&id=" . $id : ""; // check for a return value -$jinput = JFactory::getApplication()->input; +$jinput = Factory::getApplication()->input; if ($_return = $jinput->get('return', null, 'base64')) { $return .= "&return=" . $_return; } // check if return value was set -if (ComponentbuilderHelper::checkString($return)) +if (StringHelper::check($return)) { // set the referral values $ref = ($id) ? "&ref=fieldtype&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); @@ -47,40 +53,40 @@ $can = ComponentbuilderHelper::getActions('field');
get('field.create')): ?>
- - + +


- + @@ -88,7 +94,7 @@ $can = ComponentbuilderHelper::getActions('field'); $item): ?> authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('field',$item,'fields'); ?> @@ -96,7 +102,7 @@ $can = ComponentbuilderHelper::getActions('field'); get('field.edit')): ?> escape($item->name); ?>checked_out): ?> - name, $item->checked_out_time, 'fields.', $canCheckin); ?> + name, $item->checked_out_time, 'fields.', $canCheckin); ?> escape($item->name); ?> @@ -106,16 +112,16 @@ $can = ComponentbuilderHelper::getActions('field'); escape($item->fieldtype_name); ?> published == 1): ?> published == 0): ?> published == 2): ?> published == -2): ?> @@ -158,7 +164,7 @@ $can = ComponentbuilderHelper::getActions('field');
- + - + - + - + - + - + - + - + - +
- datatype); ?> + datatype); ?> - indexes); ?> + indexes); ?> - null_switch); ?> + null_switch); ?> - store); ?> + store); ?> authorise('core.edit', 'com_componentbuilder.field.category.' . (int)$item->catid)): ?> @@ -126,26 +132,26 @@ $can = ComponentbuilderHelper::getActions('field'); - - + + - - + + - - + + - - + +
- +
diff --git a/admin/layouts/fieldtype/publishing.php b/admin/layouts/fieldtype/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/fieldtype/publishing.php +++ b/admin/layouts/fieldtype/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/fieldtype/publlshing.php b/admin/layouts/fieldtype/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/fieldtype/publlshing.php +++ b/admin/layouts/fieldtype/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index 5d8ed3d98..f3a8e7abf 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'alias' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index 2d71a04d6..913080e6e 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'content' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index f72ddc06e..695279e92 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'site_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index 5dcfa71db..b986a65f5 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'article' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index 09643bbaa..07e9d9a2a 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php index cb41f62bc..d54df3db0 100644 --- a/admin/layouts/help_document/publlshing.php +++ b/admin/layouts/help_document/publlshing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/jcbnoticeboardpro.php b/admin/layouts/jcbnoticeboardpro.php index 1d0e53a8c..43533de2d 100644 --- a/admin/layouts/jcbnoticeboardpro.php +++ b/admin/layouts/jcbnoticeboardpro.php @@ -12,11 +12,16 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + ?>
- -
.
+ +
.
diff --git a/admin/layouts/jcbnoticeboardtabs.php b/admin/layouts/jcbnoticeboardtabs.php index 6a6ca9fbe..7e7693314 100644 --- a/admin/layouts/jcbnoticeboardtabs.php +++ b/admin/layouts/jcbnoticeboardtabs.php @@ -12,18 +12,23 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + ?> -
- $displayData['active'] . '-noticeboard')) ?> - - -
- - - -
- - +
+ $displayData['active'] . '-noticeboard')); ?> + + +
+ + + +
+ +
diff --git a/admin/layouts/jcbnoticeboardvdm.php b/admin/layouts/jcbnoticeboardvdm.php index 04dec6150..99bc2f1f4 100644 --- a/admin/layouts/jcbnoticeboardvdm.php +++ b/admin/layouts/jcbnoticeboardvdm.php @@ -12,11 +12,16 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + ?>
- -
.
+ +
.
diff --git a/admin/layouts/jcbsupportmessage.php b/admin/layouts/jcbsupportmessage.php index 1aaa5a707..4a242848c 100644 --- a/admin/layouts/jcbsupportmessage.php +++ b/admin/layouts/jcbsupportmessage.php @@ -12,17 +12,22 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + // Different support requests/appreciation $support = [ - JText::_("COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), - JText::_("COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL"), - JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), - JText::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), - JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), - JText::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY") + Text::_("COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_JCB_IS_A_CRUCIAL_TOOL_FOR_PHP_PROGRAMMERS_WHO_USE_JOOMLA_TO_EARN_A_LIVING_BY_MAKING_A_BFINANCIAL_DONATIONB_YOU_CAN_SUPPORT_THE_GROWTH_AND_CONTINUITY_OF_THIS_VITAL_RESOURCE_AND_ENSURE_ITS_RELEVANCE_FOR_YEARS_TO_COME_YOUR_CONTRIBUTION_NO_MATTER_HOW_BIG_OR_SMALL_WILL_BE_DEEPLY_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_THE_CONTINUED_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_HAS_ALLOWED_JOOMLA_COMPONENT_BUILDER_JCB_TO_THRIVE_FOR_SEVEN_YEARS_SINCE_GOING_PUBLIC_YOUR_CONTRIBUTIONS_HAVE_BEEN_CRUCIAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_THANK_YOU_FOR_YOUR_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), + Text::_("COM_COMPONENTBUILDER_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WITH_A_BFINANCIAL_DONATIONB_TO_SHOW_GRATITUDE_FOR_THE_TIME_AND_EFFORT_SAVED_IN_YOUR_DEVELOPMENT_PROCESS_YOUR_CONTRIBUTION_NO_MATTER_THE_SIZE_WILL_BE_APPRECIATED_BY_THE_PROJECTS_TEAM_AND_THE_WIDER_COMMUNITY_HELP_ENSURE_THE_GROWTH_AND_RELEVANCE_OF_THIS_ESSENTIAL_TOOL"), + Text::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_DONATIONB_SUPPORT_THE_NECESSARY_DEVELOPMENT_AND_MAINTENANCE_OF_THIS_OPENSOURCE_PROJECT_ENSURING_ITS_CONTINUED_GROWTH_AND_RELEVANCE_FOR_THE_COMMUNITY_YOUR_CONTRIBUTION_WILL_HELP_SECURE_THE_FUTURE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), + Text::_("COM_COMPONENTBUILDER_INVEST_IN_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_THE_CONTINUAL_SUPPORT_OF_ALL_THOSE_USING_THE_TOOL_WILL_BE_MORE_THAN_ENOUGH_TO_ENSURE_ITS_CONTINUED_GROWTH_AND_RELEVANCE_BY_INVESTING_IN_THIS_OPENSOURCE_PROJECT_YOU_ARE_SECURING_ITS_FUTURE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS"), + Text::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_GRATITUDE_TO_ALL_THOSE_WHO_SUPPORT_JOOMLA_COMPONENT_BUILDER_JCB_WHETHER_AS_A_HOBBY_OR_AS_A_PART_OF_THEIR_BUSINESS_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_HAD_A_SIGNIFICANT_IMPACT_ON_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_WE_HIGHLY_VALUE_THE_DEDICATION_OF_HOBBYISTS_AND_THE_COMMITMENT_OF_COMPANIES_WHO_SUPPORT_JCB_AS_THEY_HAVE_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_WE_ARE_GRATEFUL_FOR_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_SMALL_AND_THANK_YOU_FOR_BEING_A_PART_OF_THE_POSITIVE_IMPACT_THAT_JCB_HAS_ON_THE_PHP_PROGRAMMING_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_WITHOUT_SUFFICIENT_SUPPORT_THE_FUTURE_OF_JOOMLA_COMPONENT_BUILDER_JCB_IS_IN_JEOPARDY_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_IT_IS_CRUCIAL_TO_ENSURE_ITS_CONTINUED_DEVELOPMENT_AND_MAINTENANCE_BY_MAKING_A_BFINANCIAL_CONTRIBUTIONB_NO_MATTER_HOW_SMALL_YOU_ARE_HELPING_TO_SAFEGUARD_THE_FUTURE_OF_THIS_OPENSOURCE_PROJECT_NEGLECTING_TO_SUPPORT_JCB_COULD_RESULT_IN_ITS_DECLINE_AND_LOSS_AS_A_RESOURCE_FOR_THE_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_HEARTFELT_APPRECIATION_TO_THOSE_WHO_HAVE_SUPPORTED_THE_JOOMLA_COMPONENT_BUILDER_JCB_PROJECT_OVER_THE_YEARS_YOUR_CONTRIBUTIONS_NO_MATTER_HOW_BIG_OR_SMALL_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_ITS_GROWTH_AND_RELEVANCE_AS_A_VITAL_TOOL_FOR_PHP_PROGRAMMERS_SEVEN_YEARS_AFTER_GOING_PUBLIC_JCB_IS_STILL_HERE_TODAY_BECAUSE_OF_THE_SUPPORT_OF_INDIVIDUALS_LIKE_YOU_WHO_BELIEVE_IN_THE_IMPORTANCE_OF_THIS_OPENSOURCE_PROJECT_YOUR_GENEROSITY_HAS_ALLOWED_THE_PROJECT_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_SUPPORT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY"), + Text::_("COM_COMPONENTBUILDER_WE_EXTEND_OUR_SINCERE_APPRECIATION_TO_THE_COMPANIES_WHO_USE_JOOMLA_COMPONENT_BUILDER_JCB_AND_SUPPORT_THE_PROJECT_YOUR_CONTRIBUTIONS_WHETHER_FINANCIAL_OR_IN_THE_FORM_OF_ACTIVE_INVOLVEMENT_HAVE_BEEN_INSTRUMENTAL_IN_ENSURING_THE_GROWTH_AND_RELEVANCE_OF_THIS_VITAL_TOOL_FOR_PHP_PROGRAMMERS_YOUR_SUPPORT_HAS_ALLOWED_JCB_TO_CONTINUE_ITS_DEVELOPMENT_AND_MAINTENANCE_PROVIDING_VALUABLE_RESOURCES_FOR_THE_COMMUNITY_THANK_YOU_FOR_YOUR_UNWAVERING_COMMITMENT_TO_THE_PROJECT_AND_FOR_BEING_A_PART_OF_JCBS_JOURNEY") ]; // build the support message @@ -30,36 +35,36 @@ $support_message = $support[random_int(0, 8)]; // the button titles $titles = [ - JText::_("COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE"), - JText::_("COM_COMPONENTBUILDER_JCB_SAVES_TIME"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW"), - JText::_("COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS"), - JText::_("COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT"), - JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY"), - JText::_("COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY"), - JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE"), - JText::_("COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT"), - JText::_("COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION"), - JText::_("COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE"), - JText::_("COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE"), - JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES"), - JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE"), - JText::_("COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION"), - JText::_("COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS"), - JText::_("COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL"), - JText::_("COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE"), - JText::_("COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE"), - JText::_("COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION"), - JText::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM"), - JText::_("COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE"), - JText::_("COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS") + Text::_("COM_COMPONENTBUILDER_JCB_ENABLES_PHP_DEVELOPMENT"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_OPENSOURCE"), + Text::_("COM_COMPONENTBUILDER_JCB_SAVES_TIME"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_WORKFLOW"), + Text::_("COM_COMPONENTBUILDER_JCB_EMPOWERS_PHP_DEVELOPERS"), + Text::_("COM_COMPONENTBUILDER_JCB_STREAMLINES_DEVELOPMENT"), + Text::_("COM_COMPONENTBUILDER_JCB_PROMOTES_EFFICIENCY"), + Text::_("COM_COMPONENTBUILDER_JCB_ENHANCES_PRODUCTIVITY"), + Text::_("COM_COMPONENTBUILDER_JCB_INCREASES_REVENUE"), + Text::_("COM_COMPONENTBUILDER_JCB_REDUCES_DEVELOPMENT_COSTS"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_THE_PHP_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHP_DEVELOPMENT"), + Text::_("COM_COMPONENTBUILDER_JCB_HELPS_GROW_BUSINESSES"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_PHP_INNOVATION"), + Text::_("COM_COMPONENTBUILDER_JCB_CONTRIBUTES_TO_OPENSOURCE"), + Text::_("COM_COMPONENTBUILDER_JCB_PROVIDES_A_BETTER_EXPERIENCE"), + Text::_("COM_COMPONENTBUILDER_JCB_OFFERS_MORE_FEATURES"), + Text::_("COM_COMPONENTBUILDER_JCB_INCREASES_DEVELOPMENT_SPEED"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_USER_EXPERIENCE"), + Text::_("COM_COMPONENTBUILDER_JCB_INCREASES_USER_SATISFACTION"), + Text::_("COM_COMPONENTBUILDER_JCB_LOWERS_DEVELOPMENT_STRESS"), + Text::_("COM_COMPONENTBUILDER_JCB_PROMOTES_GOODWILL"), + Text::_("COM_COMPONENTBUILDER_JCB_OFFERS_A_STRONGER_SOLUTION"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_WORTHY_CAUSE"), + Text::_("COM_COMPONENTBUILDER_JCB_BUILDS_A_BETTER_FUTURE"), + Text::_("COM_COMPONENTBUILDER_JCB_FOSTERS_A_STRONG_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_JCB_IMPROVES_PHPS_REPUTATION"), + Text::_("COM_COMPONENTBUILDER_JCB_SUPPORTS_A_THRIVING_ECOSYSTEM"), + Text::_("COM_COMPONENTBUILDER_JCB_HELPS_PHP_THRIVE"), + Text::_("COM_COMPONENTBUILDER_JCB_INVESTS_IN_PHPS_SUCCESS") ]; // build the support button @@ -67,39 +72,39 @@ $support_titles = $titles[random_int(0, 29)]; // the button names $button_names = [ - JText::_("COM_COMPONENTBUILDER_DONATE_TO_JCB"), - JText::_("COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY"), - JText::_("COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB"), - JText::_("COM_COMPONENTBUILDER_INVEST_IN_JCB"), - JText::_("COM_COMPONENTBUILDER_GIVE_TO_JCB"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_MISSION"), - JText::_("COM_COMPONENTBUILDER_HELP_JCB_GROW"), - JText::_("COM_COMPONENTBUILDER_BE_A_PART_OF_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_NEEDS_YOU"), - JText::_("COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR"), - JText::_("COM_COMPONENTBUILDER_EMPOWER_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS"), - JText::_("COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_VISION"), - JText::_("COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS"), - JText::_("COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE"), - JText::_("COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY"), - JText::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE"), - JText::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY") + Text::_("COM_COMPONENTBUILDER_DONATE_TO_JCB"), + Text::_("COM_COMPONENTBUILDER_SUPPORT_JCB_TODAY"), + Text::_("COM_COMPONENTBUILDER_CONTRIBUTE_TO_JCB"), + Text::_("COM_COMPONENTBUILDER_INVEST_IN_JCB"), + Text::_("COM_COMPONENTBUILDER_GIVE_TO_JCB"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_MISSION"), + Text::_("COM_COMPONENTBUILDER_HELP_JCB_GROW"), + Text::_("COM_COMPONENTBUILDER_BE_A_PART_OF_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_NEEDS_YOU"), + Text::_("COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR"), + Text::_("COM_COMPONENTBUILDER_EMPOWER_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_IMPACT"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_MAKE_A_DIFFERENCE_WITH_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_FUTURE"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_JOURNEY"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_COUNTS"), + Text::_("COM_COMPONENTBUILDER_EMPOWER_THE_FUTURE_WITH_JCB"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_CONTRIBUTION_MATTERS"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_VISION"), + Text::_("COM_COMPONENTBUILDER_ELEVATE_JCB_TODAY"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_CHANGE"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_DONATION_MATTERS"), + Text::_("COM_COMPONENTBUILDER_JCB_BE_THE_CHANGE"), + Text::_("COM_COMPONENTBUILDER_JOIN_JCBS_SUCCESS"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_SUCCESS"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_IS_KEY"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_THE_COMMUNITY"), + Text::_("COM_COMPONENTBUILDER_JCB_YOUR_SUPPORT_MATTERS_MOST"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_YOUR_FUTURE"), + Text::_("COM_COMPONENTBUILDER_JCB_INVEST_IN_PROGRESS_TODAY") ]; // build the support button diff --git a/admin/layouts/joomla_component/admin_views_fullwidth.php b/admin/layouts/joomla_component/admin_views_fullwidth.php index 49ecdf8a6..5c81e30d0 100644 --- a/admin/layouts/joomla_component/admin_views_fullwidth.php +++ b/admin/layouts/joomla_component/admin_views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_component_admin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php index 0b1cc116a..66d27edee 100644 --- a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php +++ b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_component_custom_admin_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dash_install_fullwidth.php b/admin/layouts/joomla_component/dash_install_fullwidth.php index 7eccffe1f..76916652b 100644 --- a/admin/layouts/joomla_component/dash_install_fullwidth.php +++ b/admin/layouts/joomla_component/dash_install_fullwidth.php @@ -38,7 +38,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_method_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dash_install_left.php b/admin/layouts/joomla_component/dash_install_left.php index 636e104f9..cb832413a 100644 --- a/admin/layouts/joomla_component/dash_install_left.php +++ b/admin/layouts/joomla_component/dash_install_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dashboard_type' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dash_install_right.php b/admin/layouts/joomla_component/dash_install_right.php index 510a9183e..3bd773f74 100644 --- a/admin/layouts/joomla_component/dash_install_right.php +++ b/admin/layouts/joomla_component/dash_install_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_botton_component_dashboard' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_above.php b/admin/layouts/joomla_component/details_above.php index 6cbed1d15..38514f015 100644 --- a/admin/layouts/joomla_component/details_above.php +++ b/admin/layouts/joomla_component/details_above.php @@ -27,10 +27,11 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( 'system_name', + 'preferred_joomla_version', 'add_powers' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_left.php b/admin/layouts/joomla_component/details_left.php index 9ddb7a9a8..6f450a888 100644 --- a/admin/layouts/joomla_component/details_left.php +++ b/admin/layouts/joomla_component/details_left.php @@ -40,7 +40,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_right.php b/admin/layouts/joomla_component/details_right.php index 2015302da..72051362e 100644 --- a/admin/layouts/joomla_component/details_right.php +++ b/admin/layouts/joomla_component/details_right.php @@ -42,7 +42,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'copyright' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/details_under.php b/admin/layouts/joomla_component/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/joomla_component/details_under.php +++ b/admin/layouts/joomla_component/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php index 8f152abbf..903b1f9e6 100644 --- a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php +++ b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'buildcompsql' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dynamic_integration_left.php b/admin/layouts/joomla_component/dynamic_integration_left.php index f1b7da7e0..26d81ac1d 100644 --- a/admin/layouts/joomla_component/dynamic_integration_left.php +++ b/admin/layouts/joomla_component/dynamic_integration_left.php @@ -43,7 +43,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'git_folder_path' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/dynamic_integration_right.php b/admin/layouts/joomla_component/dynamic_integration_right.php index 36d48a06f..9cabdf06f 100644 --- a/admin/layouts/joomla_component/dynamic_integration_right.php +++ b/admin/layouts/joomla_component/dynamic_integration_right.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'crowdin_account_api_key' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/libs_helpers_fullwidth.php b/admin/layouts/joomla_component/libs_helpers_fullwidth.php index 4bb7292fb..8eb3abfc8 100644 --- a/admin/layouts/joomla_component/libs_helpers_fullwidth.php +++ b/admin/layouts/joomla_component/libs_helpers_fullwidth.php @@ -48,7 +48,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css_site' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/metadata.php b/admin/layouts/joomla_component/metadata.php index 47d8b22df..be4510d01 100644 --- a/admin/layouts/joomla_component/metadata.php +++ b/admin/layouts/joomla_component/metadata.php @@ -12,6 +12,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + $form = $displayData->getForm(); // JLayout for standard handling of metadata fields in the administrator content edit screens. @@ -20,7 +22,7 @@ $fieldSets = $form->getFieldsets('metadata'); $fieldSet) : ?> description) && trim($fieldSet->description)) : ?> -

escape(JText::_($fieldSet->description)); ?>

+

escape(Text::_($fieldSet->description)); ?>

get($fields_tab_layout) ?: array( 'assets_table_fix' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/publishing.php b/admin/layouts/joomla_component/publishing.php index 0375c1a3a..048dfd556 100644 --- a/admin/layouts/joomla_component/publishing.php +++ b/admin/layouts/joomla_component/publishing.php @@ -40,7 +40,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/readme_left.php b/admin/layouts/joomla_component/readme_left.php index 767d64d89..50544b2fc 100644 --- a/admin/layouts/joomla_component/readme_left.php +++ b/admin/layouts/joomla_component/readme_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/readme_right.php b/admin/layouts/joomla_component/readme_right.php index 8d81512fc..c51b74829 100644 --- a/admin/layouts/joomla_component/readme_right.php +++ b/admin/layouts/joomla_component/readme_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/settings_fullwidth.php b/admin/layouts/joomla_component/settings_fullwidth.php index f8b075556..4e723c4b7 100644 --- a/admin/layouts/joomla_component/settings_fullwidth.php +++ b/admin/layouts/joomla_component/settings_fullwidth.php @@ -26,14 +26,14 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( - 'spacer_hr_7', + 'spacer_hr_8', 'note_on_contributors', 'addcontributors', 'emptycontributors', 'number' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/settings_left.php b/admin/layouts/joomla_component/settings_left.php index 55a1ee310..5a9966cdf 100644 --- a/admin/layouts/joomla_component/settings_left.php +++ b/admin/layouts/joomla_component/settings_left.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_config' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/settings_right.php b/admin/layouts/joomla_component/settings_right.php index 9b45ab209..32fff8939 100644 --- a/admin/layouts/joomla_component/settings_right.php +++ b/admin/layouts/joomla_component/settings_right.php @@ -28,19 +28,22 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; $fields = $displayData->get($fields_tab_layout) ?: array( 'note_component_files_folders', 'spacer_hr_4', + 'add_namespace_prefix', + 'namespace_prefix', + 'spacer_hr_5', 'add_menu_prefix', 'menu_prefix', - 'spacer_hr_5', + 'spacer_hr_6', 'to_ignore_note', 'toignore', - 'spacer_hr_6', + 'spacer_hr_7', 'jcb_export_package_note', 'export_key', 'joomla_source_link', 'export_buy_link' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_component/site_views_fullwidth.php b/admin/layouts/joomla_component/site_views_fullwidth.php index 5ea3ff9a1..4807ed09c 100644 --- a/admin/layouts/joomla_component/site_views_fullwidth.php +++ b/admin/layouts/joomla_component/site_views_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_component_site_views' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/code_fullwidth.php b/admin/layouts/joomla_module/code_fullwidth.php index 7ba3cd28c..09ee16e40 100644 --- a/admin/layouts/joomla_module/code_fullwidth.php +++ b/admin/layouts/joomla_module/code_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'mod_code' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/code_left.php b/admin/layouts/joomla_module/code_left.php index 224902240..b1336905b 100644 --- a/admin/layouts/joomla_module/code_left.php +++ b/admin/layouts/joomla_module/code_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'custom_get' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/code_right.php b/admin/layouts/joomla_module/code_right.php index 8a59d48d4..1fa0b3736 100644 --- a/admin/layouts/joomla_module/code_right.php +++ b/admin/layouts/joomla_module/code_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_mod_file_options' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/dynamic_integration_left.php b/admin/layouts/joomla_module/dynamic_integration_left.php index c35d75f98..198c4d093 100644 --- a/admin/layouts/joomla_module/dynamic_integration_left.php +++ b/admin/layouts/joomla_module/dynamic_integration_left.php @@ -37,7 +37,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sales_server' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/forms_fields_fullwidth.php b/admin/layouts/joomla_module/forms_fields_fullwidth.php index 7de237af2..f193193b7 100644 --- a/admin/layouts/joomla_module/forms_fields_fullwidth.php +++ b/admin/layouts/joomla_module/forms_fields_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'fields' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/helper_fullwidth.php b/admin/layouts/joomla_module/helper_fullwidth.php index ebfea4515..1ab63004b 100644 --- a/admin/layouts/joomla_module/helper_fullwidth.php +++ b/admin/layouts/joomla_module/helper_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'class_helper_code' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/helper_left.php b/admin/layouts/joomla_module/helper_left.php index ff4aab6f6..a4769693f 100644 --- a/admin/layouts/joomla_module/helper_left.php +++ b/admin/layouts/joomla_module/helper_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_class_helper' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/helper_right.php b/admin/layouts/joomla_module/helper_right.php index 0778bbd69..306e6e1a6 100644 --- a/admin/layouts/joomla_module/helper_right.php +++ b/admin/layouts/joomla_module/helper_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_class_helper_header' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_above.php b/admin/layouts/joomla_module/html_above.php index 85fb585df..bb1bb1a53 100644 --- a/admin/layouts/joomla_module/html_above.php +++ b/admin/layouts/joomla_module/html_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'target' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_fullwidth.php b/admin/layouts/joomla_module/html_fullwidth.php index 84d9224f9..2a0879327 100644 --- a/admin/layouts/joomla_module/html_fullwidth.php +++ b/admin/layouts/joomla_module/html_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_left.php b/admin/layouts/joomla_module/html_left.php index 5e6a487b9..b42bff411 100644 --- a/admin/layouts/joomla_module/html_left.php +++ b/admin/layouts/joomla_module/html_left.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/html_right.php b/admin/layouts/joomla_module/html_right.php index f7e79a421..d26d9c258 100644 --- a/admin/layouts/joomla_module/html_right.php +++ b/admin/layouts/joomla_module/html_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/mysql_fullwidth.php b/admin/layouts/joomla_module/mysql_fullwidth.php index acde25167..c51f898bb 100644 --- a/admin/layouts/joomla_module/mysql_fullwidth.php +++ b/admin/layouts/joomla_module/mysql_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/publishing.php b/admin/layouts/joomla_module/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/joomla_module/publishing.php +++ b/admin/layouts/joomla_module/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/publlshing.php b/admin/layouts/joomla_module/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_module/publlshing.php +++ b/admin/layouts/joomla_module/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/readme_left.php b/admin/layouts/joomla_module/readme_left.php index 767d64d89..50544b2fc 100644 --- a/admin/layouts/joomla_module/readme_left.php +++ b/admin/layouts/joomla_module/readme_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module/script_file_fullwidth.php b/admin/layouts/joomla_module/script_file_fullwidth.php index 8c37a873c..f49d7850b 100644 --- a/admin/layouts/joomla_module/script_file_fullwidth.php +++ b/admin/layouts/joomla_module/script_file_fullwidth.php @@ -42,7 +42,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_method_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php b/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php +++ b/admin/layouts/joomla_module_files_folders_urls/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/basic_above.php b/admin/layouts/joomla_module_files_folders_urls/basic_above.php index 91f5cad4c..1845b0a09 100644 --- a/admin/layouts/joomla_module_files_folders_urls/basic_above.php +++ b/admin/layouts/joomla_module_files_folders_urls/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_module' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php b/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php index 5026c32d6..ad3ccb77b 100644 --- a/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php +++ b/admin/layouts/joomla_module_files_folders_urls/basic_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/publishing.php b/admin/layouts/joomla_module_files_folders_urls/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_module_files_folders_urls/publishing.php +++ b/admin/layouts/joomla_module_files_folders_urls/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_files_folders_urls/publlshing.php b/admin/layouts/joomla_module_files_folders_urls/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_module_files_folders_urls/publlshing.php +++ b/admin/layouts/joomla_module_files_folders_urls/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/publishing.php b/admin/layouts/joomla_module_updates/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_module_updates/publishing.php +++ b/admin/layouts/joomla_module_updates/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/publlshing.php b/admin/layouts/joomla_module_updates/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_module_updates/publlshing.php +++ b/admin/layouts/joomla_module_updates/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/updates_above.php b/admin/layouts/joomla_module_updates/updates_above.php index 91f5cad4c..1845b0a09 100644 --- a/admin/layouts/joomla_module_updates/updates_above.php +++ b/admin/layouts/joomla_module_updates/updates_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_module' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_module_updates/updates_fullwidth.php b/admin/layouts/joomla_module_updates/updates_fullwidth.php index ccf6866f5..c7b1a2d6c 100644 --- a/admin/layouts/joomla_module_updates/updates_fullwidth.php +++ b/admin/layouts/joomla_module_updates/updates_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'version_update' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_above.php b/admin/layouts/joomla_plugin/code_above.php index 8af6e74c1..08459ee0e 100644 --- a/admin/layouts/joomla_plugin/code_above.php +++ b/admin/layouts/joomla_plugin/code_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'plugin_version' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_fullwidth.php b/admin/layouts/joomla_plugin/code_fullwidth.php index 7b0382906..241bfebc7 100644 --- a/admin/layouts/joomla_plugin/code_fullwidth.php +++ b/admin/layouts/joomla_plugin/code_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_left.php b/admin/layouts/joomla_plugin/code_left.php index 6bbaf6c61..124c62611 100644 --- a/admin/layouts/joomla_plugin/code_left.php +++ b/admin/layouts/joomla_plugin/code_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_plugin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/code_right.php b/admin/layouts/joomla_plugin/code_right.php index cce180871..bac079e74 100644 --- a/admin/layouts/joomla_plugin/code_right.php +++ b/admin/layouts/joomla_plugin/code_right.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'method_selection' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/dynamic_integration_left.php b/admin/layouts/joomla_plugin/dynamic_integration_left.php index c35d75f98..198c4d093 100644 --- a/admin/layouts/joomla_plugin/dynamic_integration_left.php +++ b/admin/layouts/joomla_plugin/dynamic_integration_left.php @@ -37,7 +37,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sales_server' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/forms_fields_fullwidth.php b/admin/layouts/joomla_plugin/forms_fields_fullwidth.php index 7de237af2..f193193b7 100644 --- a/admin/layouts/joomla_plugin/forms_fields_fullwidth.php +++ b/admin/layouts/joomla_plugin/forms_fields_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'fields' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/mysql_fullwidth.php b/admin/layouts/joomla_plugin/mysql_fullwidth.php index acde25167..c51f898bb 100644 --- a/admin/layouts/joomla_plugin/mysql_fullwidth.php +++ b/admin/layouts/joomla_plugin/mysql_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'sql_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/publishing.php b/admin/layouts/joomla_plugin/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/joomla_plugin/publishing.php +++ b/admin/layouts/joomla_plugin/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/publlshing.php b/admin/layouts/joomla_plugin/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin/publlshing.php +++ b/admin/layouts/joomla_plugin/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/readme_left.php b/admin/layouts/joomla_plugin/readme_left.php index 767d64d89..50544b2fc 100644 --- a/admin/layouts/joomla_plugin/readme_left.php +++ b/admin/layouts/joomla_plugin/readme_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'readme' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin/script_file_fullwidth.php b/admin/layouts/joomla_plugin/script_file_fullwidth.php index 8c37a873c..f49d7850b 100644 --- a/admin/layouts/joomla_plugin/script_file_fullwidth.php +++ b/admin/layouts/joomla_plugin/script_file_fullwidth.php @@ -42,7 +42,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_method_uninstall' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php b/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php b/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php index 0aa6bd601..74d3b5c8f 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php b/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php index 5026c32d6..ad3ccb77b 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/basic_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/publishing.php b/admin/layouts/joomla_plugin_files_folders_urls/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/publishing.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php b/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php +++ b/admin/layouts/joomla_plugin_files_folders_urls/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/details_left.php b/admin/layouts/joomla_plugin_group/details_left.php index 10724a9ed..698053efe 100644 --- a/admin/layouts/joomla_plugin_group/details_left.php +++ b/admin/layouts/joomla_plugin_group/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/details_right.php b/admin/layouts/joomla_plugin_group/details_right.php index 5e8f3f7a9..586dcd2ef 100644 --- a/admin/layouts/joomla_plugin_group/details_right.php +++ b/admin/layouts/joomla_plugin_group/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'class_extends' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/publishing.php b/admin/layouts/joomla_plugin_group/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_plugin_group/publishing.php +++ b/admin/layouts/joomla_plugin_group/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_group/publlshing.php b/admin/layouts/joomla_plugin_group/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin_group/publlshing.php +++ b/admin/layouts/joomla_plugin_group/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/publishing.php b/admin/layouts/joomla_plugin_updates/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/joomla_plugin_updates/publishing.php +++ b/admin/layouts/joomla_plugin_updates/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/publlshing.php b/admin/layouts/joomla_plugin_updates/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/joomla_plugin_updates/publlshing.php +++ b/admin/layouts/joomla_plugin_updates/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/updates_above.php b/admin/layouts/joomla_plugin_updates/updates_above.php index 0aa6bd601..74d3b5c8f 100644 --- a/admin/layouts/joomla_plugin_updates/updates_above.php +++ b/admin/layouts/joomla_plugin_updates/updates_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'joomla_plugin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/joomla_plugin_updates/updates_fullwidth.php b/admin/layouts/joomla_plugin_updates/updates_fullwidth.php index ccf6866f5..c7b1a2d6c 100644 --- a/admin/layouts/joomla_plugin_updates/updates_fullwidth.php +++ b/admin/layouts/joomla_plugin_updates/updates_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'version_update' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/details_left.php b/admin/layouts/language/details_left.php index 10724a9ed..698053efe 100644 --- a/admin/layouts/language/details_left.php +++ b/admin/layouts/language/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/details_right.php b/admin/layouts/language/details_right.php index 5c45f24bd..a975654a4 100644 --- a/admin/layouts/language/details_right.php +++ b/admin/layouts/language/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'langtag' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/publishing.php b/admin/layouts/language/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/language/publishing.php +++ b/admin/layouts/language/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language/publlshing.php b/admin/layouts/language/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/language/publlshing.php +++ b/admin/layouts/language/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language_translation/details_fullwidth.php b/admin/layouts/language_translation/details_fullwidth.php index 46179d851..4fe520946 100644 --- a/admin/layouts/language_translation/details_fullwidth.php +++ b/admin/layouts/language_translation/details_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'plugins' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language_translation/publishing.php b/admin/layouts/language_translation/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/language_translation/publishing.php +++ b/admin/layouts/language_translation/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/language_translation/publlshing.php b/admin/layouts/language_translation/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/language_translation/publlshing.php +++ b/admin/layouts/language_translation/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/custom_script_fullwidth.php b/admin/layouts/layout/custom_script_fullwidth.php index edba69106..ea6db0d57 100644 --- a/admin/layouts/layout/custom_script_fullwidth.php +++ b/admin/layouts/layout/custom_script_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_view' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_fullwidth.php b/admin/layouts/layout/details_fullwidth.php index 4bc5550c6..19e53b0b0 100644 --- a/admin/layouts/layout/details_fullwidth.php +++ b/admin/layouts/layout/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'layout' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_left.php b/admin/layouts/layout/details_left.php index 876f27db5..5a2389916 100644 --- a/admin/layouts/layout/details_left.php +++ b/admin/layouts/layout/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_right.php b/admin/layouts/layout/details_right.php index f7e79a421..d26d9c258 100644 --- a/admin/layouts/layout/details_right.php +++ b/admin/layouts/layout/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_rightside.php b/admin/layouts/layout/details_rightside.php index 466f72e12..18568c5ee 100644 --- a/admin/layouts/layout/details_rightside.php +++ b/admin/layouts/layout/details_rightside.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dynamic_values' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/details_under.php b/admin/layouts/layout/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/layout/details_under.php +++ b/admin/layouts/layout/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/publishing.php b/admin/layouts/layout/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/layout/publishing.php +++ b/admin/layouts/layout/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/layout/publlshing.php b/admin/layouts/layout/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/layout/publlshing.php +++ b/admin/layouts/layout/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_above.php b/admin/layouts/library/behaviour_above.php index e1a453bf9..4190834f1 100644 --- a/admin/layouts/library/behaviour_above.php +++ b/admin/layouts/library/behaviour_above.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'type' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_fullwidth.php b/admin/layouts/library/behaviour_fullwidth.php index 0e3318e96..c80202b74 100644 --- a/admin/layouts/library/behaviour_fullwidth.php +++ b/admin/layouts/library/behaviour_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_setdocument' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_left.php b/admin/layouts/library/behaviour_left.php index d2e6922bd..cbb497a40 100644 --- a/admin/layouts/library/behaviour_left.php +++ b/admin/layouts/library/behaviour_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'libraries' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_right.php b/admin/layouts/library/behaviour_right.php index 37215496b..bd0ef9952 100644 --- a/admin/layouts/library/behaviour_right.php +++ b/admin/layouts/library/behaviour_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/behaviour_under.php b/admin/layouts/library/behaviour_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/library/behaviour_under.php +++ b/admin/layouts/library/behaviour_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/config_fullwidth.php b/admin/layouts/library/config_fullwidth.php index 03f0a08a7..7f0044561 100644 --- a/admin/layouts/library/config_fullwidth.php +++ b/admin/layouts/library/config_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_library_config' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/files_folders_urls_fullwidth.php b/admin/layouts/library/files_folders_urls_fullwidth.php index 3f3f9ac75..4e443a475 100644 --- a/admin/layouts/library/files_folders_urls_fullwidth.php +++ b/admin/layouts/library/files_folders_urls_fullwidth.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_display_library_files_folders_urls' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/linked_fullwidth.php b/admin/layouts/library/linked_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/library/linked_fullwidth.php +++ b/admin/layouts/library/linked_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/publishing.php b/admin/layouts/library/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/library/publishing.php +++ b/admin/layouts/library/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library/publlshing.php b/admin/layouts/library/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/library/publlshing.php +++ b/admin/layouts/library/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/publishing.php b/admin/layouts/library_config/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/library_config/publishing.php +++ b/admin/layouts/library_config/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/publlshing.php b/admin/layouts/library_config/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/library_config/publlshing.php +++ b/admin/layouts/library_config/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/tweaks_above.php b/admin/layouts/library_config/tweaks_above.php index 91cb40ee7..a28024f97 100644 --- a/admin/layouts/library_config/tweaks_above.php +++ b/admin/layouts/library_config/tweaks_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'library' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_config/tweaks_fullwidth.php b/admin/layouts/library_config/tweaks_fullwidth.php index f05e0e794..3d2a9a8c5 100644 --- a/admin/layouts/library_config/tweaks_fullwidth.php +++ b/admin/layouts/library_config/tweaks_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addconfig' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/advance_fullwidth.php b/admin/layouts/library_files_folders_urls/advance_fullwidth.php index 5fd19b54f..3d510dcae 100644 --- a/admin/layouts/library_files_folders_urls/advance_fullwidth.php +++ b/admin/layouts/library_files_folders_urls/advance_fullwidth.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_constant_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/basic_above.php b/admin/layouts/library_files_folders_urls/basic_above.php index 91cb40ee7..a28024f97 100644 --- a/admin/layouts/library_files_folders_urls/basic_above.php +++ b/admin/layouts/library_files_folders_urls/basic_above.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'library' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/basic_fullwidth.php b/admin/layouts/library_files_folders_urls/basic_fullwidth.php index 5026c32d6..ad3ccb77b 100644 --- a/admin/layouts/library_files_folders_urls/basic_fullwidth.php +++ b/admin/layouts/library_files_folders_urls/basic_fullwidth.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'addfolders' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/publishing.php b/admin/layouts/library_files_folders_urls/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/library_files_folders_urls/publishing.php +++ b/admin/layouts/library_files_folders_urls/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/library_files_folders_urls/publlshing.php b/admin/layouts/library_files_folders_urls/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/library_files_folders_urls/publlshing.php +++ b/admin/layouts/library_files_folders_urls/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/details_fullwidth.php b/admin/layouts/placeholder/details_fullwidth.php index 71cab66d0..ef5ca0e12 100644 --- a/admin/layouts/placeholder/details_fullwidth.php +++ b/admin/layouts/placeholder/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_placeholders_placedin' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/details_left.php b/admin/layouts/placeholder/details_left.php index 0baf316e5..8297ca542 100644 --- a/admin/layouts/placeholder/details_left.php +++ b/admin/layouts/placeholder/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'target' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/details_right.php b/admin/layouts/placeholder/details_right.php index 76c8df47c..1aa0b4512 100644 --- a/admin/layouts/placeholder/details_right.php +++ b/admin/layouts/placeholder/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'value' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/publishing.php b/admin/layouts/placeholder/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/placeholder/publishing.php +++ b/admin/layouts/placeholder/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/placeholder/publlshing.php b/admin/layouts/placeholder/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/placeholder/publlshing.php +++ b/admin/layouts/placeholder/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_above.php b/admin/layouts/power/code_above.php index cf6f7cec8..5ab82172b 100644 --- a/admin/layouts/power/code_above.php +++ b/admin/layouts/power/code_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'power_version' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_fullwidth.php b/admin/layouts/power/code_fullwidth.php index d96752827..dccfbf694 100644 --- a/admin/layouts/power/code_fullwidth.php +++ b/admin/layouts/power/code_fullwidth.php @@ -35,7 +35,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_left.php b/admin/layouts/power/code_left.php index 85ed07e9f..754b1e245 100644 --- a/admin/layouts/power/code_left.php +++ b/admin/layouts/power/code_left.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_head' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/code_right.php b/admin/layouts/power/code_right.php index 31be74664..13965517a 100644 --- a/admin/layouts/power/code_right.php +++ b/admin/layouts/power/code_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'namespace_details' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/composer_fullwidth.php b/admin/layouts/power/composer_fullwidth.php index be49af6e3..c22125db4 100644 --- a/admin/layouts/power/composer_fullwidth.php +++ b/admin/layouts/power/composer_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'composer' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/licensing_fullwidth.php b/admin/layouts/power/licensing_fullwidth.php index 56e874540..27bcb582d 100644 --- a/admin/layouts/power/licensing_fullwidth.php +++ b/admin/layouts/power/licensing_fullwidth.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'licensing_template' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/publishing.php b/admin/layouts/power/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/power/publishing.php +++ b/admin/layouts/power/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/publlshing.php b/admin/layouts/power/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/power/publlshing.php +++ b/admin/layouts/power/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/super_power_left.php b/admin/layouts/power/super_power_left.php index 8b1e5cc6c..b52853eda 100644 --- a/admin/layouts/power/super_power_left.php +++ b/admin/layouts/power/super_power_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'approved_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/power/super_power_right.php b/admin/layouts/power/super_power_right.php index e0dac78ab..9f9100729 100644 --- a/admin/layouts/power/super_power_right.php +++ b/admin/layouts/power/super_power_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_approved_paths' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/repeatablejcb.php b/admin/layouts/repeatablejcb.php index 1140563ac..b267b7fe0 100644 --- a/admin/layouts/repeatablejcb.php +++ b/admin/layouts/repeatablejcb.php @@ -12,6 +12,11 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + /** * Make thing clear * @@ -30,8 +35,8 @@ defined('JPATH_BASE') or die('Restricted access'); extract($displayData); // Add script -JHtml::_('jquery.ui', array('core', 'sortable')); -JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); +Html::_('jquery.ui', array('core', 'sortable')); +Html::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); $sublayout = 'sectionjcb'; @@ -49,7 +54,7 @@ $sublayout = 'sectionjcb';
@@ -57,7 +62,7 @@ $sublayout = 'sectionjcb'; $form) : - echo JLayoutHelper::render( + echo LayoutHelper::render( $sublayout, array( 'form' => $form, @@ -76,7 +81,7 @@ $sublayout = 'sectionjcb'; array('<', '>'), array('SUBFORMLT', 'SUBFORMGT'), trim( - JLayoutHelper::render( + LayoutHelper::render( $sublayout, array( 'form' => $tmpl, diff --git a/admin/layouts/rows.php b/admin/layouts/rows.php index 5379aea33..bb4739667 100644 --- a/admin/layouts/rows.php +++ b/admin/layouts/rows.php @@ -12,6 +12,11 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + $headers = $displayData['headers']; $items = $displayData['items']; diff --git a/admin/layouts/sectionjcb.php b/admin/layouts/sectionjcb.php index d4c471711..0480635c8 100644 --- a/admin/layouts/sectionjcb.php +++ b/admin/layouts/sectionjcb.php @@ -12,6 +12,11 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; + /** * Make thing clear * @@ -32,17 +37,17 @@ extract($displayData);
- + - + - + diff --git a/admin/layouts/server/details_above.php b/admin/layouts/server/details_above.php index c3294693f..260e4acac 100644 --- a/admin/layouts/server/details_above.php +++ b/admin/layouts/server/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'protocol' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/details_fullwidth.php b/admin/layouts/server/details_fullwidth.php index bf273a8fd..0606486ab 100644 --- a/admin/layouts/server/details_fullwidth.php +++ b/admin/layouts/server/details_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/details_left.php b/admin/layouts/server/details_left.php index e62eb25c4..24d94700e 100644 --- a/admin/layouts/server/details_left.php +++ b/admin/layouts/server/details_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'path' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/details_right.php b/admin/layouts/server/details_right.php index 650fb35b5..a79175534 100644 --- a/admin/layouts/server/details_right.php +++ b/admin/layouts/server/details_right.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'secret' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/linked_components_fullwidth.php b/admin/layouts/server/linked_components_fullwidth.php index 403302ea3..1672fb03e 100644 --- a/admin/layouts/server/linked_components_fullwidth.php +++ b/admin/layouts/server/linked_components_fullwidth.php @@ -11,25 +11,30 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use VDM\Joomla\Utilities\ArrayHelper; + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; // set the defaults $items = $displayData->vymlinked_components; -$user = JFactory::getUser(); +$user = Factory::getUser(); $id = $displayData->item->id; // set the edit URL $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; // set a return value $return = ($id) ? "index.php?option=com_componentbuilder&view=server&layout=edit&id=" . $id : ""; // check for a return value -$jinput = JFactory::getApplication()->input; +$jinput = Factory::getApplication()->input; if ($_return = $jinput->get('return', null, 'base64')) { $return .= "&return=" . $_return; } // check if return value was set -if (ComponentbuilderHelper::checkString($return)) +if (StringHelper::check($return)) { // set the referral values $ref = ($id) ? "&ref=server&refid=" . $id . "&return=" . urlencode(base64_encode($return)) : "&return=" . urlencode(base64_encode($return)); @@ -41,27 +46,27 @@ else ?>
- + @@ -69,7 +74,7 @@ else $item): ?> authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components'); ?> @@ -78,7 +83,7 @@ else get('joomla_component.edit')): ?> escape($item->system_name); ?>checked_out): ?> - name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> + name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> escape($item->system_name); ?> @@ -89,7 +94,7 @@ else // always make sure the $this->return_here is set if (!isset($this->return_here)) { - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); } // setup the buttons if (!isset($_buttons) || !ArrayHelper::check($_buttons)) @@ -99,78 +104,84 @@ else array( 'view' => 'component_admin_views', 'views' => 'components_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), 'icon' => 'stack'), array( 'view' => 'component_custom_admin_views', 'views' => 'components_custom_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), 'icon' => 'screen'), array( 'view' => 'component_site_views', 'views' => 'components_site_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), 'icon' => 'palette'), + array( + 'view' => 'component_router', + 'views' => 'components_routers', + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_ROUTER'), + 'icon' => 'tree-2'), array( 'view' => 'component_config', 'views' => 'components_config', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), 'icon' => 'options') ); $_buttons[1] = array( array( 'view' => 'component_placeholders', 'views' => 'components_placeholders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), 'icon' => 'search'), array( 'view' => 'component_updates', 'views' => 'components_updates', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), 'icon' => 'database'), array( 'view' => 'component_mysql_tweaks', 'views' => 'components_mysql_tweaks', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), 'icon' => 'screwdriver'), array( 'view' => 'component_files_folders', 'views' => 'components_files_folders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), 'icon' => 'briefcase') ); $_buttons[2] = array( array( 'view' => 'component_custom_admin_menus', 'views' => 'components_custom_admin_menus', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), 'icon' => 'plus'), array( 'view' => 'component_dashboard', 'views' => 'components_dashboard', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), 'icon' => 'dashboard'), array( 'view' => 'component_modules', 'views' => 'components_modules', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), 'icon' => 'cube'), array( 'view' => 'component_plugins', 'views' => 'components_plugins', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), 'icon' => 'power-cord') ); } ?>
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> - + +
published == 1): ?> published == 0): ?> published == 2): ?> published == -2): ?> @@ -253,7 +264,7 @@ else
- + - + - + - + - + - +
@@ -179,7 +190,7 @@ else
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -193,7 +204,7 @@ else
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -207,13 +218,13 @@ else escape($item->author); ?>
email) && StringHelper::check($item->author)) : ?> - + escape($item->email); ?>
website) && StringHelper::check($item->author)) : ?> - + escape($item->website); ?> @@ -221,26 +232,26 @@ else
- - + + - - + + - - + + - - + +
- +
diff --git a/admin/layouts/server/publishing.php b/admin/layouts/server/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/server/publishing.php +++ b/admin/layouts/server/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/server/publlshing.php b/admin/layouts/server/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/server/publlshing.php +++ b/admin/layouts/server/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/custom_buttons_fullwidth.php b/admin/layouts/site_view/custom_buttons_fullwidth.php index fef43f97c..fe8891fc9 100644 --- a/admin/layouts/site_view/custom_buttons_fullwidth.php +++ b/admin/layouts/site_view/custom_buttons_fullwidth.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_model' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/custom_buttons_left.php b/admin/layouts/site_view/custom_buttons_left.php index a4498e425..ed88d47f8 100644 --- a/admin/layouts/site_view/custom_buttons_left.php +++ b/admin/layouts/site_view/custom_buttons_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'add_custom_button' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/custom_buttons_right.php b/admin/layouts/site_view/custom_buttons_right.php index ec870325d..cd8031b00 100644 --- a/admin/layouts/site_view/custom_buttons_right.php +++ b/admin/layouts/site_view/custom_buttons_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'button_position' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_above.php b/admin/layouts/site_view/details_above.php index 019a14081..f4c751c3f 100644 --- a/admin/layouts/site_view/details_above.php +++ b/admin/layouts/site_view/details_above.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'context' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_fullwidth.php b/admin/layouts/site_view/details_fullwidth.php index 8c0c8e83e..4588be130 100644 --- a/admin/layouts/site_view/details_fullwidth.php +++ b/admin/layouts/site_view/details_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'default' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_left.php b/admin/layouts/site_view/details_left.php index df266c7f1..701581d58 100644 --- a/admin/layouts/site_view/details_left.php +++ b/admin/layouts/site_view/details_left.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_add_php_language_string' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_right.php b/admin/layouts/site_view/details_right.php index f7e79a421..d26d9c258 100644 --- a/admin/layouts/site_view/details_right.php +++ b/admin/layouts/site_view/details_right.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_snippet_usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_rightside.php b/admin/layouts/site_view/details_rightside.php index d7ea40a77..41d309d7d 100644 --- a/admin/layouts/site_view/details_rightside.php +++ b/admin/layouts/site_view/details_rightside.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'dynamic_values' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/details_under.php b/admin/layouts/site_view/details_under.php index 68af44f9c..33d83cb4e 100644 --- a/admin/layouts/site_view/details_under.php +++ b/admin/layouts/site_view/details_under.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'not_required' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/javascript_css_fullwidth.php b/admin/layouts/site_view/javascript_css_fullwidth.php index af32af44d..c081c7d95 100644 --- a/admin/layouts/site_view/javascript_css_fullwidth.php +++ b/admin/layouts/site_view/javascript_css_fullwidth.php @@ -36,7 +36,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'css' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/linked_components_fullwidth.php b/admin/layouts/site_view/linked_components_fullwidth.php index 4c12d1b6e..ca6a32f57 100644 --- a/admin/layouts/site_view/linked_components_fullwidth.php +++ b/admin/layouts/site_view/linked_components_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_linked_to_notice' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/php_fullwidth.php b/admin/layouts/site_view/php_fullwidth.php index deb10e126..84d3fe3d7 100644 --- a/admin/layouts/site_view/php_fullwidth.php +++ b/admin/layouts/site_view/php_fullwidth.php @@ -39,7 +39,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'php_jview' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/publishing.php b/admin/layouts/site_view/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/site_view/publishing.php +++ b/admin/layouts/site_view/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/site_view/publlshing.php b/admin/layouts/site_view/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/site_view/publlshing.php +++ b/admin/layouts/site_view/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/contributor_fullwidth.php b/admin/layouts/snippet/contributor_fullwidth.php index 775ce5c44..6b3984e9a 100644 --- a/admin/layouts/snippet/contributor_fullwidth.php +++ b/admin/layouts/snippet/contributor_fullwidth.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'note_contributor_details' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/contributor_left.php b/admin/layouts/snippet/contributor_left.php index e60f6bd57..36a156c78 100644 --- a/admin/layouts/snippet/contributor_left.php +++ b/admin/layouts/snippet/contributor_left.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'contributor_website' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/contributor_right.php b/admin/layouts/snippet/contributor_right.php index 6c4cbc3ef..b6501baf9 100644 --- a/admin/layouts/snippet/contributor_right.php +++ b/admin/layouts/snippet/contributor_right.php @@ -30,7 +30,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'contributor_email' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/details_above.php b/admin/layouts/snippet/details_above.php index c32593c09..aabfe2019 100644 --- a/admin/layouts/snippet/details_above.php +++ b/admin/layouts/snippet/details_above.php @@ -31,7 +31,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'library' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/details_left.php b/admin/layouts/snippet/details_left.php index ad9163876..50a1c050f 100644 --- a/admin/layouts/snippet/details_left.php +++ b/admin/layouts/snippet/details_left.php @@ -32,7 +32,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'usage' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/details_right.php b/admin/layouts/snippet/details_right.php index 722eb549b..7d903d4bd 100644 --- a/admin/layouts/snippet/details_right.php +++ b/admin/layouts/snippet/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'snippet' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/publishing.php b/admin/layouts/snippet/publishing.php index 97a901504..865bcf382 100644 --- a/admin/layouts/snippet/publishing.php +++ b/admin/layouts/snippet/publishing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet/publlshing.php b/admin/layouts/snippet/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/snippet/publlshing.php +++ b/admin/layouts/snippet/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/details_left.php b/admin/layouts/snippet_type/details_left.php index 10724a9ed..698053efe 100644 --- a/admin/layouts/snippet_type/details_left.php +++ b/admin/layouts/snippet_type/details_left.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'name' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/details_right.php b/admin/layouts/snippet_type/details_right.php index 37215496b..bd0ef9952 100644 --- a/admin/layouts/snippet_type/details_right.php +++ b/admin/layouts/snippet_type/details_right.php @@ -29,7 +29,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'description' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/publishing.php b/admin/layouts/snippet_type/publishing.php index 24144d6d4..e8b5798d7 100644 --- a/admin/layouts/snippet_type/publishing.php +++ b/admin/layouts/snippet_type/publishing.php @@ -33,7 +33,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'modified_by' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/snippet_type/publlshing.php b/admin/layouts/snippet_type/publlshing.php index 7ac64fe22..9b1e77c16 100644 --- a/admin/layouts/snippet_type/publlshing.php +++ b/admin/layouts/snippet_type/publlshing.php @@ -34,7 +34,7 @@ $fields = $displayData->get($fields_tab_layout) ?: array( 'id' ); -$hiddenFields = $displayData->get('hidden_fields') ?: array(); +$hiddenFields = $displayData->get('hidden_fields') ?: []; ?> diff --git a/admin/layouts/table.php b/admin/layouts/table.php index b526bfa0a..c5609cdde 100644 --- a/admin/layouts/table.php +++ b/admin/layouts/table.php @@ -11,16 +11,22 @@ // No direct access to this file defined('JPATH_BASE') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; use VDM\Joomla\Utilities\StringHelper; $table_id = (isset($displayData['id'])) ? $displayData['id'] : StringHelper::random(7); $name = (isset($displayData['name'])) ? $displayData['name'] : false; $table_class = (isset($displayData['table_class'])) ? $displayData['table_class'] : 'uk-table'; -$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [JText::_('COM_COMPONENTBUILDER_NO'), JText::_('COM_COMPONENTBUILDER_HEADERS'), JText::_('COM_COMPONENTBUILDER_FOUND')]; +$table_container_class = (isset($displayData['table_container_class'])) ? $displayData['table_container_class'] : 'uk-overflow-auto'; +$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [Text::_('COM_COMPONENTBUILDER_NO'), Text::_('COM_COMPONENTBUILDER_HEADERS'), Text::_('COM_COMPONENTBUILDER_FOUND')]; $items = (isset($displayData['items'])) ? $displayData['items'] : 6; ?> -
+
@@ -54,7 +60,7 @@ $items = (isset($displayData['items'])) ? $displayData['items'] : 6; - $headers, 'items' => $items]); ?> + $headers, 'items' => $items]); ?>
@@ -64,8 +70,8 @@ $items = (isset($displayData['items'])) ? $displayData['items'] : 6; if (!isset($displayData['init']) || $displayData['init']) : ?>
\ No newline at end of file diff --git a/admin/views/admins_fields_conditions/view.html.php b/admin/views/admins_fields_conditions/view.html.php index d99212b9c..04b666912 100644 --- a/admin/views/admins_fields_conditions/view.html.php +++ b/admin/views/admins_fields_conditions/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Admins_fields_conditions @@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields_conditions'); $this->canEdit = $this->canDo->get('admin_fields_conditions.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_conditions'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('admin_fields_conditions.add'); + ToolbarHelper::addNew('admin_fields_conditions.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('admin_fields_conditions.edit'); + ToolbarHelper::editList('admin_fields_conditions.edit'); } if ($this->canState) { - JToolBarHelper::publishList('admins_fields_conditions.publish'); - JToolBarHelper::unpublishList('admins_fields_conditions.unpublish'); - JToolBarHelper::archiveList('admins_fields_conditions.archive'); + ToolbarHelper::publishList('admins_fields_conditions.publish'); + ToolbarHelper::unpublishList('admins_fields_conditions.unpublish'); + ToolbarHelper::archiveList('admins_fields_conditions.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('admins_fields_conditions.checkin'); + ToolbarHelper::checkin('admins_fields_conditions.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'admins_fields_conditions.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('admins_fields_conditions.trash'); + ToolbarHelper::trash('admins_fields_conditions.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_conditions'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_conditions.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_CONDITIONS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_fields_conditions.css", ['version' => 'auto']); } /** @@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_fields_conditions extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/admins_fields_relations/tmpl/default.php b/admin/views/admins_fields_relations/tmpl/default.php index e515b42ea..09e52d271 100644 --- a/admin/views/admins_fields_relations/tmpl/default.php +++ b/admin/views/admins_fields_relations/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=admins_fields_relations.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'admin_fields_relationsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,5 +70,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/admins_fields_relations/tmpl/default_batch_body.php b/admin/views/admins_fields_relations/tmpl/default_batch_body.php index f45996a1e..e12368766 100644 --- a/admin/views/admins_fields_relations/tmpl/default_batch_body.php +++ b/admin/views/admins_fields_relations/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_batch_footer.php b/admin/views/admins_fields_relations/tmpl/default_batch_footer.php index adc091fbb..6715bf9e5 100644 --- a/admin/views/admins_fields_relations/tmpl/default_batch_footer.php +++ b/admin/views/admins_fields_relations/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_body.php b/admin/views/admins_fields_relations/tmpl/default_body.php index 7c5fb6506..de037435f 100644 --- a/admin/views/admins_fields_relations/tmpl/default_body.php +++ b/admin/views/admins_fields_relations/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task=admin_fields_relations.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('admin_fields_relations',$item,'admins_fields_relations'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task get('admin_fields_relations.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task get('admin_fields_relations.edit')): ?> escape($item->admin_view_system_name); ?> checked_out): ?> - name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?> + name, $item->checked_out_time, 'admins_fields_relations.', $canCheckin); ?> escape($item->admin_view_system_name); ?> @@ -73,15 +77,15 @@ $edit = "index.php?option=com_componentbuilder&view=admins_fields_relations&task get('admin_fields_relations.edit.state')) : ?> checked_out) : ?> - published, $i, 'admins_fields_relations.', true, 'cb'); ?> + published, $i, 'admins_fields_relations.', true, 'cb'); ?> - published, $i, 'admins_fields_relations.', false, 'cb'); ?> + published, $i, 'admins_fields_relations.', false, 'cb'); ?> - published, $i, 'admins_fields_relations.', true, 'cb'); ?> + published, $i, 'admins_fields_relations.', true, 'cb'); ?> - published, $i, 'admins_fields_relations.', false, 'cb'); ?> + published, $i, 'admins_fields_relations.', false, 'cb'); ?> diff --git a/admin/views/admins_fields_relations/tmpl/default_head.php b/admin/views/admins_fields_relations/tmpl/default_head.php index 2557d2a11..28d218805 100644 --- a/admin/views/admins_fields_relations/tmpl/default_head.php +++ b/admin/views/admins_fields_relations/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,18 +33,18 @@ defined('_JEXEC') or die('Restricted access'); - + canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/admins_fields_relations/tmpl/default_toolbar.php b/admin/views/admins_fields_relations/tmpl/default_toolbar.php index 236c32115..cce52d798 100644 --- a/admin/views/admins_fields_relations/tmpl/default_toolbar.php +++ b/admin/views/admins_fields_relations/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/admins_fields_relations/view.html.php b/admin/views/admins_fields_relations/view.html.php index dfcada8ef..06cc45a12 100644 --- a/admin/views/admins_fields_relations/view.html.php +++ b/admin/views/admins_fields_relations/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Admins_fields_relations @@ -35,7 +48,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('admin_fields_relations'); $this->canEdit = $this->canDo->get('admin_fields_relations.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=admins_fields_relations'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('admin_fields_relations.add'); + ToolbarHelper::addNew('admin_fields_relations.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('admin_fields_relations.edit'); + ToolbarHelper::editList('admin_fields_relations.edit'); } if ($this->canState) { - JToolBarHelper::publishList('admins_fields_relations.publish'); - JToolBarHelper::unpublishList('admins_fields_relations.unpublish'); - JToolBarHelper::archiveList('admins_fields_relations.archive'); + ToolbarHelper::publishList('admins_fields_relations.publish'); + ToolbarHelper::unpublishList('admins_fields_relations.unpublish'); + ToolbarHelper::archiveList('admins_fields_relations.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('admins_fields_relations.checkin'); + ToolbarHelper::checkin('admins_fields_relations.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'admins_fields_relations.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('admins_fields_relations.trash'); + ToolbarHelper::trash('admins_fields_relations.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('admins_fields_relations'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -180,10 +193,10 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_ADMINS_FIELDS_RELATIONS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/admins_fields_relations.css", ['version' => 'auto']); } /** @@ -198,23 +211,33 @@ class ComponentbuilderViewAdmins_fields_relations extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_extendings/tmpl/default.php b/admin/views/class_extendings/tmpl/default.php index 053a616f2..6505c0c6c 100644 --- a/admin/views/class_extendings/tmpl/default.php +++ b/admin/views/class_extendings/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_extendings.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'class_extendsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'class_extendsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,5 +70,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/class_extendings/tmpl/default_batch_body.php b/admin/views/class_extendings/tmpl/default_batch_body.php index ed473bd78..58f6322da 100644 --- a/admin/views/class_extendings/tmpl/default_batch_body.php +++ b/admin/views/class_extendings/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_batch_footer.php b/admin/views/class_extendings/tmpl/default_batch_footer.php index abd385711..d99efe2f7 100644 --- a/admin/views/class_extendings/tmpl/default_batch_footer.php +++ b/admin/views/class_extendings/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_body.php b/admin/views/class_extendings/tmpl/default_body.php index b0c9ea780..aa3f3f15c 100644 --- a/admin/views/class_extendings/tmpl/default_body.php +++ b/admin/views/class_extendings/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_extends.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('class_extends',$item,'class_extendings'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_ $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_ get('class_extends.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_ get('class_extends.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'class_extendings.', $canCheckin); ?> + name, $item->checked_out_time, 'class_extendings.', $canCheckin); ?> escape($item->name); ?> @@ -70,21 +74,21 @@ $edit = "index.php?option=com_componentbuilder&view=class_extendings&task=class_
- extension_type); ?> + extension_type); ?> get('class_extends.edit.state')) : ?> checked_out) : ?> - published, $i, 'class_extendings.', true, 'cb'); ?> + published, $i, 'class_extendings.', true, 'cb'); ?> - published, $i, 'class_extendings.', false, 'cb'); ?> + published, $i, 'class_extendings.', false, 'cb'); ?> - published, $i, 'class_extendings.', true, 'cb'); ?> + published, $i, 'class_extendings.', true, 'cb'); ?> - published, $i, 'class_extendings.', false, 'cb'); ?> + published, $i, 'class_extendings.', false, 'cb'); ?> diff --git a/admin/views/class_extendings/tmpl/default_head.php b/admin/views/class_extendings/tmpl/default_head.php index 40bee431c..338c01d3f 100644 --- a/admin/views/class_extendings/tmpl/default_head.php +++ b/admin/views/class_extendings/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,21 +33,21 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/class_extendings/tmpl/default_toolbar.php b/admin/views/class_extendings/tmpl/default_toolbar.php index 18c6a9ac6..c572fc964 100644 --- a/admin/views/class_extendings/tmpl/default_toolbar.php +++ b/admin/views/class_extendings/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/class_extendings/view.html.php b/admin/views/class_extendings/view.html.php index 3e0582f87..302f48e63 100644 --- a/admin/views/class_extendings/view.html.php +++ b/admin/views/class_extendings/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Class_extendings @@ -35,7 +48,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('class_extends'); $this->canEdit = $this->canDo->get('class_extends.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewClass_extendings extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewClass_extendings extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_extendings'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('class_extends.add'); + ToolbarHelper::addNew('class_extends.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('class_extends.edit'); + ToolbarHelper::editList('class_extends.edit'); } if ($this->canState) { - JToolBarHelper::publishList('class_extendings.publish'); - JToolBarHelper::unpublishList('class_extendings.unpublish'); - JToolBarHelper::archiveList('class_extendings.archive'); + ToolbarHelper::publishList('class_extendings.publish'); + ToolbarHelper::unpublishList('class_extendings.unpublish'); + ToolbarHelper::archiveList('class_extendings.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('class_extendings.checkin'); + ToolbarHelper::checkin('class_extendings.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'class_extendings.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'class_extendings.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('class_extendings.trash'); + ToolbarHelper::trash('class_extendings.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('class_extendings'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -174,19 +187,19 @@ class ComponentbuilderViewClass_extendings extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Extension Type Selection - $this->extension_typeOptions = JFormHelper::loadFieldType('classextendingsfilterextensiontype')->options; + $this->extension_typeOptions = FormHelper::loadFieldType('classextendingsfilterextensiontype')->options; // We do some sanitation for Extension Type filter - if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + if (ArrayHelper::check($this->extension_typeOptions) && isset($this->extension_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + !StringHelper::check($this->extension_typeOptions[0]->value)) { unset($this->extension_typeOptions[0]); } // Extension Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL').' -', 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + Html::_('select.options', $this->extension_typeOptions, 'value', 'text') ); } } @@ -200,10 +213,10 @@ class ComponentbuilderViewClass_extendings extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_extendings.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDINGS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_extendings.css", ['version' => 'auto']); } /** @@ -218,25 +231,35 @@ class ComponentbuilderViewClass_extendings extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL'), - 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_NAME_LABEL'), + 'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_EXTENDS_EXTENSION_TYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_extends/submitbutton.js b/admin/views/class_extends/submitbutton.js index ca3c27842..926f8a99e 100644 --- a/admin/views/class_extends/submitbutton.js +++ b/admin/views/class_extends/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/class_extends/tmpl/edit.php b/admin/views/class_extends/tmpl/edit.php index dde23d141..d0e41072d 100644 --- a/admin/views/class_extends/tmpl/edit.php +++ b/admin/views/class_extends/tmpl/edit.php @@ -12,76 +12,75 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/class_methods/view.html.php b/admin/views/class_methods/view.html.php index 29c445ee0..8dbb68f70 100644 --- a/admin/views/class_methods/view.html.php +++ b/admin/views/class_methods/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Class_methods @@ -35,7 +48,7 @@ class ComponentbuilderViewClass_methods extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewClass_methods extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('class_method'); $this->canEdit = $this->canDo->get('class_method.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewClass_methods extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewClass_methods extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS'), 'cube'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_methods'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_METHODS'), 'cube'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('class_method.add'); + ToolbarHelper::addNew('class_method.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('class_method.edit'); + ToolbarHelper::editList('class_method.edit'); } if ($this->canState) { - JToolBarHelper::publishList('class_methods.publish'); - JToolBarHelper::unpublishList('class_methods.unpublish'); - JToolBarHelper::archiveList('class_methods.archive'); + ToolbarHelper::publishList('class_methods.publish'); + ToolbarHelper::unpublishList('class_methods.unpublish'); + ToolbarHelper::archiveList('class_methods.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('class_methods.checkin'); + ToolbarHelper::checkin('class_methods.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'class_methods.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'class_methods.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('class_methods.trash'); + ToolbarHelper::trash('class_methods.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('class_method.export')) { - JToolBarHelper::custom('class_methods.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('class_methods.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('class_method.import')) { - JToolBarHelper::custom('class_methods.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('class_methods.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('class_methods'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,9 +187,9 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -184,19 +197,19 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Visibility Selection - $this->visibilityOptions = JFormHelper::loadFieldType('classmethodsfiltervisibility')->options; + $this->visibilityOptions = FormHelper::loadFieldType('classmethodsfiltervisibility')->options; // We do some sanitation for Visibility filter - if (ComponentbuilderHelper::checkArray($this->visibilityOptions) && + if (ArrayHelper::check($this->visibilityOptions) && isset($this->visibilityOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value)) + !StringHelper::check($this->visibilityOptions[0]->value)) { unset($this->visibilityOptions[0]); } // Visibility Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL').' -', 'batch[visibility]', - JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + Html::_('select.options', $this->visibilityOptions, 'value', 'text') ); } @@ -204,19 +217,19 @@ class ComponentbuilderViewClass_methods extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Extension Type Selection - $this->extension_typeOptions = JFormHelper::loadFieldType('classmethodsfilterextensiontype')->options; + $this->extension_typeOptions = FormHelper::loadFieldType('classmethodsfilterextensiontype')->options; // We do some sanitation for Extension Type filter - if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + if (ArrayHelper::check($this->extension_typeOptions) && isset($this->extension_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + !StringHelper::check($this->extension_typeOptions[0]->value)) { unset($this->extension_typeOptions[0]); } // Extension Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL').' -', 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + Html::_('select.options', $this->extension_typeOptions, 'value', 'text') ); } } @@ -230,10 +243,10 @@ class ComponentbuilderViewClass_methods extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_METHODS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_methods.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_METHODS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_methods.css", ['version' => 'auto']); } /** @@ -248,26 +261,36 @@ class ComponentbuilderViewClass_methods extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL'), - 'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL'), - 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_NAME_LABEL'), + 'a.visibility' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_VISIBILITY_LABEL'), + 'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_METHOD_EXTENSION_TYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_properties/tmpl/default.php b/admin/views/class_properties/tmpl/default.php index bdc5e8c93..691b8ad00 100644 --- a/admin/views/class_properties/tmpl/default.php +++ b/admin/views/class_properties/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=class_properties.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'class_propertyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'class_propertyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,5 +70,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/class_properties/tmpl/default_batch_body.php b/admin/views/class_properties/tmpl/default_batch_body.php index 9bd922141..3427bbae1 100644 --- a/admin/views/class_properties/tmpl/default_batch_body.php +++ b/admin/views/class_properties/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_batch_footer.php b/admin/views/class_properties/tmpl/default_batch_footer.php index 7243f9707..389db3405 100644 --- a/admin/views/class_properties/tmpl/default_batch_footer.php +++ b/admin/views/class_properties/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_body.php b/admin/views/class_properties/tmpl/default_body.php index 4befb19f3..6bffa38ca 100644 --- a/admin/views/class_properties/tmpl/default_body.php +++ b/admin/views/class_properties/tmpl/default_body.php @@ -11,6 +11,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\Utilities\StringHelper; $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_property.edit"; @@ -19,7 +23,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('class_property',$item,'class_properties'); ?> @@ -29,7 +33,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -47,12 +51,12 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ get('class_property.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -63,7 +67,7 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ get('class_property.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'class_properties.', $canCheckin); ?> + name, $item->checked_out_time, 'class_properties.', $canCheckin); ?> escape($item->name); ?> @@ -71,16 +75,16 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_
- visibility); ?> + visibility); ?>
joomla_plugin_group) && StringHelper::check($item->joomla_plugin_group)): ?> - extension_type); ?> : + extension_type); ?> : escape($item->joomla_plugin_group_name); ?> - extension_type); ?> + extension_type); ?>
@@ -88,15 +92,15 @@ $edit = "index.php?option=com_componentbuilder&view=class_properties&task=class_ get('class_property.edit.state')) : ?> checked_out) : ?> - published, $i, 'class_properties.', true, 'cb'); ?> + published, $i, 'class_properties.', true, 'cb'); ?> - published, $i, 'class_properties.', false, 'cb'); ?> + published, $i, 'class_properties.', false, 'cb'); ?> - published, $i, 'class_properties.', true, 'cb'); ?> + published, $i, 'class_properties.', true, 'cb'); ?> - published, $i, 'class_properties.', false, 'cb'); ?> + published, $i, 'class_properties.', false, 'cb'); ?> diff --git a/admin/views/class_properties/tmpl/default_head.php b/admin/views/class_properties/tmpl/default_head.php index 1f74bde03..eb3aff79a 100644 --- a/admin/views/class_properties/tmpl/default_head.php +++ b/admin/views/class_properties/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,24 +33,24 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/class_properties/tmpl/default_toolbar.php b/admin/views/class_properties/tmpl/default_toolbar.php index 5950a1dc2..a8f4988f3 100644 --- a/admin/views/class_properties/tmpl/default_toolbar.php +++ b/admin/views/class_properties/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/class_properties/view.html.php b/admin/views/class_properties/view.html.php index 58201f0e2..feeb4d2ff 100644 --- a/admin/views/class_properties/view.html.php +++ b/admin/views/class_properties/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Class_properties @@ -35,7 +48,7 @@ class ComponentbuilderViewClass_properties extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewClass_properties extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('class_property'); $this->canEdit = $this->canDo->get('class_property.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewClass_properties extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewClass_properties extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'), 'cube'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=class_properties'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES'), 'cube'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('class_property.add'); + ToolbarHelper::addNew('class_property.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('class_property.edit'); + ToolbarHelper::editList('class_property.edit'); } if ($this->canState) { - JToolBarHelper::publishList('class_properties.publish'); - JToolBarHelper::unpublishList('class_properties.unpublish'); - JToolBarHelper::archiveList('class_properties.archive'); + ToolbarHelper::publishList('class_properties.publish'); + ToolbarHelper::unpublishList('class_properties.unpublish'); + ToolbarHelper::archiveList('class_properties.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('class_properties.checkin'); + ToolbarHelper::checkin('class_properties.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'class_properties.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'class_properties.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('class_properties.trash'); + ToolbarHelper::trash('class_properties.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('class_property.export')) { - JToolBarHelper::custom('class_properties.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('class_properties.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('class_property.import')) { - JToolBarHelper::custom('class_properties.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('class_properties.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('class_properties'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,9 +187,9 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -184,19 +197,19 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Visibility Selection - $this->visibilityOptions = JFormHelper::loadFieldType('classpropertiesfiltervisibility')->options; + $this->visibilityOptions = FormHelper::loadFieldType('classpropertiesfiltervisibility')->options; // We do some sanitation for Visibility filter - if (ComponentbuilderHelper::checkArray($this->visibilityOptions) && + if (ArrayHelper::check($this->visibilityOptions) && isset($this->visibilityOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->visibilityOptions[0]->value)) + !StringHelper::check($this->visibilityOptions[0]->value)) { unset($this->visibilityOptions[0]); } // Visibility Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL').' -', 'batch[visibility]', - JHtml::_('select.options', $this->visibilityOptions, 'value', 'text') + Html::_('select.options', $this->visibilityOptions, 'value', 'text') ); } @@ -204,19 +217,19 @@ class ComponentbuilderViewClass_properties extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Extension Type Selection - $this->extension_typeOptions = JFormHelper::loadFieldType('classpropertiesfilterextensiontype')->options; + $this->extension_typeOptions = FormHelper::loadFieldType('classpropertiesfilterextensiontype')->options; // We do some sanitation for Extension Type filter - if (ComponentbuilderHelper::checkArray($this->extension_typeOptions) && + if (ArrayHelper::check($this->extension_typeOptions) && isset($this->extension_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->extension_typeOptions[0]->value)) + !StringHelper::check($this->extension_typeOptions[0]->value)) { unset($this->extension_typeOptions[0]); } // Extension Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL').' -', 'batch[extension_type]', - JHtml::_('select.options', $this->extension_typeOptions, 'value', 'text') + Html::_('select.options', $this->extension_typeOptions, 'value', 'text') ); } } @@ -230,10 +243,10 @@ class ComponentbuilderViewClass_properties extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/class_properties.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTIES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/class_properties.css", ['version' => 'auto']); } /** @@ -248,26 +261,36 @@ class ComponentbuilderViewClass_properties extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL'), - 'a.visibility' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL'), - 'a.extension_type' => JText::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_NAME_LABEL'), + 'a.visibility' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_VISIBILITY_LABEL'), + 'a.extension_type' => Text::_('COM_COMPONENTBUILDER_CLASS_PROPERTY_EXTENSION_TYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/class_property/submitbutton.js b/admin/views/class_property/submitbutton.js index 58f528b96..dcae3cc66 100644 --- a/admin/views/class_property/submitbutton.js +++ b/admin/views/class_property/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/class_property/tmpl/edit.php b/admin/views/class_property/tmpl/edit.php index 4873e8cb2..99a8d537d 100644 --- a/admin/views/class_property/tmpl/edit.php +++ b/admin/views/class_property/tmpl/edit.php @@ -12,71 +12,70 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> -
-

+

-
+
form): ?> form->renderFieldset('builder'); ?> @@ -147,7 +160,7 @@ jQuery('
')
@@ -156,75 +169,83 @@ jQuery('
')
form->renderFieldset('advanced'); ?>
- 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?> + 'noticeboard' , 'active' => $noticeboardOptions[array_rand($noticeboardOptions)])); ?>
- +
-

+

diff --git a/admin/views/compiler/view.html.php b/admin/views/compiler/view.html.php index 2a47eff3e..d139f8f64 100644 --- a/admin/views/compiler/view.html.php +++ b/admin/views/compiler/view.html.php @@ -12,10 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Form\Form; +use Joomla\CMS\Layout\LayoutHelper; use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\FormHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Compiler @@ -26,11 +36,11 @@ class ComponentbuilderViewCompiler extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('compiler'); // Initialise variables. @@ -102,15 +112,15 @@ class ComponentbuilderViewCompiler extends HtmlView // Check for errors. if (count($errors = $this->get('Errors'))) { - throw new Exception(implode(PHP_EOL, $errors), 500); + throw new \Exception(implode(PHP_EOL, $errors), 500); } parent::display($tpl); } // These are subform layouts used in JCB - // JLayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded - // JLayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded + // LayoutHelper::render('sectionjcb', [?]); // added to ensure the layout are loaded + // LayoutHelper::render('repeatablejcb', [?]); // added to ensure the layout are loaded /** * Get the dynamic build form fields needed on the page @@ -147,7 +157,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -167,7 +177,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -188,7 +198,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -208,7 +218,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -228,7 +238,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -248,7 +258,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -272,7 +282,74 @@ class ComponentbuilderViewCompiler extends HtmlView } // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Joomla Versions attributes + $attributes = [ + 'type' => 'list', + 'name' => 'joomla_version', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION', + 'class' => 'list_class', + 'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET', + 'default' => '3']; + // start the joomla versions options + $options = [ + '3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE', + '4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR', + '5' => 'COM_COMPONENTBUILDER_JOOMLA_FIVE' + ]; + + // add to form + $xml = FormHelper::xml($attributes, $options); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Joomla Version 3 attributes + $attributes = [ + 'type' => 'note', + 'name' => 'joomla_version_note_three', + 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE', + 'class' => 'alert alert-success', + 'showon' => 'joomla_version:3']; + + // add to form + $xml = FormHelper::xml($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Joomla Version 4 and five attributes + $attributes = [ + 'type' => 'note', + 'name' => 'joomla_version_note_four', + 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FOUR', + 'class' => 'alert alert-success', + 'showon' => 'joomla_version:4']; + + // add to form + $xml = FormHelper::xml($attributes); + if ($xml instanceof SimpleXMLElement) + { + $form->setField($xml, null, true, 'builder'); + } + + // Joomla Version 5 and five attributes + $attributes = [ + 'type' => 'note', + 'name' => 'joomla_version_note_five', + 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_FIVE', + 'class' => 'alert alert-success', + 'showon' => 'joomla_version:5']; + + // add to form + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -292,7 +369,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'builder'); @@ -307,58 +384,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); - if ($xml instanceof SimpleXMLElement) - { - $form->setField($xml, null, true, 'advanced'); - } - - // Joomla Versions attributes - $attributes = [ - 'type' => 'radio', - 'name' => 'joomla_version_donations', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_VERSION', - 'class' => 'btn-group btn-group-yesno', - 'description' => 'COM_COMPONENTBUILDER_WHAT_VERSION_OF_JOOMLA_WOULD_YOU_LIKE_TO_TARGET', - 'default' => '3', - 'showon' => 'show_advanced_options:1']; - // start the joomla versions options - $options = [ - '3' => 'COM_COMPONENTBUILDER_JOOMLA_THREE', - '4' => 'COM_COMPONENTBUILDER_JOOMLA_FOUR']; - - // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); - if ($xml instanceof SimpleXMLElement) - { - $form->setField($xml, null, true, 'advanced'); - } - - // Joomla Version 3 attributes - $attributes = [ - 'type' => 'note', - 'name' => 'joomla_version_note_three', - 'description' => 'COM_COMPONENTBUILDER_YOUR_COMPONENT_WILL_BE_COMPILED_TO_WORK_IN_JOOMLA_THREE', - 'class' => 'alert alert-success', - 'showon' => 'show_advanced_options:1[AND]joomla_version_donations:3']; - - // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); - if ($xml instanceof SimpleXMLElement) - { - $form->setField($xml, null, true, 'advanced'); - } - - // Joomla Version 4 attributes - $attributes = [ - 'type' => 'note', - 'name' => 'joomla_version_note_four', - 'description' => 'COM_COMPONENTBUILDER_JCB_IS_NOT_YET_FULLY_READY_FOR_JOOMLA_FOUR_BUT_WITH_YOUR_HELP_WE_CAN_MAKE_THE_TRANSITION_FASTER_SHOW_YOUR_SUPPORT_BY_MAKING_A_DONATION_TODAY_AND_HELP_US_BRING_JCB_TO_THE_NEXT_LEVELBR_BR_BYOUR_COMPONENT_WILL_STILL_ONLY_BE_COMPILED_FOR_JOOMLA_THREEB', - 'class' => 'alert alert-info', - 'showon' => 'show_advanced_options:1[AND]joomla_version_donations:4']; - - // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -380,7 +406,7 @@ class ComponentbuilderViewCompiler extends HtmlView '0' => 'COM_COMPONENTBUILDER_NO']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -397,7 +423,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]powers_repository:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -420,7 +446,7 @@ class ComponentbuilderViewCompiler extends HtmlView '4' => 'COM_COMPONENTBUILDER_FOUR_SPACES']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -442,7 +468,7 @@ class ComponentbuilderViewCompiler extends HtmlView '3' => 'COM_COMPONENTBUILDER_COMPONENT']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes, $options); + $xml = FormHelper::xml($attributes, $options); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -457,7 +483,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]add_build_date:2']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -472,7 +498,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]add_build_date:3']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -490,7 +516,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1[AND]add_build_date:2']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -507,7 +533,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -521,7 +547,7 @@ class ComponentbuilderViewCompiler extends HtmlView 'showon' => 'show_advanced_options:1']; // add to form - $xml = ComponentbuilderHelper::getFieldXML($attributes); + $xml = FormHelper::xml($attributes); if ($xml instanceof SimpleXMLElement) { $form->setField($xml, null, true, 'advanced'); @@ -543,9 +569,8 @@ class ComponentbuilderViewCompiler extends HtmlView */ protected function getSupportMessage(): string { - return JLayoutHelper::render('jcbsupportmessage', []); - } - + return LayoutHelper::render('jcbsupportmessage', []); + } /** * Prepares the document @@ -556,12 +581,12 @@ class ComponentbuilderViewCompiler extends HtmlView // Only load jQuery if needed. (default is true) if ($this->params->get('add_jquery_framework', 1) == 1) { - JHtml::_('jquery.framework'); + Html::_('jquery.framework'); } // Load the header checker class. require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' ); // Initialize the header checker. - $HeaderCheck = new componentbuilderHeaderCheck; + $HeaderCheck = new componentbuilderHeaderCheck(); // Load uikit options. $uikit = $this->params->get('uikit_load'); @@ -573,26 +598,26 @@ class ComponentbuilderViewCompiler extends HtmlView // The uikit css. if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { - JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); } // The uikit js. if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { - JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); } // Load the script to find all uikit components needed. if ($uikit != 2) { // Set the default uikit components in this view. - $uikitComp = array(); + $uikitComp = []; $uikitComp[] = 'data-uk-grid'; // Get field uikit components needed in this view. $uikitFieldComp = $this->get('UikitComp'); - if (isset($uikitFieldComp) && ComponentbuilderHelper::checkArray($uikitFieldComp)) + if (isset($uikitFieldComp) && ArrayHelper::check($uikitFieldComp)) { - if (isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) + if (isset($uikitComp) && ArrayHelper::check($uikitComp)) { $uikitComp = array_merge($uikitComp, $uikitFieldComp); $uikitComp = array_unique($uikitComp); @@ -605,10 +630,8 @@ class ComponentbuilderViewCompiler extends HtmlView } // Load the needed uikit components in this view. - if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) + if ($uikit != 2 && isset($uikitComp) && ArrayHelper::check($uikitComp)) { - // load just in case. - jimport('joomla.filesystem.file'); // loading... foreach ($uikitComp as $class) { @@ -618,95 +641,113 @@ class ComponentbuilderViewCompiler extends HtmlView if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css')) { // load the css. - JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']); } // check if the JavaScript file exists. if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js')) { // load the js. - JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); } } } } // add marked library - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/custom/marked.js"); + Html::_('script', 'administrator/components/com_componentbuilder/custom/marked.js', ['version' => 'auto']); // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/compiler.css', ['version' => 'auto']); + Html::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/compiler.css', ['version' => 'auto']); // Set the Custom JS script to view - $this->document->addScriptDeclaration(" - function getComponentDetails_server(id){ - var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\"); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id; + $this->getDocument()->addScriptDeclaration(" + function getComponentDetails_server(id) { + let getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\"); + let request = new URLSearchParams(); + if (token.length > 0 && id > 0) { + request.append(token, '1'); + request.append('id', id); } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false - }); + return fetch(getUrl + '&' + request.toString(), { + method: 'GET', + headers: { + 'Accept': 'application/json' + } + }).then(response => response.json()); } function getComponentDetails(id) { - getComponentDetails_server(id).done(function(result) { - if(result.html) { - jQuery('#component-details').html(result.html); + getComponentDetails_server(id).then(function(result) { + if (result.html) { + document.getElementById('component-details').innerHTML = result.html; + if (result.preferred_joomla_version) { + jQuery('#joomla_version').val(result.preferred_joomla_version); + jQuery('#joomla_version').trigger('liszt:updated'); + jQuery('#joomla_version').trigger('change'); + } } }); } - var noticeboard = \"https://vdm.bz/componentbuilder-noticeboard-md\"; - var proboard = \"https://vdm.bz/componentbuilder-pro-noticeboard-md\"; - jQuery(document).ready(function () { - jQuery.get(noticeboard) - .success(function(board) { - if (board.length > 5) { - jQuery(\".noticeboard-md\").html(marked.parse(board)); - getIS(1,board).done(function(result) { - if (result){ - jQuery(\".vdm-new-notice\").show(); - getIS(2,board); - } - }); - } else { - jQuery(\".noticeboard-md\").html(all_is_good); - } - }) - .error(function(jqXHR, textStatus, errorThrown) { - jQuery(\".noticeboard-md\").html(all_is_good); - }); - jQuery.get(proboard) - .success(function(board) { - if (board.length > 5) { - jQuery(\".proboard-md\").html(marked.parse(board)); - } else { - jQuery(\".proboard-md\").html(all_is_good); - } - }) - .error(function(jqXHR, textStatus, errorThrown) { - jQuery(\".proboard-md\").html(all_is_good); - }); + document.addEventListener('DOMContentLoaded', function() { + fetchNoticeboard(\"https://vdm.bz/componentbuilder-noticeboard-md\", \".noticeboard-md\", true); + fetchNoticeboard(\"https://vdm.bz/componentbuilder-pro-noticeboard-md\", \".proboard-md\", false); }); - // to check is READ/NEW - function getIS(type,notice){ - if (type == 1) { - var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\"); - } else if (type == 2) { - var getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\"); - } - if(token.length > 0 && notice.length){ - var request = token+\"=1¬ice=\"+notice; - } - return jQuery.ajax({ - type: \"POST\", - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + function fetchNoticeboard(url, selector, processGetIS) { + fetch(url) + .then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.text(); + }) + .then(board => { + var elements = document.querySelectorAll(selector); + if (board.length > 5) { + let html_board = marked.parse(board); + elements.forEach(element => { + element.innerHTML = html_board; + }); + if (processGetIS) { + getIS(1, board).then(result => { + if (result) { + document.querySelectorAll(\".vdm-new-notice\").forEach(element => { + element.style.display = 'block'; + }); + getIS(2, board); + } + }); + } + } else { + elements.forEach(element => { + element.innerHTML = all_is_good; + }); + } + }) + .catch(error => { + console.error('There was an error!', error); + document.querySelectorAll(selector).forEach(element => { + element.innerHTML = all_is_good; + }); }); } - + // to check is READ/NEW + function getIS(type, notice) { + let getUrl = \"\"; + if (type === 1) { + getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true\"); + } else if (type === 2) { + getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true\"); + } + let request = new URLSearchParams(); + if (token.length > 0 && notice.length) { + request.append(token, \"1\"); + request.append(\"notice\", notice); + } + return fetch(getUrl, { + method: \"POST\", + headers: { + \"Content-Type\": \"application/x-www-form-urlencoded;charset=UTF-8\" + }, + body: request + }).then(response => response.json()); + } "); } @@ -718,41 +759,41 @@ class ComponentbuilderViewCompiler extends HtmlView // hide the main menu $this->app->input->set('hidemainmenu', true); // add title to the page - JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPILER'),'cogs'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_COMPILER'),'cogs'); // add cpanel button - JToolBarHelper::custom('compiler.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); + ToolbarHelper::custom('compiler.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); if ($this->canDo->get('compiler.run_expansion')) { // add Run Expansion button. - JToolBarHelper::custom('compiler.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('compiler.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('compiler.translate')) { // add Translate button. - JToolBarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false); + ToolbarHelper::custom('compiler.runTranslator', 'comments-2 custom-button-runtranslator', '', 'COM_COMPONENTBUILDER_TRANSLATE', false); } if ($this->canDo->get('compiler.compiler_animations')) { // add Compiler Animations button. - JToolBarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false); + ToolbarHelper::custom('compiler.getDynamicContent', 'download custom-button-getdynamiccontent', '', 'COM_COMPONENTBUILDER_COMPILER_ANIMATIONS', false); } if ($this->canDo->get('compiler.clear_tmp')) { // add Clear tmp button. - JToolBarHelper::custom('compiler.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); + ToolbarHelper::custom('compiler.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('compiler'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } } @@ -766,6 +807,16 @@ class ComponentbuilderViewCompiler extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/component_admin_views/submitbutton.js b/admin/views/component_admin_views/submitbutton.js index 0f2245f95..33e198caa 100644 --- a/admin/views/component_admin_views/submitbutton.js +++ b/admin/views/component_admin_views/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/component_admin_views/tmpl/edit.php b/admin/views/component_admin_views/tmpl/edit.php index a2656f508..6950c9849 100644 --- a/admin/views/component_admin_views/tmpl/edit.php +++ b/admin/views/component_admin_views/tmpl/edit.php @@ -12,79 +12,78 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index 4c9274739..edf40602c 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Custom_codes @@ -35,7 +48,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('custom_code'); $this->canEdit = $this->canDo->get('custom_code.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewCustom_codes extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewCustom_codes extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_CUSTOM_CODES'), 'shuffle'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=custom_codes'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_CUSTOM_CODES'), 'shuffle'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('custom_code.add'); + ToolbarHelper::addNew('custom_code.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('custom_code.edit'); + ToolbarHelper::editList('custom_code.edit'); } if ($this->canState) { - JToolBarHelper::publishList('custom_codes.publish'); - JToolBarHelper::unpublishList('custom_codes.unpublish'); - JToolBarHelper::archiveList('custom_codes.archive'); + ToolbarHelper::publishList('custom_codes.publish'); + ToolbarHelper::unpublishList('custom_codes.unpublish'); + ToolbarHelper::archiveList('custom_codes.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('custom_codes.checkin'); + ToolbarHelper::checkin('custom_codes.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'custom_codes.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'custom_codes.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('custom_codes.trash'); + ToolbarHelper::trash('custom_codes.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('custom_code.export')) { - JToolBarHelper::custom('custom_codes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('custom_codes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('custom_code.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('custom_codes.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('custom_codes.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('custom_code.import')) { - JToolBarHelper::custom('custom_codes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('custom_codes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('custom_codes'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -189,19 +202,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Component System Name Selection - $this->componentSystem_nameOptions = JFormHelper::loadFieldType('Joomlacomponent')->options; + $this->componentSystem_nameOptions = FormHelper::loadFieldType('Joomlacomponent')->options; // We do some sanitation for Component System Name filter - if (ComponentbuilderHelper::checkArray($this->componentSystem_nameOptions) && + if (ArrayHelper::check($this->componentSystem_nameOptions) && isset($this->componentSystem_nameOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->componentSystem_nameOptions[0]->value)) + !StringHelper::check($this->componentSystem_nameOptions[0]->value)) { unset($this->componentSystem_nameOptions[0]); } // Component System Name Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL').' -', 'batch[component]', - JHtml::_('select.options', $this->componentSystem_nameOptions, 'value', 'text') + Html::_('select.options', $this->componentSystem_nameOptions, 'value', 'text') ); } @@ -209,19 +222,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Target Selection - $this->targetOptions = JFormHelper::loadFieldType('customcodesfiltertarget')->options; + $this->targetOptions = FormHelper::loadFieldType('customcodesfiltertarget')->options; // We do some sanitation for Target filter - if (ComponentbuilderHelper::checkArray($this->targetOptions) && + if (ArrayHelper::check($this->targetOptions) && isset($this->targetOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->targetOptions[0]->value)) + !StringHelper::check($this->targetOptions[0]->value)) { unset($this->targetOptions[0]); } // Target Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL').' -', 'batch[target]', - JHtml::_('select.options', $this->targetOptions, 'value', 'text') + Html::_('select.options', $this->targetOptions, 'value', 'text') ); } @@ -229,19 +242,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Type Selection - $this->typeOptions = JFormHelper::loadFieldType('customcodesfiltertype')->options; + $this->typeOptions = FormHelper::loadFieldType('customcodesfiltertype')->options; // We do some sanitation for Type filter - if (ComponentbuilderHelper::checkArray($this->typeOptions) && + if (ArrayHelper::check($this->typeOptions) && isset($this->typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + !StringHelper::check($this->typeOptions[0]->value)) { unset($this->typeOptions[0]); } // Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL').' -', 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') + Html::_('select.options', $this->typeOptions, 'value', 'text') ); } @@ -249,19 +262,19 @@ class ComponentbuilderViewCustom_codes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Comment Type Selection - $this->comment_typeOptions = JFormHelper::loadFieldType('customcodesfiltercommenttype')->options; + $this->comment_typeOptions = FormHelper::loadFieldType('customcodesfiltercommenttype')->options; // We do some sanitation for Comment Type filter - if (ComponentbuilderHelper::checkArray($this->comment_typeOptions) && + if (ArrayHelper::check($this->comment_typeOptions) && isset($this->comment_typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->comment_typeOptions[0]->value)) + !StringHelper::check($this->comment_typeOptions[0]->value)) { unset($this->comment_typeOptions[0]); } // Comment Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL').' -', 'batch[comment_type]', - JHtml::_('select.options', $this->comment_typeOptions, 'value', 'text') + Html::_('select.options', $this->comment_typeOptions, 'value', 'text') ); } } @@ -275,10 +288,10 @@ class ComponentbuilderViewCustom_codes extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_CUSTOM_CODES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/custom_codes.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_CUSTOM_CODES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/custom_codes.css", ['version' => 'auto']); } /** @@ -293,28 +306,39 @@ class ComponentbuilderViewCustom_codes extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'g.system_name' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL'), - 'a.path' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_LABEL'), - 'a.target' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL'), - 'a.type' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL'), - 'a.comment_type' => JText::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'g.system_name' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMPONENT_LABEL'), + 'a.path' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_PATH_LABEL'), + 'a.target' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TARGET_LABEL'), + 'a.type' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_TYPE_LABEL'), + 'a.comment_type' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_COMMENT_TYPE_LABEL'), + 'a.joomla_version' => Text::_('COM_COMPONENTBUILDER_CUSTOM_CODE_JOOMLA_VERSION_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/dynamic_get/submitbutton.js b/admin/views/dynamic_get/submitbutton.js index 526acadac..5bae7f879 100644 --- a/admin/views/dynamic_get/submitbutton.js +++ b/admin/views/dynamic_get/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/dynamic_get/tmpl/edit.php b/admin/views/dynamic_get/tmpl/edit.php index 2077be177..c4941e710 100644 --- a/admin/views/dynamic_get/tmpl/edit.php +++ b/admin/views/dynamic_get/tmpl/edit.php @@ -12,120 +12,119 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -683,13 +682,13 @@ jQuery('#adminForm').on('change', '#jform_select_all',function (e) }); function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -699,16 +698,18 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); diff --git a/admin/views/dynamic_get/view.html.php b/admin/views/dynamic_get/view.html.php index 8fc0761fc..580cef48a 100644 --- a/admin/views/dynamic_get/view.html.php +++ b/admin/views/dynamic_get/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Dynamic_get Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewDynamic_get extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewDynamic_get extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('dynamic_get', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewDynamic_get extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewDynamic_get extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('dynamic_get.create') && $isNew) { // We can create the record. - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('dynamic_get.edit')) { // We can save the record. - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewDynamic_get extends HtmlView // For new records, check the create permission. if ($this->canDo->get('dynamic_get.create')) { - JToolBarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('dynamic_get.edit')) { // We can save the new record - JToolBarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('dynamic_get.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('dynamic_get.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('dynamic_get.create')) { - JToolBarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('dynamic_get.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('dynamic_get.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('dynamic_get.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.dynamic_get', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.dynamic_get', $this->item->id); } if ($this->canDo->get('dynamic_get.create')) { - JToolBarHelper::custom('dynamic_get.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('dynamic_get.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('dynamic_get.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('dynamic_get'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewDynamic_get extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewDynamic_get extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/dynamic_get.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_DYNAMIC_GET_NEW' : 'COM_COMPONENTBUILDER_DYNAMIC_GET_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/dynamic_get.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/dynamic_get/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/dynamic_get/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here - $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) \JUri::getInstance())) . "';"); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/dynamic_gets/tmpl/default.php b/admin/views/dynamic_gets/tmpl/default.php index 6bfab7288..7a760d1b6 100644 --- a/admin/views/dynamic_gets/tmpl/default.php +++ b/admin/views/dynamic_gets/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=dynamic_gets.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'dynamic_getList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'dynamic_getList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GETS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,27 +70,34 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/dynamic_gets/tmpl/default_batch_body.php b/admin/views/dynamic_gets/tmpl/default_batch_body.php index c3faa117c..c68e005c9 100644 --- a/admin/views/dynamic_gets/tmpl/default_batch_body.php +++ b/admin/views/dynamic_gets/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/dynamic_gets/tmpl/default_batch_footer.php b/admin/views/dynamic_gets/tmpl/default_batch_footer.php index 06f13551e..50bbc6789 100644 --- a/admin/views/dynamic_gets/tmpl/default_batch_footer.php +++ b/admin/views/dynamic_gets/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/dynamic_gets/tmpl/default_body.php b/admin/views/dynamic_gets/tmpl/default_body.php index 5f040a3d0..54a5a65d1 100644 --- a/admin/views/dynamic_gets/tmpl/default_body.php +++ b/admin/views/dynamic_gets/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_get.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('dynamic_get',$item,'dynamic_gets'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge get('dynamic_get.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge get('dynamic_get.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'dynamic_gets.', $canCheckin); ?> + name, $item->checked_out_time, 'dynamic_gets.', $canCheckin); ?> escape($item->name); ?> @@ -70,24 +74,24 @@ $edit = "index.php?option=com_componentbuilder&view=dynamic_gets&task=dynamic_ge
- main_source); ?> + main_source); ?> - gettype); ?> + gettype); ?> get('dynamic_get.edit.state')) : ?> checked_out) : ?> - published, $i, 'dynamic_gets.', true, 'cb'); ?> + published, $i, 'dynamic_gets.', true, 'cb'); ?> - published, $i, 'dynamic_gets.', false, 'cb'); ?> + published, $i, 'dynamic_gets.', false, 'cb'); ?> - published, $i, 'dynamic_gets.', true, 'cb'); ?> + published, $i, 'dynamic_gets.', true, 'cb'); ?> - published, $i, 'dynamic_gets.', false, 'cb'); ?> + published, $i, 'dynamic_gets.', false, 'cb'); ?> diff --git a/admin/views/dynamic_gets/tmpl/default_head.php b/admin/views/dynamic_gets/tmpl/default_head.php index b93c46469..c8c643dea 100644 --- a/admin/views/dynamic_gets/tmpl/default_head.php +++ b/admin/views/dynamic_gets/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,24 +33,24 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/dynamic_gets/tmpl/default_toolbar.php b/admin/views/dynamic_gets/tmpl/default_toolbar.php index 6035becc9..a678ad682 100644 --- a/admin/views/dynamic_gets/tmpl/default_toolbar.php +++ b/admin/views/dynamic_gets/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index c6c300e2d..2a25bad1c 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Dynamic_gets @@ -35,7 +48,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('dynamic_get'); $this->canEdit = $this->canDo->get('dynamic_get.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewDynamic_gets extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewDynamic_gets extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_DYNAMIC_GETS'), 'database'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=dynamic_gets'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_DYNAMIC_GETS'), 'database'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('dynamic_get.add'); + ToolbarHelper::addNew('dynamic_get.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('dynamic_get.edit'); + ToolbarHelper::editList('dynamic_get.edit'); } if ($this->canState) { - JToolBarHelper::publishList('dynamic_gets.publish'); - JToolBarHelper::unpublishList('dynamic_gets.unpublish'); - JToolBarHelper::archiveList('dynamic_gets.archive'); + ToolbarHelper::publishList('dynamic_gets.publish'); + ToolbarHelper::unpublishList('dynamic_gets.unpublish'); + ToolbarHelper::archiveList('dynamic_gets.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('dynamic_gets.checkin'); + ToolbarHelper::checkin('dynamic_gets.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'dynamic_gets.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'dynamic_gets.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('dynamic_gets.trash'); + ToolbarHelper::trash('dynamic_gets.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('dynamic_get.export')) { - JToolBarHelper::custom('dynamic_gets.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('dynamic_gets.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('dynamic_get.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('dynamic_gets.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('dynamic_gets.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('dynamic_get.import')) { - JToolBarHelper::custom('dynamic_gets.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('dynamic_gets.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('dynamic_gets'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -189,19 +202,19 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Main Source Selection - $this->main_sourceOptions = JFormHelper::loadFieldType('dynamicgetsfiltermainsource')->options; + $this->main_sourceOptions = FormHelper::loadFieldType('dynamicgetsfiltermainsource')->options; // We do some sanitation for Main Source filter - if (ComponentbuilderHelper::checkArray($this->main_sourceOptions) && + if (ArrayHelper::check($this->main_sourceOptions) && isset($this->main_sourceOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->main_sourceOptions[0]->value)) + !StringHelper::check($this->main_sourceOptions[0]->value)) { unset($this->main_sourceOptions[0]); } // Main Source Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL').' -', 'batch[main_source]', - JHtml::_('select.options', $this->main_sourceOptions, 'value', 'text') + Html::_('select.options', $this->main_sourceOptions, 'value', 'text') ); } @@ -209,19 +222,19 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Gettype Selection - $this->gettypeOptions = JFormHelper::loadFieldType('dynamicgetsfiltergettype')->options; + $this->gettypeOptions = FormHelper::loadFieldType('dynamicgetsfiltergettype')->options; // We do some sanitation for Gettype filter - if (ComponentbuilderHelper::checkArray($this->gettypeOptions) && + if (ArrayHelper::check($this->gettypeOptions) && isset($this->gettypeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->gettypeOptions[0]->value)) + !StringHelper::check($this->gettypeOptions[0]->value)) { unset($this->gettypeOptions[0]); } // Gettype Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL').' -', 'batch[gettype]', - JHtml::_('select.options', $this->gettypeOptions, 'value', 'text') + Html::_('select.options', $this->gettypeOptions, 'value', 'text') ); } } @@ -235,10 +248,10 @@ class ComponentbuilderViewDynamic_gets extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_DYNAMIC_GETS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/dynamic_gets.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_DYNAMIC_GETS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/dynamic_gets.css", ['version' => 'auto']); } /** @@ -253,26 +266,36 @@ class ComponentbuilderViewDynamic_gets extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_LABEL'), - 'a.main_source' => JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL'), - 'a.gettype' => JText::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_NAME_LABEL'), + 'a.main_source' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_MAIN_SOURCE_LABEL'), + 'a.gettype' => Text::_('COM_COMPONENTBUILDER_DYNAMIC_GET_GETTYPE_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/field/submitbutton.js b/admin/views/field/submitbutton.js index f161b448b..555c1ba80 100644 --- a/admin/views/field/submitbutton.js +++ b/admin/views/field/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/field/tmpl/edit.php b/admin/views/field/tmpl/edit.php index 9f721a707..bd91ed5d4 100644 --- a/admin/views/field/tmpl/edit.php +++ b/admin/views/field/tmpl/edit.php @@ -12,108 +12,107 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -359,13 +358,13 @@ jQuery('#adminForm').on('change', '#jform_fieldtype',function (e) { function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -375,16 +374,18 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); diff --git a/admin/views/field/view.html.php b/admin/views/field/view.html.php index 0804fecc5..1b225e3d0 100644 --- a/admin/views/field/view.html.php +++ b/admin/views/field/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Field Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewField extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewField extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('field', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewField extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewField extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('field.create') && $isNew) { // We can create the record. - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('field.edit')) { // We can save the record. - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewField extends HtmlView // For new records, check the create permission. if ($this->canDo->get('field.create')) { - JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('field.edit')) { // We can save the new record - JToolBarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('field.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('field.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('field.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('field.create')) { - JToolBarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('field.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('field.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('field.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.field', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.field', $this->item->id); } if ($this->canDo->get('field.create')) { - JToolBarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('field.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('field.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('field'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewField extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,41 +196,47 @@ class ComponentbuilderViewField extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/field.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_FIELD_NEW' : 'COM_COMPONENTBUILDER_FIELD_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/field.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/field/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/field/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here - $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); + $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) \JUri::getInstance())) . "';"); // add the libs for subform (since not adding it via xml but ajax) - JHtml::_('jquery.ui', array('core', 'sortable')); - JHtml::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); + Html::_('jquery.ui', array('core', 'sortable')); + Html::_('script', 'system/subform-repeatable.js', array('version' => 'auto', 'relative' => true)); // set some lang - JText::script('COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER'); - JText::script('COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS'); - JText::script('COM_COMPONENTBUILDER_NO_RESULTS_MATCH'); - JText::script('COM_COMPONENTBUILDER_SELECT_A_PROPERTY'); - JText::script('COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND'); - JText::script('view not acceptable. Error'); + Text::script('COM_COMPONENTBUILDER_PROPERTY_ALREADY_SELECTED_TRY_ANOTHER'); + Text::script('COM_COMPONENTBUILDER_TYPE_OR_SELECT_SOME_OPTIONS'); + Text::script('COM_COMPONENTBUILDER_NO_RESULTS_MATCH'); + Text::script('COM_COMPONENTBUILDER_SELECT_A_PROPERTY'); + Text::script('COM_COMPONENTBUILDER_NO_DESCRIPTION_FOUND'); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/fields/tmpl/default.php b/admin/views/fields/tmpl/default.php index ecc7a3d78..90a44ac31 100644 --- a/admin/views/fields/tmpl/default.php +++ b/admin/views/fields/tmpl/default.php @@ -12,18 +12,25 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleCategories', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_FIELDS_CATEGORIES') . ' -')); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleCategories', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_FIELDS_CATEGORIES') . ' -']); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=fields.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'fieldList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'fieldList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -34,13 +41,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -50,11 +57,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_FIELDS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_FIELDS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -64,27 +71,34 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/fields/tmpl/default_batch_body.php b/admin/views/fields/tmpl/default_batch_body.php index 48f0df1af..6393a0f5f 100644 --- a/admin/views/fields/tmpl/default_batch_body.php +++ b/admin/views/fields/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/fields/tmpl/default_batch_footer.php b/admin/views/fields/tmpl/default_batch_footer.php index 3c00bc099..407c6c742 100644 --- a/admin/views/fields/tmpl/default_batch_footer.php +++ b/admin/views/fields/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/fields/tmpl/default_body.php b/admin/views/fields/tmpl/default_body.php index 9d677174f..cfae9cbe9 100644 --- a/admin/views/fields/tmpl/default_body.php +++ b/admin/views/fields/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('field',$item,'fields'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; get('field.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; get('field.edit')): ?> escape($item->name); ?> checked_out): ?> - name, $item->checked_out_time, 'fields.', $canCheckin); ?> + name, $item->checked_out_time, 'fields.', $canCheckin); ?> escape($item->name); ?> @@ -79,16 +83,16 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
- datatype); ?> + datatype); ?> - indexes); ?> + indexes); ?> - null_switch); ?> + null_switch); ?> - store); ?> + store); ?>
@@ -103,15 +107,15 @@ $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; get('field.edit.state')) : ?> checked_out) : ?> - published, $i, 'fields.', true, 'cb'); ?> + published, $i, 'fields.', true, 'cb'); ?> - published, $i, 'fields.', false, 'cb'); ?> + published, $i, 'fields.', false, 'cb'); ?> - published, $i, 'fields.', true, 'cb'); ?> + published, $i, 'fields.', true, 'cb'); ?> - published, $i, 'fields.', false, 'cb'); ?> + published, $i, 'fields.', false, 'cb'); ?> diff --git a/admin/views/fields/tmpl/default_head.php b/admin/views/fields/tmpl/default_head.php index a15b460ef..ea7a8aa50 100644 --- a/admin/views/fields/tmpl/default_head.php +++ b/admin/views/fields/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,36 +33,36 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/fields/tmpl/default_toolbar.php b/admin/views/fields/tmpl/default_toolbar.php index 3d08c5650..cc0aff7c9 100644 --- a/admin/views/fields/tmpl/default_toolbar.php +++ b/admin/views/fields/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/fields/view.html.php b/admin/views/fields/view.html.php index e37e8b641..26f232d31 100644 --- a/admin/views/fields/view.html.php +++ b/admin/views/fields/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Fields @@ -35,7 +48,7 @@ class ComponentbuilderViewFields extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewFields extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('field'); $this->canEdit = $this->canDo->get('field.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewFields extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewFields extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_FIELDS'), 'lamp'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=fields'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_FIELDS'), 'lamp'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('field.add'); + ToolbarHelper::addNew('field.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('field.edit'); + ToolbarHelper::editList('field.edit'); } if ($this->canState) { - JToolBarHelper::publishList('fields.publish'); - JToolBarHelper::unpublishList('fields.unpublish'); - JToolBarHelper::archiveList('fields.archive'); + ToolbarHelper::publishList('fields.publish'); + ToolbarHelper::unpublishList('fields.unpublish'); + ToolbarHelper::archiveList('fields.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('fields.checkin'); + ToolbarHelper::checkin('fields.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewFields extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'fields.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'fields.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('fields.trash'); + ToolbarHelper::trash('fields.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('field.export')) { - JToolBarHelper::custom('fields.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('fields.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('field.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('fields.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('fields.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->canDo->get('core.import') && $this->canDo->get('field.import')) { - JToolBarHelper::custom('fields.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('fields.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('fields'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -189,9 +202,9 @@ class ComponentbuilderViewFields extends HtmlView { // Category Batch selection. JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), 'batch[category]', - JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.field'), 'value', 'text') + Html::_('select.options', Html::_('category.options', 'com_componentbuilder.field'), 'value', 'text') ); } @@ -199,19 +212,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Fieldtype Name Selection - $this->fieldtypeNameOptions = JFormHelper::loadFieldType('Fieldtypes')->options; + $this->fieldtypeNameOptions = FormHelper::loadFieldType('Fieldtypes')->options; // We do some sanitation for Fieldtype Name filter - if (ComponentbuilderHelper::checkArray($this->fieldtypeNameOptions) && + if (ArrayHelper::check($this->fieldtypeNameOptions) && isset($this->fieldtypeNameOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->fieldtypeNameOptions[0]->value)) + !StringHelper::check($this->fieldtypeNameOptions[0]->value)) { unset($this->fieldtypeNameOptions[0]); } // Fieldtype Name Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL').' -', 'batch[fieldtype]', - JHtml::_('select.options', $this->fieldtypeNameOptions, 'value', 'text') + Html::_('select.options', $this->fieldtypeNameOptions, 'value', 'text') ); } @@ -219,19 +232,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Datatype Selection - $this->datatypeOptions = JFormHelper::loadFieldType('fieldsfilterdatatype')->options; + $this->datatypeOptions = FormHelper::loadFieldType('fieldsfilterdatatype')->options; // We do some sanitation for Datatype filter - if (ComponentbuilderHelper::checkArray($this->datatypeOptions) && + if (ArrayHelper::check($this->datatypeOptions) && isset($this->datatypeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->datatypeOptions[0]->value)) + !StringHelper::check($this->datatypeOptions[0]->value)) { unset($this->datatypeOptions[0]); } // Datatype Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL').' -', 'batch[datatype]', - JHtml::_('select.options', $this->datatypeOptions, 'value', 'text') + Html::_('select.options', $this->datatypeOptions, 'value', 'text') ); } @@ -239,19 +252,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Indexes Selection - $this->indexesOptions = JFormHelper::loadFieldType('fieldsfilterindexes')->options; + $this->indexesOptions = FormHelper::loadFieldType('fieldsfilterindexes')->options; // We do some sanitation for Indexes filter - if (ComponentbuilderHelper::checkArray($this->indexesOptions) && + if (ArrayHelper::check($this->indexesOptions) && isset($this->indexesOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->indexesOptions[0]->value)) + !StringHelper::check($this->indexesOptions[0]->value)) { unset($this->indexesOptions[0]); } // Indexes Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL').' -', 'batch[indexes]', - JHtml::_('select.options', $this->indexesOptions, 'value', 'text') + Html::_('select.options', $this->indexesOptions, 'value', 'text') ); } @@ -259,19 +272,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Null Switch Selection - $this->null_switchOptions = JFormHelper::loadFieldType('fieldsfilternullswitch')->options; + $this->null_switchOptions = FormHelper::loadFieldType('fieldsfilternullswitch')->options; // We do some sanitation for Null Switch filter - if (ComponentbuilderHelper::checkArray($this->null_switchOptions) && + if (ArrayHelper::check($this->null_switchOptions) && isset($this->null_switchOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->null_switchOptions[0]->value)) + !StringHelper::check($this->null_switchOptions[0]->value)) { unset($this->null_switchOptions[0]); } // Null Switch Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL').' -', 'batch[null_switch]', - JHtml::_('select.options', $this->null_switchOptions, 'value', 'text') + Html::_('select.options', $this->null_switchOptions, 'value', 'text') ); } @@ -279,19 +292,19 @@ class ComponentbuilderViewFields extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Store Selection - $this->storeOptions = JFormHelper::loadFieldType('fieldsfilterstore')->options; + $this->storeOptions = FormHelper::loadFieldType('fieldsfilterstore')->options; // We do some sanitation for Store filter - if (ComponentbuilderHelper::checkArray($this->storeOptions) && + if (ArrayHelper::check($this->storeOptions) && isset($this->storeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->storeOptions[0]->value)) + !StringHelper::check($this->storeOptions[0]->value)) { unset($this->storeOptions[0]); } // Store Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL').' -', 'batch[store]', - JHtml::_('select.options', $this->storeOptions, 'value', 'text') + Html::_('select.options', $this->storeOptions, 'value', 'text') ); } } @@ -305,10 +318,10 @@ class ComponentbuilderViewFields extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_FIELDS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/fields.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_FIELDS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/fields.css", ['version' => 'auto']); } /** @@ -323,30 +336,40 @@ class ComponentbuilderViewFields extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_FIELD_NAME_LABEL'), - 'g.name' => JText::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL'), - 'a.datatype' => JText::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL'), - 'a.indexes' => JText::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL'), - 'a.null_switch' => JText::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL'), - 'a.store' => JText::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'), - 'category_title' => JText::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_FIELD_NAME_LABEL'), + 'g.name' => Text::_('COM_COMPONENTBUILDER_FIELD_FIELDTYPE_LABEL'), + 'a.datatype' => Text::_('COM_COMPONENTBUILDER_FIELD_DATATYPE_LABEL'), + 'a.indexes' => Text::_('COM_COMPONENTBUILDER_FIELD_INDEXES_LABEL'), + 'a.null_switch' => Text::_('COM_COMPONENTBUILDER_FIELD_NULL_SWITCH_LABEL'), + 'a.store' => Text::_('COM_COMPONENTBUILDER_FIELD_STORE_LABEL'), + 'category_title' => Text::_('COM_COMPONENTBUILDER_FIELD_FIELDS_CATEGORIES'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/fieldtype/submitbutton.js b/admin/views/fieldtype/submitbutton.js index 7880a9e25..b07e60d48 100644 --- a/admin/views/fieldtype/submitbutton.js +++ b/admin/views/fieldtype/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/fieldtype/tmpl/edit.php b/admin/views/fieldtype/tmpl/edit.php index 8259f6b6e..137bd76b0 100644 --- a/admin/views/fieldtype/tmpl/edit.php +++ b/admin/views/fieldtype/tmpl/edit.php @@ -12,100 +12,99 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/fieldtypes/view.html.php b/admin/views/fieldtypes/view.html.php index 9fa379881..b21c54966 100644 --- a/admin/views/fieldtypes/view.html.php +++ b/admin/views/fieldtypes/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Fieldtypes @@ -35,7 +48,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('fieldtype'); $this->canEdit = $this->canDo->get('fieldtype.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewFieldtypes extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewFieldtypes extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_FIELDTYPES'), 'power-cord'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=fieldtypes'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_FIELDTYPES'), 'power-cord'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('fieldtype.add'); + ToolbarHelper::addNew('fieldtype.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('fieldtype.edit'); + ToolbarHelper::editList('fieldtype.edit'); } if ($this->canState) { - JToolBarHelper::publishList('fieldtypes.publish'); - JToolBarHelper::unpublishList('fieldtypes.unpublish'); - JToolBarHelper::archiveList('fieldtypes.archive'); + ToolbarHelper::publishList('fieldtypes.publish'); + ToolbarHelper::unpublishList('fieldtypes.unpublish'); + ToolbarHelper::archiveList('fieldtypes.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('fieldtypes.checkin'); + ToolbarHelper::checkin('fieldtypes.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewFieldtypes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewFieldtypes extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'fieldtypes.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'fieldtypes.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('fieldtypes.trash'); + ToolbarHelper::trash('fieldtypes.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('fieldtype.export')) { - JToolBarHelper::custom('fieldtypes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('fieldtypes.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('fieldtype.import')) { - JToolBarHelper::custom('fieldtypes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('fieldtypes.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('fieldtypes'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,9 +187,9 @@ class ComponentbuilderViewFieldtypes extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -184,9 +197,9 @@ class ComponentbuilderViewFieldtypes extends HtmlView { // Category Batch selection. JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY'), 'batch[category]', - JHtml::_('select.options', JHtml::_('category.options', 'com_componentbuilder.fieldtype'), 'value', 'text') + Html::_('select.options', Html::_('category.options', 'com_componentbuilder.fieldtype'), 'value', 'text') ); } } @@ -200,10 +213,10 @@ class ComponentbuilderViewFieldtypes extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_FIELDTYPES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/fieldtypes.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_FIELDTYPES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/fieldtypes.css", ['version' => 'auto']); } /** @@ -218,26 +231,36 @@ class ComponentbuilderViewFieldtypes extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL'), - 'a.short_description' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL'), - 'category_title' => JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_FIELDTYPE_NAME_LABEL'), + 'a.short_description' => Text::_('COM_COMPONENTBUILDER_FIELDTYPE_SHORT_DESCRIPTION_LABEL'), + 'category_title' => Text::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPES_CATEGORIES'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/get_snippets/tmpl/default.php b/admin/views/get_snippets/tmpl/default.php index 74cef80ce..e997c5562 100644 --- a/admin/views/get_snippets/tmpl/default.php +++ b/admin/views/get_snippets/tmpl/default.php @@ -12,10 +12,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); ?> canDo->get('get_snippets.access')): ?> -
+ - +



-


..

+


..

-

+


- -

@@ -180,63 +185,65 @@ JHtml::_('behavior.keepalive');



-

-

-

+

+

+




-

-

-

+

+

+




-

-

-

+

+

+




-

-

-

+

+

+




-

-

-

+

+

+

- + -

+

diff --git a/admin/views/get_snippets/view.html.php b/admin/views/get_snippets/view.html.php index af14e980b..ab0a72e75 100644 --- a/admin/views/get_snippets/view.html.php +++ b/admin/views/get_snippets/view.html.php @@ -12,7 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\CMS\Filesystem\File; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -26,11 +33,11 @@ class ComponentbuilderViewGet_snippets extends HtmlView function display($tpl = null) { // get component params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // get the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('get_snippets'); // Initialise variables. @@ -49,7 +56,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView // Check for errors. if (count($errors = $this->get('Errors'))) { - throw new Exception(implode(PHP_EOL, $errors), 500); + throw new \Exception(implode(PHP_EOL, $errors), 500); } parent::display($tpl); @@ -64,15 +71,15 @@ class ComponentbuilderViewGet_snippets extends HtmlView // Only load jQuery if needed. (default is true) if ($this->params->get('add_jquery_framework', 1) == 1) { - JHtml::_('jquery.framework'); + Html::_('jquery.framework'); } // Load the header checker class. require_once( JPATH_COMPONENT_ADMINISTRATOR.'/helpers/headercheck.php' ); // Initialize the header checker. - $HeaderCheck = new componentbuilderHeaderCheck; + $HeaderCheck = new componentbuilderHeaderCheck(); // Add View JavaScript File - JHtml::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/assets/js/get_snippets.js", ['version' => 'auto']); // Load uikit options. $uikit = $this->params->get('uikit_load'); @@ -84,27 +91,25 @@ class ComponentbuilderViewGet_snippets extends HtmlView // The uikit css. if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { - JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); } // The uikit js. if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { - JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); } // Load the script to find all uikit components needed. if ($uikit != 2) { // Set the default uikit components in this view. - $uikitComp = array(); + $uikitComp = []; $uikitComp[] = 'data-uk-grid'; } // Load the needed uikit components in this view. - if ($uikit != 2 && isset($uikitComp) && ComponentbuilderHelper::checkArray($uikitComp)) + if ($uikit != 2 && isset($uikitComp) && ArrayHelper::check($uikitComp)) { - // load just in case. - jimport('joomla.filesystem.file'); // loading... foreach ($uikitComp as $class) { @@ -114,13 +119,13 @@ class ComponentbuilderViewGet_snippets extends HtmlView if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css')) { // load the css. - JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']); } // check if the JavaScript file exists. if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js')) { // load the js. - JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']); } } } @@ -137,9 +142,9 @@ class ComponentbuilderViewGet_snippets extends HtmlView } // Add the JavaScript for JStore - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jquery.json.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jstorage.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/strtotime.js'); + Html::_('script', 'media/com_componentbuilder/js/jquery.json.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']); // check if we should use browser storage $setBrowserStorage = $this->params->get('set_browser_storage', null); if ($setBrowserStorage) @@ -149,7 +154,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView if ('global' == $storageTimeToLive) { // use the global session time - $session = JFactory::getSession(); + $session = Factory::getSession(); // must have itin milliseconds $expire = ($session->getExpire()*60)* 1000; } @@ -175,7 +180,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView $this->document->addScriptDeclaration("var snippetPath = '". ComponentbuilderHelper::$snippetPath ."';"); $this->document->addScriptDeclaration("var snippetsPath = '". ComponentbuilderHelper::$snippetsPath ."';"); // token - $this->document->addScriptDeclaration("var token = '". JSession::getFormToken() ."';"); + $this->document->addScriptDeclaration("var token = '". \JSession::getFormToken() ."';"); // add some global items buckets for bulk updating $this->document->addScriptDeclaration("var bulkItems = {};"); $this->document->addScriptDeclaration("bulkItems.new = [];"); @@ -183,59 +188,59 @@ class ComponentbuilderViewGet_snippets extends HtmlView $this->document->addScriptDeclaration("bulkItems.ahead = [];"); $this->document->addScriptDeclaration("bulkItems.behind = [];"); // set an error message if needed - $this->document->addScriptDeclaration("var returnError = '

".JText::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!

".JText::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".

';"); + $this->document->addScriptDeclaration("var returnError = '

".Text::_('COM_COMPONENTBUILDER_AN_ERROR_HAS_OCCURRED')."!

".Text::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER').".

';"); // need to add some language strings - JText::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS'); - JText::script('COM_COMPONENTBUILDER_SNIPPETS'); - JText::script('COM_COMPONENTBUILDER_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION'); - JText::script('COM_COMPONENTBUILDER_GET_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_LOCAL_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION'); - JText::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY'); - JText::script('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION'); - JText::script('COM_COMPONENTBUILDER_USAGE'); - JText::script('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION'); - JText::script('COM_COMPONENTBUILDER_DESCRIPTION'); - JText::script('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION'); - JText::script('COM_COMPONENTBUILDER_VIEW_BLAME'); - JText::script('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET'); - JText::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL'); - JText::script('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'); - JText::script('COM_COMPONENTBUILDER_SNIPPETS_COULD_NOT_BE_UPDATEDSAVED'); - JText::script('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR'); - JText::script('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS'); - JText::script('COM_COMPONENTBUILDER_JCB_COMMUNITY'); - JText::script('COM_COMPONENTBUILDER_COMPANY_NAME'); - JText::script('COM_COMPONENTBUILDER_AUTHOR_NAME'); - JText::script('COM_COMPONENTBUILDER_AUTHOR_EMAIL'); - JText::script('COM_COMPONENTBUILDER_AUTHOR_WEBSITE'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME'); - JText::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES'); - JText::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS'); + Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY_SNIPPETS'); + Text::script('COM_COMPONENTBUILDER_SNIPPETS'); + Text::script('COM_COMPONENTBUILDER_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_OF_COMMUNITY_VERSION'); + Text::script('COM_COMPONENTBUILDER_GET_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_LOCAL_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_UPDATE_THE_LOCAL_VERSION'); + Text::script('COM_COMPONENTBUILDER_GET_THE_SNIPPET_FROM_GITHUB_AND_INSTALL_IT_LOCALLY'); + Text::script('COM_COMPONENTBUILDER_NO_NEED_TO_GET_IT_SINCE_IT_IS_ALREADY_IN_SYNC_WITH_YOUR_LOCAL_VERSION'); + Text::script('COM_COMPONENTBUILDER_USAGE'); + Text::script('COM_COMPONENTBUILDER_VIEW_USAGE_OF_COMMUNITY_VERSION'); + Text::script('COM_COMPONENTBUILDER_DESCRIPTION'); + Text::script('COM_COMPONENTBUILDER_VIEW_DESCRIPTION_OF_COMMUNITY_VERSION'); + Text::script('COM_COMPONENTBUILDER_VIEW_BLAME'); + Text::script('COM_COMPONENTBUILDER_VIEW_WHO_CONTRIBUTED_TO_THIS_SNIPPET'); + Text::script('COM_COMPONENTBUILDER_VIEW_SNIPPET_REFERENCE_URL'); + Text::script('COM_COMPONENTBUILDER_SNIPPET_COULD_NOT_BE_UPDATEDSAVED'); + Text::script('COM_COMPONENTBUILDER_SNIPPETS_COULD_NOT_BE_UPDATEDSAVED'); + Text::script('COM_COMPONENTBUILDER_LINK_TO_THE_CONTRIBUTOR'); + Text::script('COM_COMPONENTBUILDER_VIEW_THE_CONTRIBUTOR_DETAILS'); + Text::script('COM_COMPONENTBUILDER_JCB_COMMUNITY'); + Text::script('COM_COMPONENTBUILDER_COMPANY_NAME'); + Text::script('COM_COMPONENTBUILDER_AUTHOR_NAME'); + Text::script('COM_COMPONENTBUILDER_AUTHOR_EMAIL'); + Text::script('COM_COMPONENTBUILDER_AUTHOR_WEBSITE'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_NEW_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_DIVERGED_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_AHEAD_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_OUT_OF_DATE_SNIPPETS_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_THERE_ARE_NO_SNIPPETS_TO_UPDATE_AT_THIS_TIME'); + Text::script('COM_COMPONENTBUILDER_AVAILABLE_LIBRARIES'); + Text::script('COM_COMPONENTBUILDER_OPEN_LIBRARY_SNIPPETS'); // add some lang verfy messages $this->document->addScriptDeclaration(" // set the snippet from gitHub function getConfirmUpdate(status) { switch(status) { case 'new': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_ADD_THIS_NEW_JCB_COMMUNITY_SNIPPET_TO_YOUR_LOCAL_SNIPPETS')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_ADD_THIS_NEW_JCB_COMMUNITY_SNIPPET_TO_YOUR_LOCAL_SNIPPETS')."'; break; case 'behind': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_NEWER_JCB_COMMUNITY_SNIPPET')."'; break; case 'ahead': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_UPDATE_YOUR_LOCAL_SNIPPET_WITH_THIS_OLDER_JCB_COMMUNITY_SNIPPET')."'; break; case 'diverged': - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_REPLACE_YOUR_LOCAL_SNIPPET_WITH_THIS_JCB_COMMUNITY_SNIPPET')."'; break; default: - return '".JText::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE')."'; + return '".Text::_('COM_COMPONENTBUILDER_ARE_YOU_SURE_YOU_WOULD_LIKE_TO_CONTINUE')."'; break; } } @@ -247,7 +252,7 @@ class ComponentbuilderViewGet_snippets extends HtmlView $this->document->addScriptDeclaration("var local_snippets = ". json_encode($local_snippets).";"); } // add the document default css file - JHtml::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']); + Html::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/get_snippets.css', ['version' => 'auto']); } /** @@ -258,51 +263,51 @@ class ComponentbuilderViewGet_snippets extends HtmlView // hide the main menu $this->app->input->set('hidemainmenu', true); // add title to the page - JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_GET_SNIPPETS'),'search'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_GET_SNIPPETS'),'search'); // add cpanel button - JToolBarHelper::custom('get_snippets.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); + ToolbarHelper::custom('get_snippets.dashboard', 'grid-2', '', 'COM_COMPONENTBUILDER_DASH', false); if ($this->canDo->get('get_snippets.custom_admin_views')) { // add Custom Admin Views button. - JToolBarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false); + ToolbarHelper::custom('get_snippets.openCustomAdminViews', 'screen custom-button-opencustomadminviews', '', 'COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS', false); } if ($this->canDo->get('get_snippets.site_views')) { // add Site Views button. - JToolBarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false); + ToolbarHelper::custom('get_snippets.openSiteViews', 'palette custom-button-opensiteviews', '', 'COM_COMPONENTBUILDER_SITE_VIEWS', false); } if ($this->canDo->get('get_snippets.templates')) { // add Templates button. - JToolBarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false); + ToolbarHelper::custom('get_snippets.openTemplates', 'brush custom-button-opentemplates', '', 'COM_COMPONENTBUILDER_TEMPLATES', false); } if ($this->canDo->get('get_snippets.layouts')) { // add Layouts button. - JToolBarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false); + ToolbarHelper::custom('get_snippets.openLayouts', 'brush custom-button-openlayouts', '', 'COM_COMPONENTBUILDER_LAYOUTS', false); } if ($this->canDo->get('get_snippets.snippets')) { // add Snippets button. - JToolBarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false); + ToolbarHelper::custom('get_snippets.openSnippets', 'pin custom-button-opensnippets', '', 'COM_COMPONENTBUILDER_SNIPPETS', false); } if ($this->canDo->get('get_snippets.libraries')) { // add Libraries button. - JToolBarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false); + ToolbarHelper::custom('get_snippets.openLibraries', 'puzzle custom-button-openlibraries', '', 'COM_COMPONENTBUILDER_LIBRARIES', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('get_snippets'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } } @@ -316,6 +321,16 @@ class ComponentbuilderViewGet_snippets extends HtmlView public function escape($var) { // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/help_document/submitbutton.js b/admin/views/help_document/submitbutton.js index 27198a162..25ea5a6b6 100644 --- a/admin/views/help_document/submitbutton.js +++ b/admin/views/help_document/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index 27a49473d..8b16c8995 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -12,85 +12,84 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> diff --git a/admin/views/help_document/view.html.php b/admin/views/help_document/view.html.php index 8549c7eaf..4615ce1e4 100644 --- a/admin/views/help_document/view.html.php +++ b/admin/views/help_document/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Help_document Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewHelp_document extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewHelp_document extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('help_document', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewHelp_document extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewHelp_document extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('help_document.create') && $isNew) { // We can create the record. - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('help_document.edit')) { // We can save the record. - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewHelp_document extends HtmlView // For new records, check the create permission. if ($this->canDo->get('help_document.create')) { - JToolBarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('help_document.edit')) { // We can save the new record - JToolBarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('help_document.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('help_document.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('help_document.create')) { - JToolBarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('help_document.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('help_document.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('help_document.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.help_document', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.help_document', $this->item->id); } if ($this->canDo->get('help_document.create')) { - JToolBarHelper::custom('help_document.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('help_document.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('help_document.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('help_document'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewHelp_document extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,14 +196,20 @@ class ComponentbuilderViewHelp_document extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/help_document.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/help_document/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - JText::script('view not acceptable. Error'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_HELP_DOCUMENT_NEW' : 'COM_COMPONENTBUILDER_HELP_DOCUMENT_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/help_document.css", ['version' => 'auto']); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/help_document/submitbutton.js", ['version' => 'auto']); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/help_documents/tmpl/default.php b/admin/views/help_documents/tmpl/default.php index 4a8dcb041..12011e52b 100644 --- a/admin/views/help_documents/tmpl/default.php +++ b/admin/views/help_documents/tmpl/default.php @@ -12,16 +12,23 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=help_documents.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -32,13 +39,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -48,11 +55,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -62,5 +69,5 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/help_documents/tmpl/default_batch_body.php b/admin/views/help_documents/tmpl/default_batch_body.php index d946ec995..38d5dac6a 100644 --- a/admin/views/help_documents/tmpl/default_batch_body.php +++ b/admin/views/help_documents/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/help_documents/tmpl/default_batch_footer.php b/admin/views/help_documents/tmpl/default_batch_footer.php index df213dcd9..232759e8d 100644 --- a/admin/views/help_documents/tmpl/default_batch_footer.php +++ b/admin/views/help_documents/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/help_documents/tmpl/default_body.php b/admin/views/help_documents/tmpl/default_body.php index e3ea244de..f8abd329e 100644 --- a/admin/views/help_documents/tmpl/default_body.php +++ b/admin/views/help_documents/tmpl/default_body.php @@ -12,13 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_document.edit"; ?> items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('help_document',$item,'help_documents'); ?> @@ -28,7 +32,7 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -46,12 +50,12 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc get('help_document.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -62,7 +66,7 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc get('help_document.edit')): ?> escape($item->title); ?> checked_out): ?> - name, $item->checked_out_time, 'help_documents.', $canCheckin); ?> + name, $item->checked_out_time, 'help_documents.', $canCheckin); ?> escape($item->title); ?> @@ -70,13 +74,13 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc - type); ?> + type); ?> escape($item->groups); ?> - location); ?> + location); ?> escape($item->admin_view); ?> @@ -88,15 +92,15 @@ $edit = "index.php?option=com_componentbuilder&view=help_documents&task=help_doc get('help_document.edit.state')) : ?> checked_out) : ?> - published, $i, 'help_documents.', true, 'cb'); ?> + published, $i, 'help_documents.', true, 'cb'); ?> - published, $i, 'help_documents.', false, 'cb'); ?> + published, $i, 'help_documents.', false, 'cb'); ?> - published, $i, 'help_documents.', true, 'cb'); ?> + published, $i, 'help_documents.', true, 'cb'); ?> - published, $i, 'help_documents.', false, 'cb'); ?> + published, $i, 'help_documents.', false, 'cb'); ?> diff --git a/admin/views/help_documents/tmpl/default_head.php b/admin/views/help_documents/tmpl/default_head.php index c1097f4f3..69d0602cd 100644 --- a/admin/views/help_documents/tmpl/default_head.php +++ b/admin/views/help_documents/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,33 +33,33 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/help_documents/tmpl/default_toolbar.php b/admin/views/help_documents/tmpl/default_toolbar.php index a9b97a8ec..67dc8acb8 100644 --- a/admin/views/help_documents/tmpl/default_toolbar.php +++ b/admin/views/help_documents/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index 08b606523..249d9b311 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Help_documents @@ -35,7 +48,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('help_document'); $this->canEdit = $this->canDo->get('help_document.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewHelp_documents extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewHelp_documents extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS'), 'support'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=help_documents'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS'), 'support'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('help_document.add'); + ToolbarHelper::addNew('help_document.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('help_document.edit'); + ToolbarHelper::editList('help_document.edit'); } if ($this->canState) { - JToolBarHelper::publishList('help_documents.publish'); - JToolBarHelper::unpublishList('help_documents.unpublish'); - JToolBarHelper::archiveList('help_documents.archive'); + ToolbarHelper::publishList('help_documents.publish'); + ToolbarHelper::unpublishList('help_documents.unpublish'); + ToolbarHelper::archiveList('help_documents.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('help_documents.checkin'); + ToolbarHelper::checkin('help_documents.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,44 +142,44 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'help_documents.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('help_documents.trash'); + ToolbarHelper::trash('help_documents.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('help_document.export')) { - JToolBarHelper::custom('help_documents.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('help_documents.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->canDo->get('core.import') && $this->canDo->get('help_document.import')) { - JToolBarHelper::custom('help_documents.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('help_documents.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('help_documents'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -174,19 +187,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Type Selection - $this->typeOptions = JFormHelper::loadFieldType('helpdocumentsfiltertype')->options; + $this->typeOptions = FormHelper::loadFieldType('helpdocumentsfiltertype')->options; // We do some sanitation for Type filter - if (ComponentbuilderHelper::checkArray($this->typeOptions) && + if (ArrayHelper::check($this->typeOptions) && isset($this->typeOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->typeOptions[0]->value)) + !StringHelper::check($this->typeOptions[0]->value)) { unset($this->typeOptions[0]); } // Type Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL').' -', 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') + Html::_('select.options', $this->typeOptions, 'value', 'text') ); } @@ -194,19 +207,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Location Selection - $this->locationOptions = JFormHelper::loadFieldType('helpdocumentsfilterlocation')->options; + $this->locationOptions = FormHelper::loadFieldType('helpdocumentsfilterlocation')->options; // We do some sanitation for Location filter - if (ComponentbuilderHelper::checkArray($this->locationOptions) && + if (ArrayHelper::check($this->locationOptions) && isset($this->locationOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->locationOptions[0]->value)) + !StringHelper::check($this->locationOptions[0]->value)) { unset($this->locationOptions[0]); } // Location Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL').' -', 'batch[location]', - JHtml::_('select.options', $this->locationOptions, 'value', 'text') + Html::_('select.options', $this->locationOptions, 'value', 'text') ); } @@ -214,19 +227,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Admin View Selection - $this->admin_viewOptions = JFormHelper::loadFieldType('Adminviewfolderlist')->options; + $this->admin_viewOptions = FormHelper::loadFieldType('Adminviewfolderlist')->options; // We do some sanitation for Admin View filter - if (ComponentbuilderHelper::checkArray($this->admin_viewOptions) && + if (ArrayHelper::check($this->admin_viewOptions) && isset($this->admin_viewOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->admin_viewOptions[0]->value)) + !StringHelper::check($this->admin_viewOptions[0]->value)) { unset($this->admin_viewOptions[0]); } // Admin View Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', 'batch[admin_view]', - JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text') + Html::_('select.options', $this->admin_viewOptions, 'value', 'text') ); } @@ -234,19 +247,19 @@ class ComponentbuilderViewHelp_documents extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Site View Selection - $this->site_viewOptions = JFormHelper::loadFieldType('Siteviewfolderlist')->options; + $this->site_viewOptions = FormHelper::loadFieldType('Siteviewfolderlist')->options; // We do some sanitation for Site View filter - if (ComponentbuilderHelper::checkArray($this->site_viewOptions) && + if (ArrayHelper::check($this->site_viewOptions) && isset($this->site_viewOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->site_viewOptions[0]->value)) + !StringHelper::check($this->site_viewOptions[0]->value)) { unset($this->site_viewOptions[0]); } // Site View Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', 'batch[site_view]', - JHtml::_('select.options', $this->site_viewOptions, 'value', 'text') + Html::_('select.options', $this->site_viewOptions, 'value', 'text') ); } } @@ -260,10 +273,10 @@ class ComponentbuilderViewHelp_documents extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/help_documents.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENTS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/help_documents.css", ['version' => 'auto']); } /** @@ -278,28 +291,38 @@ class ComponentbuilderViewHelp_documents extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.title' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TITLE_LABEL'), - 'a.type' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL'), - 'a.location' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL'), - 'g.' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL'), - 'h.' => JText::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.title' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TITLE_LABEL'), + 'a.type' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_TYPE_LABEL'), + 'a.location' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_LOCATION_LABEL'), + 'h.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_ADMIN_VIEW_LABEL'), + 'i.' => Text::_('COM_COMPONENTBUILDER_HELP_DOCUMENT_SITE_VIEW_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 5f2f7198b..d9003da29 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -12,13 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?>
-
+ sidebar)) : ?>
@@ -132,13 +138,13 @@ jQuery(document).ready(function($) {
- hasPackage && ComponentbuilderHelper::checkArray($this->headerList) && ComponentbuilderHelper::checkArray($this->headers)) : ?> + hasPackage && ArrayHelper::check($this->headerList) && ArrayHelper::check($this->headers)) : ?>
- +
- +
- +
headerList as $name => $title): ?> @@ -146,72 +152,72 @@ jQuery(document).ready(function($) {
- +
- 'upload')); ?> - - + 'upload')); ?> + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - - + + +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- + - +
- +
- +
-     (.csv .xls .ods) +     (.csv .xls .ods)
- - + + - +
\ No newline at end of file diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index b7669e5be..c7b9e03c4 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -12,7 +12,11 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Import Html View @@ -26,7 +30,7 @@ class ComponentbuilderViewImport extends HtmlView protected $dataType; public function display($tpl = null) - { + { if ($this->getLayout() !== 'modal') { // Include helper submenu @@ -39,7 +43,7 @@ class ComponentbuilderViewImport extends HtmlView $this->paths = &$paths; $this->state = &$state; - // get global action permissions + // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('import'); // We don't need toolbar in the modal window. @@ -50,18 +54,18 @@ class ComponentbuilderViewImport extends HtmlView } // get the session object - $session = JFactory::getSession(); + $session = Factory::getSession(); // check if it has package - $this->hasPackage = $session->get('hasPackage', false); - $this->dataType = $session->get('dataType', false); + $this->hasPackage = $session->get('hasPackage', false); + $this->dataType = $session->get('dataType', false); if($this->hasPackage && $this->dataType) { - $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); - $this->headers = ComponentbuilderHelper::getFileHeaders($this->dataType); + $this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true); + $this->headers = ComponentbuilderHelper::getFileHeaders($this->dataType); // clear the data type $session->clear('dataType'); } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -77,19 +81,19 @@ class ComponentbuilderViewImport extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=import'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('import'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/views/import_joomla_components/tmpl/default.php b/admin/views/import_joomla_components/tmpl/default.php index 59d07a8da..df2744172 100644 --- a/admin/views/import_joomla_components/tmpl/default.php +++ b/admin/views/import_joomla_components/tmpl/default.php @@ -11,12 +11,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use VDM\Joomla\Utilities\ArrayHelper; -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\ArrayHelper; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?> dataType === 'smart_package') ? '.zip' : 'none'; ?>
-
+ sidebar)) : ?>
@@ -165,8 +177,8 @@ jQuery('
')
@@ -185,14 +197,14 @@ jQuery('
') $hasOwner = (isset($this->packageInfo['getKeyFrom']) && ArrayHelper::check($this->packageInfo['getKeyFrom'])) ? true:false; $class1 = ($hasOwner) ? 'span6' : 'span12'; ?> -

-

- 'advanced')); ?> +

+

+ 'advanced')); ?> - +
- + formPackage): ?> formPackage as $field): ?>
@@ -203,13 +215,13 @@ jQuery('
')
- - + +
-

+

@@ -217,78 +229,78 @@ jQuery('
') owner($this->packageInfo); ?>
- + packageInfo['name']) && ArrayHelper::check($this->packageInfo['name'])) : ?> - + components($this->packageInfo); ?> - + - + dataType === 'smart_package'): ?> -

-

+

+

- 'upload')); ?> + 'upload')); ?> - +
- +
- +
-     () +     ()
- + - +
- +
- +
-     () +     ()
- + - +
- +
- +
-     () +     ()
- + vdmPackages) && ArrayHelper::check($this->vdmPackages)): ?> - +
-

-

-

+

+

+

- + vdmPackages as $field): ?>
label;?>
@@ -296,9 +308,9 @@ jQuery('
')
-     +    
-
+
@@ -307,19 +319,19 @@ jQuery('
')
- + jcbPackages) && ArrayHelper::check($this->jcbPackages)) : ?> - +
-

-

-

+

+

+

- + jcbPackages as $field): ?>
label;?>
@@ -327,9 +339,9 @@ jQuery('
')
-     +    
-
+
@@ -338,15 +350,15 @@ jQuery('
')
- + - + - +
@@ -518,27 +530,29 @@ jQuery('#adminForm').on('change', '#haskey',function (e) } }); -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { diff --git a/admin/views/import_joomla_components/view.html.php b/admin/views/import_joomla_components/view.html.php index 32f4bf1b4..0f53e1766 100644 --- a/admin/views/import_joomla_components/view.html.php +++ b/admin/views/import_joomla_components/view.html.php @@ -12,7 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Toolbar\ToolbarHelper; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\FormHelper as UtilitiesFormHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\StringHelper; @@ -39,9 +46,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView ComponentbuilderHelper::addSubmenu('import'); } // get component params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); - $paths = new stdClass; + $paths = new \stdClass; $paths->first = ''; $state = $this->get('state'); @@ -50,7 +57,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('import'); // load the application - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); // We don't need toolbar in the modal window. if ($this->getLayout() !== 'modal') @@ -58,12 +65,12 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView $this->addToolbar(); $this->sidebar = JHtmlSidebar::render(); // add title to the page - JToolbarHelper::title(JText::_('COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT'), 'upload'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_JCB_PACKAGE_IMPORT'), 'upload'); // add refesh button. - JToolBarHelper::custom('joomla_component.refresh', 'refresh', '', 'COM_COMPONENTBUILDER_REFRESH', false); + ToolbarHelper::custom('joomla_component.refresh', 'refresh', '', 'COM_COMPONENTBUILDER_REFRESH', false); } // get the session object - $session = JFactory::getSession(); + $session = Factory::getSession(); // check if it has package $this->hasPackage = $session->get('hasPackage', false); $this->dataType = $session->get('dataType', false); @@ -116,14 +123,14 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView protected function setDocument() { // always make sure jquery is loaded. - JHtml::_('jquery.framework'); + Html::_('jquery.framework'); // Add the JavaScript for JStore - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jquery.json.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/jstorage.min.js'); - $this->document->addScript(JURI::root() .'media/com_componentbuilder/js/strtotime.js'); + Html::_('script', 'media/com_componentbuilder/js/jquery.json.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/jstorage.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/js/strtotime.js', ['version' => 'auto']); // add marked library - $this->document->addScript(JURI::root() . "media/com_componentbuilder/js/marked.js"); + Html::_('script', "media/com_componentbuilder/js/marked.js", ['version' => 'auto']); // check if we should use browser storage $setBrowserStorage = $this->params->get('set_browser_storage', null); if ($setBrowserStorage) @@ -133,7 +140,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ('global' == $storageTimeToLive) { // use the global session time - $session = JFactory::getSession(); + $session = Factory::getSession(); // must have itin milliseconds $expire = ($session->getExpire()*60)* 1000; } @@ -156,21 +163,21 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // Set the Time To Live To JavaScript $this->document->addScriptDeclaration("var expire = ". (int) $expire.";"); - $this->document->addScriptDeclaration("var all_is_good = '".JText::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME')."';"); + $this->document->addScriptDeclaration("var all_is_good = '".Text::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IS_NO_NOTICE_AT_THIS_TIME')."';"); // add a token on the page for javascript - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); + $this->document->addScriptDeclaration("var token = '".\JSession::getFormToken()."';"); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); } public function _getForm($type) @@ -179,9 +186,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ('smart_package' === $type) { // get the force_update radio field - $force_update = JFormHelper::loadFieldType('radio',true); - // start force_update xml - $force_updateXML = new SimpleXMLElement(''); + $force_update = FormHelper::loadFieldType('radio',true); + // start force_update xl + $force_updateXML = new \SimpleXMLElement(''); // force_update attributes $force_updateAttributes = array( 'type' => 'radio', @@ -191,22 +198,22 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_FORCE_THE_UPDATE_OF_ALL_LOCAL_DATA_EVEN_IF_IT_IS_NEWER_THEN_THE_DATA_BEING_IMPORTED', 'default' => '0'); // load the force_update attributes - ComponentbuilderHelper::xmlAddAttributes($force_updateXML, $force_updateAttributes); + UtilitiesFormHelper::attributes($force_updateXML, $force_updateAttributes); // set the force_update options $force_updateOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the force_update options - ComponentbuilderHelper::xmlAddOptions($force_updateXML, $force_updateOptions); + UtilitiesFormHelper::options($force_updateXML, $force_updateOptions); // setup the force_update radio field $force_update->setup($force_updateXML,0); // add to form $form[] = $force_update; // get the more_info radio field - $more_info = JFormHelper::loadFieldType('radio',true); + $more_info = FormHelper::loadFieldType('radio',true); // start more_info xml - $more_infoXML = new SimpleXMLElement(''); + $more_infoXML = new \SimpleXMLElement(''); // more_info attributes $more_infoAttributes = array( 'type' => 'radio', @@ -216,22 +223,22 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_BE_SHOWING_MORE_ELABORATE_INFORMATION_DURING_IMPORT', 'default' => '0'); // load the more_info attributes - ComponentbuilderHelper::xmlAddAttributes($more_infoXML, $more_infoAttributes); + UtilitiesFormHelper::attributes($more_infoXML, $more_infoAttributes); // set the more_info options $more_infoOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the more_info options - ComponentbuilderHelper::xmlAddOptions($more_infoXML, $more_infoOptions); + UtilitiesFormHelper::options($more_infoXML, $more_infoOptions); // setup the more_info radio field $more_info->setup($more_infoXML,0); // add to form $form[] = $more_info; // get the merge radio field - $merge = JFormHelper::loadFieldType('radio',true); + $merge = FormHelper::loadFieldType('radio',true); // start merge xml - $mergeXML = new SimpleXMLElement(''); + $mergeXML = new \SimpleXMLElement(''); // merge attributes $mergeAttributes = array( 'type' => 'radio', @@ -241,22 +248,22 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => 'COM_COMPONENTBUILDER_SHOULD_WE_MERGE_THE_COMPONENTS_WITH_SIMILAR_LOCAL_COMPONENTS_MERGING_THE_COMPONENTS_USE_TO_BE_THE_DEFAULT_BEHAVIOUR_BUT_NOW_YOU_CAN_IMPORT_THE_COMPONENTS_AND_FORCE_IT_NOT_TO_MERGE_THE_FOLLOWING_AREAS_VALIDATION_RULE_FIELDTYPE_SNIPPET_LANGUAGE_LANGUAGE_TRANSLATION_JOOMLA_PLUGIN_GROUP_CLASS_EXTENDS_CLASS_PROPERTY_CLASS_METHOD_BMUST_AND_WILL_STILLB_MERGE_EVEN_OF_YOUR_SELECTION_IS_BNOB_BECAUSE_OF_THE_SINGULAR_NATURE_OF_THOSE_AREAS', 'default' => '1'); // load the merge attributes - ComponentbuilderHelper::xmlAddAttributes($mergeXML, $mergeAttributes); + UtilitiesFormHelper::attributes($mergeXML, $mergeAttributes); // set the merge options $mergeOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the merge options - ComponentbuilderHelper::xmlAddOptions($mergeXML, $mergeOptions); + UtilitiesFormHelper::options($mergeXML, $mergeOptions); // setup the merge radio field $merge->setup($mergeXML,1); // add to form $form[] = $merge; // get the import_guid_only radio field - $import_guid_only = JFormHelper::loadFieldType('radio',true); + $import_guid_only = FormHelper::loadFieldType('radio',true); // start import_guid_only xml - $import_guid_onlyXML = new SimpleXMLElement(''); + $import_guid_onlyXML = new \SimpleXMLElement(''); // import_guid_only attributes $import_guid_onlyAttributes = array( 'type' => 'radio', @@ -266,13 +273,13 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'description' => 'COM_COMPONENTBUILDER_FORCE_THAT_THIS_JCB_PACKAGE_IMPORT_SEARCH_FOR_LOCAL_ITEMS_TO_BE_DONE_WITH_GUID_VALUE_ONLY_IF_BMERGEB_IS_SET_TO_YES_ABOVE', 'default' => '1'); // load the import_guid_only attributes - ComponentbuilderHelper::xmlAddAttributes($import_guid_onlyXML, $import_guid_onlyAttributes); + UtilitiesFormHelper::attributes($import_guid_onlyXML, $import_guid_onlyAttributes); // set the import_guid_only options $import_guid_onlyOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the import_guid_only options - ComponentbuilderHelper::xmlAddOptions($import_guid_onlyXML, $import_guid_onlyOptions); + UtilitiesFormHelper::options($import_guid_onlyXML, $import_guid_onlyOptions); // setup the import_guid_only radio field $import_guid_only->setup($import_guid_onlyXML, $this->params->get('import_guid_only', 0)); // add to form @@ -286,9 +293,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if (!$this->packageInfo) { // get the haskey radio field - $haskey = JFormHelper::loadFieldType('radio',true); + $haskey = FormHelper::loadFieldType('radio',true); // start haskey xml - $haskeyXML = new SimpleXMLElement(''); + $haskeyXML = new \SimpleXMLElement(''); // haskey attributes $haskeyAttributes = array( 'type' => 'radio', @@ -299,13 +306,13 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView 'default' => '1', 'filter' => 'INT'); // load the haskey attributes - ComponentbuilderHelper::xmlAddAttributes($haskeyXML, $haskeyAttributes); + UtilitiesFormHelper::attributes($haskeyXML, $haskeyAttributes); // set the haskey options $haskeyOptions = array( '1' => 'COM_COMPONENTBUILDER_YES', '0' => 'COM_COMPONENTBUILDER_NO'); // load the haskey options - ComponentbuilderHelper::xmlAddOptions($haskeyXML, $haskeyOptions); + UtilitiesFormHelper::options($haskeyXML, $haskeyOptions); // setup the haskey radio field $haskey->setup($haskeyXML,1); // add to form @@ -316,9 +323,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView } // get the sleutle password field - $sleutle = JFormHelper::loadFieldType('password',true); + $sleutle = FormHelper::loadFieldType('password',true); // start sleutle xml - $sleutleXML = new SimpleXMLElement(''); + $sleutleXML = new \SimpleXMLElement(''); // sleutle attributes $sleutleAttributes = array( 'type' => 'password', @@ -335,7 +342,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView $sleutleAttributes['required'] = 'true'; } // load the sleutle attributes - ComponentbuilderHelper::xmlAddAttributes($sleutleXML, $sleutleAttributes); + UtilitiesFormHelper::attributes($sleutleXML, $sleutleAttributes); // setup the sleutle password field $sleutle->setup($sleutleXML,''); // add to form @@ -347,9 +354,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if (ArrayHelper::check($vdmListObjects)) { // get the vdm_package list field - $vdm_package = JFormHelper::loadFieldType('list',true); + $vdm_package = FormHelper::loadFieldType('list',true); // start vdm_package xml - $vdm_packageXML = new SimpleXMLElement(''); + $vdm_packageXML = new \SimpleXMLElement(''); // vdm_package attributes $vdm_packageAttributes = array( 'type' => 'list', @@ -361,7 +368,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // load the list $load = false; // load the vdm_package attributes - ComponentbuilderHelper::xmlAddAttributes($vdm_packageXML, $vdm_packageAttributes); + UtilitiesFormHelper::attributes($vdm_packageXML, $vdm_packageAttributes); // start the vdm_package options $vdm_packageOptions = array(); $vdm_packageOptions[''] = 'COM_COMPONENTBUILDER__SELECT_PACKAGE_'; @@ -378,7 +385,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ($load) { // load the vdm_package options - ComponentbuilderHelper::xmlAddOptions($vdm_packageXML, $vdm_packageOptions); + UtilitiesFormHelper::options($vdm_packageXML, $vdm_packageOptions); // setup the vdm_package radio field $vdm_package->setup($vdm_packageXML,''); // add to form @@ -391,9 +398,9 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if (ArrayHelper::check($jcbListObjects)) { // get the jcb_package list field - $jcb_package = JFormHelper::loadFieldType('list',true); + $jcb_package = FormHelper::loadFieldType('list',true); // start jcb_package xml - $jcb_packageXML = new SimpleXMLElement(''); + $jcb_packageXML = new \SimpleXMLElement(''); // jcb_package attributes $jcb_packageAttributes = array( 'type' => 'list', @@ -405,7 +412,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView // load the list $load = false; // load the jcb_package attributes - ComponentbuilderHelper::xmlAddAttributes($jcb_packageXML, $jcb_packageAttributes); + UtilitiesFormHelper::attributes($jcb_packageXML, $jcb_packageAttributes); // start the jcb_package options $jcb_packageOptions = array(); $jcb_packageOptions[''] = 'COM_COMPONENTBUILDER__SELECT_PACKAGE_'; @@ -422,7 +429,7 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView if ($load) { // load the jcb_package options - ComponentbuilderHelper::xmlAddOptions($jcb_packageXML, $jcb_packageOptions); + UtilitiesFormHelper::options($jcb_packageXML, $jcb_packageOptions); // setup the jcb_package radio field $jcb_package->setup($jcb_packageXML,''); // add to form @@ -444,19 +451,19 @@ class ComponentbuilderViewImport_joomla_components extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_IMPORT_TITLE'), 'upload'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=import_joomla_components'); if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('import_joomla_components'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } } diff --git a/admin/views/import_language_translations/tmpl/default.php b/admin/views/import_language_translations/tmpl/default.php index fb97b080e..6b9158ea8 100644 --- a/admin/views/import_language_translations/tmpl/default.php +++ b/admin/views/import_language_translations/tmpl/default.php @@ -12,13 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('jquery.framework'); -JHtml::_('bootstrap.tooltip'); -JHtml::_('script', 'system/core.js', false, true); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; +use VDM\Joomla\Utilities\ArrayHelper; +Html::_('jquery.framework'); +Html::_('bootstrap.tooltip'); +Html::_('script', 'system/core.js', false, true); +Html::_('behavior.keepalive'); + ?> @@ -754,13 +753,13 @@ jQuery('#adminForm').on('change', '#jform_translation_tool',function (e) function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -770,17 +769,19 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); // check when dashboard switch changes jQuery('#adminForm').on('change', '#jform_dashboard_type',function (e) diff --git a/admin/views/joomla_component/view.html.php b/admin/views/joomla_component/view.html.php index 227818cdc..98b2ef178 100644 --- a/admin/views/joomla_component/view.html.php +++ b/admin/views/joomla_component/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Joomla_component Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewJoomla_component extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewJoomla_component extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('joomla_component', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewJoomla_component extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewJoomla_component extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('joomla_component.create') && $isNew) { // We can create the record. - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('joomla_component.edit')) { // We can save the record. - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewJoomla_component extends HtmlView // For new records, check the create permission. if ($this->canDo->get('joomla_component.create')) { - JToolBarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('joomla_component.edit')) { // We can save the new record - JToolBarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('joomla_component.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('joomla_component.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('joomla_component.create')) { - JToolBarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('joomla_component.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('joomla_component.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('joomla_component.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.joomla_component', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.joomla_component', $this->item->id); } if ($this->canDo->get('joomla_component.create')) { - JToolBarHelper::custom('joomla_component.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('joomla_component.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('joomla_component.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_component'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewJoomla_component extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewJoomla_component extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_component.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NEW' : 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_component.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key - $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); + $this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here - $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + $this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) \JUri::getInstance())) . "';"); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/joomla_components/tmpl/default.php b/admin/views/joomla_components/tmpl/default.php index de80fb824..510c97226 100644 --- a/admin/views/joomla_components/tmpl/default.php +++ b/admin/views/joomla_components/tmpl/default.php @@ -12,19 +12,26 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleJoomlacomponentsfiltercompanyname', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_COMPANY_NAME') . ' -')); -JHtml::_('formbehavior.chosen', '.multipleJoomlacomponentsfilterauthor', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_AUTHOR') . ' -')); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleJoomlacomponentsfiltercompanyname', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_COMPANY_NAME') . ' -']); +Html::_('formbehavior.chosen', '.multipleJoomlacomponentsfilterauthor', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_AUTHOR') . ' -']); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=joomla_components.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'joomla_componentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'joomla_componentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -35,13 +42,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -51,11 +58,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -65,45 +72,52 @@ if ($this->saveOrder)
- +
diff --git a/admin/views/joomla_components/tmpl/default_batch_body.php b/admin/views/joomla_components/tmpl/default_batch_body.php index 1c10b1805..acd442afc 100644 --- a/admin/views/joomla_components/tmpl/default_batch_body.php +++ b/admin/views/joomla_components/tmpl/default_batch_body.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> -

+

batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/joomla_components/tmpl/default_batch_footer.php b/admin/views/joomla_components/tmpl/default_batch_footer.php index 1f073cecc..4955ef396 100644 --- a/admin/views/joomla_components/tmpl/default_batch_footer.php +++ b/admin/views/joomla_components/tmpl/default_batch_footer.php @@ -12,12 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; + ?> \ No newline at end of file diff --git a/admin/views/joomla_components/tmpl/default_body.php b/admin/views/joomla_components/tmpl/default_body.php index 5c046d245..d2e492452 100644 --- a/admin/views/joomla_components/tmpl/default_body.php +++ b/admin/views/joomla_components/tmpl/default_body.php @@ -11,7 +11,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\StringHelper; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; @@ -20,7 +25,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml items as $i => $item): ?> user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; - $userChkOut = JFactory::getUser($item->checked_out); + $userChkOut = Factory::getUser($item->checked_out); $canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components'); ?> @@ -30,7 +35,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml $iconClass = ''; if (!$this->saveOrder) { - $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + $iconClass = ' inactive tip-top" hasTooltip" title="' . Html::tooltipText('JORDERINGDISABLED'); } ?> @@ -48,12 +53,12 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml get('joomla_component.edit')): ?> checked_out) : ?> - id); ?> + id); ?> - id); ?> + id); ?> □ @@ -64,7 +69,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml get('joomla_component.edit')): ?> escape($item->system_name); ?> checked_out): ?> - name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> + name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?> escape($item->system_name); ?> @@ -75,7 +80,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml // always make sure the $this->return_here is set if (!isset($this->return_here)) { - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); } // setup the buttons if (!isset($_buttons) || !ArrayHelper::check($_buttons)) @@ -85,78 +90,84 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml array( 'view' => 'component_admin_views', 'views' => 'components_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS'), 'icon' => 'stack'), array( 'view' => 'component_custom_admin_views', 'views' => 'components_custom_admin_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS'), 'icon' => 'screen'), array( 'view' => 'component_site_views', 'views' => 'components_site_views', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS'), 'icon' => 'palette'), + array( + 'view' => 'component_router', + 'views' => 'components_routers', + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_SITE_ROUTER'), + 'icon' => 'tree-2'), array( 'view' => 'component_config', 'views' => 'components_config', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG'), 'icon' => 'options') ); $_buttons[1] = array( array( 'view' => 'component_placeholders', 'views' => 'components_placeholders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLACEHOLDERS'), 'icon' => 'search'), array( 'view' => 'component_updates', 'views' => 'components_updates', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES'), 'icon' => 'database'), array( 'view' => 'component_mysql_tweaks', 'views' => 'components_mysql_tweaks', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS'), 'icon' => 'screwdriver'), array( 'view' => 'component_files_folders', 'views' => 'components_files_folders', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS'), 'icon' => 'briefcase') ); $_buttons[2] = array( array( 'view' => 'component_custom_admin_menus', 'views' => 'components_custom_admin_menus', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS'), 'icon' => 'plus'), array( 'view' => 'component_dashboard', 'views' => 'components_dashboard', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD'), 'icon' => 'dashboard'), array( 'view' => 'component_modules', 'views' => 'components_modules', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_MODULES'), 'icon' => 'cube'), array( 'view' => 'component_plugins', 'views' => 'components_plugins', - 'title' => JText::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), + 'title' => Text::_('COM_COMPONENTBUILDER_THE_COMPONENT_PLUGINS'), 'icon' => 'power-cord') ); } ?>
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> - + +
@@ -165,7 +176,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -179,7 +190,7 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
- get($_button['view'].'.edit') && ($id = ComponentbuilderHelper::getVar($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> + get($_button['view'].'.edit') && ($id = GetHelper::var($_button['view'], $item->id, 'joomla_component', 'id')) !== false): ?> get($_button['view'].'.create')): ?> @@ -193,13 +204,13 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml escape($item->author); ?>
email) && StringHelper::check($item->author)) : ?> - + escape($item->email); ?>
website) && StringHelper::check($item->author)) : ?> - + escape($item->website); ?> @@ -209,15 +220,15 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml get('joomla_component.edit.state')) : ?> checked_out) : ?> - published, $i, 'joomla_components.', true, 'cb'); ?> + published, $i, 'joomla_components.', true, 'cb'); ?> - published, $i, 'joomla_components.', false, 'cb'); ?> + published, $i, 'joomla_components.', false, 'cb'); ?> - published, $i, 'joomla_components.', true, 'cb'); ?> + published, $i, 'joomla_components.', true, 'cb'); ?> - published, $i, 'joomla_components.', false, 'cb'); ?> + published, $i, 'joomla_components.', false, 'cb'); ?> diff --git a/admin/views/joomla_components/tmpl/default_head.php b/admin/views/joomla_components/tmpl/default_head.php index e148c450f..401c650c6 100644 --- a/admin/views/joomla_components/tmpl/default_head.php +++ b/admin/views/joomla_components/tmpl/default_head.php @@ -12,14 +12,17 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?> canEdit&& $this->canState): ?> - listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> + listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING', 'icon-menu-2'); ?> - + @@ -30,27 +33,27 @@ defined('_JEXEC') or die('Restricted access'); - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> canState): ?> - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> - + - listDirn, $this->listOrder); ?> + listDirn, $this->listOrder); ?> \ No newline at end of file diff --git a/admin/views/joomla_components/tmpl/default_toolbar.php b/admin/views/joomla_components/tmpl/default_toolbar.php index b6f171729..4c706e988 100644 --- a/admin/views/joomla_components/tmpl/default_toolbar.php +++ b/admin/views/joomla_components/tmpl/default_toolbar.php @@ -12,34 +12,37 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; + ?>
- -
- - -
-
- - pagination->getLimitBox(); ?> -
-
- - -
-
- - -
-
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index 8d2b4f833..186173199 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Joomla_components @@ -35,7 +48,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('joomla_component'); $this->canEdit = $this->canDo->get('joomla_component.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewJoomla_components extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewJoomla_components extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_components'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('joomla_component.add'); + ToolbarHelper::addNew('joomla_component.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('joomla_component.edit'); + ToolbarHelper::editList('joomla_component.edit'); } if ($this->canState) { - JToolBarHelper::publishList('joomla_components.publish'); - JToolBarHelper::unpublishList('joomla_components.unpublish'); - JToolBarHelper::archiveList('joomla_components.archive'); + ToolbarHelper::publishList('joomla_components.publish'); + ToolbarHelper::unpublishList('joomla_components.unpublish'); + ToolbarHelper::archiveList('joomla_components.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('joomla_components.checkin'); + ToolbarHelper::checkin('joomla_components.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,74 +142,74 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->user->authorise('joomla_component.clone', 'com_componentbuilder')) { // add Clone button. - JToolBarHelper::custom('joomla_components.cloner', 'save-copy custom-button-cloner', '', 'COM_COMPONENTBUILDER_CLONE', 'true'); + ToolbarHelper::custom('joomla_components.cloner', 'save-copy custom-button-cloner', '', 'COM_COMPONENTBUILDER_CLONE', 'true'); } if ($this->user->authorise('joomla_component.export_jcb_packages', 'com_componentbuilder')) { // add Export JCB Packages button. - JToolBarHelper::custom('joomla_components.smartExport', 'download custom-button-smartexport', '', 'COM_COMPONENTBUILDER_EXPORT_JCB_PACKAGES', 'true'); + ToolbarHelper::custom('joomla_components.smartExport', 'download custom-button-smartexport', '', 'COM_COMPONENTBUILDER_EXPORT_JCB_PACKAGES', 'true'); } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'joomla_components.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'joomla_components.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('joomla_components.trash'); + ToolbarHelper::trash('joomla_components.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('joomla_component.export')) { - JToolBarHelper::custom('joomla_components.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('joomla_components.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('joomla_component.import_jcb_packages', 'com_componentbuilder')) { // add Import JCB Packages button. - JToolBarHelper::custom('joomla_components.smartImport', 'upload custom-button-smartimport', '', 'COM_COMPONENTBUILDER_IMPORT_JCB_PACKAGES', false); + ToolbarHelper::custom('joomla_components.smartImport', 'upload custom-button-smartimport', '', 'COM_COMPONENTBUILDER_IMPORT_JCB_PACKAGES', false); } if ($this->user->authorise('joomla_component.run_expansion', 'com_componentbuilder')) { // add Run Expansion button. - JToolBarHelper::custom('joomla_components.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); + ToolbarHelper::custom('joomla_components.runExpansion', 'expand-2 custom-button-runexpansion', '', 'COM_COMPONENTBUILDER_RUN_EXPANSION', false); } if ($this->user->authorise('joomla_component.backup', 'com_componentbuilder')) { // add Backup button. - JToolBarHelper::custom('joomla_components.backup', 'archive custom-button-backup', '', 'COM_COMPONENTBUILDER_BACKUP', false); + ToolbarHelper::custom('joomla_components.backup', 'archive custom-button-backup', '', 'COM_COMPONENTBUILDER_BACKUP', false); } if ($this->user->authorise('joomla_component.clear_tmp', 'com_componentbuilder')) { // add Clear tmp button. - JToolBarHelper::custom('joomla_components.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); + ToolbarHelper::custom('joomla_components.clearTmp', 'purge custom-button-cleartmp', '', 'COM_COMPONENTBUILDER_CLEAR_TMP', false); } if ($this->canDo->get('core.import') && $this->canDo->get('joomla_component.import')) { - JToolBarHelper::custom('joomla_components.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('joomla_components.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_components'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -204,9 +217,9 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } @@ -214,19 +227,19 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Companyname Selection - $this->companynameOptions = JFormHelper::loadFieldType('joomlacomponentsfiltercompanyname')->options; + $this->companynameOptions = FormHelper::loadFieldType('joomlacomponentsfiltercompanyname')->options; // We do some sanitation for Companyname filter - if (ComponentbuilderHelper::checkArray($this->companynameOptions) && + if (ArrayHelper::check($this->companynameOptions) && isset($this->companynameOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->companynameOptions[0]->value)) + !StringHelper::check($this->companynameOptions[0]->value)) { unset($this->companynameOptions[0]); } // Companyname Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL').' -', 'batch[companyname]', - JHtml::_('select.options', $this->companynameOptions, 'value', 'text') + Html::_('select.options', $this->companynameOptions, 'value', 'text') ); } @@ -234,19 +247,19 @@ class ComponentbuilderViewJoomla_components extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { // Set Author Selection - $this->authorOptions = JFormHelper::loadFieldType('joomlacomponentsfilterauthor')->options; + $this->authorOptions = FormHelper::loadFieldType('joomlacomponentsfilterauthor')->options; // We do some sanitation for Author filter - if (ComponentbuilderHelper::checkArray($this->authorOptions) && + if (ArrayHelper::check($this->authorOptions) && isset($this->authorOptions[0]->value) && - !ComponentbuilderHelper::checkString($this->authorOptions[0]->value)) + !StringHelper::check($this->authorOptions[0]->value)) { unset($this->authorOptions[0]); } // Author Batch Selection JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL').' -', + '- Keep Original '.Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL').' -', 'batch[author]', - JHtml::_('select.options', $this->authorOptions, 'value', 'text') + Html::_('select.options', $this->authorOptions, 'value', 'text') ); } } @@ -260,10 +273,10 @@ class ComponentbuilderViewJoomla_components extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_components.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENTS')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_components.css", ['version' => 'auto']); } /** @@ -278,29 +291,39 @@ class ComponentbuilderViewJoomla_components extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.system_name' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_LABEL'), - 'a.name_code' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL'), - 'a.short_description' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_LABEL'), - 'a.companyname' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL'), - 'a.created' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATED_LABEL'), - 'a.modified' => JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.system_name' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_LABEL'), + 'a.name_code' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAME_CODE_LABEL'), + 'a.short_description' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_LABEL'), + 'a.companyname' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPANYNAME_LABEL'), + 'a.created' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATED_LABEL'), + 'a.modified' => Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MODIFIED_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/joomla_module/submitbutton.js b/admin/views/joomla_module/submitbutton.js index 15089b320..79c9b133a 100644 --- a/admin/views/joomla_module/submitbutton.js +++ b/admin/views/joomla_module/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/joomla_module/tmpl/edit.php b/admin/views/joomla_module/tmpl/edit.php index cb6da1ee7..a7a02fef5 100644 --- a/admin/views/joomla_module/tmpl/edit.php +++ b/admin/views/joomla_module/tmpl/edit.php @@ -12,155 +12,154 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/joomla_modules_updates/view.html.php b/admin/views/joomla_modules_updates/view.html.php index da3e8a64f..d84f6e6eb 100644 --- a/admin/views/joomla_modules_updates/view.html.php +++ b/admin/views/joomla_modules_updates/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Joomla_modules_updates @@ -35,7 +48,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('joomla_module_updates'); $this->canEdit = $this->canDo->get('joomla_module_updates.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES'), 'joomla'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=joomla_modules_updates'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES'), 'joomla'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('joomla_module_updates.add'); + ToolbarHelper::addNew('joomla_module_updates.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('joomla_module_updates.edit'); + ToolbarHelper::editList('joomla_module_updates.edit'); } if ($this->canState) { - JToolBarHelper::publishList('joomla_modules_updates.publish'); - JToolBarHelper::unpublishList('joomla_modules_updates.unpublish'); - JToolBarHelper::archiveList('joomla_modules_updates.archive'); + ToolbarHelper::publishList('joomla_modules_updates.publish'); + ToolbarHelper::unpublishList('joomla_modules_updates.unpublish'); + ToolbarHelper::archiveList('joomla_modules_updates.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('joomla_modules_updates.checkin'); + ToolbarHelper::checkin('joomla_modules_updates.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,34 +142,34 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'joomla_modules_updates.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'joomla_modules_updates.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('joomla_modules_updates.trash'); + ToolbarHelper::trash('joomla_modules_updates.trash'); } } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('joomla_modules_updates'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -164,9 +177,9 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -180,10 +193,10 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/joomla_modules_updates.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_JOOMLA_MODULES_UPDATES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/joomla_modules_updates.css", ['version' => 'auto']); } /** @@ -198,23 +211,33 @@ class ComponentbuilderViewJoomla_modules_updates extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/joomla_plugin/submitbutton.js b/admin/views/joomla_plugin/submitbutton.js index f078a60c1..44f507308 100644 --- a/admin/views/joomla_plugin/submitbutton.js +++ b/admin/views/joomla_plugin/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/joomla_plugin/tmpl/edit.php b/admin/views/joomla_plugin/tmpl/edit.php index 3e0069787..b25dc89cc 100644 --- a/admin/views/joomla_plugin/tmpl/edit.php +++ b/admin/views/joomla_plugin/tmpl/edit.php @@ -12,123 +12,122 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?>
\ No newline at end of file diff --git a/admin/views/languages/view.html.php b/admin/views/languages/view.html.php index 86b8ac1c7..8cc07ae04 100644 --- a/admin/views/languages/view.html.php +++ b/admin/views/languages/view.html.php @@ -12,7 +12,20 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Languages @@ -35,7 +48,7 @@ class ComponentbuilderViewLanguages extends HtmlView $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); $this->state = $this->get('State'); - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Load the filter form from xml. $this->filterForm = $this->get('FilterForm'); // Load the active filters. @@ -45,7 +58,7 @@ class ComponentbuilderViewLanguages extends HtmlView $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value - $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); + $this->return_here = urlencode(base64_encode((string) Uri::getInstance())); // get global action permissions $this->canDo = ComponentbuilderHelper::getActions('language'); $this->canEdit = $this->canDo->get('language.edit'); @@ -65,7 +78,7 @@ class ComponentbuilderViewLanguages extends HtmlView $this->batchDisplay = JHtmlBatch_::render(); } } - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -84,32 +97,32 @@ class ComponentbuilderViewLanguages extends HtmlView */ protected function addToolBar() { - JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_LANGUAGES'), 'comment'); JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=languages'); - JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + ToolbarHelper::title(Text::_('COM_COMPONENTBUILDER_LANGUAGES'), 'comment'); + FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); if ($this->canCreate) { - JToolBarHelper::addNew('language.add'); + ToolbarHelper::addNew('language.add'); } // Only load if there are items - if (ComponentbuilderHelper::checkArray($this->items)) + if (ArrayHelper::check($this->items)) { if ($this->canEdit) { - JToolBarHelper::editList('language.edit'); + ToolbarHelper::editList('language.edit'); } if ($this->canState) { - JToolBarHelper::publishList('languages.publish'); - JToolBarHelper::unpublishList('languages.unpublish'); - JToolBarHelper::archiveList('languages.archive'); + ToolbarHelper::publishList('languages.publish'); + ToolbarHelper::unpublishList('languages.unpublish'); + ToolbarHelper::archiveList('languages.archive'); if ($this->canDo->get('core.admin')) { - JToolBarHelper::checkin('languages.checkin'); + ToolbarHelper::checkin('languages.checkin'); } } @@ -117,11 +130,11 @@ class ComponentbuilderViewLanguages extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) { // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = Toolbar::getInstance('toolbar'); // set the batch button name - $title = JText::_('JTOOLBAR_BATCH'); + $title = Text::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button - $layout = new JLayoutFile('joomla.toolbar.batch'); + $layout = new FileLayout('joomla.toolbar.batch'); // add the button to the page $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); @@ -129,49 +142,49 @@ class ComponentbuilderViewLanguages extends HtmlView if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { - JToolbarHelper::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH'); + ToolbarHelper::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($this->canState && $this->canDelete) { - JToolbarHelper::trash('languages.trash'); + ToolbarHelper::trash('languages.trash'); } if ($this->canDo->get('core.export') && $this->canDo->get('language.export')) { - JToolBarHelper::custom('languages.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + ToolbarHelper::custom('languages.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); } } if ($this->user->authorise('language.build', 'com_componentbuilder')) { // add Build button. - JToolBarHelper::custom('languages.buildLanguages', 'joomla custom-button-buildlanguages', '', 'COM_COMPONENTBUILDER_BUILD', false); + ToolbarHelper::custom('languages.buildLanguages', 'joomla custom-button-buildlanguages', '', 'COM_COMPONENTBUILDER_BUILD', false); } if ($this->canDo->get('core.import') && $this->canDo->get('language.import')) { - JToolBarHelper::custom('languages.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + ToolbarHelper::custom('languages.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); } // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('languages'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // add the options comp button if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { - JToolBarHelper::preferences('com_componentbuilder'); + ToolbarHelper::preferences('com_componentbuilder'); } // Only load published batch if state and batch is allowed if ($this->canState && $this->canBatch) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + Html::_('select.options', Html::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) ); } @@ -179,9 +192,9 @@ class ComponentbuilderViewLanguages extends HtmlView if ($this->canBatch && $this->canCreate && $this->canEdit) { JHtmlBatch_::addListSelection( - JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + Text::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + Html::_('select.options', Html::_('access.assetgroups'), 'value', 'text') ); } } @@ -195,10 +208,10 @@ class ComponentbuilderViewLanguages extends HtmlView { if (!isset($this->document)) { - $this->document = JFactory::getDocument(); + $this->document = Factory::getDocument(); } - $this->document->setTitle(JText::_('COM_COMPONENTBUILDER_LANGUAGES')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/languages.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->document->setTitle(Text::_('COM_COMPONENTBUILDER_LANGUAGES')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/languages.css", ['version' => 'auto']); } /** @@ -213,25 +226,35 @@ class ComponentbuilderViewLanguages extends HtmlView if(strlen($var) > 50) { // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + return StringHelper::html($var, $this->_charset, true); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** * Returns an array of fields the table can be sorted by * - * @return array Array containing the field name to sort by as the key and display text as value + * @return array Array containing the field name to sort by as the key and display text as value */ protected function getSortFields() { return array( - 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.name' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_NAME_LABEL'), - 'a.langtag' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_LABEL'), - 'a.id' => JText::_('JGRID_HEADING_ID') + 'a.ordering' => Text::_('JGRID_HEADING_ORDERING'), + 'a.published' => Text::_('JSTATUS'), + 'a.name' => Text::_('COM_COMPONENTBUILDER_LANGUAGE_NAME_LABEL'), + 'a.langtag' => Text::_('COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_LABEL'), + 'a.id' => Text::_('JGRID_HEADING_ID') ); } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; + } } diff --git a/admin/views/layout/submitbutton.js b/admin/views/layout/submitbutton.js index d0f44b6c8..d2214e1a3 100644 --- a/admin/views/layout/submitbutton.js +++ b/admin/views/layout/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/layout/tmpl/edit.php b/admin/views/layout/tmpl/edit.php index 2b9d6aae8..bc19fb8b3 100644 --- a/admin/views/layout/tmpl/edit.php +++ b/admin/views/layout/tmpl/edit.php @@ -12,87 +12,86 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -187,8 +187,8 @@ jQuery(document).ready(function() { getLayoutDetails(item->id) ? $this->item->id:9999; ?>); }); // some lang strings -var select_a_snippet = ''; -var create_a_snippet = ''; +var select_a_snippet = ''; +var create_a_snippet = ''; jQuery.fn.selText = function() { var obj = this[0]; @@ -210,13 +210,13 @@ jQuery.fn.selText = function() { } function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { diff --git a/admin/views/layout/view.html.php b/admin/views/layout/view.html.php index a02210e2e..1844d04b3 100644 --- a/admin/views/layout/view.html.php +++ b/admin/views/layout/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Layout Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewLayout extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewLayout extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('layout', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewLayout extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewLayout extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('core.create') && $isNew) { // We can create the record. - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('core.edit')) { // We can save the record. - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewLayout extends HtmlView // For new records, check the create permission. if ($this->canDo->get('core.create')) { - JToolBarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('core.edit')) { // We can save the new record - JToolBarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('layout.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('layout.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('layout.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('core.create')) { - JToolBarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('layout.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('layout.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('core.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.layout', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.layout', $this->item->id); } if ($this->canDo->get('core.create')) { - JToolBarHelper::custom('layout.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('layout.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('layout.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('layout'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewLayout extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewLayout extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/layout.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LAYOUT_NEW' : 'COM_COMPONENTBUILDER_LAYOUT_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/layout.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/layout/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/layout/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here - $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) \JUri::getInstance())) . "';"); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/layouts/tmpl/default.php b/admin/views/layouts/tmpl/default.php index 94d8ba26f..8af410455 100644 --- a/admin/views/layouts/tmpl/default.php +++ b/admin/views/layouts/tmpl/default.php @@ -12,17 +12,24 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); -JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -')); -JHtml::_('formbehavior.chosen', 'select'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::_('behavior.multiselect'); +Html::_('dropdown.init'); +Html::_('formbehavior.chosen', 'select'); +Html::_('formbehavior.chosen', '.multipleAccessLevels', null, ['placeholder_text_multiple' => '- ' . Text::_('COM_COMPONENTBUILDER_FILTER_SELECT_ACCESS') . ' -']); + if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=layouts.saveOrderAjax&tmpl=component'; - JHtml::_('sortablelist.sortable', 'layoutList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); + Html::_('sortablelist.sortable', 'layoutList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } ?> -
+ sidebar)): ?>
sidebar; ?> @@ -33,13 +40,13 @@ if ($this->saveOrder) $this)); + echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?> items)): ?>
- +
@@ -49,11 +56,11 @@ if ($this->saveOrder)
canCreate && $this->canEdit) : ?> - JText::_('COM_COMPONENTBUILDER_LAYOUTS_BATCH_OPTIONS'), + 'title' => Text::_('COM_COMPONENTBUILDER_LAYOUTS_BATCH_OPTIONS'), 'footer' => $this->loadTemplate('batch_footer') ), $this->loadTemplate('batch_body') @@ -63,7 +70,7 @@ if ($this->saveOrder)
- +
@@ -575,13 +574,13 @@ jQuery(document).ready(function(){ }); function JRouter(link) { isClient('site')) { - echo 'var url = "'.JURI::root().'";'; + echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; } else { @@ -591,16 +590,18 @@ function JRouter(link) { return url+link; } -// nice little dot trick :) -jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; - } - $(".loading-dots").text(dots); - } , 500); +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll(".loading-dots").forEach(function(loading_dots) { + let x = 0; + let intervalId = setInterval(function() { + if (!loading_dots.classList.contains("loading-dots")) { + clearInterval(intervalId); + return; + } + let dots = ".".repeat(x % 8); + loading_dots.textContent = dots; + x++; + }, 500); + }); }); diff --git a/admin/views/library/view.html.php b/admin/views/library/view.html.php index d013e61b7..420717d88 100644 --- a/admin/views/library/view.html.php +++ b/admin/views/library/view.html.php @@ -12,7 +12,19 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Form\FormHelper; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Library Html View class @@ -26,7 +38,7 @@ class ComponentbuilderViewLibrary extends HtmlView public function display($tpl = null) { // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); // Assign the variables $this->form = $this->get('Form'); $this->item = $this->get('Item'); @@ -35,7 +47,7 @@ class ComponentbuilderViewLibrary extends HtmlView // get action permissions $this->canDo = ComponentbuilderHelper::getActions('library', $this->item); // get input - $jinput = JFactory::getApplication()->input; + $jinput = Factory::getApplication()->input; $this->ref = $jinput->get('ref', 0, 'word'); $this->refid = $jinput->get('refid', 0, 'int'); $return = $jinput->get('return', null, 'base64'); @@ -60,7 +72,7 @@ class ComponentbuilderViewLibrary extends HtmlView // Set the toolbar $this->addToolBar(); - + // Check for errors. if (count($errors = $this->get('Errors'))) { @@ -80,34 +92,34 @@ class ComponentbuilderViewLibrary extends HtmlView */ protected function addToolBar() { - JFactory::getApplication()->input->set('hidemainmenu', true); - $user = JFactory::getUser(); + Factory::getApplication()->input->set('hidemainmenu', true); + $user = Factory::getUser(); $userId = $user->id; $isNew = $this->item->id == 0; - JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT'), 'pencil-2 article-add'); + ToolbarHelper::title( Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT'), 'pencil-2 article-add'); // Built the actions for new and existing records. - if (ComponentbuilderHelper::checkString($this->referral)) + if (StringHelper::check($this->referral)) { if ($this->canDo->get('library.create') && $isNew) { // We can create the record. - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); } elseif ($this->canDo->get('library.edit')) { // We can save the record. - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); } if ($isNew) { // Do not creat but cancel. - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); } else { // We can close it. - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); } } else @@ -117,44 +129,44 @@ class ComponentbuilderViewLibrary extends HtmlView // For new records, check the create permission. if ($this->canDo->get('library.create')) { - JToolBarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); - JToolBarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); }; - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CANCEL'); } else { if ($this->canDo->get('library.edit')) { // We can save the new record - JToolBarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); - JToolBarHelper::save('library.save', 'JTOOLBAR_SAVE'); + ToolbarHelper::apply('library.apply', 'JTOOLBAR_APPLY'); + ToolbarHelper::save('library.save', 'JTOOLBAR_SAVE'); // We can save this record, but check the create permission to see // if we can return to make a new one. if ($this->canDo->get('library.create')) { - JToolBarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + ToolbarHelper::custom('library.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); } } $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('library.version')); if ($this->state->params->get('save_history', 1) && $this->canDo->get('library.edit') && $canVersion) { - JToolbarHelper::versions('com_componentbuilder.library', $this->item->id); + ToolbarHelper::versions('com_componentbuilder.library', $this->item->id); } if ($this->canDo->get('library.create')) { - JToolBarHelper::custom('library.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + ToolbarHelper::custom('library.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); } - JToolBarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); + ToolbarHelper::cancel('library.cancel', 'JTOOLBAR_CLOSE'); } } - JToolbarHelper::divider(); + ToolbarHelper::divider(); // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('library'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } } @@ -169,11 +181,11 @@ class ComponentbuilderViewLibrary extends HtmlView { if(strlen($var) > 30) { - // use the helper htmlEscape method instead and shorten the string - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + // use the helper htmlEscape method instead and shorten the string + return StringHelper::html($var, $this->_charset, true, 30); } // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + return StringHelper::html($var, $this->_charset); } /** @@ -184,32 +196,38 @@ class ComponentbuilderViewLibrary extends HtmlView protected function setDocument() { $isNew = ($this->item->id < 1); - if (!isset($this->document)) - { - $this->document = JFactory::getDocument(); - } - $this->document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT')); - $this->document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/library.css", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + $this->getDocument()->setTitle(Text::_($isNew ? 'COM_COMPONENTBUILDER_LIBRARY_NEW' : 'COM_COMPONENTBUILDER_LIBRARY_EDIT')); + Html::_('stylesheet', "administrator/components/com_componentbuilder/assets/css/library.css", ['version' => 'auto']); // Add Ajax Token - $this->document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); - $this->document->addScript(JURI::root() . $this->script, (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); - $this->document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/library/submitbutton.js", (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + $this->getDocument()->addScriptDeclaration("var token = '" . Session::getFormToken() . "';"); + Html::_('script', $this->script, ['version' => 'auto']); + Html::_('script', "administrator/components/com_componentbuilder/views/library/submitbutton.js", ['version' => 'auto']); // add the Uikit v2 style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit.gradient.min.css', ['version' => 'auto']); // add Uikit v2 JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/uikit.min.js' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit.min.js', ['version' => 'auto']); // add the Uikit v2 extra style sheets - $this->document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css' , (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css'); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/components/notify.gradient.min.css', ['version' => 'auto']); // add Uikit v2 extra JavaScripts - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); - $this->document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/notify.min.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']); + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']); // add var key $this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';"); // add return_here - $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) JUri::getInstance())) . "';"); - JText::script('view not acceptable. Error'); + $this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) \JUri::getInstance())) . "';"); + Text::script('view not acceptable. Error'); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } } diff --git a/admin/views/library_config/submitbutton.js b/admin/views/library_config/submitbutton.js index d866dc9e0..c2dbcfab2 100644 --- a/admin/views/library_config/submitbutton.js +++ b/admin/views/library_config/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/admin/views/library_config/tmpl/edit.php b/admin/views/library_config/tmpl/edit.php index f5273842d..f77861e0d 100644 --- a/admin/views/library_config/tmpl/edit.php +++ b/admin/views/library_config/tmpl/edit.php @@ -12,71 +12,70 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.formvalidator'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\LayoutHelper; +use Joomla\CMS\Router\Route; +Html::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +Html::_('behavior.formvalidator'); +Html::_('formbehavior.chosen', 'select'); +Html::_('behavior.keepalive'); + $componentParams = $this->params; // will be removed just use $this->params instead ?> '; $tmp .= PHP_EOL . $_tab . Indent::_(2) . '
'; $tmp .= PHP_EOL . $_tab . Indent::_(1) - . ""; + . ""; // update html $tab['html'] = $tmp; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/JoomlaThree/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/JoomlaThree/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/JoomlaThree/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Router.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Router.php new file mode 100644 index 000000000..87f106613 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Router.php @@ -0,0 +1,330 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Model; + + +use VDM\Joomla\Componentbuilder\Compiler\Config; +use VDM\Joomla\Componentbuilder\Compiler\Customcode\Dispenser; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Router as Builder; +use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\JsonHelper; + + +/** + * Model Component Site Router Class + * + * @since 3.2.0 + */ +class Router +{ + /** + * The Config Class. + * + * @var Config + * @since 3.2.0 + */ + protected Config $config; + + /** + * The Dispenser Class. + * + * @var Dispenser + * @since 3.2.0 + */ + protected Dispenser $dispenser; + + /** + * The Router Class. + * + * @var Builder + * @since 3.2.0 + */ + protected Builder $builder; + + /** + * The gui mapper array + * + * @var array + * @since 3.2.0 + */ + protected array $guiMapper = [ + 'table' => 'component_router', + 'id' => null, + 'field' => null, + 'type' => 'php' + ]; + + /** + * The field targets + * + * @var array + * @since 3.2.0 + */ + protected array $targets = [ + 'before' => 'constructor_before_parent', + 'after' => 'constructor_after_parent', + 'method' => 'methods' + ]; + + /** + * Constructor. + * + * @param Config $config The Config Class. + * @param Dispenser $dispenser The Dispenser Class. + * @param Builder $builder The Router Class. + * + * @since 3.2.0 + */ + public function __construct(Config $config, Dispenser $dispenser, Builder $builder) + { + $this->config = $config; + $this->dispenser = $dispenser; + $this->builder = $builder; + } + + /** + * Set Router + * + * @param object $item The item data + * + * @return void + * @since 3.2.0 + */ + public function set(object &$item) + { + $this->config->lang_target = 'site'; + foreach ($this->targets as $target) + { + // add the code + if ($item->{"router_mode_{$target}"} == 3 + && StringHelper::check($item->{"router_{$target}_code"})) + { + // update GUI mapper field + $this->guiMapper['field'] = "{$target}_code"; + $this->dispenser->set( + $item->{"router_{$target}_code"}, + "_site_router_", + $target, + null, + $this->guiMapper + ); + } + unset($item->{"router_{$target}_code"}); + } + + // get the site views + $views = $this->getSiteViews($item->site_views ?? [], $item->admin_views ?? []); + $edit_views = $this->getSiteEditViews($item->admin_views); + + // get the edit site views + $this->builder->set('views', + ArrayHelper::merge([$views, $edit_views]) + ); + + if ($item->router_mode_constructor_before_parent == 2 + && JsonHelper::check($item->router_constructor_before_parent_manual)) + { + // build and validate the constructor before parent call code + $this->builder->set('manual', + json_decode($item->router_constructor_before_parent_manual) + ); + } + + // clear the data from the item + foreach ($this->targets as $key => $target) + { + // set the modes + $this->builder->set("mode_{$key}", + (int) $item->{"router_mode_{$target}"} + ); + + unset($item->{"router_mode_{$target}"}); + } + + unset($item->router_constructor_before_parent_manual); + } + + /** + * Get the array of site views with additional details. + * + * This method processes each site view to enrich it with additional details such as the associated table, + * alias keys, and other relevant information. The enrichment is based on the view's settings and the admin views. + * + * @param array $siteViews The site views to be processed. + * @param array $adminViews The admin views used for fetching additional data. + * + * @return array An array of objects, each representing a site view with enriched details. + * @since 3.2.0 + */ + protected function getSiteViews(array $siteViews, array $adminViews): array + { + return array_map(function ($view) use ($adminViews) { + // Attempt to get the main selection details from the view's settings. + $selection = $this->getMainSelection($view['settings']->main_get->main_get ?? null); + + // We can only work with ID if the [main get] is a [getItem] dynamicGet for this site view. + $key = ($view['settings']->main_get->gettype == 1) ? 'id' : null; + + // Construct the enriched view object. + return (object) [ + 'view' => $view['settings']->code, + 'View' => $view['settings']->Code, + 'stable' => ($selection['view'] === $view['settings']->code), // sanity check + 'target_view' => $selection['view'], + 'table' => $selection['table'], + 'table_name' => $selection['name'], + 'alias' => $this->getSiteViewAliasKey($selection['name'] ?? null, $adminViews), + 'key' => $key, + 'form' => false + ]; + }, $siteViews); + } + + /** + * Get the array of site edit views + * + * This method processes the provided admin views to extract and return an array of site edit views. + * Each site edit view is constructed based on specific conditions from the admin view's settings. + * + * @param array|null $views The admin views to process. + * + * @return array An array of site edit views, each as an object with view, table, alias, key, and form properties. + * @since 3.2.0 + */ + protected function getSiteEditViews(?array $views): array + { + $siteEditViews = []; + + // Return early if no views are provided. + if (empty($views)) + { + return $siteEditViews; + } + + foreach ($views as $view) + { + // Check if the view is marked for edit/create on the site. + if (!empty($view['edit_create_site_view'])) + { + $siteEditViews[] = (object) [ + 'view' => $view['settings']->name_single_code, + 'View' => StringHelper::safe($view['settings']->name_single_code, 'F'), + 'stable' => true, + 'target_view' => $view['settings']->name_single_code, + 'table' => '#__' . $this->config->component_code_name . '_' . $view['settings']->name_single_code, + 'alias' => $this->getSiteEditViewAliasKey($view['settings']->fields ?? null), + 'key' => 'id', + 'form' => true + ]; + } + } + + return $siteEditViews; + } + + /** + * Get the site edit view alias key value + * + * This method fetches the alias keys for a given site edit view by matching the view name + * against a list of admin views. It processes the admin views to find a match and then + * retrieves the alias keys from the matched view's settings. + * + * @param string|null $viewName The view name to match. + * @param array $adminViews The admin views to search within. + * + * @return string|null The alias key for the site edit view, or null if not found. + * @since 3.2.0 + */ + protected function getSiteViewAliasKey(?string $viewName, array $adminViews): ?string + { + // Return early if no view name is provided or admin views are empty. + if ($viewName === null || empty($adminViews)) + { + return null; + } + + foreach ($adminViews as $view) + { + // Check if the current view matches the specified view name and has fields defined. + if ($view['settings']->name_single_code === $viewName && is_array($view['settings']->fields ?? null)) + { + // If a match is found, retrieve and return the site edit view alias keys. + return $this->getSiteEditViewAliasKey($view['settings']->fields); + } + } + + // Return an empty array if no matching view is found. + return null; + } + + /** + * Get the site view alias key value + * + * @param array|null $fields The main get object + * + * @return string|null + * @since 3.2.0 + */ + protected function getSiteEditViewAliasKey(?array $fields): ?string + { + if ($fields !== null) + { + foreach ($fields as $field) + { + if (isset($field['alias']) && $field['alias'] && $field['type_name'] === 'text') + { + return $field['base_name']; + } + } + } + + return null; + } + + /** + * Get the view (main selection) table and view name value + * from the main get object + * + * @param array|null $gets The main get objects + * + * @return array + * @since 3.2.0 + */ + protected function getMainSelection(?array $gets): array + { + if ($gets !== null) + { + foreach ($gets as $get) + { + // get the main table + if (isset($get['as']) + && $get['as'] === 'a' + && isset($get['selection']) + && ArrayHelper::check($get['selection']) + && isset($get['selection']['select_gets']) + && ArrayHelper::check($get['selection']['select_gets']) + && isset($get['selection']['name']) && isset($get['selection']['table'])) + { + $name = $get['selection']['name']; + $view = $get['selection']['view']; + $table = $get['selection']['table']; + + return ['table' => $table, 'view' => $view, 'name' => $name]; + } + } + } + + return []; + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php index e6ed67572..bc76ac23e 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Model/Sqldump.php @@ -38,10 +38,9 @@ class Sqldump /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -51,10 +50,10 @@ class Sqldump * @since 3.2.0 */ - public function __construct(?Registry $registry = null, ?\JDatabaseDriver $db = null) + public function __construct(?Registry $registry = null) { $this->registry = $registry ?: Compiler::_('Registry'); - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php index 314ae6a25..738ec5684 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power.php @@ -144,18 +144,16 @@ class Power implements PowerInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Database object to query local DB * - * @var CMSApplication * @since 3.2.0 **/ - protected CMSApplication $app; + protected $app; /** * Constructor. @@ -165,23 +163,20 @@ class Power implements PowerInterface * @param Customcode|null $customcode The compiler customcode object. * @param Gui|null $gui The compiler customcode gui object. * @param Superpower|null $superpower The JCB superpower object. - * @param \JDatabaseDriver|null $db The Database Driver object. - * @param CMSApplication|null $app The CMS Application object. * * @throws \Exception * @since 3.2.0 */ public function __construct(?Config $config = null, ?Placeholder $placeholder = null, - ?Customcode $customcode = null, ?Gui $gui = null, ?Superpower $superpower = null, - ?\JDatabaseDriver $db = null, ?CMSApplication $app = null) + ?Customcode $customcode = null, ?Gui $gui = null, ?Superpower $superpower = null) { $this->config = $config ?: Compiler::_('Config'); $this->placeholder = $placeholder ?: Compiler::_('Placeholder'); $this->customcode = $customcode ?: Compiler::_('Customcode'); $this->gui = $gui ?: Compiler::_('Customcode.Gui'); $this->superpower = $superpower ?: Compiler::_('Superpower'); - $this->db = $db ?: Factory::getDbo(); - $this->app = $app ?: Factory::getApplication(); + $this->db = Factory::getDbo(); + $this->app = Factory::getApplication(); } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php index 2a0dec87e..648692171 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Autoloader.php @@ -150,7 +150,10 @@ class Autoloader // for now we load it if the plugin is not loaded // but we may want to add a switch that // controls this behaviour. - return !$this->loadPluginAutoloader(); + // return !$this->loadPluginAutoloader(); + // lets load it anyway (can't break anything) + // but we will still like a switch for this + return true; } /** @@ -282,8 +285,8 @@ class Autoloader // we start building the spl_autoload_register function call $autoload_method = []; $autoload_method[] = Indent::_($tabSpace) . '//' - . Line::_(__Line__, __Class__) . ' register this component namespace'; - $autoload_method[] = Indent::_($tabSpace) . 'spl_autoload_register(function ($class) {'; + . Line::_(__Line__, __Class__) . ' register additional namespace'; + $autoload_method[] = Indent::_($tabSpace) . '\spl_autoload_register(function ($class) {'; $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '//' . Line::_(__Line__, __Class__) . ' project-specific base directories and namespace prefix'; $autoload_method[] = Indent::_($tabSpace) . Indent::_(1) . '$search = ['; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php index b1b0c5287..8dafcfb60 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Extractor.php @@ -41,20 +41,18 @@ final class Extractor /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor * - * @param \JDatabaseDriver|null $db The database object. * @since 3.2.0 */ - public function __construct(?\JDatabaseDriver $db = null) + public function __construct() { - $this->db = $db ?: Factory::getDbo(); + $this->db = Factory::getDbo(); } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php index ed1ed4100..41e97e7d4 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Infusion.php @@ -16,7 +16,6 @@ use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Power; use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne as Content; use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti as Contents; -use VDM\Joomla\Componentbuilder\Compiler\Power\Autoloader; use VDM\Joomla\Componentbuilder\Compiler\Power\Parser; use VDM\Joomla\Componentbuilder\Compiler\Power\Repo\Readme as RepoReadme; use VDM\Joomla\Componentbuilder\Compiler\Power\Repos\Readme as ReposReadme; @@ -65,14 +64,6 @@ class Infusion */ protected Contents $contents; - /** - * The Autoloader Class. - * - * @var Autoloader - * @since 3.2.0 - */ - protected Autoloader $autoloader; - /** * The Parser Class. * @@ -140,6 +131,30 @@ class Infusion 'unchanged_licensing_template' => 'licensing_template' ]; + /** + * Power Infusion Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $done = []; + + /** + * Power Content Infusion Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $content_done = []; + + /** + * Path Infusion Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $path_done = []; + /** * Constructor. * @@ -147,7 +162,6 @@ class Infusion * @param Power $power The Power Class. * @param Content $content The ContentOne Class. * @param Contents $contents The ContentMulti Class. - * @param Autoloader $autoloader The Autoloader Class. * @param Parser $parser The Parser Class. * @param RepoReadme $reporeadme The Readme Class. * @param ReposReadme $reposreadme The Readme Class. @@ -157,8 +171,7 @@ class Infusion * @since 3.2.0 */ public function __construct(Config $config, Power $power, Content $content, - Contents $contents, Autoloader $autoloader, - Parser $parser, RepoReadme $reporeadme, + Contents $contents, Parser $parser, RepoReadme $reporeadme, ReposReadme $reposreadme, Placeholder $placeholder, Event $event) { @@ -166,7 +179,6 @@ class Infusion $this->power = $power; $this->content = $content; $this->contents = $contents; - $this->autoloader = $autoloader; $this->parser = $parser; $this->reporeadme = $reporeadme; $this->reposreadme = $reposreadme; @@ -203,8 +215,13 @@ class Infusion // we only do this if super powers are active if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) { - foreach ($this->power->active as $n => &$power) + foreach ($this->power->active as $guid => &$power) { + if (isset($this->done[$guid])) + { + continue; + } + if (ObjectHelper::check($power) && isset($power->main_class_code) && StringHelper::check($power->main_class_code)) { @@ -215,6 +232,9 @@ class Infusion $power->parsed_class_code = $this->parser->code($power->main_class_code); } } + + // do each power just once + $this->done[$guid] = true; } } } @@ -230,17 +250,18 @@ class Infusion // infuse super powers details if set if ($this->config->add_super_powers && ArrayHelper::check($this->power->superpowers)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - foreach ($this->power->superpowers as $path => $powers) { + if (isset($this->path_done[$path])) + { + continue; + } + $key = StringHelper::safe($path); // Trigger Event: jcb_ce_onBeforeInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onBeforeInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onBeforeInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); // we add and all missing powers @@ -260,9 +281,11 @@ class Infusion // Trigger Event: jcb_ce_onAfterInfuseSuperPowerDetails $this->event->trigger( - 'jcb_ce_onAfterInfuseSuperPowerDetails', - array(&$context, &$path, &$key, &$powers) + 'jcb_ce_onAfterInfuseSuperPowerDetails', [&$path, &$key, &$powers] ); + + // do each path just once + $this->path_done[$path] = true; } } } @@ -306,17 +329,18 @@ class Infusion // infuse powers data if set if (ArrayHelper::check($this->power->active)) { - // TODO we need to update the event signatures - $context = $this->config->component_context; - - foreach ($this->power->active as $power) + foreach ($this->power->active as $guid => $power) { + if (isset($this->content_done[$guid])) + { + continue; + } + if (ObjectHelper::check($power)) { // Trigger Event: jcb_ce_onBeforeInfusePowerData $this->event->trigger( - 'jcb_ce_onBeforeInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onBeforeInfusePowerData', [&$power] ); // POWERCODE @@ -333,14 +357,13 @@ class Infusion // Trigger Event: jcb_ce_onAfterInfusePowerData $this->event->trigger( - 'jcb_ce_onAfterInfusePowerData', - array(&$context, &$power) + 'jcb_ce_onAfterInfusePowerData', [&$power] ); } - } - // now set the power autoloader - $this->autoloader->set(); + // do each power just once + $this->content_done[$guid] = true; + } } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php index e650f4b71..246a7acfd 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Injector.php @@ -81,6 +81,22 @@ final class Injector */ protected array $traits = []; + /** + * Other Statements + * + * @var array + * @since 3.2.0 + */ + protected array $other = []; + + /** + * Duplicate Statements + * + * @var array + * @since 3.2.0 + */ + protected array $duplicate = []; + /** * Constructor. * @@ -138,6 +154,8 @@ final class Injector $this->map = []; $this->useStatements = []; $this->traits = []; + $this->other = []; + $this->duplicate = []; foreach ($guids as $key => $guid) { @@ -165,168 +183,200 @@ final class Injector } /** - * inspect the super power + * Inspect the super power to determine the necessary class name based on use statements and traits. + * It checks if the given power (class, trait, etc.) already has a corresponding use statement + * and handles the naming accordingly to avoid conflicts. * - * @param object|null $power The power object. - * @param array|null $useStatements The code use statments - * @param array|null $traits The code traits use statments + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $useStatements Array of existing use statements in the code. + * @param array|null $traits Array of existing traits used in the code. * - * @return string|null The class name (or as name) + * @return string|null The determined class name, or null if the type is not valid. * @since 3.2.0 */ protected function inspect(object $power, ?array $useStatements, ?array $traits): ?string { - if (isset($power->type) && in_array($power->type, ['class', 'abstract class', 'final class', 'trait'])) - { - $statement = 'use ' . $power->_namespace . '\\' . $power->class_name; - // other class names - $use_other = []; - $trait_other = []; - // some tracker globals - $has_use_statement = false; // add if not found - $has_trait_statement = !('trait' === $power->type); // don't add if not trait - $name = null; - $trait_name = null; + $namespaceStatement = $this->buildNamespaceStatment($power); - // check if the name space is loaded - if ($useStatements !== null) + $use_extracted = $this->extractUseStatements($namespaceStatement, $power->class_name, $useStatements); + + $name = $use_extracted['found'] ?? $power->class_name; + + $name = $this->getUniqueName($name, $power); + + $this->handleTraitLogic($name, $power, $traits); + + if (!$use_extracted['hasStatement']) + { + $this->addUseStatement($name, $power->class_name, $namespaceStatement); + } + + return $name; + } + + /** + * Builds the namespace statement from the power object's namespace and class name. + * + * @param object $power The power object. + * + * @return string The constructed use statement. + * @since 3.2.0 + */ + protected function buildNamespaceStatment(object $power): string + { + return $power->_namespace . '\\' . $power->class_name; + } + + /** + * Extracts and processes use statements to find if the current class name is already used. + * It identifies any potential naming conflicts. + * + * @param string $useStatement The search statement of the current class. + * @param string $className The class name of the power object. + * @param array|null $useStatements The existing use statements. + * + * @return array An array with keys 'found' and 'hasStatement'. + * @since 3.2.0 + */ + protected function extractUseStatements(string $useStatement, string $className, ?array $useStatements): array + { + $results = ['found' => null, 'hasStatement' => false]; + + if ($useStatements !== null) + { + foreach ($useStatements as $use_statement) { - foreach ($useStatements as $use_statement) + $class_name = $this->extractClassNameOrAlias($use_statement); + + if ($this->isUseStatementEqual($use_statement, $useStatement)) { - if ($use_statement === $statement . ';' || strpos($use_statement, $statement . ' as ') !== false) + if ($results['found'] === null) { - $name = $this->getName($use_statement); - $has_use_statement = true; + $results['found'] = $class_name; + $results['hasStatement'] = true; } else { - $tmp = $this->getName($use_statement); - if ($power->class_name === $tmp) - { - $use_other[$tmp] = $tmp; - } + // TODO we need to backport fix these + $this->duplicate[$use_statement] = $class_name; } } - } - - // check if the trait is loaded - if (!$has_trait_statement && $traits !== null) - { - $trait_statement = $name ?? $power->class_name; - - foreach ($traits as $trait) + elseif ($className === $class_name) { - if ($trait === $trait_statement) - { - $trait_name = $trait; - $has_trait_statement = true; - } + $this->other[$className] = $class_name; } } - - // build the name - $name = $trait_name ?? $name ?? $power->class_name; - - // if we have a trait we may need to add use and trait - if ('trait' === $power->type) - { - if (!$has_trait_statement) - { - $this->traits[$name] = 'use ' . $name . ';'; - } - } - - // check if we need to update the name - if ($use_other !== []) - { - // set search namespace - $namespace = ($name !== $power->class_name) ? $power->_namespace . '\\' . $power->class_name : $power->_namespace; - - // get the unique name - $name = $this->getUniqueName($name, $namespace, $use_other); - } - - if (!$has_use_statement) - { - // if the name is not the same as class name - if ($name !== $power->class_name) - { - $statement .= ' as ' . $name . ';'; - } - else - { - $statement .= ';'; - } - - $this->useStatements[$name] = $statement; - } - - return $name; } - return null; + return $results; } /** - * Extracts the class name from a use statement. + * Checks if the namespace statement is already declared in the current use statements. * - * @param string $useStatement The use statement from which to extract the class name + * This method uses a regular expression to check for an exact match of the full statement, + * taking into account the possibility of an alias being used. * - * @return string|null The class name or null if not found + * @param string $useStatement The existing use statement to check against. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @return bool True if the full statement is found, false otherwise. + */ + protected function isUseStatementEqual(string $useStatement, string $namespaceStatement): bool + { + // Create a regular expression pattern to match the full statement + // The pattern checks for the start of the statement, optional whitespace, + // and an optional alias after the full statement. + $pattern = '/^use\s+' . preg_quote($namespaceStatement, '/') . '(?:\s+as\s+\w+)?;$/'; + + // Perform the regex match to check if the use statement is equal to the search statment + return (bool) preg_match($pattern, $useStatement); + } + + /** + * Extracts the class name or alias from a use statement. + * + * This method parses a PHP 'use' statement and extracts either the class name or its alias. + * If the statement doesn't match the expected format, or if no class name or alias is found, + * the method returns null. + * + * Example: + * - 'use Namespace\ClassName;' -> returns 'ClassName' + * - 'use Namespace\ClassName as Alias;' -> returns 'Alias' + * + * @param string $useStatement The use statement from which to extract the class name or alias. + * + * @return string|null The class name or alias if found, null otherwise. * @since 3.2.0 */ - protected function getName(string $useStatement): ?string + protected function extractClassNameOrAlias(string $useStatement): ?string { - // If the input doesn't start with 'use ', assume it's a class name without a use statement + // If the input doesn't start with 'use ', assume it's just the namespace without a use statement if (strpos($useStatement, 'use ') !== 0) { - $parts = explode('\\', $useStatement); - $result = end($parts); - - // Remove '\\' from the beginning and end of the resulting string - $result = trim($result, '\\'); - - // If the resulting string is empty, return null - return empty($result) ? null : $result; + return $this->extractLastNameFromNamespace($useStatement); } - $pattern = '/use\s+([\w\\\\]+)(?:\s+as\s+)?([\w]+)?;/'; + // Regular expression to extract the class name and alias from the use statement + $pattern = '/use\s+(?P[\w\\\\]+?)(?:\s+as\s+(?P\w+))?;/'; if (preg_match($pattern, $useStatement, $matches)) { - // If there's an alias, return it - if (!empty($matches[2])) - { - return $matches[2]; - } - - // If there's no alias, extract the class name from the namespace - $parts = explode('\\', $matches[1]); - return end($parts); + // Return the alias if it exists; otherwise, return the last part of the namespace (class name) + return $matches['alias'] ?? $this->extractLastNameFromNamespace($matches['namespace']); } + // Return null if no match is found return null; } /** - * Removes the last space from the namespace. + * Ensures the name for the use statement is unique, avoiding conflicts with other classes. * - * @param string $name The current name - * @param string $namespace The namespace - * @param array $useOther The other use names + * @param string $name The current name + * @param object $power The power object containing type, namespace, and class name. * - * @return string The namespace shortened + * @return string The unique name * @since 3.2.0 */ - protected function getUniqueName(string $name, string $namespace, array $useOther): string + protected function getUniqueName(string $name, object $power): string { - // if the name is already used - while (isset($useOther[$name])) + // set search namespace + $namespace = ($name !== $power->class_name) ? $this->buildNamespaceStatment($power) : $power->_namespace; + + // check if we need to update the name + if (isset($this->other[$name])) { - if (($tmp = $this->getName($namespace)) !== null) + // if the name is already used + while (isset($this->other[$name])) { - $name = ucfirst($tmp) . $name; - $namespace = $this->removeLastSpace($namespace); + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } + } + } + + // also loop new found use statements + if (isset($this->useStatements[$name])) + { + // if the name is already used + while (isset($this->useStatements[$name])) + { + if (($tmp = $this->extractClassNameOrAlias($namespace)) !== null) + { + $name = ucfirst($tmp) . $name; + $namespace = $this->removeLastNameFromNamespace($namespace); + } + else + { + $name = 'Unique' . $name; + } } } @@ -334,14 +384,34 @@ final class Injector } /** - * Removes the last space from the namespace. + * Extracts the last part of a namespace string, which is typically the class name. + * + * @param string $namespace The namespace string to extract from. + * + * @return string|null The extracted class name. + * @since 3.2.0 + */ + protected function extractLastNameFromNamespace(string $namespace): ?string + { + $parts = explode('\\', $namespace); + $result = end($parts); + + // Remove '\\' from the beginning and end of the resulting string + $result = trim($result, '\\'); + + // If the resulting string is empty, return null + return empty($result) ? null : $result; + } + + /** + * Removes the last name from the namespace. * * @param string $namespace The namespace * * @return string The namespace shortened * @since 3.2.0 */ - protected function removeLastSpace(string $namespace): string + protected function removeLastNameFromNamespace(string $namespace): string { // Remove '\\' from the beginning and end of the resulting string $namespace = trim($namespace, '\\'); @@ -355,6 +425,69 @@ final class Injector return implode('\\', $parts); } + /** + * Determines whether a trait statement should be added. + * + * @param object $power The power object. + * + * @return bool True if a trait statement should be added, false otherwise. + * @since 3.2.0 + */ + protected function shouldAddTraitStatement(object $power): bool + { + return $power->type === 'trait'; + } + + /** + * Handles specific logic for traits, such as checking if the trait is already used. + * + * @param string $name The current name. + * @param object $power The power object containing type, namespace, and class name. + * @param array|null $traits The traits used in the code. + * + * @return void + * @since 3.2.0 + */ + protected function handleTraitLogic(string $name, object $power, ?array $traits): void + { + if ($this->shouldAddTraitStatement($power) && $traits !== null) + { + foreach ($traits as $trait) + { + if ($trait === $name) + { + return; + } + } + } + + // add the trait + $this->traits[$name] = 'use ' . $name . ';'; + } + + /** + * Adds a use statement to the class if it's not already present. + * + * @param string $name The name to use. + * @param string $className The class name of the power object. + * @param string $namespaceStatement The search statement to search for (without the trailing semicolon, or use prefix). + * + * @since 3.2.0 + */ + protected function addUseStatement(string &$name, string $className, string $namespaceStatement): void + { + if ($name !== $className) + { + $statement = 'use ' . $namespaceStatement . ' as ' . $name . ';'; + } + else + { + $statement = 'use ' . $namespaceStatement . ';'; + } + + $this->useStatements[$name] = $statement; + } + /** * Insert a line before the class declaration in the given class code. * @@ -405,7 +538,7 @@ final class Injector // Find the position of the comment block right before the class declaration $comment_pattern = '/\s*\*\/\s*$/m'; $insert_pos = null; - if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($comment_pattern, $code, $comment_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $comment_matches[0][1] + strlen($comment_matches[0][0]); } @@ -413,7 +546,7 @@ final class Injector { // Find the last empty line before the class declaration $empty_line_pattern = '/(^|\r\n|\r|\n)[\s]*($|\r\n|\r|\n)/'; - if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, 0, $last_newline_pos)) + if (preg_match($empty_line_pattern, $code, $empty_line_matches, PREG_OFFSET_CAPTURE, $last_newline_pos)) { $insert_pos = (int) $empty_line_matches[0][1] + strlen($empty_line_matches[0][0]); } @@ -444,7 +577,9 @@ final class Injector // Patterns to match the defined('_JEXEC') and defined('JPATH_BASE') lines $patterns = [ "/defined\('_JEXEC'\)(.*?)\s*;/", + "/\\defined\('_JEXEC'\)(.*?)\s*;/", "/defined\('JPATH_BASE'\)(.*?)\s*;/", + "/\\defined\('JPATH_BASE'\)(.*?)\s*;/", ]; $insert_pos = null; diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php index 6178083d6..da6862daa 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Power/Structure.php @@ -48,6 +48,22 @@ class Structure **/ protected array $htaccess = []; + /** + * Power Build Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $done = []; + + /** + * Path Build Tracker + * + * @var array + * @since 3.2.0 + **/ + protected array $path_done = []; + /** * Power Objects * @@ -172,22 +188,21 @@ class Structure { if (ArrayHelper::check($this->power->active)) { - // for plugin event TODO change event api signatures - $powers = $this->power->active; - $component_context = $this->config->component_context; // Trigger Event: jcb_ce_onBeforeSetModules $this->event->trigger( - 'jcb_ce_onBeforeBuildPowers', - array(&$component_context, &$powers) + 'jcb_ce_onBeforeBuildPowers' ); - // for plugin event TODO change event api signatures - $this->power->active = $powers; // set super power details $this->setSuperPowerDetails(); - foreach ($this->power->active as $power) + foreach ($this->power->active as $guid => $power) { + if (isset($this->done[$guid])) + { + continue; + } + if (ObjectHelper::check($power) && isset($power->path) && StringHelper::check( @@ -232,6 +247,9 @@ class Structure // set htaccess once per path $this->setHtaccess($power); + + // do each power just once + $this->done[$guid] = true; } } } @@ -347,6 +365,14 @@ class Structure // check if we should add the dynamic folder moving script to the installer script if (!$this->registry->get('set_move_folders_install_script')) { + $function = 'setDynamicF0ld3rs'; + $script = 'script.php'; + if ($this->config->get('joomla_version', 3) != 3) + { + $function = 'moveFolders'; + $script = 'ComponentnameInstallerScript.php'; + } + // add the setDynamicF0ld3rs() method to the install script.php file $this->registry->set('set_move_folders_install_script', true); @@ -356,7 +382,9 @@ class Structure 'Notice' ); $this->app->enqueueMessage( - Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED'), + Text::sprintf('COM_COMPONENTBUILDER_A_METHOD_S_WAS_ADDED_TO_THE_INSTALL_BSB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED', + $function, $script + ), 'Notice' ); } @@ -374,6 +402,11 @@ class Structure { foreach ($this->power->superpowers as $path => $powers) { + if (isset($this->path_done[$path])) + { + continue; + } + // get existing files $this->loadExistingSuperPower($path); @@ -389,6 +422,9 @@ class Structure // set the super power index file $this->createFile(Placefix::_h('POWERINDEX'), $path, 'super-powers.json', $key); + + // do each path just once + $this->path_done[$path] = true; } } } @@ -440,7 +476,7 @@ class Structure */ private function loadExistingSuperPower(string $repository) { - if (($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null && + if (!isset($this->power->old_superpowers[$repository]) && ($content = FileHelper::getContent($repository . '/super-powers.json', null)) !== null && JsonHelper::check($content)) { $this->power->old_superpowers[$repository] = json_decode($content, true); diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureController.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureController.php new file mode 100644 index 000000000..b6c6820e2 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureController.php @@ -0,0 +1,221 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowAddInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller\AllowAdd as J5ControllerAllowAdd; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowAdd as J4ControllerAllowAdd; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowAdd as J3ControllerAllowAdd; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Controller\AllowEditInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Controller\AllowEdit as J5ControllerAllowEdit; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Controller\AllowEdit as J4ControllerAllowEdit; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Controller\AllowEdit as J3ControllerAllowEdit; + + +/** + * Architecture Controller Service Provider + * + * @since 3.2.0 + */ +class ArchitectureController implements ServiceProviderInterface +{ + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(AllowAddInterface::class, 'Architecture.Controller.AllowAdd') + ->share('Architecture.Controller.AllowAdd', [$this, 'getAllowAdd'], true); + + $container->alias(J5ControllerAllowAdd::class, 'Architecture.Controller.J5.AllowAdd') + ->share('Architecture.Controller.J5.AllowAdd', [$this, 'getJ5ControllerAllowAdd'], true); + + $container->alias(J4ControllerAllowAdd::class, 'Architecture.Controller.J4.AllowAdd') + ->share('Architecture.Controller.J4.AllowAdd', [$this, 'getJ4ControllerAllowAdd'], true); + + $container->alias(J3ControllerAllowAdd::class, 'Architecture.Controller.J3.AllowAdd') + ->share('Architecture.Controller.J3.AllowAdd', [$this, 'getJ3ControllerAllowAdd'], true); + + $container->alias(AllowEditInterface::class, 'Architecture.Controller.AllowEdit') + ->share('Architecture.Controller.AllowEdit', [$this, 'getAllowEdit'], true); + + $container->alias(J5ControllerAllowEdit::class, 'Architecture.Controller.J5.AllowEdit') + ->share('Architecture.Controller.J5.AllowEdit', [$this, 'getJ5ControllerAllowEdit'], true); + + $container->alias(J4ControllerAllowEdit::class, 'Architecture.Controller.J4.AllowEdit') + ->share('Architecture.Controller.J4.AllowEdit', [$this, 'getJ4ControllerAllowEdit'], true); + + $container->alias(J3ControllerAllowEdit::class, 'Architecture.Controller.J3.AllowEdit') + ->share('Architecture.Controller.J3.AllowEdit', [$this, 'getJ3ControllerAllowEdit'], true); + } + + /** + * Get The AllowAddInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowAddInterface + * @since 3.2.0 + */ + public function getAllowAdd(Container $container): AllowAddInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowAdd'); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J5ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ5ControllerAllowAdd(Container $container): J5ControllerAllowAdd + { + return new J5ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ4ControllerAllowAdd(Container $container): J4ControllerAllowAdd + { + return new J4ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowAdd Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowAdd + * @since 3.2.0 + */ + public function getJ3ControllerAllowAdd(Container $container): J3ControllerAllowAdd + { + return new J3ControllerAllowAdd( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser') + ); + } + + /** + * Get The AllowEditInterface Class. + * + * @param Container $container The DI container. + * + * @return AllowEditInterface + * @since 3.2.0 + */ + public function getAllowEdit(Container $container): AllowEditInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Controller.J' . $this->targetVersion . '.AllowEdit'); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J5ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ5ControllerAllowEdit(Container $container): J5ControllerAllowEdit + { + return new J5ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J4ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ4ControllerAllowEdit(Container $container): J4ControllerAllowEdit + { + return new J4ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } + + /** + * Get The AllowEdit Class. + * + * @param Container $container The DI container. + * + * @return J3ControllerAllowEdit + * @since 3.2.0 + */ + public function getJ3ControllerAllowEdit(Container $container): J3ControllerAllowEdit + { + return new J3ControllerAllowEdit( + $container->get('Config'), + $container->get('Compiler.Creator.Permission'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Category.Other.Name') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureModel.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureModel.php new file mode 100644 index 000000000..b3e6b762d --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/ArchitectureModel.php @@ -0,0 +1,209 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanDeleteInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model\CanDelete as J5ModelCanDelete; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanDelete as J4ModelCanDelete; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanDelete as J3ModelCanDelete; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Architecture\Model\CanEditStateInterface; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFive\Model\CanEditState as J5ModelCanEditState; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaFour\Model\CanEditState as J4ModelCanEditState; +use VDM\Joomla\Componentbuilder\Compiler\Architecture\JoomlaThree\Model\CanEditState as J3ModelCanEditState; + + +/** + * Architecture Model Service Provider + * + * @since 3.2.0 + */ +class ArchitectureModel implements ServiceProviderInterface +{ + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3ModelCanDelete::class, 'Architecture.Model.J3.CanDelete') + ->share('Architecture.Model.J3.CanDelete', [$this, 'getJ3ModelCanDelete'], true); + + $container->alias(J4ModelCanDelete::class, 'Architecture.Model.J4.CanDelete') + ->share('Architecture.Model.J4.CanDelete', [$this, 'getJ4ModelCanDelete'], true); + + $container->alias(J5ModelCanDelete::class, 'Architecture.Model.J5.CanDelete') + ->share('Architecture.Model.J5.CanDelete', [$this, 'getJ5ModelCanDelete'], true); + + $container->alias(CanDeleteInterface::class, 'Architecture.Model.CanDelete') + ->share('Architecture.Model.CanDelete', [$this, 'getModelCanDelete'], true); + + $container->alias(J3ModelCanEditState::class, 'Architecture.Model.J3.CanEditState') + ->share('Architecture.Model.J3.CanEditState', [$this, 'getJ3ModelCanEditState'], true); + + $container->alias(J4ModelCanEditState::class, 'Architecture.Model.J4.CanEditState') + ->share('Architecture.Model.J4.CanEditState', [$this, 'getJ4ModelCanEditState'], true); + + $container->alias(J5ModelCanEditState::class, 'Architecture.Model.J5.CanEditState') + ->share('Architecture.Model.J5.CanEditState', [$this, 'getJ5ModelCanEditState'], true); + + $container->alias(CanEditStateInterface::class, 'Architecture.Model.CanEditState') + ->share('Architecture.Model.CanEditState', [$this, 'getModelCanEditState'], true); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return CanDeleteInterface + * @since 3.2.0 + */ + public function getModelCanDelete(Container $container): CanDeleteInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanDelete'); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J5ModelCanDelete + * @since 3.2.0 + */ + public function getJ5ModelCanDelete(Container $container): J5ModelCanDelete + { + return new J5ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanDelete + * @since 3.2.0 + */ + public function getJ4ModelCanDelete(Container $container): J4ModelCanDelete + { + return new J4ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model CanDelete Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanDelete + * @since 3.2.0 + */ + public function getJ3ModelCanDelete(Container $container): J3ModelCanDelete + { + return new J3ModelCanDelete( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return CanEditStateInterface + * @since 3.2.0 + */ + public function getModelCanEditState(Container $container): CanEditStateInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Architecture.Model.J' . $this->targetVersion . '.CanEditState'); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J5ModelCanEditState + * @since 3.2.0 + */ + public function getJ5ModelCanEditState(Container $container): J5ModelCanEditState + { + return new J5ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J4ModelCanEditState + * @since 3.2.0 + */ + public function getJ4ModelCanEditState(Container $container): J4ModelCanEditState + { + return new J4ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The Model Can Edit State Class. + * + * @param Container $container The DI container. + * + * @return J3ModelCanEditState + * @since 3.2.0 + */ + public function getJ3ModelCanEditState(Container $container): J3ModelCanEditState + { + return new J3ModelCanEditState( + $container->get('Config'), + $container->get('Compiler.Creator.Permission') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderAJ.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderAJ.php new file mode 100644 index 000000000..61eae650f --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderAJ.php @@ -0,0 +1,870 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitch; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AssetsRules; +use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Alias; +use VDM\Joomla\Componentbuilder\Compiler\Builder\BaseSixFour; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CheckBox; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ComponentFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ConfigFieldsetsCustomfield; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Contributors; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomAlias; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomField; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomFieldLinks; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomList; +use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseKeys; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseTables; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueGuid; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueKeys; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUninstall; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DoNotEscape; +use VDM\Joomla\Componentbuilder\Compiler\Builder\DynamicFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionsParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldNames; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldRelations; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts; +use VDM\Joomla\Componentbuilder\Compiler\Builder\FrontendParams; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GetAsLookup; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule; +use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasMenuGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions; +use VDM\Joomla\Componentbuilder\Compiler\Builder\HiddenFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\History; +use VDM\Joomla\Componentbuilder\Compiler\Builder\IntegerFields; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodEximportString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodListString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItem; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItemArray; +use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonString; + + +/** + * Builder A-J Service Provider + * + * @since 3.2.0 + */ +class BuilderAJ implements ServiceProviderInterface +{ + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') + ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); + + $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') + ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); + + $container->alias(AssetsRules::class, 'Compiler.Builder.Assets.Rules') + ->share('Compiler.Builder.Assets.Rules', [$this, 'getAssetsRules'], true); + + $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') + ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); + + $container->alias(Alias::class, 'Compiler.Builder.Alias') + ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); + + $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') + ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); + + $container->alias(Category::class, 'Compiler.Builder.Category') + ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); + + $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') + ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); + + $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') + ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); + + $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') + ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); + + $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') + ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Builder.Config.Fieldsets') + ->share('Compiler.Builder.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Builder.Config.Fieldsets.Customfield') + ->share('Compiler.Builder.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') + ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); + + $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') + ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); + + $container->alias(Contributors::class, 'Compiler.Builder.Contributors') + ->share('Compiler.Builder.Contributors', [$this, 'getContributors'], true); + + $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') + ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); + + $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') + ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); + + $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') + ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); + + $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') + ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); + + $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') + ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); + + $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') + ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); + + $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') + ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); + + $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') + ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); + + $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') + ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); + + $container->alias(DatabaseUninstall::class, 'Compiler.Builder.Database.Uninstall') + ->share('Compiler.Builder.Database.Uninstall', [$this, 'getDatabaseUninstall'], true); + + $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') + ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); + + $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') + ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); + + $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') + ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); + + $container->alias(ExtensionsParams::class, 'Compiler.Builder.Extensions.Params') + ->share('Compiler.Builder.Extensions.Params', [$this, 'getExtensionsParams'], true); + + $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') + ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); + + $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') + ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); + + $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') + ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); + + $container->alias(Filter::class, 'Compiler.Builder.Filter') + ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); + + $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') + ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); + + $container->alias(FrontendParams::class, 'Compiler.Builder.Frontend.Params') + ->share('Compiler.Builder.Frontend.Params', [$this, 'getFrontendParams'], true); + + $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') + ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); + + $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') + ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); + + $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') + ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); + + $container->alias(HasMenuGlobal::class, 'Compiler.Builder.Has.Menu.Global') + ->share('Compiler.Builder.Has.Menu.Global', [$this, 'getHasMenuGlobal'], true); + + $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') + ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); + + $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') + ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); + + $container->alias(History::class, 'Compiler.Builder.History') + ->share('Compiler.Builder.History', [$this, 'getHistory'], true); + + $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') + ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); + + $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') + ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); + + $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') + ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); + + $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') + ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); + + $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') + ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); + + $container->alias(JsonString::class, 'Compiler.Builder.Json.String') + ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + } + + /** + * Get The AccessSwitch Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitch + * @since 3.2.0 + */ + public function getAccessSwitch(Container $container): AccessSwitch + { + return new AccessSwitch(); + } + + /** + * Get The AccessSwitchList Class. + * + * @param Container $container The DI container. + * + * @return AccessSwitchList + * @since 3.2.0 + */ + public function getAccessSwitchList(Container $container): AccessSwitchList + { + return new AccessSwitchList(); + } + + /** + * Get The AssetsRules Class. + * + * @param Container $container The DI container. + * + * @return AssetsRules + * @since 3.2.0 + */ + public function getAssetsRules(Container $container): AssetsRules + { + return new AssetsRules(); + } + + /** + * Get The AdminFilterType Class. + * + * @param Container $container The DI container. + * + * @return AdminFilterType + * @since 3.2.0 + */ + public function getAdminFilterType(Container $container): AdminFilterType + { + return new AdminFilterType(); + } + + /** + * Get The Alias Class. + * + * @param Container $container The DI container. + * + * @return Alias + * @since 3.2.0 + */ + public function getAlias(Container $container): Alias + { + return new Alias(); + } + + /** + * Get The BaseSixFour Class. + * + * @param Container $container The DI container. + * + * @return BaseSixFour + * @since 3.2.0 + */ + public function getBaseSixFour(Container $container): BaseSixFour + { + return new BaseSixFour(); + } + + /** + * Get The Category Class. + * + * @param Container $container The DI container. + * + * @return Category + * @since 3.2.0 + */ + public function getCategory(Container $container): Category + { + return new Category(); + } + + /** + * Get The CategoryCode Class. + * + * @param Container $container The DI container. + * + * @return CategoryCode + * @since 3.2.0 + */ + public function getCategoryCode(Container $container): CategoryCode + { + return new CategoryCode(); + } + + /** + * Get The CategoryOtherName Class. + * + * @param Container $container The DI container. + * + * @return CategoryOtherName + * @since 3.2.0 + */ + public function getCategoryOtherName(Container $container): CategoryOtherName + { + return new CategoryOtherName(); + } + + /** + * Get The CheckBox Class. + * + * @param Container $container The DI container. + * + * @return CheckBox + * @since 3.2.0 + */ + public function getCheckBox(Container $container): CheckBox + { + return new CheckBox(); + } + + /** + * Get The ComponentFields Class. + * + * @param Container $container The DI container. + * + * @return ComponentFields + * @since 3.2.0 + */ + public function getComponentFields(Container $container): ComponentFields + { + return new ComponentFields(); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets(); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield(); + } + + /** + * Get The ContentMulti Class. + * + * @param Container $container The DI container. + * + * @return ContentMulti + * @since 3.2.0 + */ + public function getContentMulti(Container $container): ContentMulti + { + return new ContentMulti(); + } + + /** + * Get The ContentOne Class. + * + * @param Container $container The DI container. + * + * @return ContentOne + * @since 3.2.0 + */ + public function getContentOne(Container $container): ContentOne + { + return new ContentOne(); + } + + /** + * Get The Contributors Class. + * + * @param Container $container The DI container. + * + * @return Contributors + * @since 3.2.0 + */ + public function getContributors(Container $container): Contributors + { + return new Contributors(); + } + + /** + * Get The CustomAlias Class. + * + * @param Container $container The DI container. + * + * @return CustomAlias + * @since 3.2.0 + */ + public function getCustomAlias(Container $container): CustomAlias + { + return new CustomAlias(); + } + + /** + * Get The CustomField Class. + * + * @param Container $container The DI container. + * + * @return CustomField + * @since 3.2.0 + */ + public function getCustomField(Container $container): CustomField + { + return new CustomField(); + } + + /** + * Get The CustomFieldLinks Class. + * + * @param Container $container The DI container. + * + * @return CustomFieldLinks + * @since 3.2.0 + */ + public function getCustomFieldLinks(Container $container): CustomFieldLinks + { + return new CustomFieldLinks(); + } + + /** + * Get The CustomList Class. + * + * @param Container $container The DI container. + * + * @return CustomList + * @since 3.2.0 + */ + public function getCustomList(Container $container): CustomList + { + return new CustomList(); + } + + /** + * Get The CustomTabs Class. + * + * @param Container $container The DI container. + * + * @return CustomTabs + * @since 3.2.0 + */ + public function getCustomTabs(Container $container): CustomTabs + { + return new CustomTabs(); + } + + /** + * Get The DatabaseKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseKeys + * @since 3.2.0 + */ + public function getDatabaseKeys(Container $container): DatabaseKeys + { + return new DatabaseKeys(); + } + + /** + * Get The DatabaseTables Class. + * + * @param Container $container The DI container. + * + * @return DatabaseTables + * @since 3.2.0 + */ + public function getDatabaseTables(Container $container): DatabaseTables + { + return new DatabaseTables(); + } + + /** + * Get The DatabaseUniqueGuid Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueGuid + * @since 3.2.0 + */ + public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid + { + return new DatabaseUniqueGuid(); + } + + /** + * Get The DatabaseUniqueKeys Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUniqueKeys + * @since 3.2.0 + */ + public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys + { + return new DatabaseUniqueKeys(); + } + + /** + * Get The DatabaseUninstall Class. + * + * @param Container $container The DI container. + * + * @return DatabaseUninstall + * @since 3.2.0 + */ + public function getDatabaseUninstall(Container $container): DatabaseUninstall + { + return new DatabaseUninstall(); + } + + /** + * Get The DoNotEscape Class. + * + * @param Container $container The DI container. + * + * @return DoNotEscape + * @since 3.2.0 + */ + public function getDoNotEscape(Container $container): DoNotEscape + { + return new DoNotEscape(); + } + + /** + * Get The DynamicFields Class. + * + * @param Container $container The DI container. + * + * @return DynamicFields + * @since 3.2.0 + */ + public function getDynamicFields(Container $container): DynamicFields + { + return new DynamicFields(); + } + + /** + * Get The ExtensionCustomFields Class. + * + * @param Container $container The DI container. + * + * @return ExtensionCustomFields + * @since 3.2.0 + */ + public function getExtensionCustomFields(Container $container): ExtensionCustomFields + { + return new ExtensionCustomFields(); + } + + /** + * Get The ExtensionsParams Class. + * + * @param Container $container The DI container. + * + * @return ExtensionsParams + * @since 3.2.0 + */ + public function getExtensionsParams(Container $container): ExtensionsParams + { + return new ExtensionsParams(); + } + + /** + * Get The FieldGroupControl Class. + * + * @param Container $container The DI container. + * + * @return FieldGroupControl + * @since 3.2.0 + */ + public function getFieldGroupControl(Container $container): FieldGroupControl + { + return new FieldGroupControl(); + } + + /** + * Get The FieldNames Class. + * + * @param Container $container The DI container. + * + * @return FieldNames + * @since 3.2.0 + */ + public function getFieldNames(Container $container): FieldNames + { + return new FieldNames(); + } + + /** + * Get The FieldRelations Class. + * + * @param Container $container The DI container. + * + * @return FieldRelations + * @since 3.2.0 + */ + public function getFieldRelations(Container $container): FieldRelations + { + return new FieldRelations(); + } + + /** + * Get The Filter Class. + * + * @param Container $container The DI container. + * + * @return Filter + * @since 3.2.0 + */ + public function getFilter(Container $container): Filter + { + return new Filter(); + } + + /** + * Get The FootableScripts Class. + * + * @param Container $container The DI container. + * + * @return FootableScripts + * @since 3.2.0 + */ + public function getFootableScripts(Container $container): FootableScripts + { + return new FootableScripts(); + } + + /** + * Get The FrontendParams Class. + * + * @param Container $container The DI container. + * + * @return FrontendParams + * @since 3.2.0 + */ + public function getFrontendParams(Container $container): FrontendParams + { + return new FrontendParams(); + } + + /** + * Get The GetAsLookup Class. + * + * @param Container $container The DI container. + * + * @return GetAsLookup + * @since 3.2.0 + */ + public function getGetAsLookup(Container $container): GetAsLookup + { + return new GetAsLookup(); + } + + /** + * Get The GetModule Class. + * + * @param Container $container The DI container. + * + * @return GetModule + * @since 3.2.0 + */ + public function getGetModule(Container $container): GetModule + { + return new GetModule(); + } + + /** + * Get The GoogleChart Class. + * + * @param Container $container The DI container. + * + * @return GoogleChart + * @since 3.2.0 + */ + public function getGoogleChart(Container $container): GoogleChart + { + return new GoogleChart(); + } + + /** + * Get The HasMenuGlobal Class. + * + * @param Container $container The DI container. + * + * @return HasMenuGlobal + * @since 3.2.0 + */ + public function getHasMenuGlobal(Container $container): HasMenuGlobal + { + return new HasMenuGlobal(); + } + + /** + * Get The HasPermissions Class. + * + * @param Container $container The DI container. + * + * @return HasPermissions + * @since 3.2.0 + */ + public function getHasPermissions(Container $container): HasPermissions + { + return new HasPermissions(); + } + + /** + * Get The HiddenFields Class. + * + * @param Container $container The DI container. + * + * @return HiddenFields + * @since 3.2.0 + */ + public function getHiddenFields(Container $container): HiddenFields + { + return new HiddenFields(); + } + + /** + * Get The History Class. + * + * @param Container $container The DI container. + * + * @return History + * @since 3.2.0 + */ + public function getHistory(Container $container): History + { + return new History(); + } + + /** + * Get The IntegerFields Class. + * + * @param Container $container The DI container. + * + * @return IntegerFields + * @since 3.2.0 + */ + public function getIntegerFields(Container $container): IntegerFields + { + return new IntegerFields(); + } + + /** + * Get The ItemsMethodEximportString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodEximportString + * @since 3.2.0 + */ + public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString + { + return new ItemsMethodEximportString(); + } + + /** + * Get The ItemsMethodListString Class. + * + * @param Container $container The DI container. + * + * @return ItemsMethodListString + * @since 3.2.0 + */ + public function getItemsMethodListString(Container $container): ItemsMethodListString + { + return new ItemsMethodListString(); + } + + /** + * Get The JsonItem Class. + * + * @param Container $container The DI container. + * + * @return JsonItem + * @since 3.2.0 + */ + public function getJsonItem(Container $container): JsonItem + { + return new JsonItem(); + } + + /** + * Get The JsonItemArray Class. + * + * @param Container $container The DI container. + * + * @return JsonItemArray + * @since 3.2.0 + */ + public function getJsonItemArray(Container $container): JsonItemArray + { + return new JsonItemArray(); + } + + /** + * Get The JsonString Class. + * + * @param Container $container The DI container. + * + * @return JsonString + * @since 3.2.0 + */ + public function getJsonString(Container $container): JsonString + { + return new JsonString(); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Builder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderLZ.php similarity index 54% rename from libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Builder.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderLZ.php index 8e5f73592..b6421dd92 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Builder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/BuilderLZ.php @@ -14,47 +14,7 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitch; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AccessSwitchList; -use VDM\Joomla\Componentbuilder\Compiler\Builder\AdminFilterType; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Alias; -use VDM\Joomla\Componentbuilder\Compiler\Builder\BaseSixFour; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Category; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryCode; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CategoryOtherName; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CheckBox; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ComponentFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentMulti; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ContentOne; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomAlias; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomField; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomFieldLinks; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomList; -use VDM\Joomla\Componentbuilder\Compiler\Builder\CustomTabs; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseKeys; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseTables; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueGuid; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DatabaseUniqueKeys; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DoNotEscape; -use VDM\Joomla\Componentbuilder\Compiler\Builder\DynamicFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ExtensionCustomFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldGroupControl; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldNames; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FieldRelations; -use VDM\Joomla\Componentbuilder\Compiler\Builder\Filter; -use VDM\Joomla\Componentbuilder\Compiler\Builder\FootableScripts; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GetAsLookup; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GetModule; -use VDM\Joomla\Componentbuilder\Compiler\Builder\GoogleChart; -use VDM\Joomla\Componentbuilder\Compiler\Builder\HasPermissions; -use VDM\Joomla\Componentbuilder\Compiler\Builder\HiddenFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\History; -use VDM\Joomla\Componentbuilder\Compiler\Builder\IntegerFields; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodEximportString; -use VDM\Joomla\Componentbuilder\Compiler\Builder\ItemsMethodListString; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItem; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonItemArray; -use VDM\Joomla\Componentbuilder\Compiler\Builder\JsonString; +use VDM\Joomla\Componentbuilder\Compiler\Builder\LanguageMessages; use VDM\Joomla\Componentbuilder\Compiler\Builder\Layout; use VDM\Joomla\Componentbuilder\Compiler\Builder\LayoutData; use VDM\Joomla\Componentbuilder\Compiler\Builder\LibraryManager; @@ -83,8 +43,11 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionAction; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionComponent; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionCore; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionDashboard; +use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionFields; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionGlobalAction; use VDM\Joomla\Componentbuilder\Compiler\Builder\PermissionViews; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Request; +use VDM\Joomla\Componentbuilder\Compiler\Builder\Router; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptMediaSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\ScriptUserSwitch; use VDM\Joomla\Componentbuilder\Compiler\Builder\Search; @@ -103,14 +66,15 @@ use VDM\Joomla\Componentbuilder\Compiler\Builder\TemplateData; use VDM\Joomla\Componentbuilder\Compiler\Builder\Title; use VDM\Joomla\Componentbuilder\Compiler\Builder\UikitComp; use VDM\Joomla\Componentbuilder\Compiler\Builder\UpdateMysql; +use VDM\Joomla\Componentbuilder\Compiler\Builder\ViewsDefaultOrdering; /** - * Builder Service Provider + * Builder L-Z Service Provider * * @since 3.2.0 */ -class Builder implements ServiceProviderInterface +class BuilderLZ implements ServiceProviderInterface { /** * Registers the service provider with a DI container. @@ -122,128 +86,8 @@ class Builder implements ServiceProviderInterface */ public function register(Container $container) { - $container->alias(AccessSwitch::class, 'Compiler.Builder.Access.Switch') - ->share('Compiler.Builder.Access.Switch', [$this, 'getAccessSwitch'], true); - - $container->alias(AccessSwitchList::class, 'Compiler.Builder.Access.Switch.List') - ->share('Compiler.Builder.Access.Switch.List', [$this, 'getAccessSwitchList'], true); - - $container->alias(AdminFilterType::class, 'Compiler.Builder.Admin.Filter.Type') - ->share('Compiler.Builder.Admin.Filter.Type', [$this, 'getAdminFilterType'], true); - - $container->alias(Alias::class, 'Compiler.Builder.Alias') - ->share('Compiler.Builder.Alias', [$this, 'getAlias'], true); - - $container->alias(BaseSixFour::class, 'Compiler.Builder.Base.Six.Four') - ->share('Compiler.Builder.Base.Six.Four', [$this, 'getBaseSixFour'], true); - - $container->alias(Category::class, 'Compiler.Builder.Category') - ->share('Compiler.Builder.Category', [$this, 'getCategory'], true); - - $container->alias(CategoryCode::class, 'Compiler.Builder.Category.Code') - ->share('Compiler.Builder.Category.Code', [$this, 'getCategoryCode'], true); - - $container->alias(CategoryOtherName::class, 'Compiler.Builder.Category.Other.Name') - ->share('Compiler.Builder.Category.Other.Name', [$this, 'getCategoryOtherName'], true); - - $container->alias(CheckBox::class, 'Compiler.Builder.Check.Box') - ->share('Compiler.Builder.Check.Box', [$this, 'getCheckBox'], true); - - $container->alias(ComponentFields::class, 'Compiler.Builder.Component.Fields') - ->share('Compiler.Builder.Component.Fields', [$this, 'getComponentFields'], true); - - $container->alias(ContentMulti::class, 'Compiler.Builder.Content.Multi') - ->share('Compiler.Builder.Content.Multi', [$this, 'getContentMulti'], true); - - $container->alias(ContentOne::class, 'Compiler.Builder.Content.One') - ->share('Compiler.Builder.Content.One', [$this, 'getContentOne'], true); - - $container->alias(CustomAlias::class, 'Compiler.Builder.Custom.Alias') - ->share('Compiler.Builder.Custom.Alias', [$this, 'getCustomAlias'], true); - - $container->alias(CustomField::class, 'Compiler.Builder.Custom.Field') - ->share('Compiler.Builder.Custom.Field', [$this, 'getCustomField'], true); - - $container->alias(CustomFieldLinks::class, 'Compiler.Builder.Custom.Field.Links') - ->share('Compiler.Builder.Custom.Field.Links', [$this, 'getCustomFieldLinks'], true); - - $container->alias(CustomList::class, 'Compiler.Builder.Custom.List') - ->share('Compiler.Builder.Custom.List', [$this, 'getCustomList'], true); - - $container->alias(CustomTabs::class, 'Compiler.Builder.Custom.Tabs') - ->share('Compiler.Builder.Custom.Tabs', [$this, 'getCustomTabs'], true); - - $container->alias(DatabaseKeys::class, 'Compiler.Builder.Database.Keys') - ->share('Compiler.Builder.Database.Keys', [$this, 'getDatabaseKeys'], true); - - $container->alias(DatabaseTables::class, 'Compiler.Builder.Database.Tables') - ->share('Compiler.Builder.Database.Tables', [$this, 'getDatabaseTables'], true); - - $container->alias(DatabaseUniqueGuid::class, 'Compiler.Builder.Database.Unique.Guid') - ->share('Compiler.Builder.Database.Unique.Guid', [$this, 'getDatabaseUniqueGuid'], true); - - $container->alias(DatabaseUniqueKeys::class, 'Compiler.Builder.Database.Unique.Keys') - ->share('Compiler.Builder.Database.Unique.Keys', [$this, 'getDatabaseUniqueKeys'], true); - - $container->alias(DoNotEscape::class, 'Compiler.Builder.Do.Not.Escape') - ->share('Compiler.Builder.Do.Not.Escape', [$this, 'getDoNotEscape'], true); - - $container->alias(DynamicFields::class, 'Compiler.Builder.Dynamic.Fields') - ->share('Compiler.Builder.Dynamic.Fields', [$this, 'getDynamicFields'], true); - - $container->alias(ExtensionCustomFields::class, 'Compiler.Builder.Extension.Custom.Fields') - ->share('Compiler.Builder.Extension.Custom.Fields', [$this, 'getExtensionCustomFields'], true); - - $container->alias(FieldGroupControl::class, 'Compiler.Builder.Field.Group.Control') - ->share('Compiler.Builder.Field.Group.Control', [$this, 'getFieldGroupControl'], true); - - $container->alias(FieldNames::class, 'Compiler.Builder.Field.Names') - ->share('Compiler.Builder.Field.Names', [$this, 'getFieldNames'], true); - - $container->alias(FieldRelations::class, 'Compiler.Builder.Field.Relations') - ->share('Compiler.Builder.Field.Relations', [$this, 'getFieldRelations'], true); - - $container->alias(Filter::class, 'Compiler.Builder.Filter') - ->share('Compiler.Builder.Filter', [$this, 'getFilter'], true); - - $container->alias(FootableScripts::class, 'Compiler.Builder.Footable.Scripts') - ->share('Compiler.Builder.Footable.Scripts', [$this, 'getFootableScripts'], true); - - $container->alias(GetAsLookup::class, 'Compiler.Builder.Get.As.Lookup') - ->share('Compiler.Builder.Get.As.Lookup', [$this, 'getGetAsLookup'], true); - - $container->alias(GetModule::class, 'Compiler.Builder.Get.Module') - ->share('Compiler.Builder.Get.Module', [$this, 'getGetModule'], true); - - $container->alias(GoogleChart::class, 'Compiler.Builder.Google.Chart') - ->share('Compiler.Builder.Google.Chart', [$this, 'getGoogleChart'], true); - - $container->alias(HasPermissions::class, 'Compiler.Builder.Has.Permissions') - ->share('Compiler.Builder.Has.Permissions', [$this, 'getHasPermissions'], true); - - $container->alias(HiddenFields::class, 'Compiler.Builder.Hidden.Fields') - ->share('Compiler.Builder.Hidden.Fields', [$this, 'getHiddenFields'], true); - - $container->alias(History::class, 'Compiler.Builder.History') - ->share('Compiler.Builder.History', [$this, 'getHistory'], true); - - $container->alias(IntegerFields::class, 'Compiler.Builder.Integer.Fields') - ->share('Compiler.Builder.Integer.Fields', [$this, 'getIntegerFields'], true); - - $container->alias(ItemsMethodEximportString::class, 'Compiler.Builder.Items.Method.Eximport.String') - ->share('Compiler.Builder.Items.Method.Eximport.String', [$this, 'getItemsMethodEximportString'], true); - - $container->alias(ItemsMethodListString::class, 'Compiler.Builder.Items.Method.List.String') - ->share('Compiler.Builder.Items.Method.List.String', [$this, 'getItemsMethodListString'], true); - - $container->alias(JsonItem::class, 'Compiler.Builder.Json.Item') - ->share('Compiler.Builder.Json.Item', [$this, 'getJsonItem'], true); - - $container->alias(JsonItemArray::class, 'Compiler.Builder.Json.Item.Array') - ->share('Compiler.Builder.Json.Item.Array', [$this, 'getJsonItemArray'], true); - - $container->alias(JsonString::class, 'Compiler.Builder.Json.String') - ->share('Compiler.Builder.Json.String', [$this, 'getJsonString'], true); + $container->alias(LanguageMessages::class, 'Compiler.Builder.Language.Messages') + ->share('Compiler.Builder.Language.Messages', [$this, 'getLanguageMessages'], true); $container->alias(Layout::class, 'Compiler.Builder.Layout') ->share('Compiler.Builder.Layout', [$this, 'getLayout'], true); @@ -329,12 +173,21 @@ class Builder implements ServiceProviderInterface $container->alias(PermissionDashboard::class, 'Compiler.Builder.Permission.Dashboard') ->share('Compiler.Builder.Permission.Dashboard', [$this, 'getPermissionDashboard'], true); + $container->alias(PermissionFields::class, 'Compiler.Builder.Permission.Fields') + ->share('Compiler.Builder.Permission.Fields', [$this, 'getPermissionFields'], true); + $container->alias(PermissionGlobalAction::class, 'Compiler.Builder.Permission.Global.Action') ->share('Compiler.Builder.Permission.Global.Action', [$this, 'getPermissionGlobalAction'], true); $container->alias(PermissionViews::class, 'Compiler.Builder.Permission.Views') ->share('Compiler.Builder.Permission.Views', [$this, 'getPermissionViews'], true); + $container->alias(Request::class, 'Compiler.Builder.Request') + ->share('Compiler.Builder.Request', [$this, 'getRequest'], true); + + $container->alias(Router::class, 'Compiler.Builder.Router') + ->share('Compiler.Builder.Router', [$this, 'getRouter'], true); + $container->alias(ScriptMediaSwitch::class, 'Compiler.Builder.Script.Media.Switch') ->share('Compiler.Builder.Script.Media.Switch', [$this, 'getScriptMediaSwitch'], true); @@ -388,539 +241,22 @@ class Builder implements ServiceProviderInterface $container->alias(UpdateMysql::class, 'Compiler.Builder.Update.Mysql') ->share('Compiler.Builder.Update.Mysql', [$this, 'getUpdateMysql'], true); + + $container->alias(ViewsDefaultOrdering::class, 'Compiler.Builder.Views.Default.Ordering') + ->share('Compiler.Builder.Views.Default.Ordering', [$this, 'getViewsDefaultOrdering'], true); } /** - * Get The AccessSwitch Class. + * Get The LanguageMessages Class. * * @param Container $container The DI container. * - * @return AccessSwitch + * @return LanguageMessages * @since 3.2.0 */ - public function getAccessSwitch(Container $container): AccessSwitch + public function getLanguageMessages(Container $container): LanguageMessages { - return new AccessSwitch(); - } - - /** - * Get The AccessSwitchList Class. - * - * @param Container $container The DI container. - * - * @return AccessSwitchList - * @since 3.2.0 - */ - public function getAccessSwitchList(Container $container): AccessSwitchList - { - return new AccessSwitchList(); - } - - /** - * Get The AdminFilterType Class. - * - * @param Container $container The DI container. - * - * @return AdminFilterType - * @since 3.2.0 - */ - public function getAdminFilterType(Container $container): AdminFilterType - { - return new AdminFilterType(); - } - - /** - * Get The Alias Class. - * - * @param Container $container The DI container. - * - * @return Alias - * @since 3.2.0 - */ - public function getAlias(Container $container): Alias - { - return new Alias(); - } - - /** - * Get The BaseSixFour Class. - * - * @param Container $container The DI container. - * - * @return BaseSixFour - * @since 3.2.0 - */ - public function getBaseSixFour(Container $container): BaseSixFour - { - return new BaseSixFour(); - } - - /** - * Get The Category Class. - * - * @param Container $container The DI container. - * - * @return Category - * @since 3.2.0 - */ - public function getCategory(Container $container): Category - { - return new Category(); - } - - /** - * Get The CategoryCode Class. - * - * @param Container $container The DI container. - * - * @return CategoryCode - * @since 3.2.0 - */ - public function getCategoryCode(Container $container): CategoryCode - { - return new CategoryCode(); - } - - /** - * Get The CategoryOtherName Class. - * - * @param Container $container The DI container. - * - * @return CategoryOtherName - * @since 3.2.0 - */ - public function getCategoryOtherName(Container $container): CategoryOtherName - { - return new CategoryOtherName(); - } - - /** - * Get The CheckBox Class. - * - * @param Container $container The DI container. - * - * @return CheckBox - * @since 3.2.0 - */ - public function getCheckBox(Container $container): CheckBox - { - return new CheckBox(); - } - - /** - * Get The ComponentFields Class. - * - * @param Container $container The DI container. - * - * @return ComponentFields - * @since 3.2.0 - */ - public function getComponentFields(Container $container): ComponentFields - { - return new ComponentFields(); - } - - /** - * Get The ContentMulti Class. - * - * @param Container $container The DI container. - * - * @return ContentMulti - * @since 3.2.0 - */ - public function getContentMulti(Container $container): ContentMulti - { - return new ContentMulti(); - } - - /** - * Get The ContentOne Class. - * - * @param Container $container The DI container. - * - * @return ContentOne - * @since 3.2.0 - */ - public function getContentOne(Container $container): ContentOne - { - return new ContentOne(); - } - - /** - * Get The CustomAlias Class. - * - * @param Container $container The DI container. - * - * @return CustomAlias - * @since 3.2.0 - */ - public function getCustomAlias(Container $container): CustomAlias - { - return new CustomAlias(); - } - - /** - * Get The CustomField Class. - * - * @param Container $container The DI container. - * - * @return CustomField - * @since 3.2.0 - */ - public function getCustomField(Container $container): CustomField - { - return new CustomField(); - } - - /** - * Get The CustomFieldLinks Class. - * - * @param Container $container The DI container. - * - * @return CustomFieldLinks - * @since 3.2.0 - */ - public function getCustomFieldLinks(Container $container): CustomFieldLinks - { - return new CustomFieldLinks(); - } - - /** - * Get The CustomList Class. - * - * @param Container $container The DI container. - * - * @return CustomList - * @since 3.2.0 - */ - public function getCustomList(Container $container): CustomList - { - return new CustomList(); - } - - /** - * Get The CustomTabs Class. - * - * @param Container $container The DI container. - * - * @return CustomTabs - * @since 3.2.0 - */ - public function getCustomTabs(Container $container): CustomTabs - { - return new CustomTabs(); - } - - /** - * Get The DatabaseKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseKeys - * @since 3.2.0 - */ - public function getDatabaseKeys(Container $container): DatabaseKeys - { - return new DatabaseKeys(); - } - - /** - * Get The DatabaseTables Class. - * - * @param Container $container The DI container. - * - * @return DatabaseTables - * @since 3.2.0 - */ - public function getDatabaseTables(Container $container): DatabaseTables - { - return new DatabaseTables(); - } - - /** - * Get The DatabaseUniqueGuid Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueGuid - * @since 3.2.0 - */ - public function getDatabaseUniqueGuid(Container $container): DatabaseUniqueGuid - { - return new DatabaseUniqueGuid(); - } - - /** - * Get The DatabaseUniqueKeys Class. - * - * @param Container $container The DI container. - * - * @return DatabaseUniqueKeys - * @since 3.2.0 - */ - public function getDatabaseUniqueKeys(Container $container): DatabaseUniqueKeys - { - return new DatabaseUniqueKeys(); - } - - /** - * Get The DoNotEscape Class. - * - * @param Container $container The DI container. - * - * @return DoNotEscape - * @since 3.2.0 - */ - public function getDoNotEscape(Container $container): DoNotEscape - { - return new DoNotEscape(); - } - - /** - * Get The DynamicFields Class. - * - * @param Container $container The DI container. - * - * @return DynamicFields - * @since 3.2.0 - */ - public function getDynamicFields(Container $container): DynamicFields - { - return new DynamicFields(); - } - - /** - * Get The ExtensionCustomFields Class. - * - * @param Container $container The DI container. - * - * @return ExtensionCustomFields - * @since 3.2.0 - */ - public function getExtensionCustomFields(Container $container): ExtensionCustomFields - { - return new ExtensionCustomFields(); - } - - /** - * Get The FieldGroupControl Class. - * - * @param Container $container The DI container. - * - * @return FieldGroupControl - * @since 3.2.0 - */ - public function getFieldGroupControl(Container $container): FieldGroupControl - { - return new FieldGroupControl(); - } - - /** - * Get The FieldNames Class. - * - * @param Container $container The DI container. - * - * @return FieldNames - * @since 3.2.0 - */ - public function getFieldNames(Container $container): FieldNames - { - return new FieldNames(); - } - - /** - * Get The FieldRelations Class. - * - * @param Container $container The DI container. - * - * @return FieldRelations - * @since 3.2.0 - */ - public function getFieldRelations(Container $container): FieldRelations - { - return new FieldRelations(); - } - - /** - * Get The Filter Class. - * - * @param Container $container The DI container. - * - * @return Filter - * @since 3.2.0 - */ - public function getFilter(Container $container): Filter - { - return new Filter(); - } - - /** - * Get The FootableScripts Class. - * - * @param Container $container The DI container. - * - * @return FootableScripts - * @since 3.2.0 - */ - public function getFootableScripts(Container $container): FootableScripts - { - return new FootableScripts(); - } - - /** - * Get The GetAsLookup Class. - * - * @param Container $container The DI container. - * - * @return GetAsLookup - * @since 3.2.0 - */ - public function getGetAsLookup(Container $container): GetAsLookup - { - return new GetAsLookup(); - } - - /** - * Get The GetModule Class. - * - * @param Container $container The DI container. - * - * @return GetModule - * @since 3.2.0 - */ - public function getGetModule(Container $container): GetModule - { - return new GetModule(); - } - - /** - * Get The GoogleChart Class. - * - * @param Container $container The DI container. - * - * @return GoogleChart - * @since 3.2.0 - */ - public function getGoogleChart(Container $container): GoogleChart - { - return new GoogleChart(); - } - - /** - * Get The HasPermissions Class. - * - * @param Container $container The DI container. - * - * @return HasPermissions - * @since 3.2.0 - */ - public function getHasPermissions(Container $container): HasPermissions - { - return new HasPermissions(); - } - - /** - * Get The HiddenFields Class. - * - * @param Container $container The DI container. - * - * @return HiddenFields - * @since 3.2.0 - */ - public function getHiddenFields(Container $container): HiddenFields - { - return new HiddenFields(); - } - - /** - * Get The History Class. - * - * @param Container $container The DI container. - * - * @return History - * @since 3.2.0 - */ - public function getHistory(Container $container): History - { - return new History(); - } - - /** - * Get The IntegerFields Class. - * - * @param Container $container The DI container. - * - * @return IntegerFields - * @since 3.2.0 - */ - public function getIntegerFields(Container $container): IntegerFields - { - return new IntegerFields(); - } - - /** - * Get The ItemsMethodEximportString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodEximportString - * @since 3.2.0 - */ - public function getItemsMethodEximportString(Container $container): ItemsMethodEximportString - { - return new ItemsMethodEximportString(); - } - - /** - * Get The ItemsMethodListString Class. - * - * @param Container $container The DI container. - * - * @return ItemsMethodListString - * @since 3.2.0 - */ - public function getItemsMethodListString(Container $container): ItemsMethodListString - { - return new ItemsMethodListString(); - } - - /** - * Get The JsonItem Class. - * - * @param Container $container The DI container. - * - * @return JsonItem - * @since 3.2.0 - */ - public function getJsonItem(Container $container): JsonItem - { - return new JsonItem(); - } - - /** - * Get The JsonItemArray Class. - * - * @param Container $container The DI container. - * - * @return JsonItemArray - * @since 3.2.0 - */ - public function getJsonItemArray(Container $container): JsonItemArray - { - return new JsonItemArray(); - } - - /** - * Get The JsonString Class. - * - * @param Container $container The DI container. - * - * @return JsonString - * @since 3.2.0 - */ - public function getJsonString(Container $container): JsonString - { - return new JsonString(); + return new LanguageMessages(); } /** @@ -1287,6 +623,19 @@ class Builder implements ServiceProviderInterface return new PermissionDashboard(); } + /** + * Get The PermissionFields Class. + * + * @param Container $container The DI container. + * + * @return PermissionFields + * @since 3.2.0 + */ + public function getPermissionFields(Container $container): PermissionFields + { + return new PermissionFields(); + } + /** * Get The PermissionGlobalAction Class. * @@ -1313,6 +662,32 @@ class Builder implements ServiceProviderInterface return new PermissionViews(); } + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request(); + } + + /** + * Get The Router Class. + * + * @param Container $container The DI container. + * + * @return Router + * @since 3.2.0 + */ + public function getRouter(Container $container): Router + { + return new Router(); + } + /** * Get The ScriptMediaSwitch Class. * @@ -1545,6 +920,19 @@ class Builder implements ServiceProviderInterface public function getUpdateMysql(Container $container): UpdateMysql { return new UpdateMysql(); + } + + /** + * Get The ViewsDefaultOrdering Class. + * + * @param Container $container The DI container. + * + * @return ViewsDefaultOrdering + * @since 3.2.0 + */ + public function getViewsDefaultOrdering(Container $container): ViewsDefaultOrdering + { + return new ViewsDefaultOrdering(); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php index b6e9b6759..093d0b655 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Component.php @@ -15,13 +15,16 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Component as CompilerComponent; -use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaThree\Settings as J3Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFour\Settings as J4Settings; +use VDM\Joomla\Componentbuilder\Compiler\Component\JoomlaFive\Settings as J5Settings; use VDM\Joomla\Componentbuilder\Compiler\Component\Dashboard; use VDM\Joomla\Componentbuilder\Compiler\Component\Placeholder; use VDM\Joomla\Componentbuilder\Compiler\Component\Data; use VDM\Joomla\Componentbuilder\Compiler\Component\Structure; use VDM\Joomla\Componentbuilder\Compiler\Component\Structuresingle; use VDM\Joomla\Componentbuilder\Compiler\Component\Structuremultiple; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; /** @@ -31,6 +34,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Component\Structuremultiple; */ class Component implements ServiceProviderInterface { + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + /** * Registers the service provider with a DI container. * @@ -42,10 +53,16 @@ class Component implements ServiceProviderInterface public function register(Container $container) { $container->alias(CompilerComponent::class, 'Component') - ->share('Component', [$this, 'getComponent'], true); + ->share('Component', [$this, 'getCompilerComponent'], true); - $container->alias(Settings::class, 'Component.Settings') - ->share('Component.Settings', [$this, 'getSettings'], true); + $container->alias(J3Settings::class, 'Component.J3.Settings') + ->share('Component.J3.Settings', [$this, 'getJ3Settings'], true); + + $container->alias(J4Settings::class, 'Component.J4.Settings') + ->share('Component.J4.Settings', [$this, 'getJ4Settings'], true); + + $container->alias(J5Settings::class, 'Component.J5.Settings') + ->share('Component.J5.Settings', [$this, 'getJ5Settings'], true); $container->alias(Dashboard::class, 'Component.Dashboard') ->share('Component.Dashboard', [$this, 'getDashboard'], true); @@ -64,17 +81,20 @@ class Component implements ServiceProviderInterface $container->alias(Structuremultiple::class, 'Component.Structure.Multiple') ->share('Component.Structure.Multiple', [$this, 'getStructuremultiple'], true); + + $container->alias(Settings::class, 'Component.Settings') + ->share('Component.Settings', [$this, 'getSettings'], true); } /** - * Get the Component + * Get The Component Class. * * @param Container $container The DI container. * * @return CompilerComponent * @since 3.2.0 */ - public function getComponent(Container $container): CompilerComponent + public function getCompilerComponent(Container $container): CompilerComponent { return new CompilerComponent( $container->get('Component.Data') @@ -82,16 +102,16 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Component (version) Settings + * Get The Settings Class. * * @param Container $container The DI container. * - * @return Settings + * @return J3Settings * @since 3.2.0 */ - public function getSettings(Container $container): Settings + public function getJ3Settings(Container $container): J3Settings { - return new Settings( + return new J3Settings( $container->get('Config'), $container->get('Registry'), $container->get('Event'), @@ -104,7 +124,51 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Component Dynamic Dashboard + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return J4Settings + * @since 3.2.0 + */ + public function getJ4Settings(Container $container): J4Settings + { + return new J4Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + + /** + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return J5Settings + * @since 3.2.0 + */ + public function getJ5Settings(Container $container): J5Settings + { + return new J5Settings( + $container->get('Config'), + $container->get('Registry'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component'), + $container->get('Utilities.Paths'), + $container->get('Utilities.Dynamicpath'), + $container->get('Utilities.Pathfix') + ); + } + + /** + * Get The Dashboard Class. * * @param Container $container The DI container. * @@ -120,7 +184,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Component Placeholders + * Get The Placeholder Class. * * @param Container $container The DI container. * @@ -135,7 +199,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Component Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -164,12 +228,13 @@ class Component implements ServiceProviderInterface $container->get('Model.Customadminviews'), $container->get('Model.Updateserver'), $container->get('Model.Joomlamodules'), - $container->get('Model.Joomlaplugins') + $container->get('Model.Joomlaplugins'), + $container->get('Model.Router') ); } /** - * Get the Compiler Structure + * Get The Structure Class. * * @param Container $container The DI container. * @@ -186,7 +251,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Structure Single + * Get The Structuresingle Class. * * @param Container $container The DI container. * @@ -198,6 +263,7 @@ class Component implements ServiceProviderInterface return new Structuresingle( $container->get('Config'), $container->get('Registry'), + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Component'), $container->get('Compiler.Builder.Content.One'), @@ -208,7 +274,7 @@ class Component implements ServiceProviderInterface } /** - * Get the Compiler Structure Multiple + * Get The Structuremultiple Class. * * @param Container $container The DI container. * @@ -227,6 +293,23 @@ class Component implements ServiceProviderInterface $container->get('Utilities.Structure') ); } - + + /** + * Get The Settings Class. + * + * @param Container $container The DI container. + * + * @return Settings + * @since 3.2.0 + */ + public function getSettings(Container $container): Settings + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Component.J' . $this->targetVersion . '.Settings'); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php index 67b743786..36aa47485 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Creator.php @@ -14,11 +14,30 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSections; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSectionsCategory; +use VDM\Joomla\Componentbuilder\Compiler\Creator\AccessSectionsJoomlaFields; use VDM\Joomla\Componentbuilder\Compiler\Creator\Builders; use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomFieldTypeFile; +use VDM\Joomla\Componentbuilder\Compiler\Creator\CustomButtonPermissions; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsets; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsCustomfield; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEmailHelper; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsEncryption; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGlobal; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGooglechart; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsGroupControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsSiteControl; +use VDM\Joomla\Componentbuilder\Compiler\Creator\ConfigFieldsetsUikit; use VDM\Joomla\Componentbuilder\Compiler\Creator\Layout; use VDM\Joomla\Componentbuilder\Compiler\Creator\Permission; use VDM\Joomla\Componentbuilder\Compiler\Creator\SiteFieldData; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Request; +use VDM\Joomla\Componentbuilder\Compiler\Creator\Router; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorDefault; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterConstructorManual; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsDefault; +use VDM\Joomla\Componentbuilder\Compiler\Creator\RouterMethodsManual; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetString; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetXML; use VDM\Joomla\Componentbuilder\Compiler\Creator\FieldsetDynamic; @@ -47,12 +66,51 @@ class Creator implements ServiceProviderInterface */ public function register(Container $container) { + $container->alias(AccessSections::class, 'Compiler.Creator.Access.Sections') + ->share('Compiler.Creator.Access.Sections', [$this, 'getAccessSections'], true); + + $container->alias(AccessSectionsCategory::class, 'Compiler.Creator.Access.Sections.Category') + ->share('Compiler.Creator.Access.Sections.Category', [$this, 'getAccessSectionsCategory'], true); + + $container->alias(AccessSectionsJoomlaFields::class, 'Compiler.Creator.Access.Sections.Joomla.Fields') + ->share('Compiler.Creator.Access.Sections.Joomla.Fields', [$this, 'getAccessSectionsJoomlaFields'], true); + $container->alias(Builders::class, 'Compiler.Creator.Builders') ->share('Compiler.Creator.Builders', [$this, 'getBuilders'], true); $container->alias(CustomFieldTypeFile::class, 'Compiler.Creator.Custom.Field.Type.File') ->share('Compiler.Creator.Custom.Field.Type.File', [$this, 'getCustomFieldTypeFile'], true); + $container->alias(CustomButtonPermissions::class, 'Compiler.Creator.Custom.Button.Permissions') + ->share('Compiler.Creator.Custom.Button.Permissions', [$this, 'getCustomButtonPermissions'], true); + + $container->alias(ConfigFieldsets::class, 'Compiler.Creator.Config.Fieldsets') + ->share('Compiler.Creator.Config.Fieldsets', [$this, 'getConfigFieldsets'], true); + + $container->alias(ConfigFieldsetsCustomfield::class, 'Compiler.Creator.Config.Fieldsets.Customfield') + ->share('Compiler.Creator.Config.Fieldsets.Customfield', [$this, 'getConfigFieldsetsCustomfield'], true); + + $container->alias(ConfigFieldsetsEmailHelper::class, 'Compiler.Creator.Config.Fieldsets.Email.Helper') + ->share('Compiler.Creator.Config.Fieldsets.Email.Helper', [$this, 'getConfigFieldsetsEmailHelper'], true); + + $container->alias(ConfigFieldsetsEncryption::class, 'Compiler.Creator.Config.Fieldsets.Encryption') + ->share('Compiler.Creator.Config.Fieldsets.Encryption', [$this, 'getConfigFieldsetsEncryption'], true); + + $container->alias(ConfigFieldsetsGlobal::class, 'Compiler.Creator.Config.Fieldsets.Global') + ->share('Compiler.Creator.Config.Fieldsets.Global', [$this, 'getConfigFieldsetsGlobal'], true); + + $container->alias(ConfigFieldsetsGooglechart::class, 'Compiler.Creator.Config.Fieldsets.Googlechart') + ->share('Compiler.Creator.Config.Fieldsets.Googlechart', [$this, 'getConfigFieldsetsGooglechart'], true); + + $container->alias(ConfigFieldsetsGroupControl::class, 'Compiler.Creator.Config.Fieldsets.Group.Control') + ->share('Compiler.Creator.Config.Fieldsets.Group.Control', [$this, 'getConfigFieldsetsGroupControl'], true); + + $container->alias(ConfigFieldsetsSiteControl::class, 'Compiler.Creator.Config.Fieldsets.Site.Control') + ->share('Compiler.Creator.Config.Fieldsets.Site.Control', [$this, 'getConfigFieldsetsSiteControl'], true); + + $container->alias(ConfigFieldsetsUikit::class, 'Compiler.Creator.Config.Fieldsets.Uikit') + ->share('Compiler.Creator.Config.Fieldsets.Uikit', [$this, 'getConfigFieldsetsUikit'], true); + $container->alias(Layout::class, 'Compiler.Creator.Layout') ->share('Compiler.Creator.Layout', [$this, 'getLayout'], true); @@ -62,6 +120,24 @@ class Creator implements ServiceProviderInterface $container->alias(SiteFieldData::class, 'Compiler.Creator.Site.Field.Data') ->share('Compiler.Creator.Site.Field.Data', [$this, 'getSiteFieldData'], true); + $container->alias(Request::class, 'Compiler.Creator.Request') + ->share('Compiler.Creator.Request', [$this, 'getRequest'], true); + + $container->alias(Router::class, 'Compiler.Creator.Router') + ->share('Compiler.Creator.Router', [$this, 'getRouter'], true); + + $container->alias(RouterConstructorDefault::class, 'Compiler.Creator.Router.Constructor.Default') + ->share('Compiler.Creator.Router.Constructor.Default', [$this, 'getRouterConstructorDefault'], true); + + $container->alias(RouterConstructorManual::class, 'Compiler.Creator.Router.Constructor.Manual') + ->share('Compiler.Creator.Router.Constructor.Manual', [$this, 'getRouterConstructorManual'], true); + + $container->alias(RouterMethodsDefault::class, 'Compiler.Creator.Router.Methods.Default') + ->share('Compiler.Creator.Router.Methods.Default', [$this, 'getRouterMethodsDefault'], true); + + $container->alias(RouterMethodsManual::class, 'Compiler.Creator.Router.Methods.Manual') + ->share('Compiler.Creator.Router.Methods.Manual', [$this, 'getRouterMethodsManual'], true); + $container->alias(FieldsetString::class, 'Compiler.Creator.Fieldset.String') ->share('Compiler.Creator.Fieldset.String', [$this, 'getFieldsetString'], true); @@ -90,6 +166,62 @@ class Creator implements ServiceProviderInterface ->share('Compiler.Creator.Fieldset', [$this, 'getFieldset'], true); } + /** + * Get The AccessSections Class. + * + * @param Container $container The DI container. + * + * @return AccessSections + * @since 3.2.0 + */ + public function getAccessSections(Container $container): AccessSections + { + return new AccessSections( + $container->get('Config'), + $container->get('Event'), + $container->get('Language'), + $container->get('Component'), + $container->get('Field.Name'), + $container->get('Field.Type.Name'), + $container->get('Utilities.Counter'), + $container->get('Compiler.Creator.Permission'), + $container->get('Compiler.Builder.Assets.Rules'), + $container->get('Compiler.Builder.Custom.Tabs'), + $container->get('Compiler.Builder.Permission.Views'), + $container->get('Compiler.Builder.Permission.Fields'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Compiler.Creator.Custom.Button.Permissions') + ); + } + + /** + * Get The AccessSectionsCategory Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsCategory + * @since 3.2.0 + */ + public function getAccessSectionsCategory(Container $container): AccessSectionsCategory + { + return new AccessSectionsCategory( + $container->get('Compiler.Builder.Category.Code') + ); + } + + /** + * Get The AccessSectionsJoomlaFields Class. + * + * @param Container $container The DI container. + * + * @return AccessSectionsJoomlaFields + * @since 3.2.0 + */ + public function getAccessSectionsJoomlaFields(Container $container): AccessSectionsJoomlaFields + { + return new AccessSectionsJoomlaFields(); + } + /** * Get The Builders Class. * @@ -102,6 +234,7 @@ class Creator implements ServiceProviderInterface { return new Builders( $container->get('Config'), + $container->get('Power'), $container->get('Language'), $container->get('Placeholder'), $container->get('Compiler.Creator.Layout'), @@ -171,7 +304,212 @@ class Creator implements ServiceProviderInterface $container->get('Utilities.Structure'), $container->get('Field.Input.Button'), $container->get('Compiler.Builder.Field.Group.Control'), - $container->get('Compiler.Builder.Extension.Custom.Fields') + $container->get('Compiler.Builder.Extension.Custom.Fields'), + $container->get('Header'), + $container->get('Field.Core.Field') + ); + } + + /** + * Get The CustomButtonPermissions Class. + * + * @param Container $container The DI container. + * + * @return CustomButtonPermissions + * @since 3.2.0 + */ + public function getCustomButtonPermissions(Container $container): CustomButtonPermissions + { + return new CustomButtonPermissions( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Permission.Component'), + $container->get('Utilities.Counter') + ); + } + + /** + * Get The ConfigFieldsets Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsets + * @since 3.2.0 + */ + public function getConfigFieldsets(Container $container): ConfigFieldsets + { + return new ConfigFieldsets( + $container->get('Config'), + $container->get('Component'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Component.Placeholder'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Creator.Field.As.String'), + $container->get('Compiler.Creator.Config.Fieldsets.Global'), + $container->get('Compiler.Creator.Config.Fieldsets.Site.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Group.Control'), + $container->get('Compiler.Creator.Config.Fieldsets.Uikit'), + $container->get('Compiler.Creator.Config.Fieldsets.Googlechart'), + $container->get('Compiler.Creator.Config.Fieldsets.Email.Helper'), + $container->get('Compiler.Creator.Config.Fieldsets.Encryption'), + $container->get('Compiler.Creator.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsCustomfield Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsCustomfield + * @since 3.2.0 + */ + public function getConfigFieldsetsCustomfield(Container $container): ConfigFieldsetsCustomfield + { + return new ConfigFieldsetsCustomfield( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Config.Fieldsets') + ); + } + + /** + * Get The ConfigFieldsetsEmailHelper Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEmailHelper + * @since 3.2.0 + */ + public function getConfigFieldsetsEmailHelper(Container $container): ConfigFieldsetsEmailHelper + { + return new ConfigFieldsetsEmailHelper( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsEncryption Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsEncryption + * @since 3.2.0 + */ + public function getConfigFieldsetsEncryption(Container $container): ConfigFieldsetsEncryption + { + return new ConfigFieldsetsEncryption( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGlobal Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGlobal + * @since 3.2.0 + */ + public function getConfigFieldsetsGlobal(Container $container): ConfigFieldsetsGlobal + { + return new ConfigFieldsetsGlobal( + $container->get('Config'), + $container->get('Language'), + $container->get('Component'), + $container->get('Compiler.Builder.Contributors'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsGooglechart Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGooglechart + * @since 3.2.0 + */ + public function getConfigFieldsetsGooglechart(Container $container): ConfigFieldsetsGooglechart + { + return new ConfigFieldsetsGooglechart( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Extensions.Params') + ); + } + + /** + * Get The ConfigFieldsetsGroupControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsGroupControl + * @since 3.2.0 + */ + public function getConfigFieldsetsGroupControl(Container $container): ConfigFieldsetsGroupControl + { + return new ConfigFieldsetsGroupControl( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Field.Group.Control'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') + ); + } + + /** + * Get The ConfigFieldsetsSiteControl Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsSiteControl + * @since 3.2.0 + */ + public function getConfigFieldsetsSiteControl(Container $container): ConfigFieldsetsSiteControl + { + return new ConfigFieldsetsSiteControl( + $container->get('Component'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield'), + $container->get('Compiler.Builder.Has.Menu.Global'), + $container->get('Compiler.Builder.Frontend.Params'), + $container->get('Compiler.Creator.Request') + ); + } + + /** + * Get The ConfigFieldsetsUikit Class. + * + * @param Container $container The DI container. + * + * @return ConfigFieldsetsUikit + * @since 3.2.0 + */ + public function getConfigFieldsetsUikit(Container $container): ConfigFieldsetsUikit + { + return new ConfigFieldsetsUikit( + $container->get('Config'), + $container->get('Language'), + $container->get('Compiler.Builder.Config.Fieldsets'), + $container->get('Compiler.Builder.Extensions.Params'), + $container->get('Compiler.Builder.Config.Fieldsets.Customfield') ); } @@ -235,6 +573,102 @@ class Creator implements ServiceProviderInterface ); } + /** + * Get The Request Class. + * + * @param Container $container The DI container. + * + * @return Request + * @since 3.2.0 + */ + public function getRequest(Container $container): Request + { + return new Request( + $container->get('Compiler.Builder.Request') + ); + } + + /** + * Get The Router Class. + * + * @param Container $container The DI container. + * + * @return Router + * @since 3.2.0 + */ + public function getRouter(Container $container): Router + { + return new Router( + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Request'), + $container->get('Compiler.Builder.Router'), + $container->get('Compiler.Creator.Router.Constructor.Default'), + $container->get('Compiler.Creator.Router.Constructor.Manual'), + $container->get('Compiler.Creator.Router.Methods.Default'), + $container->get('Compiler.Creator.Router.Methods.Manual') + ); + } + + /** + * Get The RouterConstructorDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorDefault + * @since 3.2.0 + */ + public function getRouterConstructorDefault(Container $container): RouterConstructorDefault + { + return new RouterConstructorDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterConstructorManual Class. + * + * @param Container $container The DI container. + * + * @return RouterConstructorManual + * @since 3.2.0 + */ + public function getRouterConstructorManual(Container $container): RouterConstructorManual + { + return new RouterConstructorManual( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsDefault Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsDefault + * @since 3.2.0 + */ + public function getRouterMethodsDefault(Container $container): RouterMethodsDefault + { + return new RouterMethodsDefault( + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The RouterMethodsManual Class. + * + * @param Container $container The DI container. + * + * @return RouterMethodsManual + * @since 3.2.0 + */ + public function getRouterMethodsManual(Container $container): RouterMethodsManual + { + return new RouterMethodsManual( + $container->get('Compiler.Builder.Router') + ); + } + /** * Get The FieldsetString Class. * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php index 091f7c2ea..bc0c7edab 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Event.php @@ -17,6 +17,8 @@ use Joomla\DI\ServiceProviderInterface; use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\EventInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Event as J3Event; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Event as J4Event; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\Event as J5Event; /** @@ -47,6 +49,12 @@ class Event implements ServiceProviderInterface $container->alias(J3Event::class, 'J3.Event') ->share('J3.Event', [$this, 'getJ3Event'], true); + $container->alias(J4Event::class, 'J4.Event') + ->share('J4.Event', [$this, 'getJ4Event'], true); + + $container->alias(J5Event::class, 'J5.Event') + ->share('J5.Event', [$this, 'getJ5Event'], true); + $container->alias(EventInterface::class, 'Event') ->share('Event', [$this, 'getEvent'], true); } @@ -81,6 +89,31 @@ class Event implements ServiceProviderInterface { return new J3Event(); } - + + /** + * Get the Joomla 4 Event + * + * @param Container $container The DI container. + * + * @return J4Event + * @since 3.2.0 + */ + public function getJ4Event(Container $container): J4Event + { + return new J4Event(); + } + + /** + * Get the Joomla 5 Event + * + * @param Container $container The DI container. + * + * @return J5Event + * @since 3.2.0 + */ + public function getJ5Event(Container $container): J5Event + { + return new J5Event(); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php index 50d751bae..1c2c5e791 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Extension.php @@ -16,6 +16,8 @@ use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\GetScriptInterface; use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaThree\InstallScript as J3InstallScript; +use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFour\InstallScript as J4InstallScript; +use VDM\Joomla\Componentbuilder\Compiler\Extension\JoomlaFive\InstallScript as J5InstallScript; /** @@ -48,6 +50,12 @@ class Extension implements ServiceProviderInterface $container->alias(J3InstallScript::class, 'J3.Extension.InstallScript') ->share('J3.Extension.InstallScript', [$this, 'getJ3ExtensionInstallScript'], true); + + $container->alias(J4InstallScript::class, 'J4.Extension.InstallScript') + ->share('J4.Extension.InstallScript', [$this, 'getJ4ExtensionInstallScript'], true); + + $container->alias(J5InstallScript::class, 'J5.Extension.InstallScript') + ->share('J5.Extension.InstallScript', [$this, 'getJ5ExtensionInstallScript'], true); } /** @@ -63,6 +71,32 @@ class Extension implements ServiceProviderInterface return new J3InstallScript(); } + /** + * Get the Joomla 4 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J4InstallScript + * @since 3.2.0 + */ + public function getJ4ExtensionInstallScript(Container $container): J4InstallScript + { + return new J4InstallScript(); + } + + /** + * Get the Joomla 5 Extension Install Script + * + * @param Container $container The DI container. + * + * @return J5InstallScript + * @since 3.2.0 + */ + public function getJ5ExtensionInstallScript(Container $container): J5InstallScript + { + return new J5InstallScript(); + } + /** * Get the Joomla Extension Install Script * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php index e3ba24db5..1db4eac27 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Field.php @@ -13,7 +13,8 @@ namespace VDM\Joomla\Componentbuilder\Compiler\Service; use Joomla\DI\Container; -use Joomla\DI\ServiceProviderInterface; +use Joomla\DI\ServiceProviderInterface; +use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Field as CompilerField; use VDM\Joomla\Componentbuilder\Compiler\Field\Data; use VDM\Joomla\Componentbuilder\Compiler\Field\Groups; @@ -21,12 +22,17 @@ use VDM\Joomla\Componentbuilder\Compiler\Field\Attributes; use VDM\Joomla\Componentbuilder\Compiler\Field\Name; use VDM\Joomla\Componentbuilder\Compiler\Field\TypeName; use VDM\Joomla\Componentbuilder\Compiler\Field\UniqueName; -use VDM\Joomla\Componentbuilder\Compiler\Field\Validation; +use VDM\Joomla\Componentbuilder\Compiler\Field\Rule; use VDM\Joomla\Componentbuilder\Compiler\Field\Customcode; use VDM\Joomla\Componentbuilder\Compiler\Field\DatabaseName; -use VDM\Joomla\Componentbuilder\Compiler\Field\InputButton; -use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreValidation as J3CoreValidation; -use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreValidationInterface; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreField as J3CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreField as J4CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\CoreField as J5CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\InputButton as J3InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\InputButton as J4InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\InputButton as J5InputButton; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreFieldInterface as CoreField; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\InputButtonInterface as InputButton; /** @@ -44,6 +50,14 @@ class Field implements ServiceProviderInterface **/ protected $targetVersion; + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + /** * Registers the service provider with a DI container. * @@ -55,7 +69,7 @@ class Field implements ServiceProviderInterface public function register(Container $container) { $container->alias(CompilerField::class, 'Field') - ->share('Field', [$this, 'getField'], true); + ->share('Field', [$this, 'getCompilerField'], true); $container->alias(Data::class, 'Field.Data') ->share('Field.Data', [$this, 'getData'], true); @@ -66,43 +80,58 @@ class Field implements ServiceProviderInterface $container->alias(Attributes::class, 'Field.Attributes') ->share('Field.Attributes', [$this, 'getAttributes'], true); - $container->alias(Validation::class, 'Field.Validation') - ->share('Field.Validation', [$this, 'getValidation'], true); + $container->alias(Name::class, 'Field.Name') + ->share('Field.Name', [$this, 'getName'], true); - $container->alias(J3CoreValidation::class, 'J3.Field.Core.Validation') - ->share('J3.Field.Core.Validation', [$this, 'getJ3CoreValidation'], true); + $container->alias(TypeName::class, 'Field.Type.Name') + ->share('Field.Type.Name', [$this, 'getTypeName'], true); - $container->alias(CoreValidationInterface::class, 'Field.Core.Validation') - ->share('Field.Core.Validation', [$this, 'getCoreValidation'], true); + $container->alias(UniqueName::class, 'Field.Unique.Name') + ->share('Field.Unique.Name', [$this, 'getUniqueName'], true); + + $container->alias(Rule::class, 'Field.Rule') + ->share('Field.Rule', [$this, 'getRule'], true); $container->alias(Customcode::class, 'Field.Customcode') ->share('Field.Customcode', [$this, 'getCustomcode'], true); - $container->alias(Name::class, 'Field.Name') - ->share('Field.Name', [$this, 'getFieldName'], true); - - $container->alias(TypeName::class, 'Field.Type.Name') - ->share('Field.Type.Name', [$this, 'getFieldTypeName'], true); - - $container->alias(UniqueName::class, 'Field.Unique.Name') - ->share('Field.Unique.Name', [$this, 'getFieldUniqueName'], true); - $container->alias(DatabaseName::class, 'Field.Database.Name') - ->share('Field.Database.Name', [$this, 'getFieldDatabaseName'], true); + ->share('Field.Database.Name', [$this, 'getDatabaseName'], true); + + $container->alias(J3CoreField::class, 'J3.Field.Core.Field') + ->share('J3.Field.Core.Field', [$this, 'getJ3CoreField'], true); + + $container->alias(J4CoreField::class, 'J4.Field.Core.Field') + ->share('J4.Field.Core.Field', [$this, 'getJ4CoreField'], true); + + $container->alias(J5CoreField::class, 'J5.Field.Core.Field') + ->share('J5.Field.Core.Field', [$this, 'getJ5CoreField'], true); + + $container->alias(J3InputButton::class, 'J3.Field.Input.Button') + ->share('J3.Field.Input.Button', [$this, 'getJ3InputButton'], true); + + $container->alias(J4InputButton::class, 'J4.Field.Input.Button') + ->share('J4.Field.Input.Button', [$this, 'getJ4InputButton'], true); + + $container->alias(J5InputButton::class, 'J5.Field.Input.Button') + ->share('J5.Field.Input.Button', [$this, 'getJ5InputButton'], true); + + $container->alias(CoreField::class, 'Field.Core.Field') + ->share('Field.Core.Field', [$this, 'getCoreField'], true); $container->alias(InputButton::class, 'Field.Input.Button') ->share('Field.Input.Button', [$this, 'getInputButton'], true); } /** - * Get the Compiler Field + * Get The Field Class. * * @param Container $container The DI container. * * @return CompilerField * @since 3.2.0 */ - public function getField(Container $container): CompilerField + public function getCompilerField(Container $container): CompilerField { return new CompilerField( $container->get('Field.Data'), @@ -113,7 +142,7 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Data + * Get The Data Class. * * @param Container $container The DI container. * @@ -129,12 +158,12 @@ class Field implements ServiceProviderInterface $container->get('Placeholder'), $container->get('Customcode'), $container->get('Field.Customcode'), - $container->get('Field.Validation') + $container->get('Field.Rule') ); } /** - * Get the Compiler Field Groups + * Get The Groups Class. * * @param Container $container The DI container. * @@ -147,7 +176,7 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Attributes + * Get The Attributes Class. * * @param Container $container The DI container. * @@ -169,57 +198,71 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Validation + * Get The Name Class. * * @param Container $container The DI container. * - * @return Validation + * @return Name * @since 3.2.0 */ - public function getValidation(Container $container): Validation + public function getName(Container $container): Name { - return new Validation( - $container->get('Registry'), - $container->get('Customcode.Gui'), + return new Name( $container->get('Placeholder'), - $container->get('Customcode'), - $container->get('Field.Core.Validation') + $container->get('Field.Unique.Name'), + $container->get('Compiler.Builder.Category.Other.Name') ); } /** - * Get the Compiler Field Joomla 3 Validation + * Get The TypeName Class. * * @param Container $container The DI container. * - * @return J3CoreValidation + * @return TypeName * @since 3.2.0 */ - public function getJ3CoreValidation(Container $container): J3CoreValidation + public function getTypeName(Container $container): TypeName { - return new J3CoreValidation(); + return new TypeName(); } /** - * Get the Compiler Field Core Validation + * Get The UniqueName Class. * * @param Container $container The DI container. * - * @return CoreValidationInterface + * @return UniqueName * @since 3.2.0 */ - public function getCoreValidation(Container $container): CoreValidationInterface + public function getUniqueName(Container $container): UniqueName { - if (empty($this->targetVersion)) - { - $this->targetVersion = $container->get('Config')->joomla_version; - } - - return $container->get('J' . $this->targetVersion . '.Field.Core.Validation'); + return new UniqueName( + $container->get('Registry') + ); } /** - * Get the Compiler Field Customcode + * Get The Rule Class. + * + * @param Container $container The DI container. + * + * @return Rule + * @since 3.2.0 + */ + public function getRule(Container $container): Rule + { + return new Rule( + $container->get('Registry'), + $container->get('Customcode'), + $container->get('Customcode.Gui'), + $container->get('Placeholder'), + $container->get('Field.Core.Rule') + ); + } + + /** + * Get The Customcode Class. * * @param Container $container The DI container. * @@ -234,59 +277,14 @@ class Field implements ServiceProviderInterface } /** - * Get the Compiler Field Name - * - * @param Container $container The DI container. - * - * @return Name - * @since 3.2.0 - */ - public function getFieldName(Container $container): Name - { - return new Name( - $container->get('Placeholder'), - $container->get('Field.Unique.Name'), - $container->get('Compiler.Builder.Category.Other.Name') - ); - } - - /** - * Get the Compiler Field Type Name - * - * @param Container $container The DI container. - * - * @return TypeName - * @since 3.2.0 - */ - public function getFieldTypeName(Container $container): TypeName - { - return new TypeName(); - } - - /** - * Get the Compiler Field Unique Name - * - * @param Container $container The DI container. - * - * @return UniqueName - * @since 3.2.0 - */ - public function getFieldUniqueName(Container $container): UniqueName - { - return new UniqueName( - $container->get('Registry') - ); - } - - /** - * Get the Compiler Field Database Name + * Get The DatabaseName Class. * * @param Container $container The DI container. * * @return DatabaseName * @since 3.2.0 */ - public function getFieldDatabaseName(Container $container): DatabaseName + public function getDatabaseName(Container $container): DatabaseName { return new DatabaseName( $container->get('Compiler.Builder.Lists'), @@ -294,6 +292,114 @@ class Field implements ServiceProviderInterface ); } + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J3CoreField + * @since 3.2.0 + */ + public function getJ3CoreField(Container $container): J3CoreField + { + return new J3CoreField(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J4CoreField + * @since 3.2.0 + */ + public function getJ4CoreField(Container $container): J4CoreField + { + return new J4CoreField(); + } + + /** + * Get The CoreField Class. + * + * @param Container $container The DI container. + * + * @return J5CoreField + * @since 3.2.0 + */ + public function getJ5CoreField(Container $container): J5CoreField + { + return new J5CoreField(); + } + + /** + * Get The J3InputButton Class. + * + * @param Container $container The DI container. + * + * @return J3InputButton + * @since 3.2.0 + */ + public function getJ3InputButton(Container $container): J3InputButton + { + return new J3InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The J4InputButton Class. + * + * @param Container $container The DI container. + * + * @return J4InputButton + * @since 3.2.0 + */ + public function getJ4InputButton(Container $container): J4InputButton + { + return new J4InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The J5InputButton Class. + * + * @param Container $container The DI container. + * + * @return J5InputButton + * @since 3.2.0 + */ + public function getJ5InputButton(Container $container): J5InputButton + { + return new J5InputButton( + $container->get('Config'), + $container->get('Placeholder'), + $container->get('Compiler.Creator.Permission') + ); + } + + /** + * Get The CoreFieldInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreField + * @since 3.2.0 + */ + public function getCoreField(Container $container): CoreField + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Field'); + } + /** * Get The InputButton Class. * @@ -304,11 +410,12 @@ class Field implements ServiceProviderInterface */ public function getInputButton(Container $container): InputButton { - return new InputButton( - $container->get('Config'), - $container->get('Placeholder'), - $container->get('Compiler.Creator.Permission') - ); + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Field.Input.Button'); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Header.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Header.php new file mode 100644 index 000000000..6f3ee5c94 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Header.php @@ -0,0 +1,151 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HeaderInterface; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\Header as J3Header; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\Header as J4Header; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\Header as J5Header; + + +/** + * Header Service Provider + * + * @since 3.2.0 + */ +class Header implements ServiceProviderInterface +{ + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3Header::class, 'J3.Header') + ->share('J3.Header', [$this, 'getJ3Header'], true); + + $container->alias(J4Header::class, 'J4.Header') + ->share('J4.Header', [$this, 'getJ4Header'], true); + + $container->alias(J5Header::class, 'J5.Header') + ->share('J5.Header', [$this, 'getJ5Header'], true); + + $container->alias(HeaderInterface::class, 'Header') + ->share('Header', [$this, 'getHeader'], true); + } + + /** + * Get the Header + * + * @param Container $container The DI container. + * + * @return HeaderInterface + * @since 3.2.0 + */ + public function getHeader(Container $container): HeaderInterface + { + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('J' . $this->targetVersion . '.Header'); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J3Header + * @since 3.2.0 + */ + public function getJ3Header(Container $container): J3Header + { + return new J3Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J4Header + * @since 3.2.0 + */ + public function getJ4Header(Container $container): J4Header + { + return new J4Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } + + /** + * Get The Header Class. + * + * @param Container $container The DI container. + * + * @return J5Header + * @since 3.2.0 + */ + public function getJ5Header(Container $container): J5Header + { + return new J5Header( + $container->get('Config'), + $container->get('Event'), + $container->get('Placeholder'), + $container->get('Language'), + $container->get('Compiler.Builder.Uikit.Comp'), + $container->get('Compiler.Builder.Admin.Filter.Type'), + $container->get('Compiler.Builder.Category'), + $container->get('Compiler.Builder.Access.Switch.List'), + $container->get('Compiler.Builder.Filter'), + $container->get('Compiler.Builder.Tags') + ); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php index 7b3a67d4e..9beb59d9c 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/History.php @@ -17,6 +17,8 @@ use Joomla\DI\ServiceProviderInterface; use Joomla\CMS\Version; use VDM\Joomla\Componentbuilder\Compiler\Interfaces\HistoryInterface; use VDM\Joomla\Componentbuilder\Compiler\JoomlaThree\History as J3History; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFour\History as J4History; +use VDM\Joomla\Componentbuilder\Compiler\JoomlaFive\History as J5History; /** @@ -47,6 +49,12 @@ class History implements ServiceProviderInterface $container->alias(J3History::class, 'J3.History') ->share('J3.History', [$this, 'getJ3History'], true); + $container->alias(J4History::class, 'J4.History') + ->share('J4.History', [$this, 'getJ4History'], true); + + $container->alias(J5History::class, 'J5.History') + ->share('J5.History', [$this, 'getJ5History'], true); + $container->alias(HistoryInterface::class, 'History') ->share('History', [$this, 'getHistory'], true); } @@ -83,6 +91,35 @@ class History implements ServiceProviderInterface $container->get('Config') ); } - + + /** + * Get the Joomla 4 History + * + * @param Container $container The DI container. + * + * @return J4History + * @since 3.2.0 + */ + public function getJ4History(Container $container): J4History + { + return new J4History( + $container->get('Config') + ); + } + + /** + * Get the Joomla 5 History + * + * @param Container $container The DI container. + * + * @return J5History + * @since 3.2.0 + */ + public function getJ5History(Container $container): J5History + { + return new J5History( + $container->get('Config') + ); + } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php index fe9caea63..833398249 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php @@ -44,7 +44,10 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Conditions; use VDM\Joomla\Componentbuilder\Compiler\Model\Fields; use VDM\Joomla\Componentbuilder\Compiler\Model\Updatesql; use VDM\Joomla\Componentbuilder\Compiler\Model\Tabs; -use VDM\Joomla\Componentbuilder\Compiler\Model\Customtabs; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Model\CustomtabsInterface as Customtabs; +use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaThree\Customtabs as CustomtabsJ3; +use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFour\Customtabs as CustomtabsJ4; +use VDM\Joomla\Componentbuilder\Compiler\Model\JoomlaFive\Customtabs as CustomtabsJ5; use VDM\Joomla\Componentbuilder\Compiler\Model\Adminviews; use VDM\Joomla\Componentbuilder\Compiler\Model\Sqltweaking; use VDM\Joomla\Componentbuilder\Compiler\Model\Sqldump; @@ -52,6 +55,7 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Whmcs; use VDM\Joomla\Componentbuilder\Compiler\Model\Filesfolders; use VDM\Joomla\Componentbuilder\Compiler\Model\Modifieddate; use VDM\Joomla\Componentbuilder\Compiler\Model\Createdate; +use VDM\Joomla\Componentbuilder\Compiler\Model\Router; use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver; @@ -62,6 +66,14 @@ use VDM\Joomla\Componentbuilder\Compiler\Model\Updateserver; */ class Model implements ServiceProviderInterface { + /** + * Current Joomla Version Being Build + * + * @var int + * @since 3.2.0 + **/ + protected $targetVersion; + /** * Registers the service provider with a DI container. * @@ -72,107 +84,122 @@ class Model implements ServiceProviderInterface */ public function register(Container $container) { + $container->alias(ServerLoad::class, 'Model.Server.Load') + ->share('Model.Server.Load', [$this, 'getServerLoad'], true); + $container->alias(Joomlaplugins::class, 'Model.Joomlaplugins') - ->share('Model.Joomlaplugins', [$this, 'getModelJoomlaplugins'], true); + ->share('Model.Joomlaplugins', [$this, 'getJoomlaplugins'], true); $container->alias(Joomlamodules::class, 'Model.Joomlamodules') - ->share('Model.Joomlamodules', [$this, 'getModelJoomlamodules'], true); + ->share('Model.Joomlamodules', [$this, 'getJoomlamodules'], true); $container->alias(Historycomponent::class, 'Model.Historycomponent') - ->share('Model.Historycomponent', [$this, 'getModelHistorycomponent'], true); + ->share('Model.Historycomponent', [$this, 'getHistorycomponent'], true); $container->alias(Customadminviews::class, 'Model.Customadminviews') - ->share('Model.Customadminviews', [$this, 'getModelCustomadminviews'], true); + ->share('Model.Customadminviews', [$this, 'getCustomadminviews'], true); $container->alias(Ajaxcustomview::class, 'Model.Ajaxcustomview') - ->share('Model.Ajaxcustomview', [$this, 'getModelAjaxcustomview'], true); + ->share('Model.Ajaxcustomview', [$this, 'getAjaxcustomview'], true); $container->alias(Javascriptcustomview::class, 'Model.Javascriptcustomview') - ->share('Model.Javascriptcustomview', [$this, 'getModelJavascriptcustomview'], true); + ->share('Model.Javascriptcustomview', [$this, 'getJavascriptcustomview'], true); $container->alias(Csscustomview::class, 'Model.Csscustomview') - ->share('Model.Csscustomview', [$this, 'getModelCsscustomview'], true); + ->share('Model.Csscustomview', [$this, 'getCsscustomview'], true); $container->alias(Phpcustomview::class, 'Model.Phpcustomview') - ->share('Model.Phpcustomview', [$this, 'getModelPhpcustomview'], true); + ->share('Model.Phpcustomview', [$this, 'getPhpcustomview'], true); $container->alias(Dynamicget::class, 'Model.Dynamicget') - ->share('Model.Dynamicget', [$this, 'getModelDynamicget'], true); + ->share('Model.Dynamicget', [$this, 'getDynamicget'], true); $container->alias(Libraries::class, 'Model.Libraries') - ->share('Model.Libraries', [$this, 'getModelLibraries'], true); + ->share('Model.Libraries', [$this, 'getLibraries'], true); $container->alias(Siteviews::class, 'Model.Siteviews') - ->share('Model.Siteviews', [$this, 'getModelSiteviews'], true); + ->share('Model.Siteviews', [$this, 'getSiteviews'], true); $container->alias(Permissions::class, 'Model.Permissions') - ->share('Model.Permissions', [$this, 'getModelPermissions'], true); + ->share('Model.Permissions', [$this, 'getPermissions'], true); $container->alias(Historyadminview::class, 'Model.Historyadminview') - ->share('Model.Historyadminview', [$this, 'getModelHistoryadminview'], true); + ->share('Model.Historyadminview', [$this, 'getHistoryadminview'], true); $container->alias(Mysqlsettings::class, 'Model.Mysqlsettings') - ->share('Model.Mysqlsettings', [$this, 'getModelMysqlsettings'], true); + ->share('Model.Mysqlsettings', [$this, 'getMysqlsettings'], true); $container->alias(Sql::class, 'Model.Sql') - ->share('Model.Sql', [$this, 'getModelSql'], true); + ->share('Model.Sql', [$this, 'getSql'], true); $container->alias(Customalias::class, 'Model.Customalias') - ->share('Model.Customalias', [$this, 'getModelCustomalias'], true); + ->share('Model.Customalias', [$this, 'getCustomalias'], true); $container->alias(Ajaxadmin::class, 'Model.Ajaxadmin') - ->share('Model.Ajaxadmin', [$this, 'getModelAjaxadmin'], true); + ->share('Model.Ajaxadmin', [$this, 'getAjaxadmin'], true); $container->alias(Customimportscripts::class, 'Model.Customimportscripts') - ->share('Model.Customimportscripts', [$this, 'getModelCustomimportscripts'], true); + ->share('Model.Customimportscripts', [$this, 'getCustomimportscripts'], true); $container->alias(Custombuttons::class, 'Model.Custombuttons') - ->share('Model.Custombuttons', [$this, 'getModelCustombuttons'], true); + ->share('Model.Custombuttons', [$this, 'getCustombuttons'], true); $container->alias(Loader::class, 'Model.Loader') - ->share('Model.Loader', [$this, 'getModelLoader'], true); + ->share('Model.Loader', [$this, 'getLoader'], true); $container->alias(Phpadminview::class, 'Model.Phpadminview') - ->share('Model.Phpadminview', [$this, 'getModelPhpadminview'], true); + ->share('Model.Phpadminview', [$this, 'getPhpadminview'], true); $container->alias(Cssadminview::class, 'Model.Cssadminview') - ->share('Model.Cssadminview', [$this, 'getModelCssadminview'], true); + ->share('Model.Cssadminview', [$this, 'getCssadminview'], true); $container->alias(Javascriptadminview::class, 'Model.Javascriptadminview') - ->share('Model.Javascriptadminview', [$this, 'getModelJavascriptadminview'], true); + ->share('Model.Javascriptadminview', [$this, 'getJavascriptadminview'], true); $container->alias(Linkedviews::class, 'Model.Linkedviews') - ->share('Model.Linkedviews', [$this, 'getModelLinkedviews'], true); + ->share('Model.Linkedviews', [$this, 'getLinkedviews'], true); $container->alias(Relations::class, 'Model.Relations') - ->share('Model.Relations', [$this, 'getModelRelations'], true); + ->share('Model.Relations', [$this, 'getRelations'], true); $container->alias(Conditions::class, 'Model.Conditions') - ->share('Model.Conditions', [$this, 'getModelConditions'], true); + ->share('Model.Conditions', [$this, 'getConditions'], true); $container->alias(Fields::class, 'Model.Fields') - ->share('Model.Fields', [$this, 'getModelFields'], true); + ->share('Model.Fields', [$this, 'getFields'], true); $container->alias(Updatesql::class, 'Model.Updatesql') - ->share('Model.Updatesql', [$this, 'getModelUpdatesql'], true); + ->share('Model.Updatesql', [$this, 'getUpdatesql'], true); $container->alias(Tabs::class, 'Model.Tabs') - ->share('Model.Tabs', [$this, 'getModelTabs'], true); + ->share('Model.Tabs', [$this, 'getTabs'], true); $container->alias(Customtabs::class, 'Model.Customtabs') - ->share('Model.Customtabs', [$this, 'getModelCustomtabs'], true); + ->share('Model.Customtabs', [$this, 'getCustomtabs'], true); + + $container->alias(CustomtabsJ3::class, 'Model.J3.Customtabs') + ->share('Model.J3.Customtabs', [$this, 'getCustomtabsJ3'], true); + + $container->alias(CustomtabsJ4::class, 'Model.J4.Customtabs') + ->share('Model.J4.Customtabs', [$this, 'getCustomtabsJ4'], true); + + $container->alias(CustomtabsJ5::class, 'Model.J5.Customtabs') + ->share('Model.J5.Customtabs', [$this, 'getCustomtabsJ5'], true); $container->alias(Adminviews::class, 'Model.Adminviews') - ->share('Model.Adminviews', [$this, 'getModelAdminviews'], true); + ->share('Model.Adminviews', [$this, 'getAdminviews'], true); $container->alias(Sqltweaking::class, 'Model.Sqltweaking') - ->share('Model.Sqltweaking', [$this, 'getModelSqltweaking'], true); + ->share('Model.Sqltweaking', [$this, 'getSqltweaking'], true); $container->alias(Sqldump::class, 'Model.Sqldump') - ->share('Model.Sqldump', [$this, 'getModelSqldump'], true); + ->share('Model.Sqldump', [$this, 'getSqldump'], true); $container->alias(Whmcs::class, 'Model.Whmcs') - ->share('Model.Whmcs', [$this, 'getModelWhmcs'], true); + ->share('Model.Whmcs', [$this, 'getWhmcs'], true); + + $container->alias(Filesfolders::class, 'Model.Filesfolders') + ->share('Model.Filesfolders', [$this, 'getFilesfolders'], true); $container->alias(Modifieddate::class, 'Model.Modifieddate') ->share('Model.Modifieddate', [$this, 'getModifieddate'], true); @@ -180,25 +207,38 @@ class Model implements ServiceProviderInterface $container->alias(Createdate::class, 'Model.Createdate') ->share('Model.Createdate', [$this, 'getCreatedate'], true); + $container->alias(Router::class, 'Model.Router') + ->share('Model.Router', [$this, 'getRouter'], true); + $container->alias(Updateserver::class, 'Model.Updateserver') ->share('Model.Updateserver', [$this, 'getUpdateserver'], true); - - $container->alias(Filesfolders::class, 'Model.Filesfolders') - ->share('Model.Filesfolders', [$this, 'getModelFilesfolders'], true); - - $container->alias(ServerLoad::class, 'Model.Server.Load') - ->share('Model.Server.Load', [$this, 'getServerLoad'], true); } /** - * Get the Joomla plugins Model + * Get The Load Class. + * + * @param Container $container The DI container. + * + * @return ServerLoad + * @since 3.2.0 + */ + public function getServerLoad(Container $container): ServerLoad + { + return new ServerLoad( + $container->get('Crypt'), + $container->get('Table') + ); + } + + /** + * Get The Joomlaplugins Class. * * @param Container $container The DI container. * * @return Joomlaplugins * @since 3.2.0 */ - public function getModelJoomlaplugins(Container $container): Joomlaplugins + public function getJoomlaplugins(Container $container): Joomlaplugins { return new Joomlaplugins( $container->get('Joomlaplugin.Data') @@ -206,14 +246,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Joomla modules Model + * Get The Joomlamodules Class. * * @param Container $container The DI container. * * @return Joomlamodules * @since 3.2.0 */ - public function getModelJoomlamodules(Container $container): Joomlamodules + public function getJoomlamodules(Container $container): Joomlamodules { return new Joomlamodules( $container->get('Joomlamodule.Data') @@ -221,14 +261,14 @@ class Model implements ServiceProviderInterface } /** - * Get the history component Model + * Get The Historycomponent Class. * * @param Container $container The DI container. * * @return Historycomponent * @since 3.2.0 */ - public function getModelHistorycomponent(Container $container): Historycomponent + public function getHistorycomponent(Container $container): Historycomponent { return new Historycomponent( $container->get('Config'), @@ -238,14 +278,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom admin views Model + * Get The Customadminviews Class. * * @param Container $container The DI container. * * @return Customadminviews * @since 3.2.0 */ - public function getModelCustomadminviews(Container $container): Customadminviews + public function getCustomadminviews(Container $container): Customadminviews { return new Customadminviews( $container->get('Customview.Data'), @@ -254,14 +294,14 @@ class Model implements ServiceProviderInterface } /** - * Get the ajax custom view Model + * Get The Ajaxcustomview Class. * * @param Container $container The DI container. * * @return Ajaxcustomview * @since 3.2.0 */ - public function getModelAjaxcustomview(Container $container): Ajaxcustomview + public function getAjaxcustomview(Container $container): Ajaxcustomview { return new Ajaxcustomview( $container->get('Config'), @@ -270,14 +310,14 @@ class Model implements ServiceProviderInterface } /** - * Get the javascript custom view Model + * Get The Javascriptcustomview Class. * * @param Container $container The DI container. * * @return Javascriptcustomview * @since 3.2.0 */ - public function getModelJavascriptcustomview(Container $container): Javascriptcustomview + public function getJavascriptcustomview(Container $container): Javascriptcustomview { return new Javascriptcustomview( $container->get('Customcode'), @@ -286,14 +326,14 @@ class Model implements ServiceProviderInterface } /** - * Get the css custom view Model + * Get The Csscustomview Class. * * @param Container $container The DI container. * * @return Csscustomview * @since 3.2.0 */ - public function getModelCsscustomview(Container $container): Csscustomview + public function getCsscustomview(Container $container): Csscustomview { return new Csscustomview( $container->get('Customcode') @@ -301,14 +341,14 @@ class Model implements ServiceProviderInterface } /** - * Get the php custom view Model + * Get The Phpcustomview Class. * * @param Container $container The DI container. * * @return Phpcustomview * @since 3.2.0 */ - public function getModelPhpcustomview(Container $container): Phpcustomview + public function getPhpcustomview(Container $container): Phpcustomview { return new Phpcustomview( $container->get('Customcode'), @@ -319,14 +359,14 @@ class Model implements ServiceProviderInterface } /** - * Get the dynamic get Model + * Get The Dynamicget Class. * * @param Container $container The DI container. * * @return Dynamicget * @since 3.2.0 */ - public function getModelDynamicget(Container $container): Dynamicget + public function getDynamicget(Container $container): Dynamicget { return new Dynamicget( $container->get('Config'), @@ -340,14 +380,14 @@ class Model implements ServiceProviderInterface } /** - * Get the libraries Model + * Get The Libraries Class. * * @param Container $container The DI container. * * @return Libraries * @since 3.2.0 */ - public function getModelLibraries(Container $container): Libraries + public function getLibraries(Container $container): Libraries { return new Libraries( $container->get('Config'), @@ -357,14 +397,14 @@ class Model implements ServiceProviderInterface } /** - * Get the site views Model + * Get The Siteviews Class. * * @param Container $container The DI container. * * @return Siteviews * @since 3.2.0 */ - public function getModelSiteviews(Container $container): Siteviews + public function getSiteviews(Container $container): Siteviews { return new Siteviews( $container->get('Customview.Data'), @@ -373,27 +413,27 @@ class Model implements ServiceProviderInterface } /** - * Get the permissions Model + * Get The Permissions Class. * * @param Container $container The DI container. * * @return Permissions * @since 3.2.0 */ - public function getModelPermissions(Container $container): Permissions + public function getPermissions(Container $container): Permissions { return new Permissions(); } /** - * Get the admin view history Model + * Get The Historyadminview Class. * * @param Container $container The DI container. * * @return Historyadminview * @since 3.2.0 */ - public function getModelHistoryadminview(Container $container): Historyadminview + public function getHistoryadminview(Container $container): Historyadminview { return new Historyadminview( $container->get('Config'), @@ -403,14 +443,14 @@ class Model implements ServiceProviderInterface } /** - * Get the MySQL settings Model + * Get The Mysqlsettings Class. * * @param Container $container The DI container. * * @return Mysqlsettings * @since 3.2.0 */ - public function getModelMysqlsettings(Container $container): Mysqlsettings + public function getMysqlsettings(Container $container): Mysqlsettings { return new Mysqlsettings( $container->get('Config'), @@ -419,14 +459,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Sql Model + * Get The Sql Class. * * @param Container $container The DI container. * * @return Sql * @since 3.2.0 */ - public function getModelSql(Container $container): Sql + public function getSql(Container $container): Sql { return new Sql( $container->get('Customcode.Dispenser'), @@ -435,14 +475,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom alias Model + * Get The Customalias Class. * * @param Container $container The DI container. * * @return Customalias * @since 3.2.0 */ - public function getModelCustomalias(Container $container): Customalias + public function getCustomalias(Container $container): Customalias { return new Customalias( $container->get('Compiler.Builder.Custom.Alias'), @@ -451,14 +491,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Admin Ajax Model + * Get The Ajaxadmin Class. * * @param Container $container The DI container. * * @return Ajaxadmin * @since 3.2.0 */ - public function getModelAjaxadmin(Container $container): Ajaxadmin + public function getAjaxadmin(Container $container): Ajaxadmin { return new Ajaxadmin( $container->get('Config'), @@ -468,14 +508,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom import scripts Model + * Get The Customimportscripts Class. * * @param Container $container The DI container. * * @return Customimportscripts * @since 3.2.0 */ - public function getModelCustomimportscripts(Container $container): Customimportscripts + public function getCustomimportscripts(Container $container): Customimportscripts { return new Customimportscripts( $container->get('Customcode.Dispenser') @@ -483,14 +523,14 @@ class Model implements ServiceProviderInterface } /** - * Get the custom import scripts Model + * Get The Custombuttons Class. * * @param Container $container The DI container. * * @return Custombuttons * @since 3.2.0 */ - public function getModelCustombuttons(Container $container): Custombuttons + public function getCustombuttons(Container $container): Custombuttons { return new Custombuttons( $container->get('Customcode'), @@ -500,14 +540,14 @@ class Model implements ServiceProviderInterface } /** - * Get The Model Loader Class. + * Get The Loader Class. * * @param Container $container The DI container. * * @return Loader * @since 3.2.0 */ - public function getModelLoader(Container $container): Loader + public function getLoader(Container $container): Loader { return new Loader( $container->get('Config'), @@ -519,14 +559,14 @@ class Model implements ServiceProviderInterface } /** - * Get the php admin view Model + * Get The Phpadminview Class. * * @param Container $container The DI container. * * @return Phpadminview * @since 3.2.0 */ - public function getModelPhpadminview(Container $container): Phpadminview + public function getPhpadminview(Container $container): Phpadminview { return new Phpadminview( $container->get('Customcode.Dispenser'), @@ -535,14 +575,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Css Adminview Model + * Get The Cssadminview Class. * * @param Container $container The DI container. * * @return Cssadminview * @since 3.2.0 */ - public function getModelCssadminview(Container $container): Cssadminview + public function getCssadminview(Container $container): Cssadminview { return new Cssadminview( $container->get('Customcode.Dispenser') @@ -550,14 +590,14 @@ class Model implements ServiceProviderInterface } /** - * Get the Javascript Adminview Model + * Get The Javascriptadminview Class. * * @param Container $container The DI container. * * @return Javascriptadminview * @since 3.2.0 */ - public function getModelJavascriptadminview(Container $container): Javascriptadminview + public function getJavascriptadminview(Container $container): Javascriptadminview { return new Javascriptadminview( $container->get('Customcode.Dispenser') @@ -565,14 +605,14 @@ class Model implements ServiceProviderInterface } /** - * Get the linked views Model + * Get The Linkedviews Class. * * @param Container $container The DI container. * * @return Linkedviews * @since 3.2.0 */ - public function getModelLinkedviews(Container $container): Linkedviews + public function getLinkedviews(Container $container): Linkedviews { return new Linkedviews( $container->get('Registry') @@ -580,14 +620,14 @@ class Model implements ServiceProviderInterface } /** - * Get the relations Model + * Get The Relations Class. * * @param Container $container The DI container. * * @return Relations * @since 3.2.0 */ - public function getModelRelations(Container $container): Relations + public function getRelations(Container $container): Relations { return new Relations( $container->get('Config'), @@ -600,14 +640,14 @@ class Model implements ServiceProviderInterface } /** - * Get the conditions Model + * Get The Conditions Class. * * @param Container $container The DI container. * * @return Conditions * @since 3.2.0 */ - public function getModelConditions(Container $container): Conditions + public function getConditions(Container $container): Conditions { return new Conditions( $container->get('Field.Type.Name'), @@ -617,14 +657,14 @@ class Model implements ServiceProviderInterface } /** - * Get the fields Model + * Get The Fields Class. * * @param Container $container The DI container. * * @return Fields * @since 3.2.0 */ - public function getModelFields(Container $container): Fields + public function getFields(Container $container): Fields { return new Fields( $container->get('Config'), @@ -639,14 +679,14 @@ class Model implements ServiceProviderInterface } /** - * Get the update sql Model + * Get The Updatesql Class. * * @param Container $container The DI container. * * @return Updatesql * @since 3.2.0 */ - public function getModelUpdatesql(Container $container): Updatesql + public function getUpdatesql(Container $container): Updatesql { return new Updatesql( $container->get('Registry') @@ -654,29 +694,47 @@ class Model implements ServiceProviderInterface } /** - * Get the tabs Model + * Get The Tabs Class. * * @param Container $container The DI container. * - * @return Updatesql + * @return Tabs * @since 3.2.0 */ - public function getModelTabs(Container $container): Tabs + public function getTabs(Container $container): Tabs { return new Tabs(); } /** - * Get the custom tabs Model + * Get The Customtabs Class. * * @param Container $container The DI container. * * @return Customtabs * @since 3.2.0 */ - public function getModelCustomtabs(Container $container): Customtabs + public function getCustomtabs(Container $container): Customtabs { - return new Customtabs( + if (empty($this->targetVersion)) + { + $this->targetVersion = $container->get('Config')->joomla_version; + } + + return $container->get('Model.J' . $this->targetVersion . '.Customtabs'); + } + + /** + * Get The CustomtabsJ3 Class. + * + * @param Container $container The DI container. + * + * @return CustomtabsJ3 + * @since 3.2.0 + */ + public function getCustomtabsJ3(Container $container): CustomtabsJ3 + { + return new CustomtabsJ3( $container->get('Config'), $container->get('Compiler.Builder.Custom.Tabs'), $container->get('Language'), @@ -686,14 +744,52 @@ class Model implements ServiceProviderInterface } /** - * Get the admin views Model + * Get The CustomtabsJ4 Class. + * + * @param Container $container The DI container. + * + * @return CustomtabsJ4 + * @since 3.2.0 + */ + public function getCustomtabsJ4(Container $container): CustomtabsJ4 + { + return new CustomtabsJ4( + $container->get('Config'), + $container->get('Compiler.Builder.Custom.Tabs'), + $container->get('Language'), + $container->get('Placeholder'), + $container->get('Customcode') + ); + } + + /** + * Get The CustomtabsJ5 Class. + * + * @param Container $container The DI container. + * + * @return CustomtabsJ5 + * @since 3.2.0 + */ + public function getCustomtabsJ5(Container $container): CustomtabsJ5 + { + return new CustomtabsJ5( + $container->get('Config'), + $container->get('Compiler.Builder.Custom.Tabs'), + $container->get('Language'), + $container->get('Placeholder'), + $container->get('Customcode') + ); + } + + /** + * Get The Adminviews Class. * * @param Container $container The DI container. * * @return Adminviews * @since 3.2.0 */ - public function getModelAdminviews(Container $container): Adminviews + public function getAdminviews(Container $container): Adminviews { return new Adminviews( $container->get('Config'), @@ -704,14 +800,14 @@ class Model implements ServiceProviderInterface } /** - * Get the SQL tweaking Model + * Get The Sqltweaking Class. * * @param Container $container The DI container. * * @return Sqltweaking * @since 3.2.0 */ - public function getModelSqltweaking(Container $container): Sqltweaking + public function getSqltweaking(Container $container): Sqltweaking { return new Sqltweaking( $container->get('Registry') @@ -719,14 +815,14 @@ class Model implements ServiceProviderInterface } /** - * Get the SQL dump Model + * Get The Sqldump Class. * * @param Container $container The DI container. * * @return Sqldump * @since 3.2.0 */ - public function getModelSqldump(Container $container): Sqldump + public function getSqldump(Container $container): Sqldump { return new Sqldump( $container->get('Registry') @@ -734,20 +830,33 @@ class Model implements ServiceProviderInterface } /** - * Get the whmcs Model + * Get The Whmcs Class. * * @param Container $container The DI container. * * @return Whmcs * @since 3.2.0 */ - public function getModelWhmcs(Container $container): Whmcs + public function getWhmcs(Container $container): Whmcs { return new Whmcs(); } /** - * Get the modified date Model + * Get The Filesfolders Class. + * + * @param Container $container The DI container. + * + * @return Filesfolders + * @since 3.2.0 + */ + public function getFilesfolders(Container $container): Filesfolders + { + return new Filesfolders(); + } + + /** + * Get The Modifieddate Class. * * @param Container $container The DI container. * @@ -760,7 +869,7 @@ class Model implements ServiceProviderInterface } /** - * Get the create date Model + * Get The Createdate Class. * * @param Container $container The DI container. * @@ -773,7 +882,24 @@ class Model implements ServiceProviderInterface } /** - * Get the update server Model + * Get The Router Class. + * + * @param Container $container The DI container. + * + * @return Router + * @since 3.2.0 + */ + public function getRouter(Container $container): Router + { + return new Router( + $container->get('Config'), + $container->get('Customcode.Dispenser'), + $container->get('Compiler.Builder.Router') + ); + } + + /** + * Get The Updateserver Class. * * @param Container $container The DI container. * @@ -783,35 +909,6 @@ class Model implements ServiceProviderInterface public function getUpdateserver(Container $container): Updateserver { return new Updateserver(); - } - - /** - * Get the files folders Model - * - * @param Container $container The DI container. - * - * @return Filesfolders - * @since 3.2.0 - */ - public function getModelFilesfolders(Container $container): Filesfolders - { - return new Filesfolders(); - } - - /** - * Get the Server Model Server Loader class - * - * @param Container $container The DI container. - * - * @return ServerLoad - * @since 3.2.0 - */ - public function getServerLoad(Container $container): ServerLoad - { - return new ServerLoad( - $container->get('Crypt'), - $container->get('Table') - ); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php index b03acb72a..845ce4041 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Power.php @@ -178,7 +178,6 @@ class Power implements ServiceProviderInterface $container->get('Power'), $container->get('Compiler.Builder.Content.One'), $container->get('Compiler.Builder.Content.Multi'), - $container->get('Power.Autoloader'), $container->get('Power.Parser'), $container->get('Power.Repo.Readme'), $container->get('Power.Repos.Readme'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php index 40d4d3625..2f4b56a6d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Utilities.php @@ -17,6 +17,7 @@ use Joomla\DI\ServiceProviderInterface; use VDM\Joomla\Componentbuilder\Compiler\Config; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Folder; use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; +use VDM\Joomla\Componentbuilder\Compiler\Utilities\FileInjector; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Files; @@ -50,6 +51,9 @@ class Utilities implements ServiceProviderInterface $container->alias(File::class, 'Utilities.File') ->share('Utilities.File', [$this, 'getFile'], true); + $container->alias(FileInjector::class, 'Utilities.FileInjector') + ->share('Utilities.FileInjector', [$this, 'getFileInjector'], true); + $container->alias(Counter::class, 'Utilities.Counter') ->share('Utilities.Counter', [$this, 'getCounter'], true); @@ -106,6 +110,21 @@ class Utilities implements ServiceProviderInterface ); } + /** + * Get The FileInjector Class. + * + * @param Container $container The DI container. + * + * @return FileInjector + * @since 3.2.0 + */ + public function getFileInjector(Container $container): FileInjector + { + return new FileInjector( + $container->get('Power.Injector') + ); + } + /** * Get the Compiler Counter * @@ -203,6 +222,7 @@ class Utilities implements ServiceProviderInterface public function getStructure(Container $container): Structure { return new Structure( + $container->get('Placeholder'), $container->get('Component.Settings'), $container->get('Utilities.Paths'), $container->get('Utilities.Counter'), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php index f0cca1754..1f15a35b8 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Templatelayout/Data.php @@ -160,10 +160,10 @@ class Data { // set the Layout data $lay1 = GetHelper::allBetween( - $content, "JLayoutHelper::render('", "'," + $content, "LayoutHelper::render('", "'," ); $lay2 = GetHelper::allBetween( - $content, 'JLayoutHelper::render("', '",' + $content, 'LayoutHelper::render("', '",' ); if (ArrayHelper::check($lay1) && ArrayHelper::check($lay2)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php new file mode 100644 index 000000000..47c9af0bf --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/FileInjector.php @@ -0,0 +1,213 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Compiler\Utilities; + + +use VDM\Joomla\Componentbuilder\Compiler\Power\Injector as Power; +use VDM\Joomla\Utilities\MathHelper; + + +/** + * File Injector + * Thanks to http://stackoverflow.com/a/16813550/1429677 + * + * @since 3.2.0 + */ +final class FileInjector +{ + /** + * The Injector Class. + * + * @var Power + * @since 3.2.0 + */ + protected Power $power; + + /** + * The pattern to get the powers + * + * @var string + * @since 3.2.0 + **/ + protected string $pattern = '/Super_'.'_'.'_[a-zA-Z0-9_]+_'.'_'.'_Power/'; + + /** + * Constructor. + * + * @param Power $power The Injector Class. + * + * @since 3.2.0 + */ + public function __construct(Power $power) + { + $this->power = $power; + } + + /** + * Inserts or replaces data in a file at a specific position. + * + * @param string $file The path of the file to modify. + * @param string $data The data to insert or replace. + * @param int $position The position in the file where the data should be inserted or replaced. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @throws \RuntimeException If unable to open or modify the file. + * @throws \InvalidArgumentException If the position is negative. + * @since 3.2.0 + */ + public function add(string $file, string $data, int $position, ?int $replace = null): void + { + if ($position < 0) + { + throw new \InvalidArgumentException('Position cannot be negative.'); + } + + $found_super_powers = preg_match($this->pattern, $data); + $actual_file = $this->openFileWithLock($file); + + try + { + $temp_file = fopen('php://temp', "rw+"); + if ($temp_file === false) + { + throw new \RuntimeException("Unable to open temporary file."); + } + + $this->processFile($actual_file, $temp_file, $data, $position, $replace); + + if ($found_super_powers) + { + $this->injectSuperPowers($actual_file); + } + } + finally + { + flock($actual_file, LOCK_UN); + fclose($actual_file); + if (isset($temp_file)) + { + fclose($temp_file); + } + } + } + + /** + * Opens a file and acquires an exclusive lock on it. + * + * @param string $file The file path to open. + * + * @return resource The file handle. + * @throws \RuntimeException If the file cannot be opened or locked. + * @since 3.2.0 + */ + private function openFileWithLock(string $file) + { + $actual_file = fopen($file, "rw+"); + if ($actual_file === false || !flock($actual_file, LOCK_EX)) + { + throw new \RuntimeException("Unable to open and lock the file: {$file}"); + } + return $actual_file; + } + + /** + * Processes the file for data insertion and copying the remaining data. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param string $data The data to be inserted. + * @param int $position The position in the file for the data insertion. + * @param int|null $replace The number of bytes to replace; if null, data will be inserted. + * + * @return void + * @since 3.2.0 + */ + private function processFile($actual_file, $temp_file, string $data, int $position, ?int $replace): void + { + // Make a copy of the file in the temporary stream + stream_copy_to_stream($actual_file, $temp_file); + + // Move to the position where the data should be added + fseek($actual_file, $position); + + // Add the data + fwrite($actual_file, $data); + + $this->truncateIfNeeded($actual_file, $data, $position); + $this->copyRemainingData($actual_file, $temp_file, $position, $replace); + } + + /** + * Truncates the file after data insertion if necessary. + * + * @param resource $actual_file The file handle. + * @param string $data The data that was inserted. + * @param int $position The position where data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function truncateIfNeeded($actual_file, string $data, int $position): void + { + // Truncate the file at the end of the added data if replacing + $data_length = mb_strlen($data, '8bit'); + $remove = MathHelper::bc('add', $position, $data_length); + ftruncate($actual_file, $remove); + } + + /** + * Copies the remaining data from the temporary stream to the actual file. + * + * @param resource $actual_file The file handle of the actual file. + * @param resource $temp_file The file handle of the temporary file. + * @param int $position The position in the file where data insertion finished. + * @param int|null $replace The number of bytes that were replaced; if null, data was inserted. + * + * @return void + * @since 3.2.0 + */ + private function copyRemainingData($actual_file, $temp_file, int $position, ?int $replace): void + { + // check if this was a replacement of data + $position = MathHelper::bc('add', $position, $replace ?: 0); + + // Move to the position of the remaining data in the temporary stream + fseek($temp_file, $position); + + // Copy the remaining data from the temporary stream to the file + stream_copy_to_stream($temp_file, $actual_file); + } + + /** + * Injects super powers into the file content, if found, and updates the file. + * + * @param resource $actual_file The file handle of the actual file. + * + * @return void + * @since 3.2.0 + */ + private function injectSuperPowers($actual_file): void + { + rewind($actual_file); + + $power_data = $this->power->power( + stream_get_contents($actual_file) + ); + + ftruncate($actual_file, 0); + rewind($actual_file); + + fwrite($actual_file, $power_data); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php index ccef5d633..5cddb26f3 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Utilities/Structure.php @@ -17,8 +17,8 @@ use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File as JoomlaFile; use Joomla\CMS\Filesystem\Folder; -use VDM\Joomla\Componentbuilder\Compiler\Factory as Compiler; -use VDM\Joomla\Componentbuilder\Compiler\Component\Settings; +use VDM\Joomla\Componentbuilder\Compiler\Placeholder; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component\SettingsInterface as Settings; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Paths; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Counter; use VDM\Joomla\Componentbuilder\Compiler\Utilities\File; @@ -35,41 +35,49 @@ use VDM\Joomla\Utilities\StringHelper; class Structure { /** - * Compiler Component Joomla Version Settings + * The Placeholder Class. * - * @var Settings + * @var Placeholder + * @since 3.2.0 + */ + protected Placeholder $placeholder; + + /** + * The SettingsInterface Class. + * + * @var Settings * @since 3.2.0 */ protected Settings $settings; /** - * Compiler Utilities Paths + * The Paths Class. * - * @var Paths + * @var Paths * @since 3.2.0 */ protected Paths $paths; /** - * Compiler Counter + * The Counter Class. * - * @var Counter + * @var Counter * @since 3.2.0 */ protected Counter $counter; /** - * Compiler Utilities File + * The File Class. * - * @var File + * @var File * @since 3.2.0 */ protected File $file; /** - * Compiler Utilities Files + * The Files Class. * - * @var Files + * @var Files * @since 3.2.0 */ protected Files $files; @@ -85,25 +93,25 @@ class Structure /** * Constructor. * - * @param Settings|null $settings The compiler component joomla version settings object. - * @param Paths|null $paths The compiler paths object. - * @param Counter|null $counter The compiler counter object. - * @param File|null $file The compiler file object. - * @param Files|null $files The compiler files object. - * @param CMSApplication|null $app The CMS Application object. + * @param Placeholder $placeholder The Placeholder Class. + * @param Settings $settings The SettingsInterface Class. + * @param Paths $paths The Paths Class. + * @param Counter $counter The Counter Class. + * @param File $file The File Class. + * @param Files $files The Files Class. + * @param CMSApplication|null $app The CMS Application object. * * @since 3.2.0 - * @throws \Exception */ - public function __construct(?Settings $settings = null, ?Paths $paths = null, - ?Counter $counter = null, ?File $file = null, ?Files $files = null, - ?CMSApplication $app = null) + public function __construct(Placeholder $placeholder, Settings $settings, Paths $paths, + Counter $counter, File $file, Files $files, ?CMSApplication $app = null) { - $this->settings = $settings ?: Compiler::_('Component.Settings'); - $this->paths = $paths ?: Compiler::_('Utilities.Paths'); - $this->counter = $counter ?: Compiler::_('Utilities.Counter'); - $this->file = $file ?: Compiler::_('Utilities.File'); - $this->files = $files ?: Compiler::_('Utilities.Files'); + $this->placeholder = $placeholder; + $this->settings = $settings; + $this->paths = $paths; + $this->counter = $counter; + $this->file = $file; + $this->files = $files; $this->app = $app ?: Factory::getApplication(); } @@ -130,6 +138,15 @@ class Structure // search the target foreach ($target as $main => $name) { + // get the key name (either file name or name) + $key = $fileName ?? $name; + + // add to placeholders as Name and name + $this->placeholder->set('Name', StringHelper::safe($name, 'F')); + $this->placeholder->set('name', StringHelper::safe($name)); + $this->placeholder->set('Key', StringHelper::safe($key, 'F')); + $this->placeholder->set('key', StringHelper::safe($key)); + // make sure it is lower case $name = StringHelper::safe($name); @@ -157,6 +174,12 @@ class Structure } } } + + // remove the name from placeholders + $this->placeholder->remove('Name'); + $this->placeholder->remove('name'); + $this->placeholder->remove('Key'); + $this->placeholder->remove('key'); } } @@ -251,6 +274,8 @@ class Structure { $path = $details->path; } + + $path = $this->placeholder->update_($path); // make sure we have component to replace if (strpos((string) $path, 'c0mp0n3nt') !== false) @@ -291,23 +316,27 @@ class Structure if (!empty($fileName)) { $name = $name . '_' . $fileName; + } - return str_replace( + if ($details->rename === 'new') + { + $item = $details->newName; + } + elseif (!empty($fileName)) + { + $item = str_replace( $details->rename, $fileName, $item ); } - elseif ($details->rename === 'new') + else { - return $details->newName; + $item = str_replace( + $details->rename, $name, $item + ); } - - return str_replace( - $details->rename, $name, $item - ); } - return $item; - } - + return $this->placeholder->update_($item); + } } diff --git a/admin/helpers/extrusion/b_builder.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Builder.php similarity index 72% rename from admin/helpers/extrusion/b_builder.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Builder.php index 81e145cc0..94d6734c8 100644 --- a/admin/helpers/extrusion/b_builder.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Builder.php @@ -1,294 +1,287 @@ + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ - @version 1.0.0 - @created 26th December, 2016 - @package Component Builder - @subpackage builder.php - @author Llewellyn van der Merwe - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +namespace VDM\Joomla\Componentbuilder\Extrusion\Helper; -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +// use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; (for Joomla 4 and above) use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Extrusion\Helper\Mapping; + /** - * Builder class + * Builder class + * + * @since 3.2.0 */ class Builder extends Mapping { - /** - * Some default fields - */ - public $user; - public $today; - public $db; - public $views = array(); - public $admin_fields = array(); - protected $fields = array(); - protected $title = array(); - protected $description = array(); - protected $alias = array(); - protected $list = array(); - - /** - * Field that should not be used in name, alias, disc, and list view - * (TODO) We may need to set this dynamicly - */ - protected $avoidList = array('not_required'); - - /*** - * Constructor - */ - public function __construct(&$data) - { - // first we run the perent constructor - if (parent::__construct($data)) - { - // always reset the building values if found - $data['buildcomp'] = 0; - $data['buildcompsql'] = ''; - // set some globals - $this->db = JFactory::getDbo(); - $this->user = JFactory::getUser(); - $this->today = JFactory::getDate()->toSql(); - - // no start the building of the views and fields - if ($this->setBuild()) - { - return true; - } - } - return false; - } - - /** - * The building function - * To build the views and fields that are needed - */ - protected function setBuild() - { - foreach ($this->map as $view => $fields) - { - // set this field with all its needed data - foreach ($fields as $field) - { - $this->setField($view, $field); - } - // set this view with all its needed data - $this->setView($view); - } - return true; - } - - /** - * The building function for views - */ - protected function setView(&$name) - { - // set the view object - $object = new stdClass(); - $object->system_name = StringHelper::check($name, 'W') . ' (dynamic build)'; - $object->name_single = $name; - $object->name_list = $name. 's'; - $object->short_description = $name. ' view (dynamic build)'; - $object->type = 1; - $object->description = $name. ' view (dynamic build)'; - $object->add_fadein = 1; - $object->add_sql = (isset($this->addSql[$name])) ? $this->addSql[$name]: 0; - $object->source = (isset($this->source[$name])) ? $this->source[$name]: 0; - $object->sql = (isset($this->sql[$name])) ? base64_encode($this->sql[$name]): ''; - $object->addpermissions = '{"action":["view.edit","view.edit.own","view.edit.state","view.create","view.delete","view.access"],"implementation":["3","3","3","3","3","3"]}'; - $object->created = $this->today; - $object->created_by = $this->user->id; - $object->published = 1; - // add to data base - if ($this->db->insertObject('#__componentbuilder_admin_view', $object)) - { - // make sure the access of asset is set - $id = $this->db->insertid(); - ComponentbuilderHelper::setAsset($id, 'admin_view'); - // load the views - $this->views[] = $id; - // load the admin view fields - return $this->addFields($name, $id); - } - return false; - } - - /** - * Add the fields to the view - */ - protected function addFields(&$view, &$view_id) - { - if (isset($this->fields[$view])) - { - // set some defaults - $addField = array (); - $fixLink = (isset($this->title[$view])) ? 0 : 1; - // build the field data... hmmm - foreach ($this->fields[$view] as $nr => $id) - { - $alignment = 1; - if ($nr % 2 == 0) - { - $alignment = 2; - } - // some defaults - $isTitle = (isset($this->title[$view]) && $this->title[$view] == $id) ? 1 : 0; - $isAlias = (isset($this->alias[$view]) && $this->alias[$view] == $id) ? 1 : 0; - $isList = ($key = array_search($id, $this->list[$view])) ? 1 : 0; - $isLink = ($isTitle) ? 1 : (($isList && $fixLink) ? 1 : 0); - if ($isLink) - { - $fixLink = 0; - } - // load the field values - $addField['addfields'.$nr]['field'] = $id; - $addField['addfields'.$nr]['list'] = $isList; - $addField['addfields'.$nr]['order_list'] = ($key) ? $key : 0; - $addField['addfields'.$nr]['title'] = $isTitle; - $addField['addfields'.$nr]['alias'] = $isAlias; - $addField['addfields'.$nr]['sort'] = $isList; - $addField['addfields'.$nr]['search'] = $isList; - $addField['addfields'.$nr]['filter'] = $isList; - $addField['addfields'.$nr]['link'] = $isLink; - $addField['addfields'.$nr]['tab'] = 1; - $addField['addfields'.$nr]['alignment'] = ($isTitle || $isAlias) ? 4 : $alignment; - $addField['addfields'.$nr]['order_edit'] = $nr; - $addField['addfields'.$nr]['permission'] = 0; - } - - // set the field object - $object = new stdClass(); - $object->admin_view = $view_id; - $object->addfields = json_encode($addField, JSON_FORCE_OBJECT); - $object->created = $this->today; - $object->created_by = $this->user->id; - $object->published = 1; - // add to data base - return $this->db->insertObject('#__componentbuilder_admin_fields', $object); - } - return false; - } - - /** - * The building function for fields - */ - protected function setField(&$view, &$field) - { - if ($fieldType = CFactory::_('Field.Type.Name')->get($field['fieldType'])) - { - // set the field object - $object = new stdClass(); - $object->name = $field['label'] . ' (dynamic build)'; - $object->fieldtype = $fieldType; - $object->datatype = $field['dataType']; - $object->indexes = $field['key']; - $object->null_switch = $field['null']; - $object->datalenght = $field['size']; - $object->datalenght_other = $field['sizeOther']; - $object->datadefault = $field['default']; - $object->datadefault_other = $field['defaultOther']; - $object->created = $this->today; - $object->created_by = $this->user->id; - $object->published = 1; - $object->store = 0; - $object->xml = $this->setFieldXML($field, $fieldType); - // add to data base - if ($this->db->insertObject('#__componentbuilder_field', $object)) - { - // make sure the access of asset is set - $id = $this->db->insertid(); - ComponentbuilderHelper::setAsset($id, 'field'); - // check if any field for this field was already set, if not set array - if (!isset($this->fields[$view])) - { - $this->fields[$view] = array(); - } - // load the field - $this->fields[$view][] = $id; - - if (!isset($this->list[$view])) - { - $this->list[$view] = array(); - } - // insure that some fields are avoided - if (!in_array($field['name'], $this->avoidList)) - { - // set the name/title field if found - if (!isset($this->title[$view]) && (stripos($field['name'], 'name') !== false || stripos($field['name'], 'title') !== false)) - { - $this->title[$view] = $id; - $this->list[$view][] = $id; - } - // set the alias field if found - elseif (!isset($this->alias[$id]) && stripos($field['name'], 'alias') !== false) - { - $this->alias[$view] = $id; - } - // set the alias field if found - elseif (!isset($this->description[$id]) && stripos($field['name'], 'desc') !== false) - { - $this->description[$view] = $id; - $this->list[$view][] = $id; - } - elseif ('Text' == $field['fieldType'] && count($this->list[$view]) < 5) - { - $this->list[$view][] = $id; - } - } - return true; - } - } - return false; - } - - /** - * get the field type id from system - */ - protected function getFieldType($fieldName) - { - // load the field settings - return GetHelper::var('fieldtype', $fieldName, 'name', 'id'); - } - - /** - * The building function for field xml - */ - protected function setFieldXML(&$field, $fieldId) - { - // load the field settings - $settings = array(); - $settings['name'] = $field['name']; - $settings['description'] = 'The '.strtolower($field['label']) . ' is set here.'; - $settings['message'] = "Error! Please add some ".strtolower($field['label'])." here."; - $settings['label'] = $field['label']; - $settings['default'] = ($field['default'] == 'Other') ? $field['defaultOther'] : $field['default']; - $settings['hint'] = $field['label'] .' Here!'; - // okay set the xml field values - if ($fieldOptions = ComponentbuilderHelper::getFieldTypeProperties($fieldId, 'id', $settings)) - { - return json_encode($fieldOptions['values']); - } - return ''; + /** + * Some default fields + */ + public $user; + public $today; + public $db; + public array $views = []; + public array $admin_fields = []; + protected array $fields = []; + protected array $title = []; + protected array $description = []; + protected array $alias = []; + protected array $list = []; + + /** + * Field that should not be used in name, alias, disc, and list view + * (TODO) We may need to set this dynamicly + */ + protected array $avoidList = ['not_required']; + + /*** + * Constructor + */ + public function __construct(&$data) + { + // first we run the perent constructor + if (parent::__construct($data)) + { + // always reset the building values if found + $data['buildcomp'] = 0; + $data['buildcompsql'] = ''; + // set some globals + $this->db = Factory::getDbo(); + $this->user = Factory::getUser(); + $this->today = Factory::getDate()->toSql(); + + // no start the building of the views and fields + if ($this->setBuild()) + { + return true; + } + } + return false; + } + + /** + * The building function + * To build the views and fields that are needed + */ + protected function setBuild() + { + foreach ($this->map as $view => $fields) + { + // set this field with all its needed data + foreach ($fields as $field) + { + $this->setField($view, $field); + } + // set this view with all its needed data + $this->setView($view); + } + return true; + } + + /** + * The building function for views + */ + protected function setView(&$name) + { + // set the view object + $object = new \stdClass(); + $object->system_name = StringHelper::check($name, 'W') . ' (dynamic build)'; + $object->name_single = $name; + $object->name_list = $name. 's'; + $object->short_description = $name. ' view (dynamic build)'; + $object->type = 1; + $object->description = $name. ' view (dynamic build)'; + $object->add_fadein = 1; + $object->add_sql = (isset($this->addSql[$name])) ? $this->addSql[$name]: 0; + $object->source = (isset($this->source[$name])) ? $this->source[$name]: 0; + $object->sql = (isset($this->sql[$name])) ? base64_encode($this->sql[$name]): ''; + $object->addpermissions = '{"action":["view.edit","view.edit.own","view.edit.state","view.create","view.delete","view.access"],"implementation":["3","3","3","3","3","3"]}'; + $object->created = $this->today; + $object->created_by = $this->user->id; + $object->published = 1; + // add to data base + if ($this->db->insertObject('#__componentbuilder_admin_view', $object)) + { + // make sure the access of asset is set + $id = $this->db->insertid(); + \ComponentbuilderHelper::setAsset($id, 'admin_view'); + // load the views + $this->views[] = $id; + // load the admin view fields + return $this->addFields($name, $id); + } + return false; + } + + /** + * Add the fields to the view + */ + protected function addFields(&$view, &$view_id) + { + if (isset($this->fields[$view])) + { + // set some defaults + $addField = array (); + $fixLink = (isset($this->title[$view])) ? 0 : 1; + // build the field data... hmmm + foreach ($this->fields[$view] as $nr => $id) + { + $alignment = 1; + if ($nr % 2 == 0) + { + $alignment = 2; + } + // some defaults + $isTitle = (isset($this->title[$view]) && $this->title[$view] == $id) ? 1 : 0; + $isAlias = (isset($this->alias[$view]) && $this->alias[$view] == $id) ? 1 : 0; + $isList = ($key = array_search($id, $this->list[$view])) ? 1 : 0; + $isLink = ($isTitle) ? 1 : (($isList && $fixLink) ? 1 : 0); + if ($isLink) + { + $fixLink = 0; + } + // load the field values + $addField['addfields'.$nr]['field'] = $id; + $addField['addfields'.$nr]['list'] = $isList; + $addField['addfields'.$nr]['order_list'] = ($key) ? $key : 0; + $addField['addfields'.$nr]['title'] = $isTitle; + $addField['addfields'.$nr]['alias'] = $isAlias; + $addField['addfields'.$nr]['sort'] = $isList; + $addField['addfields'.$nr]['search'] = $isList; + $addField['addfields'.$nr]['filter'] = $isList; + $addField['addfields'.$nr]['link'] = $isLink; + $addField['addfields'.$nr]['tab'] = 1; + $addField['addfields'.$nr]['alignment'] = ($isTitle || $isAlias) ? 4 : $alignment; + $addField['addfields'.$nr]['order_edit'] = $nr; + $addField['addfields'.$nr]['permission'] = 0; + } + + // set the field object + $object = new \stdClass(); + $object->admin_view = $view_id; + $object->addfields = json_encode($addField, JSON_FORCE_OBJECT); + $object->created = $this->today; + $object->created_by = $this->user->id; + $object->published = 1; + // add to data base + return $this->db->insertObject('#__componentbuilder_admin_fields', $object); + } + return false; + } + + /** + * The building function for fields + */ + protected function setField(&$view, &$field) + { + if ($fieldType = CFactory::_('Field.Type.Name')->get($field['fieldType'])) + { + // set the field object + $object = new \stdClass(); + $object->name = $field['label'] . ' (dynamic build)'; + $object->fieldtype = $fieldType; + $object->datatype = $field['dataType']; + $object->indexes = $field['key']; + $object->null_switch = $field['null']; + $object->datalenght = $field['size']; + $object->datalenght_other = $field['sizeOther']; + $object->datadefault = $field['default']; + $object->datadefault_other = $field['defaultOther']; + $object->created = $this->today; + $object->created_by = $this->user->id; + $object->published = 1; + $object->store = 0; + $object->xml = $this->setFieldXML($field, $fieldType); + // add to data base + if ($this->db->insertObject('#__componentbuilder_field', $object)) + { + // make sure the access of asset is set + $id = $this->db->insertid(); + \ComponentbuilderHelper::setAsset($id, 'field'); + // check if any field for this field was already set, if not set array + if (!isset($this->fields[$view])) + { + $this->fields[$view] = []; + } + // load the field + $this->fields[$view][] = $id; + + if (!isset($this->list[$view])) + { + $this->list[$view] = []; + } + // insure that some fields are avoided + if (!in_array($field['name'], $this->avoidList)) + { + // set the name/title field if found + if (!isset($this->title[$view]) && (stripos($field['name'], 'name') !== false || stripos($field['name'], 'title') !== false)) + { + $this->title[$view] = $id; + $this->list[$view][] = $id; + } + // set the alias field if found + elseif (!isset($this->alias[$id]) && stripos($field['name'], 'alias') !== false) + { + $this->alias[$view] = $id; + } + // set the alias field if found + elseif (!isset($this->description[$id]) && stripos($field['name'], 'desc') !== false) + { + $this->description[$view] = $id; + $this->list[$view][] = $id; + } + elseif ('Text' == $field['fieldType'] && count($this->list[$view]) < 5) + { + $this->list[$view][] = $id; + } + } + return true; + } + } + return false; + } + + /** + * get the field type id from system + */ + protected function getFieldType($fieldName) + { + // load the field settings + return GetHelper::var('fieldtype', $fieldName, 'name', 'id'); + } + + /** + * The building function for field xml + */ + protected function setFieldXML(&$field, $fieldId) + { + // load the field settings + $settings = []; + $settings['name'] = $field['name']; + $settings['description'] = 'The '.strtolower($field['label']) . ' is set here.'; + $settings['message'] = "Error! Please add some ".strtolower($field['label'])." here."; + $settings['label'] = $field['label']; + $settings['default'] = ($field['default'] == 'Other') ? $field['defaultOther'] : $field['default']; + $settings['hint'] = $field['label'] .' Here!'; + // okay set the xml field values + if ($fieldOptions = \ComponentbuilderHelper::getFieldTypeProperties($fieldId, 'id', $settings)) + { + return json_encode($fieldOptions['values']); + } + return ''; } } + diff --git a/admin/helpers/extrusion/c_extrusion.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Extrusion.php similarity index 56% rename from admin/helpers/extrusion/c_extrusion.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Extrusion.php index 718858cbf..2f2a7e55c 100644 --- a/admin/helpers/extrusion/c_extrusion.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Extrusion.php @@ -1,111 +1,103 @@ + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ - @version 1.0.0 - @created 26th December, 2016 - @package Component Builder - @subpackage extrusion.php - @author Llewellyn van der Merwe - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +namespace VDM\Joomla\Componentbuilder\Extrusion\Helper; -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); -use VDM\Joomla\Utilities\GetHelper; +use Joomla\CMS\Language\Text; use VDM\Joomla\Utilities\ArrayHelper; +use VDM\Joomla\Utilities\GetHelper; +use VDM\Joomla\Componentbuilder\Extrusion\Helper\Builder; + /** - * Extrusion class + * Extrusion class + * + * @since 3.2.0 */ class Extrusion extends Builder { - /*** - * Constructor - */ - public function __construct(&$data) - { - // first we run the perent constructor - if (parent::__construct($data)) - { - // link the view data to the component - if ($this->setAdminViews($data['id'])) - { - $this->app->enqueueMessage( - JText::_('All the fields and views from your sql dump has been created and linked to this component.'), - 'Success' - ); - return true; - } - } - return false; + /*** + * Constructor + */ + public function __construct(&$data) + { + // first we run the perent constructor + if (parent::__construct($data)) + { + // link the view data to the component + if ($this->setAdminViews($data['id'])) + { + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_ALL_THE_FIELDS_AND_VIEWS_FROM_YOUR_SQL_DUMP_HAS_BEEN_CREATED_AND_LINKED_TO_THIS_COMPONENT'), + 'Success' + ); + return true; + } + } + return false; + } + + /** + * link the build views to the component + */ + protected function setAdminViews(&$component_id) + { + // check if views were set + if (ArrayHelper::check($this->views)) + { + $count = 0; + if (ArrayHelper::check($this->addadmin_views)) + { + $count = (int) count((array)$this->addadmin_views) + 3; + } + // set the admin view data linking + foreach ($this->views as $nr => $id) + { + $pointer = $count + $nr; + $this->addadmin_views['addadmin_views'.$pointer]['adminview'] = $id; + $this->addadmin_views['addadmin_views'.$pointer]['icomoon'] = 'joomla'; + $this->addadmin_views['addadmin_views'.$pointer]['mainmenu'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['dashboard_add'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['dashboard_list'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['submenu'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['checkin'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['history'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['metadata'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['access'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['port'] = 1; + $this->addadmin_views['addadmin_views'.$pointer]['edit_create_site_view'] = 0; + $this->addadmin_views['addadmin_views'.$pointer]['order'] = $pointer + 1; + } + } + if (isset($this->addadmin_views) && ArrayHelper::check($this->addadmin_views)) + { + // set the field object + $object = new \stdClass(); + $object->joomla_component = $component_id; + $object->addadmin_views = json_encode($this->addadmin_views, JSON_FORCE_OBJECT); + $object->created = $this->today; + $object->created_by = $this->user->id; + $object->published = 1; + // check if it is already set + if ($item_id = GetHelper::var('component_admin_views', $component_id, 'joomla_component', 'id')) + { + // set ID + $object->id = (int) $item_id; + return $this->db->updateObject('#__componentbuilder_component_admin_views', $object, 'id'); + } + // add to data base + return $this->db->insertObject('#__componentbuilder_component_admin_views', $object); + } + return false; } - - /** - * link the build views to the component - */ - protected function setAdminViews(&$component_id) - { - // check if views were set - if (ArrayHelper::check($this->views)) - { - $count = 0; - if (ArrayHelper::check($this->addadmin_views)) - { - $count = (int) count((array)$this->addadmin_views) + 3; - } - // set the admin view data linking - foreach ($this->views as $nr => $id) - { - $pointer = $count + $nr; - $this->addadmin_views['addadmin_views'.$pointer]['adminview'] = $id; - $this->addadmin_views['addadmin_views'.$pointer]['icomoon'] = 'joomla'; - $this->addadmin_views['addadmin_views'.$pointer]['mainmenu'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['dashboard_add'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['dashboard_list'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['submenu'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['checkin'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['history'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['metadata'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['access'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['port'] = 1; - $this->addadmin_views['addadmin_views'.$pointer]['edit_create_site_view'] = 0; - $this->addadmin_views['addadmin_views'.$pointer]['order'] = $pointer + 1; - } - } - if (isset($this->addadmin_views) && ArrayHelper::check($this->addadmin_views)) - { - // set the field object - $object = new stdClass(); - $object->joomla_component = $component_id; - $object->addadmin_views = json_encode($this->addadmin_views, JSON_FORCE_OBJECT); - $object->created = $this->today; - $object->created_by = $this->user->id; - $object->published = 1; - // check if it is already set - if ($item_id = GetHelper::var('component_admin_views', $component_id, 'joomla_component', 'id')) - { - // set ID - $object->id = (int) $item_id; - return $this->db->updateObject('#__componentbuilder_component_admin_views', $object, 'id'); - } - // add to data base - return $this->db->insertObject('#__componentbuilder_component_admin_views', $object); - } - return false; - } } + diff --git a/admin/helpers/extrusion/a_mapping.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Mapping.php similarity index 70% rename from admin/helpers/extrusion/a_mapping.php rename to libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Mapping.php index d5149def1..aac396e9b 100644 --- a/admin/helpers/extrusion/a_mapping.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/Mapping.php @@ -1,420 +1,422 @@ + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ - @version 1.0.0 - @created 26th December, 2016 - @package Component Builder - @subpackage mapping.php - @author Llewellyn van der Merwe - @my wife Roline van der Merwe - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ +namespace VDM\Joomla\Componentbuilder\Extrusion\Helper; -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +// use Joomla\Database\DatabaseDriver; (for Joomla 4 and above) use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\ArrayHelper; + /** - * Mapping class + * Mapping class + * + * @since 3.2.0 */ class Mapping { - /** - * Some default fields - */ - protected $buildcompsql; - public $id; - public $name_code; - public $addadmin_views; - public $addSql = array(); - public $source = array(); - public $sql = array(); - - /** - * The map of the needed fields and views - */ - public $map; - - /** - * The app to load messages mostly - */ - public $app; - - /** - * The needed set of keys needed to set - */ - protected $setting = array('id' => 'default', 'buildcompsql' => 'base64', 'name_code' => 'safeString'); - - /** - * The needed set of keys needed to set - */ - protected $notRequiered = array('id', 'asset_id', 'published', - 'created_by', 'modified_by', 'created', 'modified', 'checked_out','checked_out_time', - 'version', 'hits', 'access', 'ordering', - 'metakey', 'metadesc', 'metadata', 'params'); - - /** - * The datatypes and it linked field types (basic) - * (TODO) We may need to set this dynamicly - */ - protected $dataTypes = array( 'VARCHAR' => 'Text', 'CHAR' => 'Text', - 'MEDIUMTEXT' => 'Textarea', 'LONGTEXT' => 'Textarea', - 'TEXT' => 'Textarea', 'DATETIME' => 'Calendar', - 'DATE' => 'Text', 'TIME' => 'Text', 'TINYINT' => 'Text', - 'BIGINT' => 'Text', 'INT' => 'Text', 'FLOAT' => 'Text', - 'DECIMAL' => 'Text', 'DOUBLE' => 'Text'); - - /** - * The datasize identifiers - */ - protected $dataSize = array( - 'CHAR', 'VARCHAR', 'INT', 'TINYINT', - 'BIGINT', 'FLOAT', 'DECIMAL', 'DOUBLE'); - - /** - * The default identifiers - */ - protected $defaults = array(0, 1, "CURRENT_TIMESTAMP", "DATETIME"); // Other - - /** - * The sizes identifiers - */ - protected $sizes = array("1", "7", "10", "11", "50", "64", "100", "255", "1024", "2048"); // Other - - - /** - * Constructor - */ - public function __construct($data = false) - { - // set the app to insure messages can be set - $this->app = JFactory::getApplication(); - // check that we have data - if (ArrayHelper::check($data)) - { - // make sure we have an id - if (isset($data['id']) && $data['id'] > 0) - { - if (isset($data['buildcomp']) && 1 == $data['buildcomp'] && isset($data['buildcompsql'])) - { - foreach ($data as $key => $value) - { - if (isset($this->setting[$key])) - { - switch($this->setting[$key]) - { - case 'base64': - // set needed value - $this->$key = base64_decode((string) $value); - break; - case 'json': - // set needed value - $this->$key = json_decode((string) $value, true); - break; - case 'safeString': - // set needed value - $this->$key = StringHelper::check($value); - break; - default : - $this->$key = $value; - break; - } - } - } - // get linked admin views - $addadmin_views = GetHelper::var('component_admin_views', $data['id'], 'joomla_component', 'addadmin_views'); - if (JsonHelper::check($addadmin_views)) - { - $this->addadmin_views = json_decode((string)$addadmin_views, true); - } - // set the map of the views needed - if ($this->setMap()) - { - return true; - } - $this->app->enqueueMessage( - JText::_('No "CREATE TABLE.." were found, please check your sql.'), - 'Error' - ); - return false; - } - return false; // not set so just return without any error - } - $this->app->enqueueMessage( - JText::_('Please try again, this error usualy happens if it is a new component, beacues we need a component ID to do this build with your sql dump.'), - 'Error' - ); - return false; - } - $this->app->enqueueMessage( - JText::_('Could not find the data needed to continue.'), - 'Error' - ); - return false; - } - - /** - * The mapping function - * To Map the views and fields that are needed - */ - protected function setMap() - { - // start parsing the sql dump data - $queries = JDatabaseDriver::splitSql($this->buildcompsql); - if (ArrayHelper::check($queries)) - { - foreach ($queries as $query) - { - // only use create table queries - if (strpos($query, 'CREATE TABLE IF NOT EXISTS') !== false || - strpos($query, 'CREATE TABLE') !== false) - { - if ($tableName = $this->getTableName($query)) - { - // now get the fields/columns of this view/table - if ($fields = $this->getFields($query)) - { - // make sure it is all lower case from here on - $tableName = strtolower($tableName); - $this->map[$tableName] = $fields; - } - } - else - { - continue; - } - } - // get the insert data if set - if (strpos($query, 'INSERT INTO `') !== false) - { - if ($tableName = $this->getTableName($query)) - { - $this->addSql[$tableName] = 1; - $this->source[$tableName] = 2; - $this->sql[$tableName] = $query; - } - } - } - // check if the mapping was done - if (ArrayHelper::check($this->map)) - { - return true; - } - } - return false; - } - - /** - * Get the table name - */ - protected function getTableName(&$query) - { - if (strpos($query, '`#__') !== false) - { - // get table name - $tableName = GetHelper::between($query, '`#__', "`"); - } - elseif (strpos($query, "'#__") !== false) - { - // get table name - $tableName = GetHelper::between($query, "'#__", "'"); - } - // if it still was not found - if (!isset($tableName) || !ComponentbuilderHelper::checkString($tableName)) - { - // skip this query - return false; - } - // clean the table name (so only view name remain) - if (strpos($tableName, $this->name_code) !== false) - { - $tableName = trim(str_replace($this->name_code, '', $tableName), '_'); - } - // if found - if (ComponentbuilderHelper::checkString($tableName)) - { - return $tableName; - } - // skip this query - return false; - } - - /** - * Get the field details - */ - protected function getFields(&$query) - { - $rows = array_map('trim', explode(PHP_EOL, $query)); - $fields = array(); - foreach ($rows as $row) - { - // make sure we have a lower case string - $row = strtoupper($row); - $field = array(); - $name = ''; - if (0 === strpos($row, '`')) - { - // get field name - $name = GetHelper::between($row, '`', '`'); - } - if (0 === strpos($row, "'")) - { - // get field name - $name = GetHelper::between($row, "'", "'"); - } - // check if the name was found - if (ComponentbuilderHelper::checkString($name)) - { - // insure we have the name in lower case from here on - $name = strtolower($name); - // only continue if field is requered - if (in_array($name, $this->notRequiered)) - { - continue; - } - // check if the field type is found - if ($fieldType = $this->getType($row, $field, $name)) - { - $field['row'] = $row; - $field['name'] = $name; - $field['label'] = StringHelper::check($name, 'W'); - $field['fieldType'] = $fieldType; - $field['size'] = $this->getSize($row, $field); - $field['sizeOther'] = ''; - if (!in_array($field['size'], $this->sizes)) - { - if (ComponentbuilderHelper::checkString($field['size'])) - { - $field['sizeOther'] = $field['size']; - $field['size'] = 'Other'; - } - } - $field['default'] = $this->getDefault($row); - $field['defaultOther'] = ''; - if (!in_array($field['default'], $this->defaults)) - { - if (ComponentbuilderHelper::checkString($field['default'])) - { - $field['defaultOther'] = $field['default']; - $field['default'] = 'Other'; - } - } - $field['null'] = $this->getNullValue($row, $field); - // check if field is a key - $field['key'] = $this->getKeyStatus($rows, $name); - // load to fields - $fields[] = $field; - } - } - } - if (ArrayHelper::check($fields)) - { - return $fields; - } - return false; - } - - /** - * Get the field types - */ - protected function getType($row, &$field, &$name) - { - // first remove field name - $row = str_replace($name, '', $row); - // get the data type first - foreach ($this->dataTypes as $type => $fieldType) - { - if (strpos($row, $type) !== false) - { - $field['dataType'] = $type; - return $fieldType; - } - } - return false; - } - - /** - * Get the field size - */ - protected function getSize(&$row, $field) - { - if (in_array($field['dataType'], $this->dataSize)) - { - return GetHelper::between($row, $field['dataType'].'(', ')'); - } - return ''; - } - - /** - * Get the field default - */ - protected function getDefault(&$row) - { - // get default value - if (strpos($row, 'DEFAULT "') !== false) // to sure it this is correct... - { - return GetHelper::between($row, 'DEFAULT "', '"'); - } - // get default value - if (strpos($row, "DEFAULT '") !== false) - { - return GetHelper::between($row, "DEFAULT '", "'"); - } - return ''; - } - - /** - * Get the field Null Value - */ - protected function getNullValue(&$row, &$field) - { - // get the result of null - if (strpos($row, 'NOT NULL') !== false) - { - return 'NOT NULL'; - } - if (strpos($row, 'DEFAULT NULL') !== false) - { - $field['default'] = 'NULL'; - return ''; - } - return 'NULL'; - } - - /** - * Get the field key status - */ - protected function getKeyStatus(&$rows, &$name) - { - // get the data type first - foreach ($rows as $row) - { - if (strpos($row, 'UNIQUE KEY ') !== false && stripos($row, $name) !== false) - { - return 1; - } - if ((strpos($row, 'PRIMARY KEY ') !== false && stripos($row, $name) !== false) || (strpos($row, 'KEY ') !== false && stripos($row, $name) !== false)) - { - return 2; - } - } - return 0; + /** + * Some default fields + */ + protected $buildcompsql; + public $id; + public $name_code; + public array $addadmin_views; + public array $addSql = []; + public array $source = []; + public array $sql = []; + + /** + * The map of the needed fields and views + */ + public $map; + + /** + * The app to load messages mostly + */ + public $app; + + /** + * The needed set of keys needed to set + */ + protected array $setting = ['id' => 'default', 'buildcompsql' => 'base64', 'name_code' => 'safeString']; + + /** + * The needed set of keys needed to set + */ + protected array $notRequiered = [ + 'id', 'asset_id', 'published', + 'created_by', 'modified_by', 'created', 'modified', 'checked_out','checked_out_time', + 'version', 'hits', 'access', 'ordering', + 'metakey', 'metadesc', 'metadata', 'params' + ]; + + /** + * The datatypes and it linked field types (basic) + * (TODO) We may need to set this dynamicly + */ + protected array $dataTypes = [ + 'VARCHAR' => 'Text', 'CHAR' => 'Text', + 'MEDIUMTEXT' => 'Textarea', 'LONGTEXT' => 'Textarea', + 'TEXT' => 'Textarea', 'DATETIME' => 'Calendar', + 'DATE' => 'Text', 'TIME' => 'Text', 'TINYINT' => 'Text', + 'BIGINT' => 'Text', 'INT' => 'Text', 'FLOAT' => 'Text', + 'DECIMAL' => 'Text', 'DOUBLE' => 'Text' + ]; + + /** + * The datasize identifiers + */ + protected array $dataSize = [ + 'CHAR', 'VARCHAR', 'INT', 'TINYINT', + 'BIGINT', 'FLOAT', 'DECIMAL', 'DOUBLE' + ]; + + /** + * The default identifiers + */ + protected $defaults = [ + 0, 1, "CURRENT_TIMESTAMP", "DATETIME" + ]; // Other + + /** + * The sizes identifiers + */ + protected $sizes = [ + "1", "7", "10", "11", "50", "64", "100", "255", "1024", "2048" + ]; // Other + + /** + * Constructor + */ + public function __construct($data = false) + { + // set the app to insure messages can be set + $this->app = Factory::getApplication(); + + // check that we have data + if (ArrayHelper::check($data)) + { + // make sure we have an id + if (isset($data['id']) && $data['id'] > 0) + { + if (isset($data['buildcomp']) && 1 == $data['buildcomp'] && isset($data['buildcompsql'])) + { + foreach ($data as $key => $value) + { + if (isset($this->setting[$key])) + { + switch($this->setting[$key]) + { + case 'base64': + // set needed value + $this->$key = base64_decode((string) $value); + break; + case 'json': + // set needed value + $this->$key = json_decode((string) $value, true); + break; + case 'safeString': + // set needed value + $this->$key = StringHelper::check($value); + break; + default : + $this->$key = $value; + break; + } + } + } + // get linked admin views + $addadmin_views = GetHelper::var('component_admin_views', $data['id'], 'joomla_component', 'addadmin_views'); + if (JsonHelper::check($addadmin_views)) + { + $this->addadmin_views = json_decode((string)$addadmin_views, true); + } + // set the map of the views needed + if ($this->setMap()) + { + return true; + } + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_NO_CREATE_TABLE_WERE_FOUND_PLEASE_CHECK_YOUR_SQL'), + 'Error' + ); + return false; + } + return false; // not set so just return without any error + } + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_THIS_ERROR_USUALY_HAPPENS_IF_IT_IS_A_NEW_COMPONENT_BEACUES_WE_NEED_A_COMPONENT_ID_TO_DO_THIS_BUILD_WITH_YOUR_SQL_DUMP'), + 'Error' + ); + return false; + } + $this->app->enqueueMessage( + Text::_('COM_COMPONENTBUILDER_COULD_NOT_FIND_THE_DATA_NEEDED_TO_CONTINUE'), + 'Error' + ); + return false; + } + + /** + * The mapping function + * To Map the views and fields that are needed + */ + protected function setMap() + { + // start parsing the sql dump data + $queries = \JDatabaseDriver::splitSql($this->buildcompsql); + if (ArrayHelper::check($queries)) + { + foreach ($queries as $query) + { + // only use create table queries + if (strpos($query, 'CREATE TABLE IF NOT EXISTS') !== false || + strpos($query, 'CREATE TABLE') !== false) + { + if ($tableName = $this->getTableName($query)) + { + // now get the fields/columns of this view/table + if ($fields = $this->getFields($query)) + { + // make sure it is all lower case from here on + $tableName = strtolower($tableName); + $this->map[$tableName] = $fields; + } + } + else + { + continue; + } + } + // get the insert data if set + if (strpos($query, 'INSERT INTO `') !== false) + { + if ($tableName = $this->getTableName($query)) + { + $this->addSql[$tableName] = 1; + $this->source[$tableName] = 2; + $this->sql[$tableName] = $query; + } + } + } + // check if the mapping was done + if (ArrayHelper::check($this->map)) + { + return true; + } + } + return false; + } + + /** + * Get the table name + */ + protected function getTableName(&$query) + { + if (strpos($query, '`#__') !== false) + { + // get table name + $tableName = GetHelper::between($query, '`#__', "`"); + } + elseif (strpos($query, "'#__") !== false) + { + // get table name + $tableName = GetHelper::between($query, "'#__", "'"); + } + // if it still was not found + if (!isset($tableName) || !StringHelper::check($tableName)) + { + // skip this query + return false; + } + // clean the table name (so only view name remain) + if (strpos($tableName, $this->name_code) !== false) + { + $tableName = trim(str_replace($this->name_code, '', $tableName), '_'); + } + // if found + if (StringHelper::check($tableName)) + { + return $tableName; + } + // skip this query + return false; + } + + /** + * Get the field details + */ + protected function getFields(&$query) + { + $rows = array_map('trim', explode(PHP_EOL, $query)); + $fields = array(); + foreach ($rows as $row) + { + // make sure we have a lower case string + $row = strtoupper($row); + $field = array(); + $name = ''; + if (0 === strpos($row, '`')) + { + // get field name + $name = GetHelper::between($row, '`', '`'); + } + if (0 === strpos($row, "'")) + { + // get field name + $name = GetHelper::between($row, "'", "'"); + } + // check if the name was found + if (StringHelper::check($name)) + { + // insure we have the name in lower case from here on + $name = strtolower($name); + // only continue if field is required + if (in_array($name, $this->notRequiered)) + { + continue; + } + // check if the field type is found + if ($fieldType = $this->getType($row, $field, $name)) + { + $field['row'] = $row; + $field['name'] = $name; + $field['label'] = StringHelper::check($name, 'W'); + $field['fieldType'] = $fieldType; + $field['size'] = $this->getSize($row, $field); + $field['sizeOther'] = ''; + if (!in_array($field['size'], $this->sizes)) + { + if (StringHelper::check($field['size'])) + { + $field['sizeOther'] = $field['size']; + $field['size'] = 'Other'; + } + } + $field['default'] = $this->getDefault($row); + $field['defaultOther'] = ''; + if (!in_array($field['default'], $this->defaults)) + { + if (StringHelper::check($field['default'])) + { + $field['defaultOther'] = $field['default']; + $field['default'] = 'Other'; + } + } + $field['null'] = $this->getNullValue($row, $field); + // check if field is a key + $field['key'] = $this->getKeyStatus($rows, $name); + // load to fields + $fields[] = $field; + } + } + } + if (ArrayHelper::check($fields)) + { + return $fields; + } + return false; + } + + /** + * Get the field types + */ + protected function getType($row, &$field, &$name) + { + // first remove field name + $row = str_replace($name, '', $row); + // get the data type first + foreach ($this->dataTypes as $type => $fieldType) + { + if (strpos($row, $type) !== false) + { + $field['dataType'] = $type; + return $fieldType; + } + } + return false; + } + + /** + * Get the field size + */ + protected function getSize(&$row, $field) + { + if (in_array($field['dataType'], $this->dataSize)) + { + return GetHelper::between($row, $field['dataType'].'(', ')'); + } + return ''; + } + + /** + * Get the field default + */ + protected function getDefault(&$row) + { + // get default value + if (strpos($row, 'DEFAULT "') !== false) // to sure it this is correct... + { + return GetHelper::between($row, 'DEFAULT "', '"'); + } + // get default value + if (strpos($row, "DEFAULT '") !== false) + { + return GetHelper::between($row, "DEFAULT '", "'"); + } + return ''; + } + + /** + * Get the field Null Value + */ + protected function getNullValue(&$row, &$field) + { + // get the result of null + if (strpos($row, 'NOT NULL') !== false) + { + return 'NOT NULL'; + } + if (strpos($row, 'DEFAULT NULL') !== false) + { + $field['default'] = 'NULL'; + return ''; + } + return 'NULL'; + } + + /** + * Get the field key status + */ + protected function getKeyStatus(&$rows, &$name) + { + // get the data type first + foreach ($rows as $row) + { + if (strpos($row, 'UNIQUE KEY ') !== false && stripos($row, $name) !== false) + { + return 1; + } + if ((strpos($row, 'PRIMARY KEY ') !== false && stripos($row, $name) !== false) || (strpos($row, 'KEY ') !== false && stripos($row, $name) !== false)) + { + return 2; + } + } + return 0; } } + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/index.html b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Extrusion/Helper/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Database/Load.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Database/Load.php index 42f5632d8..778fdf1f2 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Database/Load.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Power/Database/Load.php @@ -73,7 +73,7 @@ final class Load { return $this->model->value( $this->load->value( - ["a.${field}" => $field], + ["a.{$field}" => $field], ['a' => 'power'], $this->prefix($keys) ), diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Insert.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Insert.php index afce63c7c..89106bf0a 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Insert.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Database/Insert.php @@ -55,10 +55,9 @@ class Insert implements InsertInterface /** * Database object to query local DB * - * @var \JDatabaseDriver * @since 3.2.0 **/ - protected \JDatabaseDriver $db; + protected $db; /** * Constructor @@ -66,17 +65,16 @@ class Insert implements InsertInterface * @param Config|null $config The search config object. * @param Table|null $table The search table object. * @param Model|null $model The search get model object. - * @param \JDatabaseDriver|null $db The database object. * * @since 3.2.0 */ public function __construct(?Config $config = null, ?Table $table = null, - ?Model $model = null, ?\JDatabaseDriver $db = null) + ?Model $model = null) { $this->config = $config ?: Factory::_('Config'); $this->table = $table ?: Factory::_('Table'); $this->model = $model ?: Factory::_('Insert.Model'); - $this->db = $db ?: JoomlaFactory::getDbo(); + $this->db = JoomlaFactory::getDbo(); } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Load.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Load.php index 07dd04bd4..a1149a26e 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Load.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Search/Model/Load.php @@ -119,13 +119,35 @@ class Load extends Model implements ModelInterface */ protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool { + // Start note to self + // Yes we don't search in the field->xml (field) PHP because the xml is messy + // first of all we need to change that storage method :((( seriously + // and the actual PHP is stored in the xml as base64 with a [__.o0=base64=Oo.__] key in front of it + // if I can go back and drag you around by your ear... I will, but okay you did not know better. + // Listen you have tried to fix this a few times already (I lost count) and by the time you realize how it works + // two hours have been wasted, and you usually only then realize why it's not fixed in the first place... o boy... just walk now! + // since unless you have three days don't even look further, this is a huge issue/mess + // and while I agree it needs fixing, it will not take a few hours... but days + // End note to self + // check values if (StringHelper::check($value) || ArrayHelper::check($value, true)) { return true; } + // remove empty values return false; + + // Start another note to self + // If you're still here + // the problem is not opening the PHP in the xml, + // it is storing it with the updated changes... if any are made via the search-update methods + // so the only way to fix this is to change the whole way the xml values in the field table is stored. + // Yes, that is right... all the way back to the field view... and then to update all places you open that xml values + // and get the values out of the xml string and use them, and if you've forgotten, that is nearly everywhere, + // and so let the refactoring of the foundation begin... there I saved you another 3 hours. + // End another note to self } /** diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/CoreRules.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/CoreRules.php new file mode 100644 index 000000000..ce8d63343 --- /dev/null +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/CoreRules.php @@ -0,0 +1,119 @@ + + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace VDM\Joomla\Componentbuilder\Service; + + +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\CMS\Version; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaThree\CoreRule as J3CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFour\CoreRule as J4CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Field\JoomlaFive\CoreRule as J5CoreRule; +use VDM\Joomla\Componentbuilder\Compiler\Interfaces\Field\CoreRuleInterface as CoreRule; + + +/** + * Joomla Core Rules + * + * @since 3.2.0 + */ +class CoreRules implements ServiceProviderInterface +{ + /** + * Current Joomla Version We are IN + * + * @var int + * @since 3.2.0 + **/ + protected $currentVersion; + + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 3.2.0 + */ + public function register(Container $container) + { + $container->alias(J3CoreRule::class, 'J3.Field.Core.Rule') + ->share('J3.Field.Core.Rule', [$this, 'getJ3CoreRule'], true); + + $container->alias(J4CoreRule::class, 'J4.Field.Core.Rule') + ->share('J4.Field.Core.Rule', [$this, 'getJ4CoreRule'], true); + + $container->alias(J5CoreRule::class, 'J5.Field.Core.Rule') + ->share('J5.Field.Core.Rule', [$this, 'getJ5CoreRule'], true); + + $container->alias(CoreRule::class, 'Field.Core.Rule') + ->share('Field.Core.Rule', [$this, 'getCoreRule'], true); + } + + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J3CoreRule + * @since 3.2.0 + */ + public function getJ3CoreRule(Container $container): J3CoreRule + { + return new J3CoreRule(); + } + + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J4CoreRule + * @since 3.2.0 + */ + public function getJ4CoreRule(Container $container): J4CoreRule + { + return new J4CoreRule(); + } + + /** + * Get The CoreRule Class. + * + * @param Container $container The DI container. + * + * @return J5CoreRule + * @since 3.2.0 + */ + public function getJ5CoreRule(Container $container): J5CoreRule + { + return new J5CoreRule(); + } + + /** + * Get The CoreRuleInterface Class. + * + * @param Container $container The DI container. + * + * @return CoreRule + * @since 3.2.0 + */ + public function getCoreRule(Container $container): CoreRule + { + if (empty($this->currentVersion)) + { + $this->currentVersion = Version::MAJOR_VERSION; + } + + return $container->get('J' . $this->currentVersion . '.Field.Core.Rule'); + } +} + diff --git a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php index 0210aa25a..a69d9af12 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Table.php @@ -67,6 +67,51 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], + 'buildcompsql' => [ + 'name' => 'buildcompsql', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL', + 'type' => 'textarea', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dynamic Build (beta)', + ], + 'translation_tool' => [ + 'name' => 'translation_tool', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION_TOOL_LABEL', + 'type' => 'list', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'add_sales_server' => [ + 'name' => 'add_sales_server', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_method_uninstall' => [ + 'name' => 'php_method_uninstall', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'php_preflight_install' => [ + 'name' => 'php_preflight_install', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], 'css_admin' => [ 'name' => 'css_admin', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_ADMIN_LABEL', @@ -76,14 +121,41 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Libs & Helpers', ], - 'php_admin_event' => [ - 'name' => 'php_admin_event', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_LABEL', - 'type' => 'editor', + 'mvc_versiondate' => [ + 'name' => 'mvc_versiondate', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL', + 'type' => 'list', 'title' => false, 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Libs & Helpers', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'remove_line_breaks' => [ + 'name' => 'remove_line_breaks', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'add_placeholders' => [ + 'name' => 'add_placeholders', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'debug_linenr' => [ + 'name' => 'debug_linenr', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', ], 'php_site_event' => [ 'name' => 'php_site_event', @@ -94,18 +166,18 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Libs & Helpers', ], - 'crowdin_username' => [ - 'name' => 'crowdin_username', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_USERNAME_LABEL', - 'type' => 'text', + 'description' => [ + 'name' => 'description', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL', + 'type' => 'textarea', 'title' => false, 'list' => 'joomla_components', - 'store' => 'basic_encryption', - 'tab_name' => 'Dynamic Integration', + 'store' => NULL, + 'tab_name' => 'Details', ], - 'component_version' => [ - 'name' => 'component_version', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL', + 'author' => [ + 'name' => 'author', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL', 'type' => 'text', 'title' => false, 'list' => 'joomla_components', @@ -121,19 +193,10 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Dash & Install', ], - 'remove_line_breaks' => [ - 'name' => 'remove_line_breaks', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REMOVE_LINE_BREAKS_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'description' => [ - 'name' => 'description', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DESCRIPTION_LABEL', - 'type' => 'textarea', + 'email' => [ + 'name' => 'email', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL', + 'type' => 'text', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -148,96 +211,6 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'MySQL', ], - 'debug_linenr' => [ - 'name' => 'debug_linenr', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DEBUG_LINENR_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'mvc_versiondate' => [ - 'name' => 'mvc_versiondate', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_MVC_VERSIONDATE_LABEL', - 'type' => 'list', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'php_preflight_install' => [ - 'name' => 'php_preflight_install', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_INSTALL_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Dash & Install', - ], - 'backup_folder_path' => [ - 'name' => 'backup_folder_path', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dynamic Integration', - ], - 'php_method_uninstall' => [ - 'name' => 'php_method_uninstall', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_METHOD_UNINSTALL_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Dash & Install', - ], - 'add_placeholders' => [ - 'name' => 'add_placeholders', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PLACEHOLDERS_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'author' => [ - 'name' => 'author', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_AUTHOR_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'add_sales_server' => [ - 'name' => 'add_sales_server', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SALES_SERVER_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dynamic Integration', - ], - 'email' => [ - 'name' => 'email', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMAIL_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Details', - ], - 'translation_tool' => [ - 'name' => 'translation_tool', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION_TOOL_LABEL', - 'type' => 'list', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dynamic Integration', - ], 'website' => [ 'name' => 'website', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_LABEL', @@ -247,15 +220,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'buildcompsql' => [ - 'name' => 'buildcompsql', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDCOMPSQL_LABEL', - 'type' => 'textarea', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Dynamic Build (beta)', - ], 'add_license' => [ 'name' => 'add_license', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_LICENSE_LABEL', @@ -265,9 +229,36 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'php_helper_admin' => [ - 'name' => 'php_helper_admin', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN_LABEL', + 'backup_folder_path' => [ + 'name' => 'backup_folder_path', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BACKUP_FOLDER_PATH_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dynamic Integration', + ], + 'php_helper_both' => [ + 'name' => 'php_helper_both', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], + 'crowdin_username' => [ + 'name' => 'crowdin_username', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_USERNAME_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'basic_encryption', + 'tab_name' => 'Dynamic Integration', + ], + 'php_admin_event' => [ + 'name' => 'php_admin_event', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_LABEL', 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', @@ -283,18 +274,27 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'php_helper_site' => [ - 'name' => 'php_helper_site', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL', + 'component_version' => [ + 'name' => 'component_version', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COMPONENT_VERSION_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], + 'php_helper_admin' => [ + 'name' => 'php_helper_admin', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN_LABEL', 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', 'store' => 'base64', 'tab_name' => 'Libs & Helpers', ], - 'javascript' => [ - 'name' => 'javascript', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL', + 'php_helper_site' => [ + 'name' => 'php_helper_site', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_SITE_LABEL', 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', @@ -310,9 +310,9 @@ class Table extends BaseTable implements Tableinterface 'store' => 'basic_encryption', 'tab_name' => 'Details', ], - 'css_site' => [ - 'name' => 'css_site', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL', + 'javascript' => [ + 'name' => 'javascript', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_JAVASCRIPT_LABEL', 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', @@ -328,6 +328,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], + 'css_site' => [ + 'name' => 'css_site', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CSS_SITE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Libs & Helpers', + ], 'whmcs_buy_link' => [ 'name' => 'whmcs_buy_link', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_BUY_LINK_LABEL', @@ -337,15 +346,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'php_preflight_update' => [ - 'name' => 'php_preflight_update', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'base64', - 'tab_name' => 'Dash & Install', - ], 'license' => [ 'name' => 'license', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_LICENSE_LABEL', @@ -355,9 +355,9 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], - 'php_postflight_update' => [ - 'name' => 'php_postflight_update', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL', + 'php_preflight_update' => [ + 'name' => 'php_preflight_update', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_PREFLIGHT_UPDATE_LABEL', 'type' => 'editor', 'title' => false, 'list' => 'joomla_components', @@ -373,6 +373,24 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], + 'php_postflight_update' => [ + 'name' => 'php_postflight_update', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_POSTFLIGHT_UPDATE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'joomla_components', + 'store' => 'base64', + 'tab_name' => 'Dash & Install', + ], + 'image' => [ + 'name' => 'image', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL', + 'type' => 'media', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Details', + ], 'sql' => [ 'name' => 'sql', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_LABEL', @@ -382,10 +400,10 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'MySQL', ], - 'image' => [ - 'name' => 'image', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_IMAGE_LABEL', - 'type' => 'media', + 'copyright' => [ + 'name' => 'copyright', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL', + 'type' => 'textarea', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -400,10 +418,10 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Readme', ], - 'copyright' => [ - 'name' => 'copyright', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_COPYRIGHT_LABEL', - 'type' => 'textarea', + 'preferred_joomla_version' => [ + 'name' => 'preferred_joomla_version', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREFERRED_JOOMLA_VERSION_LABEL', + 'type' => 'number', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -454,6 +472,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'publishing', ], + 'add_php_helper_both' => [ + 'name' => 'add_php_helper_both', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Libs & Helpers', + ], 'add_php_helper_admin' => [ 'name' => 'add_php_helper_admin', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_ADMIN_LABEL', @@ -490,6 +517,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Libs & Helpers', ], + 'add_namespace_prefix' => [ + 'name' => 'add_namespace_prefix', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_NAMESPACE_PREFIX_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], 'add_javascript' => [ 'name' => 'add_javascript', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_JAVASCRIPT_LABEL', @@ -499,6 +535,33 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Libs & Helpers', ], + 'namespace_prefix' => [ + 'name' => 'namespace_prefix', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NAMESPACE_PREFIX_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'add_css_admin' => [ + 'name' => 'add_css_admin', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_ADMIN_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Libs & Helpers', + ], + 'add_css_site' => [ + 'name' => 'add_css_site', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_SITE_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Libs & Helpers', + ], 'add_menu_prefix' => [ 'name' => 'add_menu_prefix', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_MENU_PREFIX_LABEL', @@ -508,14 +571,14 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_css_admin' => [ - 'name' => 'add_css_admin', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_ADMIN_LABEL', + 'dashboard_type' => [ + 'name' => 'dashboard_type', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DASHBOARD_TYPE_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, - 'tab_name' => 'Libs & Helpers', + 'tab_name' => 'Dash & Install', ], 'menu_prefix' => [ 'name' => 'menu_prefix', @@ -526,24 +589,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_css_site' => [ - 'name' => 'add_css_site', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_CSS_SITE_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Libs & Helpers', - ], - 'dashboard_type' => [ - 'name' => 'dashboard_type', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DASHBOARD_TYPE_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Dash & Install', - ], 'dashboard' => [ 'name' => 'dashboard', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_DASHBOARD_LABEL', @@ -553,15 +598,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dash & Install', ], - 'toignore' => [ - 'name' => 'toignore', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TOIGNORE_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Settings', - ], 'add_php_preflight_install' => [ 'name' => 'add_php_preflight_install', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_PREFLIGHT_INSTALL_LABEL', @@ -580,6 +616,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dash & Install', ], + 'toignore' => [ + 'name' => 'toignore', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TOIGNORE_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], 'add_php_postflight_install' => [ 'name' => 'add_php_postflight_install', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_INSTALL_LABEL', @@ -589,6 +634,24 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dash & Install', ], + 'add_php_postflight_update' => [ + 'name' => 'add_php_postflight_update', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_UPDATE_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dash & Install', + ], + 'add_php_method_uninstall' => [ + 'name' => 'add_php_method_uninstall', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_METHOD_UNINSTALL_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Dash & Install', + ], 'export_key' => [ 'name' => 'export_key', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EXPORT_KEY_LABEL', @@ -598,14 +661,14 @@ class Table extends BaseTable implements Tableinterface 'store' => 'basic_encryption', 'tab_name' => 'Settings', ], - 'add_php_postflight_update' => [ - 'name' => 'add_php_postflight_update', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_POSTFLIGHT_UPDATE_LABEL', + 'add_sql' => [ + 'name' => 'add_sql', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, - 'tab_name' => 'Dash & Install', + 'tab_name' => 'MySQL', ], 'joomla_source_link' => [ 'name' => 'joomla_source_link', @@ -616,14 +679,14 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_php_method_uninstall' => [ - 'name' => 'add_php_method_uninstall', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_METHOD_UNINSTALL_LABEL', + 'add_sql_uninstall' => [ + 'name' => 'add_sql_uninstall', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_UNINSTALL_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, - 'tab_name' => 'Dash & Install', + 'tab_name' => 'MySQL', ], 'export_buy_link' => [ 'name' => 'export_buy_link', @@ -634,24 +697,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Settings', ], - 'add_sql' => [ - 'name' => 'add_sql', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'MySQL', - ], - 'add_sql_uninstall' => [ - 'name' => 'add_sql_uninstall', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_SQL_UNINSTALL_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'MySQL', - ], 'assets_table_fix' => [ 'name' => 'assets_table_fix', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ASSETS_TABLE_FIX_LABEL', @@ -661,15 +706,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'MySQL', ], - 'addcontributors' => [ - 'name' => 'addcontributors', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDCONTRIBUTORS_LABEL', - 'type' => 'subform', - 'title' => false, - 'list' => 'joomla_components', - 'store' => 'json', - 'tab_name' => 'Settings', - ], 'readme' => [ 'name' => 'readme', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README_LABEL', @@ -679,15 +715,6 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Readme', ], - 'emptycontributors' => [ - 'name' => 'emptycontributors', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Settings', - ], 'add_update_server' => [ 'name' => 'add_update_server', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_UPDATE_SERVER_LABEL', @@ -697,13 +724,13 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Integration', ], - 'number' => [ - 'name' => 'number', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NUMBER_LABEL', - 'type' => 'number', + 'addcontributors' => [ + 'name' => 'addcontributors', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDCONTRIBUTORS_LABEL', + 'type' => 'subform', 'title' => false, 'list' => 'joomla_components', - 'store' => NULL, + 'store' => 'json', 'tab_name' => 'Settings', ], 'update_server_target' => [ @@ -715,6 +742,24 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Integration', ], + 'emptycontributors' => [ + 'name' => 'emptycontributors', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_EMPTYCONTRIBUTORS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'number' => [ + 'name' => 'number', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NUMBER_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'joomla_components', + 'store' => NULL, + 'tab_name' => 'Settings', + ], 'update_server' => [ 'name' => 'update_server', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER_LABEL', @@ -751,24 +796,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Integration', ], - 'creatuserhelper' => [ - 'name' => 'creatuserhelper', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATUSERHELPER_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Libs & Helpers', - ], - 'adduikit' => [ - 'name' => 'adduikit', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_LABEL', - 'type' => 'list', - 'title' => false, - 'list' => 'joomla_components', - 'store' => NULL, - 'tab_name' => 'Libs & Helpers', - ], 'crowdin_project_api_key' => [ 'name' => 'crowdin_project_api_key', 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CROWDIN_PROJECT_API_KEY_LABEL', @@ -778,10 +805,10 @@ class Table extends BaseTable implements Tableinterface 'store' => 'basic_encryption', 'tab_name' => 'Dynamic Integration', ], - 'addfootable' => [ - 'name' => 'addfootable', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDFOOTABLE_LABEL', - 'type' => 'list', + 'creatuserhelper' => [ + 'name' => 'creatuserhelper', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_CREATUSERHELPER_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -796,10 +823,10 @@ class Table extends BaseTable implements Tableinterface 'store' => 'basic_encryption', 'tab_name' => 'Dynamic Integration', ], - 'add_email_helper' => [ - 'name' => 'add_email_helper', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_LABEL', - 'type' => 'radio', + 'adduikit' => [ + 'name' => 'adduikit', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDUIKIT_LABEL', + 'type' => 'list', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -814,10 +841,10 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Dynamic Build (beta)', ], - 'add_php_helper_both' => [ - 'name' => 'add_php_helper_both', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_PHP_HELPER_BOTH_LABEL', - 'type' => 'radio', + 'addfootable' => [ + 'name' => 'addfootable', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADDFOOTABLE_LABEL', + 'type' => 'list', 'title' => false, 'list' => 'joomla_components', 'store' => NULL, @@ -832,13 +859,13 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'publishing', ], - 'php_helper_both' => [ - 'name' => 'php_helper_both', - 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_BOTH_LABEL', - 'type' => 'editor', + 'add_email_helper' => [ + 'name' => 'add_email_helper', + 'label' => 'COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ADD_EMAIL_HELPER_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'joomla_components', - 'store' => 'base64', + 'store' => NULL, 'tab_name' => 'Libs & Helpers', ], 'modified' => [ @@ -3478,6 +3505,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], + 'php_calculation' => [ + 'name' => 'php_calculation', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_CALCULATION_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Abacus', + ], 'php_router_parse' => [ 'name' => 'php_router_parse', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_ROUTER_PARSE_LABEL', @@ -3487,51 +3523,24 @@ class Table extends BaseTable implements Tableinterface 'store' => 'base64', 'tab_name' => 'Custom Script', ], - 'php_before_getitems' => [ - 'name' => 'php_before_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEMS_LABEL', - 'type' => 'editor', + 'add_php_after_getitems' => [ + 'name' => 'add_php_after_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEMS_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'dynamic_gets', - 'store' => 'base64', + 'store' => NULL, 'tab_name' => 'Custom Script', ], - 'php_after_getitems' => [ - 'name' => 'php_after_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEMS_LABEL', - 'type' => 'editor', + 'add_php_router_parse' => [ + 'name' => 'add_php_router_parse', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL', + 'type' => 'radio', 'title' => false, 'list' => 'dynamic_gets', - 'store' => 'base64', + 'store' => NULL, 'tab_name' => 'Custom Script', ], - 'php_after_getitem' => [ - 'name' => 'php_after_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEM_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Custom Script', - ], - 'php_getlistquery' => [ - 'name' => 'php_getlistquery', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Custom Script', - ], - 'join_db_table' => [ - 'name' => 'join_db_table', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_DB_TABLE_LABEL', - 'type' => 'subform', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'json', - 'tab_name' => 'Joint', - ], 'view_selection' => [ 'name' => 'view_selection', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_VIEW_SELECTION_LABEL', @@ -3541,6 +3550,33 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], + 'add_php_before_getitems' => [ + 'name' => 'add_php_before_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEMS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Custom Script', + ], + 'add_php_before_getitem' => [ + 'name' => 'add_php_before_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEM_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Custom Script', + ], + 'add_php_after_getitem' => [ + 'name' => 'add_php_after_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEM_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Custom Script', + ], 'db_table_main' => [ 'name' => 'db_table_main', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_DB_TABLE_MAIN_LABEL', @@ -3577,24 +3613,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], - 'php_calculation' => [ - 'name' => 'php_calculation', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_CALCULATION_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Abacus', - ], - 'php_before_getitem' => [ - 'name' => 'php_before_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEM_LABEL', - 'type' => 'editor', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => 'base64', - 'tab_name' => 'Custom Script', - ], 'view_table_main' => [ 'name' => 'view_table_main', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_VIEW_TABLE_MAIN_LABEL', @@ -3604,51 +3622,6 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Main', ], - 'select_all' => [ - 'name' => 'select_all', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_SELECT_ALL_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Main', - ], - 'add_php_before_getitem' => [ - 'name' => 'add_php_before_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEM_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Custom Script', - ], - 'getcustom' => [ - 'name' => 'getcustom', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_GETCUSTOM_LABEL', - 'type' => 'text', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Main', - ], - 'add_php_after_getitem' => [ - 'name' => 'add_php_after_getitem', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEM_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Custom Script', - ], - 'pagination' => [ - 'name' => 'pagination', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PAGINATION_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Main', - ], 'add_php_getlistquery' => [ 'name' => 'add_php_getlistquery', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_GETLISTQUERY_LABEL', @@ -3658,13 +3631,76 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Custom Script', ], - 'add_php_before_getitems' => [ - 'name' => 'add_php_before_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_BEFORE_GETITEMS_LABEL', + 'join_db_table' => [ + 'name' => 'join_db_table', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_JOIN_DB_TABLE_LABEL', + 'type' => 'subform', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'json', + 'tab_name' => 'Joint', + ], + 'select_all' => [ + 'name' => 'select_all', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_SELECT_ALL_LABEL', 'type' => 'radio', 'title' => false, 'list' => 'dynamic_gets', 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_before_getitem' => [ + 'name' => 'php_before_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEM_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'getcustom' => [ + 'name' => 'getcustom', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_GETCUSTOM_LABEL', + 'type' => 'text', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_after_getitem' => [ + 'name' => 'php_after_getitem', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEM_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'pagination' => [ + 'name' => 'pagination', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PAGINATION_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => NULL, + 'tab_name' => 'Main', + ], + 'php_getlistquery' => [ + 'name' => 'php_getlistquery', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_GETLISTQUERY_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', + 'tab_name' => 'Custom Script', + ], + 'php_before_getitems' => [ + 'name' => 'php_before_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_BEFORE_GETITEMS_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'dynamic_gets', + 'store' => 'base64', 'tab_name' => 'Custom Script', ], 'filter' => [ @@ -3676,13 +3712,13 @@ class Table extends BaseTable implements Tableinterface 'store' => 'json', 'tab_name' => 'Tweak', ], - 'add_php_after_getitems' => [ - 'name' => 'add_php_after_getitems', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_AFTER_GETITEMS_LABEL', - 'type' => 'radio', + 'php_after_getitems' => [ + 'name' => 'php_after_getitems', + 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_PHP_AFTER_GETITEMS_LABEL', + 'type' => 'editor', 'title' => false, 'list' => 'dynamic_gets', - 'store' => NULL, + 'store' => 'base64', 'tab_name' => 'Custom Script', ], 'where' => [ @@ -3694,15 +3730,6 @@ class Table extends BaseTable implements Tableinterface 'store' => 'json', 'tab_name' => 'Tweak', ], - 'add_php_router_parse' => [ - 'name' => 'add_php_router_parse', - 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ADD_PHP_ROUTER_PARSE_LABEL', - 'type' => 'radio', - 'title' => false, - 'list' => 'dynamic_gets', - 'store' => NULL, - 'tab_name' => 'Custom Script', - ], 'order' => [ 'name' => 'order', 'label' => 'COM_COMPONENTBUILDER_DYNAMIC_GET_ORDER_LABEL', @@ -3804,6 +3831,15 @@ class Table extends BaseTable implements Tableinterface 'store' => NULL, 'tab_name' => 'Details', ], + 'joomla_version' => [ + 'name' => 'joomla_version', + 'label' => 'COM_COMPONENTBUILDER_CUSTOM_CODE_JOOMLA_VERSION_LABEL', + 'type' => 'number', + 'title' => false, + 'list' => 'custom_codes', + 'store' => NULL, + 'tab_name' => 'Details', + ], 'function_name' => [ 'name' => 'function_name', 'label' => 'COM_COMPONENTBUILDER_CUSTOM_CODE_FUNCTION_NAME_LABEL', @@ -4020,7 +4056,7 @@ class Table extends BaseTable implements Tableinterface 'value' => [ 'name' => 'value', 'label' => 'COM_COMPONENTBUILDER_PLACEHOLDER_VALUE_LABEL', - 'type' => 'text', + 'type' => 'textarea', 'title' => false, 'list' => 'placeholders', 'store' => 'base64', @@ -4830,7 +4866,7 @@ class Table extends BaseTable implements Tableinterface 'groups' => [ 'name' => 'groups', 'label' => 'COM_COMPONENTBUILDER_HELP_DOCUMENT_GROUPS_LABEL', - 'type' => 'usergroup', + 'type' => 'usergrouplist', 'title' => false, 'list' => 'help_documents', 'store' => 'json', @@ -5118,6 +5154,80 @@ class Table extends BaseTable implements Tableinterface 'tab_name' => 'Menus', ], ], + 'component_router' => [ + 'joomla_component' => [ + 'name' => 'joomla_component', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_JOOMLA_COMPONENT_LABEL', + 'type' => 'joomlacomponents', + 'title' => true, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'mode_constructor_before_parent' => [ + 'name' => 'mode_constructor_before_parent', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_BEFORE_PARENT_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'mode_constructor_after_parent' => [ + 'name' => 'mode_constructor_after_parent', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_CONSTRUCTOR_AFTER_PARENT_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'mode_methods' => [ + 'name' => 'mode_methods', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_MODE_METHODS_LABEL', + 'type' => 'radio', + 'title' => false, + 'list' => 'components_routers', + 'store' => NULL, + 'tab_name' => 'Settings', + ], + 'methods_code' => [ + 'name' => 'methods_code', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_METHODS_CODE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'base64', + 'tab_name' => 'Settings', + ], + 'constructor_after_parent_code' => [ + 'name' => 'constructor_after_parent_code', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_AFTER_PARENT_CODE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'base64', + 'tab_name' => 'Settings', + ], + 'constructor_before_parent_manual' => [ + 'name' => 'constructor_before_parent_manual', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_MANUAL_LABEL', + 'type' => 'subform', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'json', + 'tab_name' => 'Settings', + ], + 'constructor_before_parent_code' => [ + 'name' => 'constructor_before_parent_code', + 'label' => 'COM_COMPONENTBUILDER_COMPONENT_ROUTER_CONSTRUCTOR_BEFORE_PARENT_CODE_LABEL', + 'type' => 'editor', + 'title' => false, + 'list' => 'components_routers', + 'store' => 'base64', + 'tab_name' => 'Settings', + ], + ], 'component_config' => [ 'joomla_component' => [ 'name' => 'joomla_component', diff --git a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php index 9fdf2c0a4..ebf3a67b4 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Activeregistryinterface.php @@ -51,15 +51,17 @@ interface Activeregistryinterface * Adds content into the registry. If a key exists, * it either appends or concatenates based on the value's type. * - * @param mixed $value The value to set. - * @param bool $asArray Determines if the new value should be treated as an array. - * @param string ...$keys The keys to determine the location. + * @param mixed $value The value to set. + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. + * @param string ...$keys The keys to determine the location. * * @throws \InvalidArgumentException If any of the keys are not a number or string. * @return void * @since 3.2.0 */ - public function addActive($value, bool $asArray, string ...$keys): void; + public function addActive($value, ?bool $asArray, string ...$keys): void; /** * Retrieves a value (or sub-array) from the registry using multiple keys. diff --git a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php index e7a8f0297..58eab826d 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Interfaces/Registryinterface.php @@ -35,15 +35,17 @@ interface Registryinterface * Adds content into the registry. If a key exists, * it either appends or concatenates based on $asArray switch. * - * @param string $path Registry path (e.g. vdm.content.builder) - * @param mixed $value Value of entry - * @param bool $asArray Determines if the new value should be treated as an array. Default is false. + * @param string $path Registry path (e.g. vdm.content.builder) + * @param mixed $value Value of entry + * @param bool|null $asArray Determines if the new value should be treated as an array. + * Default is $addAsArray = false (if null) in base class. + * Override in child class allowed set class property $addAsArray = true. * * @throws \InvalidArgumentException If any of the path values are not a number or string. * @return void * @since 3.2.0 */ - public function add(string $path, $value, bool $asArray = false): void; + public function add(string $path, $value, ?bool $asArray = null): void; /** * Retrieves a value (or sub-array) from the registry using multiple keys. diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities.php deleted file mode 100644 index b473fea4f..000000000 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities.php +++ /dev/null @@ -1,669 +0,0 @@ - - * @git Joomla Component Builder - * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -namespace VDM\Joomla; - - -use VDM\Joomla\Utilities\StringHelper; -use VDM\Joomla\Utilities\JsonHelper; -use VDM\Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\ObjectHelper; -use VDM\Joomla\Utilities\MathHelper; -use VDM\Joomla\Utilities\GetHelper; -use VDM\Joomla\Utilities\GuidHelper; -use VDM\Joomla\Utilities\FileHelper; -use VDM\Joomla\Utilities\String\FieldHelper; -use VDM\Joomla\Utilities\String\TypeHelper; -use VDM\Joomla\Utilities\String\ClassfunctionHelper; -use VDM\Joomla\Utilities\String\NamespaceHelper; -use VDM\Joomla\Utilities\String\PluginHelper; -use VDM\Joomla\Utilities\Component\Helper; - - -/** - * Basic shared utilities, a legacy implementation - * - * @since 3.0.9 - */ -trait Utilities -{ - /** - * The Main Active Language - * - * @var string - * - * @since 3.0.9 - */ - public static $langTag; - - /** - * Check if have a string with a length - * - * @input string $string The string to check - * - * @returns bool true on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::check($string); - */ - public static function checkString($string): bool - { - return StringHelper::check($string); - } - - /** - * Shorten a string - * - * @input string $string That you would like to shorten - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::shorten($string, $length, $addTip); - */ - public static function shorten($string, $length = 40, $addTip = true) - { - return StringHelper::shorten($string, $length, $addTip); - } - - /** - * Making strings safe (various ways) - * - * @input string $string That you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::safe($string, $type, $spacer, $replaceNumbers, $keepOnlyCharacters); - */ - public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) - { - // set the local component option - self::setComponentOption(); - - return StringHelper::safe($string, $type, $spacer, $replaceNumbers, $keepOnlyCharacters); - } - - /** - * Making class or function name safe - * - * @input string The name you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ClassfunctionHelper::safe($name); - */ - public static function safeClassFunctionName($name) - { - return ClassfunctionHelper::safe($name); - } - - /** - * Making field names safe - * - * @input string The you would like to make safe - * @input boolean The switch to return an ALL UPPER CASE string - * @input string The string to use in white space - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FieldHelper::safe($string, $allcap, $spacer); - */ - public static function safeFieldName($string, $allcap = false, $spacer = '_') - { - // set the local component option - self::setComponentOption(); - - return FieldHelper::safe($string, $allcap, $spacer); - } - - /** - * Making field type name safe - * - * @input string The you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use TypeHelper::safe($string); - */ - public static function safeTypeName($string) - { - // set the local component option - self::setComponentOption(); - - return TypeHelper::safe($string); - } - - /** - * Making namespace safe - * - * @input string The you would like to make safe - * - * @returns string on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use NamespaceHelper::safe($string); - */ - public static function safeNamespace($string) - { - return NamespaceHelper::safe($string); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::transliterate($string); - */ - public static function transliterate($string) - { - // set the local component option - self::setComponentOption(); - - return StringHelper::transliterate($string); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::html($var, $charset, $shorten, $length); - */ - public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) - { - // set the local component option - self::setComponentOption(); - - return StringHelper::html($var, $charset, $shorten, $length); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::numbers($string); - */ - public static function replaceNumbers($string) - { - return StringHelper::numbers($string); - } - - /** - * Convert an integer into an English word string - * Thanks to Tom Nicholson - * - * @input int $x an int - * - * @returns string a string - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::number($x); - */ - public static function numberToString($x) - { - return StringHelper::number($x); - } - - /** - * Random Key - * - * @input int $size the length of the string - * - * @returns string a string of random characters - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use StringHelper::random($size); - */ - public static function randomkey($size): string - { - return StringHelper::random($size); - } - - /** - * Check if you have a json string - * - * @input string $string The json string to check - * - * @returns bool true on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use JsonHelper::check($string); - */ - public static function checkJson($string): bool - { - return JsonHelper::check($string); - } - - /** - * @since 3.0.9 - * - * @deprecated 4.0 - Use JsonHelper::string($value, $sperator, $table, $id, $name); - */ - public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') - { - return JsonHelper::string($value, $sperator, $table, $id, $name); - } - - /** - * Check if you have an array with a length - * - * @input mixed $array The array to check - * @input bool $removeEmptyString Should we remove empty values - * - * @returns int number of items in array on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ArrayHelper::check($array, $removeEmptyString); - */ - public static function checkArray($array, $removeEmptyString = false): int - { - return ArrayHelper::check($array, $removeEmptyString); - } - - /** - * Merge an array of array's - * - * @input mixed $arrays The arrays you would like to merge - * - * @returns mixed array on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ArrayHelper::merge($arrays); - */ - public static function mergeArrays($arrays) - { - return ArrayHelper::merge($arrays); - } - - /** - * Check if you have an object with a length - * - * @input object $object The object to check - * - * @returns bool true on success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use ObjectHelper::check($object); - */ - public static function checkObject($object): bool - { - return ObjectHelper::check($object); - } - - /** - * Get a Variable - * - * @param string $table The table from which to get the variable - * @param string $where The value where - * @param string $whereString The target/field string where/name - * @param string $what The return field - * @param string $operator The operator between $whereString/field and $where/value - * @param string $main The component in which the table is found - * - * @return mix string/int/float - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::var($table, $where, $whereString, $what, $operator, $main); - */ - public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = null) - { - // set the local component option - self::setComponentOption(); - - return GetHelper::var($table, $where, $whereString, $what, $operator, $main); - } - - /** - * Get array of variables - * - * @param string $table The table from which to get the variables - * @param string $where The value where - * @param string $whereString The target/field string where/name - * @param string $what The return field - * @param string $operator The operator between $whereString/field and $where/value - * @param string $main The component in which the table is found - * @param bool $unique The switch to return a unique array - * - * @return array - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::vars($table, $where, $whereString, $what, $operator, $main, $unique); - */ - public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = null, $unique = true) - { - // set the local component option - self::setComponentOption(); - - return GetHelper::vars($table, $where, $whereString, $what, $operator, $main, $unique); - } - - /** - * get all strings between two other strings - * - * @param string $content The content to search - * @param string $start The starting value - * @param string $end The ending value - * - * @return array On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::allBetween($content, $start, $end); - */ - public static function getAllBetween($content, $start, $end) - { - return GetHelper::allBetween($content, $start, $end); - } - - /** - * get a string between two other strings - * - * @param string $content The content to search - * @param string $start The starting value - * @param string $end The ending value - * @param string $default The default value if none found - * - * @return string On success / empty string on failure - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GetHelper::between($content, $start, $end, $default); - */ - public static function getBetween($content, $start, $end, $default = '') - { - return GetHelper::between($content, $start, $end, $default); - } - - /** - * bc math wrapper (very basic not for accounting) - * - * @param string $type The type bc math - * @param int $val1 The first value - * @param int $val2 The second value - * @param int $scale The scale value - * - * @return float|int - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use MathHelper::bc($type, $val1, $val2, $scale); - */ - public static function bcmath($type, $val1, $val2, $scale = 0) - { - return MathHelper::bc($type, $val1, $val2, $scale); - } - - /** - * Basic sum of an array with more precision - * - * @param array $array The values to sum - * @param int $scale The scale value - * - * @return float|int - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use MathHelper::sum($array, $scale); - */ - public static function bcsum($array, $scale = 4) - { - return MathHelper::sum($array, $scale); - } - - /** - * create plugin class name - * - * @input string The group name - * @input string The name - * - * @return string - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use PluginHelper::safe($name, $group); - */ - public static function createPluginClassName($group, $name) - { - return PluginHelper::safeClassName($name, $group); - } - - /** - * Returns a GUIDv4 string - * - * Thanks to Dave Pearson (and other) - * https://www.php.net/manual/en/function.com-create-guid.php#119168 - * - * Uses the best cryptographically secure method - * for all supported platforms with fallback to an older, - * less secure version. - * - * @param bool $trim - * - * @return string - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GuidHelper::get($trim); - */ - public static function GUID($trim = true) - { - return GuidHelper::get($trim); - } - - /** - * Validate the Globally Unique Identifier ( and check if table already has this identifier) - * - * @param string $guid - * @param string $table - * @param int $id - * @param string|null $component - * - * @return bool - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); - */ - public static function validGUID($guid, $table = null, $id = 0, $component = null) - { - // set the local component option - self::setComponentOption(); - - return GuidHelper::valid($guid, $table, $id, $component); - } - - /** - * get the ITEM of a GUID by table - * - * @param string $guid - * @param string $table - * @param string/array $what - * @param string|null $component - * - * @return mix - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); - */ - public static function getGUID($guid, $table, $what = 'a.id', $component = null) - { - // set the local component option - self::setComponentOption(); - - return GuidHelper::item($guid, $table, $what, $component); - } - - /** - * Validate the Globally Unique Identifier - * - * Thanks to Lewie - * https://stackoverflow.com/a/1515456/1429677 - * - * @param string $guid - * - * @return bool - * - * @deprecated 4.0 - Use GuidHelper::validate($guid); - */ - protected static function validateGUID($guid) - { - return GuidHelper::validate($guid); - } - - /** - * The zipper method - * - * @param string $workingDIR The directory where the items must be zipped - * @param string $filepath The path to where the zip file must be placed - * - * @return bool true On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::zip($workingDIR, $filepath); - */ - public static function zip($workingDIR, &$filepath) - { - return FileHelper::zip($workingDIR, $filepath); - } - - /** - * get the content of a file - * - * @param string $path The path to the file - * @param string/bool $none The return value if no content was found - * - * @return string On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::getContent($path, $none); - */ - public static function getFileContents($path, $none = '') - { - return FileHelper::getContent($path, $none); - } - - /** - * Write a file to the server - * - * @param string $path The path and file name where to safe the data - * @param string $data The data to safe - * - * @return bool true On success - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::write($path, $data); - */ - public static function writeFile($path, $data) - { - return FileHelper::write($path, $data); - } - - /** - * get all the file paths in folder and sub folders - * - * @param string $folder The local path to parse - * @param array $fileTypes The type of files to get - * - * @return void - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::getPaths($folder, $fileTypes , $recurse, $full); - */ - public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) - { - return FileHelper::getPaths($folder, $fileTypes , $recurse, $full); - } - - /** - * Get the file path or url - * - * @param string $type The (url/path) type to return - * @param string $target The Params Target name (if set) - * @param string $fileType The kind of filename to generate (if not set no file name is generated) - * @param string $key The key to adjust the filename (if not set ignored) - * @param string $default The default path if not set in Params (fallback path) - * @param bool $createIfNotSet The switch to create the folder if not found - * - * @return string On success the path or url is returned based on the type requested - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); - */ - public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) - { - // set the local component option - self::setComponentOption(); - - return FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); - } - - /** - * Check if file exist - * - * @param string $path The url/path to check - * - * @return bool If exist true - * - * @since 3.0.9 - * - * @deprecated 4.0 - Use FileHelper::exists($path); - */ - public static function urlExists($path) - { - return FileHelper::exists($path); - } - - /** - * Set the component option - * - * @param String|null $option The option for the component. - * - * @since 3.0.11 - */ - public static function setComponentOption($option = null) - { - // set the local component option - if (empty($option)) - { - if (empty(Helper::$option) && property_exists(__CLASS__, 'ComponentCodeName')) - { - Helper::$option = 'com_' . self::$ComponentCodeName; - } - } - else - { - Helper::$option = $option; - } - } - -} - diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php index 61dbf59f8..5660a4915 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/Component/Helper.php @@ -12,9 +12,11 @@ namespace VDM\Joomla\Utilities\Component; -use Joomla\Input\Input; +use Joomla\CMS\Factory; use Joomla\CMS\Component\ComponentHelper; +use Joomla\Input\Input; use Joomla\Registry\Registry; +use VDM\Joomla\Utilities\String\NamespaceHelper; /** @@ -27,10 +29,18 @@ abstract class Helper /** * The current option * - * @var string + * @var string|null * @since 3.0.11 */ - public static string $option; + public static ?string $option = null; + + /** + * The component manifest list cache + * + * @var array + * @since 3.2.0 + */ + public static array $manifest = []; /** * The component params list cache @@ -67,27 +77,52 @@ abstract class Helper } /** - * Gets the component option + * Set the component option + * + * @param string|null $option The option + * + * @return void + * @since 3.2.0 + */ + public static function setOption(?string $option): void + { + self::$option = $option; + } + + /** + * Get the component option * * @param string|null $default The default return value if none is found * * @return string|null A component option * @since 3.0.11 */ - public static function getOption(string $default = 'empty'): ?string + public static function getOption(?string $default = 'empty'): ?string { if (empty(self::$option)) { // get the option from the url input - self::$option = (new Input)->getString('option', false); + self::$option = (new Input)->getString('option', null); } - if (self::$option) + if (empty(self::$option)) { - return self::$option; + $app = Factory::getApplication(); + + // Check if the getInput method exists in the application object + if (method_exists($app, 'getInput')) + { + // get the option from the application + self::$option = $app->getInput()->getCmd('option', $default); + } + else + { + // Use the default value if getInput method does not exist + self::$option = $default; + } } - return $default; + return self::$option; } /** @@ -125,24 +160,96 @@ abstract class Helper * * @since 3.0.11 */ - public static function get(string $option = null, string $default = null): ?string + public static function get(?string $option = null, ?string $default = null): ?string { // check that we have an option // and get the code name from it - if (($code_name = self::getCode($option, false)) !== false) + if (($code_name = self::getCode($option, null)) !== null) { // we build the helper class name $helper_name = '\\' . \ucfirst($code_name) . 'Helper'; + // check if class exist if (class_exists($helper_name)) { return $helper_name; } + + // try loading namespace + if (($namespace = self::getNamespace($option)) !== null) + { + $name = \ucfirst($code_name) . 'Helper'; + $namespace_helper = '\\' . $namespace . '\Administrator\Helper\\' . NamespaceHelper::safeSegment($name); // TODO target site or admin locations not just admin... + if (class_exists($namespace_helper)) + { + return $namespace_helper; + } + } } return $default; } + /** + * Gets the component namespace if set + * + * @param string|null $option The option for the component. + * @param string|null $default The default return value if none is found + * + * @return string|null A component namespace + * + * @since 3.0.11 + */ + public static function getNamespace(?string $option = null): ?string + { + $manifest = self::getManifest($option); + + return $manifest->namespace ?? null; + } + + /** + * Gets the component abstract helper class + * + * @param string|null $option The option for the component. + * @param string|null $default The default return value if none is found + * + * @return object|null A component helper name + * + * @since 3.0.11 + */ + public static function getManifest(?string $option = null): ?object + { + if ($option === null + && ($option = self::getOption($option)) === null) + { + return null; + } + + // get global manifest_cache values + if (!isset(self::$manifest[$option])) + { + $db = Factory::getDbo(); + $query = $db->getQuery(true); + + $query->select($db->quoteName('manifest_cache')) + ->from($db->quoteName('#__extensions')) + ->where($db->quoteName('type') . ' = ' . $db->quote('component')) + ->where($db->quoteName('element') . ' LIKE ' . $db->quote($option)); + + $db->setQuery($query); + + try { + $manifest = $db->loadResult(); + self::$manifest[$option] = json_decode($manifest); + } catch (\Exception $e) { + // Handle the database error appropriately. + self::$manifest[$option] = null; + } + } + + return self::$manifest[$option]; + } + /** * Check if the helper class of this component has a method * @@ -153,10 +260,10 @@ abstract class Helper * * @since 3.0.11 */ - public static function methodExists(string $method, string $option = null): bool + public static function methodExists(string $method, ?string $option = null): bool { // get the helper class - return ($helper = self::get($option, false)) !== false && + return ($helper = self::get($option, null)) !== null && method_exists($helper, $method); } @@ -173,7 +280,7 @@ abstract class Helper public static function _(string $method, array $arguments = [], ?string $option = null) { // get the helper class - if (($helper = self::get($option, false)) !== false && + if (($helper = self::get($option, null)) !== null && method_exists($helper, $method)) { // we know this is not ideal... diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php index 0dd04d81b..7d1dd0a57 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php @@ -89,8 +89,8 @@ abstract class FileHelper /** * get the content of a file * - * @param string $path The path to the file - * @param string/bool $none The return value if no content was found + * @param string $path The path to the file + * @param mixed $none The return value if no content was found * * @return string On success * @@ -150,7 +150,7 @@ abstract class FileHelper * * @since 3.0.9 */ - public static function write($path, $data) + public static function write($path, $data): bool { $klaar = false; if (StringHelper::check($data)) @@ -179,11 +179,11 @@ abstract class FileHelper * @param string $folder The local path to parse * @param array $fileTypes The type of files to get * - * @return void + * @return array|null * * @since 3.0.9 */ - public static function getPaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) + public static function getPaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true): ?array { if (Folder::exists($folder)) { @@ -219,7 +219,7 @@ abstract class FileHelper // return array of files return array_map( fn($file) => str_replace('./', '/', (string) $file), (array) ArrayHelper::merge($files)); } - return false; + return null; } /** @@ -236,7 +236,7 @@ abstract class FileHelper * * @since 3.0.9 */ - public static function getPath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) + public static function getPath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true): string { // make sure to always have a string/path if(!StringHelper::check($default)) @@ -316,7 +316,7 @@ abstract class FileHelper * * @since 3.0.9 */ - public static function exists($path) + public static function exists($path): bool { $exists = false; // if this is a local path diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FormHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FormHelper.php index a2f48fd41..b21d71c3c 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FormHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FormHelper.php @@ -75,24 +75,24 @@ abstract class FormHelper // element was not returned return; } - switch (get_class($node)) + + if ($node instanceof \stdClass) { - case 'stdClass': - if (property_exists($node, 'comment')) - { - self::comment($xml, $node->comment); - } - if (property_exists($node, 'fieldXML')) - { - self::append($xml, $node->fieldXML); - } - break; - case 'SimpleXMLElement': - $domXML = \dom_import_simplexml($xml); - $domNode = \dom_import_simplexml($node); - $domXML->appendChild($domXML->ownerDocument->importNode($domNode, true)); - $xml = \simplexml_import_dom($domXML); - break; + if (property_exists($node, 'comment')) + { + self::comment($xml, $node->comment); + } + if (property_exists($node, 'fieldXML')) + { + self::append($xml, $node->fieldXML); + } + } + elseif ($node instanceof \SimpleXMLElement) + { + $domXML = \dom_import_simplexml($xml); + $domNode = \dom_import_simplexml($node); + $domXML->appendChild($domXML->ownerDocument->importNode($domNode, true)); + $xml = \simplexml_import_dom($domXML); } } @@ -127,7 +127,7 @@ abstract class FormHelper { foreach ($attributes as $key => $value) { - $xml->addAttribute($key, $value); + $xml->addAttribute($key, $value ?? ''); } } @@ -145,7 +145,7 @@ abstract class FormHelper foreach ($options as $key => $value) { $addOption = $xml->addChild('option'); - $addOption->addAttribute('value', $key); + $addOption->addAttribute('value', $key ?? ''); $addOption[] = $value; } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php index f58409767..1f89e7b87 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GetHelper.php @@ -113,14 +113,14 @@ abstract class GetHelper $where = Factory::getUser()->id; } - if(is_null($main)) + if($main === null) { $main = Helper::getCode(); } if (!ArrayHelper::check($where) && $where > 0) { - $where = array($where); + $where = [$where]; } if (ArrayHelper::check($where)) diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php index e21947347..14a114832 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/GuidHelper.php @@ -138,7 +138,7 @@ abstract class GuidHelper * @param string|array $what * @param string|null $component * - * @return mix + * @return mixed * * @since 3.0.9 */ diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php index 4776fb9fa..55ee2e490 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/String/NamespaceHelper.php @@ -38,30 +38,41 @@ abstract class NamespaceHelper // Split the string into namespace segments $segments = explode('\\', $string); - foreach ($segments as &$segment) - { - // Check if segment starts with a number - if (preg_match("/^\d/", $segment)) - { - // Extract the starting number(s) - preg_match("/^\d+/", $segment, $matches); - - if (isset($matches[0])) - { - $numberWord = StringHelper::numbers($matches[0]); - $segment = str_replace($matches[0], $numberWord, $segment); - } - } - - // Transliterate string TODO: look again as this makes it lowercase - // $segment = StringHelper::transliterate($segment); - - // Make sure segment only contains valid characters - $segment = preg_replace("/[^A-Za-z0-9]/", '', $segment); - } + // make each segment safe + $segments = array_map([self::class, 'safeSegment'], $segments); // Join the namespace segments back together return implode('\\', $segments); + } + + /** + * Making one namespace segment safe + * + * @param string $string The namespace segment string you would like to make safe + * + * @return string on success + * @since 3.0.9 + */ + public static function safeSegment(string $string): string + { + // Check if segment starts with a number + if (preg_match("/^\d/", $string)) + { + // Extract the starting number(s) + preg_match("/^\d+/", $string, $matches); + + if (isset($matches[0])) + { + $numberWord = StringHelper::numbers($matches[0]); + $string = str_replace($matches[0], $numberWord, $string); + } + } + + // Transliterate string TODO: look again as this makes it lowercase + // $segment = StringHelper::transliterate($segment); + + // Make sure segment only contains valid characters + return preg_replace("/[^A-Za-z0-9]/", '', $string); } } diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php index 3a37f2b9a..fad233560 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/StringHelper.php @@ -50,18 +50,18 @@ abstract class StringHelper /** * Shorten a string * - * @input string The you would like to shorten + * @input string The sting that you would like to shorten * * @returns string on success * - * @since 3.0.9 + * @since 3.2.0 */ public static function shorten($string, $length = 40, $addTip = true) { if (self::check($string)) { $initial = strlen((string) $string); - $words = preg_split('/([\s\n\r]+)/', (string) $string, null, PREG_SPLIT_DELIM_CAPTURE); + $words = preg_split('/([\s\n\r]+)/', (string) $string, -1, PREG_SPLIT_DELIM_CAPTURE); $words_count = count((array)$words); $word_length = 0; diff --git a/media/js/admin_custom_tabs.js b/media/js/admin_custom_tabs.js index 215a78d2d..9d6629898 100644 --- a/media/js/admin_custom_tabs.js +++ b/media/js/admin_custom_tabs.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/admin_fields.js b/media/js/admin_fields.js index 215a78d2d..9d6629898 100644 --- a/media/js/admin_fields.js +++ b/media/js/admin_fields.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/admin_fields_conditions.js b/media/js/admin_fields_conditions.js index 848e391d0..53c716c20 100644 --- a/media/js/admin_fields_conditions.js +++ b/media/js/admin_fields_conditions.js @@ -40,4 +40,4 @@ function getFieldSelectOptions(fieldKey){ } } - + diff --git a/media/js/admin_fields_relations.js b/media/js/admin_fields_relations.js index 0856e158b..957ab6c2d 100644 --- a/media/js/admin_fields_relations.js +++ b/media/js/admin_fields_relations.js @@ -73,42 +73,53 @@ function _isSet(val) return false; } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) + }).catch(error => { + console.error('Error:', error); + }); } - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} - + diff --git a/media/js/admin_view.js b/media/js/admin_view.js index f431e0e77..90ddf07cd 100644 --- a/media/js/admin_view.js +++ b/media/js/admin_view.js @@ -20,7 +20,7 @@ jform_vvvvwabvwq_required = false; jform_vvvvwabvwr_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_css_view_vvvvvyw = jQuery("#jform_add_css_view input[type='radio']:checked").val(); vvvvvyw(add_css_view_vvvvvyw); @@ -758,7 +758,7 @@ function vvvvwad(add_custom_button_vvvvwad) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -985,43 +985,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function addButtonID_server(type, size){ @@ -1082,4 +1093,4 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} diff --git a/media/js/class_extends.js b/media/js/class_extends.js index 07460eb01..10c2e2aa3 100644 --- a/media/js/class_extends.js +++ b/media/js/class_extends.js @@ -19,41 +19,52 @@ jQuery(document).ready(function() setTimeout(getEditCustomCodeButtons, 300); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/class_method.js b/media/js/class_method.js index a30791c12..bf73cebbc 100644 --- a/media/js/class_method.js +++ b/media/js/class_method.js @@ -12,7 +12,7 @@ jform_vvvvwchvxk_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var extension_type_vvvvwch = jQuery("#jform_extension_type").val(); vvvvwch(extension_type_vvvvwch); @@ -77,7 +77,7 @@ function extension_type_vvvvwch_SomeFunc(extension_type_vvvvwch) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -134,41 +134,52 @@ jQuery(document).ready(function() setTimeout(getEditCustomCodeButtons, 300); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/class_property.js b/media/js/class_property.js index 5a6ecf5fd..27e899048 100644 --- a/media/js/class_property.js +++ b/media/js/class_property.js @@ -12,7 +12,7 @@ jform_vvvvwcgvxj_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var extension_type_vvvvwcg = jQuery("#jform_extension_type").val(); vvvvwcg(extension_type_vvvvwcg); @@ -77,7 +77,7 @@ function extension_type_vvvvwcg_SomeFunc(extension_type_vvvvwcg) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -134,41 +134,52 @@ jQuery(document).ready(function() setTimeout(getEditCustomCodeButtons, 300); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/component_admin_views.js b/media/js/component_admin_views.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_admin_views.js +++ b/media/js/component_admin_views.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_config.js b/media/js/component_config.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_config.js +++ b/media/js/component_config.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_custom_admin_menus.js b/media/js/component_custom_admin_menus.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_custom_admin_menus.js +++ b/media/js/component_custom_admin_menus.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_custom_admin_views.js b/media/js/component_custom_admin_views.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_custom_admin_views.js +++ b/media/js/component_custom_admin_views.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_dashboard.js b/media/js/component_dashboard.js index 47682dec1..cfa526706 100644 --- a/media/js/component_dashboard.js +++ b/media/js/component_dashboard.js @@ -17,41 +17,52 @@ jQuery(document).ready(function() getEditCustomCodeButtons(); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/component_files_folders.js b/media/js/component_files_folders.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_files_folders.js +++ b/media/js/component_files_folders.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_modules.js b/media/js/component_modules.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_modules.js +++ b/media/js/component_modules.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_mysql_tweaks.js b/media/js/component_mysql_tweaks.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_mysql_tweaks.js +++ b/media/js/component_mysql_tweaks.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_placeholders.js b/media/js/component_placeholders.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_placeholders.js +++ b/media/js/component_placeholders.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_plugins.js b/media/js/component_plugins.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_plugins.js +++ b/media/js/component_plugins.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_router.js b/media/js/component_router.js new file mode 100644 index 000000000..ecd8d798e --- /dev/null +++ b/media/js/component_router.js @@ -0,0 +1,67 @@ +/** + * @package Joomla.Component.Builder + * + * @created 30th April, 2015 + * @author Llewellyn van der Merwe + * @git Joomla Component Builder + * @copyright Copyright (C) 2015 Vast Development Method. All rights reserved. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + + + + +document.addEventListener('DOMContentLoaded', function() { + // check and load all the customcode edit buttons + setTimeout(getEditCustomCodeButtons, 300); +}); + +function getEditCustomCodeButtons_server(id) { + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; + } + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); + }); +} + +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; + }); + }); + } + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/component_site_views.js b/media/js/component_site_views.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_site_views.js +++ b/media/js/component_site_views.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/component_updates.js b/media/js/component_updates.js index 215a78d2d..9d6629898 100644 --- a/media/js/component_updates.js +++ b/media/js/component_updates.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/custom_admin_view.js b/media/js/custom_admin_view.js index baf398a7a..b037b80a2 100644 --- a/media/js/custom_admin_view.js +++ b/media/js/custom_admin_view.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwae = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwae(add_php_view_vvvvwae); @@ -397,41 +397,52 @@ function setSnippets(array){ jQuery('#jform_snippet').trigger('liszt:updated'); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/custom_code.js b/media/js/custom_code.js index e1f5fad84..4184e9c28 100644 --- a/media/js/custom_code.js +++ b/media/js/custom_code.js @@ -15,7 +15,7 @@ jform_vvvvwcdvxh_required = false; jform_vvvvwcdvxi_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var target_vvvvwcc = jQuery("#jform_target input[type='radio']:checked").val(); vvvvwcc(target_vvvvwcc); @@ -181,7 +181,7 @@ function vvvvwcf(type_vvvvwcf,target_vvvvwcf) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -372,41 +372,52 @@ function usedin_server(functioName, ide, target){ } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/dynamic_get.js b/media/js/dynamic_get.js index d473cc4e8..5553fcedf 100644 --- a/media/js/dynamic_get.js +++ b/media/js/dynamic_get.js @@ -24,7 +24,7 @@ jform_vvvvwbyvxd_required = false; jform_vvvvwbzvxe_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var gettype_vvvvwbb = jQuery("#jform_gettype").val(); vvvvwbb(gettype_vvvvwbb); @@ -1352,7 +1352,7 @@ function gettype_vvvvwcb_SomeFunc(gettype_vvvvwcb) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -1609,43 +1609,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getLinked(){ @@ -1654,4 +1665,4 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} diff --git a/media/js/field.js b/media/js/field.js index b004eee22..1510e6f01 100644 --- a/media/js/field.js +++ b/media/js/field.js @@ -17,7 +17,7 @@ jform_vvvvwdgvxs_required = false; jform_vvvvwdgvxt_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var datalenght_vvvvwda = jQuery("#jform_datalenght").val(); vvvvwda(datalenght_vvvvwda); @@ -479,7 +479,7 @@ function vvvvwdk(add_javascript_views_footer_vvvvwdk) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -881,41 +881,52 @@ function addButton(type, where, size){ }) } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/fieldtype.js b/media/js/fieldtype.js index be9fab32c..df059058b 100644 --- a/media/js/fieldtype.js +++ b/media/js/fieldtype.js @@ -19,7 +19,7 @@ jform_vvvvwdyvya_required = false; jform_vvvvwdyvyb_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var datalenght_vvvvwdl = jQuery("#jform_datalenght").val(); var has_defaults_vvvvwdl = jQuery("#jform_has_defaults input[type='radio']:checked").val(); @@ -849,7 +849,7 @@ function vvvvwdy(has_defaults_vvvvwdy) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -904,41 +904,52 @@ jQuery(document).ready(function($) getEditCustomCodeButtons(); }); -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/help_document.js b/media/js/help_document.js index bbb326f91..f30a100ab 100644 --- a/media/js/help_document.js +++ b/media/js/help_document.js @@ -16,7 +16,7 @@ jform_vvvvwemvyq_required = false; jform_vvvvweovyr_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var location_vvvvwej = jQuery("#jform_location input[type='radio']:checked").val(); vvvvwej(location_vvvvwej); @@ -286,7 +286,7 @@ function vvvvweo(target_vvvvweo) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -332,4 +332,4 @@ function isSet(val) return true; } return false; -} +} diff --git a/media/js/joomla_component.js b/media/js/joomla_component.js index 95c37ed75..d478dba84 100644 --- a/media/js/joomla_component.js +++ b/media/js/joomla_component.js @@ -19,7 +19,7 @@ jform_vvvvvxavwb_required = false; jform_vvvvvxavwc_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_helper_admin_vvvvvvv = jQuery("#jform_add_php_helper_admin input[type='radio']:checked").val(); vvvvvvv(add_php_helper_admin_vvvvvvv); @@ -729,7 +729,7 @@ function translation_tool_vvvvvxa_SomeFunc(translation_tool_vvvvvxa) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -913,43 +913,54 @@ function dasboardSwitch(value){ } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function addButtonID_server(type, size){ @@ -1002,4 +1013,4 @@ function addButton(type, where, size){ } } }) -} +} diff --git a/media/js/joomla_module.js b/media/js/joomla_module.js index d10ae51e8..1a3ccea7b 100644 --- a/media/js/joomla_module.js +++ b/media/js/joomla_module.js @@ -14,7 +14,7 @@ jform_vvvvvxsvwe_required = false; jform_vvvvvxtvwf_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_class_helper_vvvvvxb = jQuery("#jform_add_class_helper").val(); vvvvvxb(add_class_helper_vvvvvxb); @@ -479,7 +479,7 @@ function vvvvvxw(addreadme_vvvvvxw) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -672,43 +672,54 @@ function removeCodeFromEditor(code_string, editor_id){ } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getSnippetDetails(id){ @@ -803,4 +814,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/media/js/joomla_module_files_folders_urls.js b/media/js/joomla_module_files_folders_urls.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_module_files_folders_urls.js +++ b/media/js/joomla_module_files_folders_urls.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_module_updates.js b/media/js/joomla_module_updates.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_module_updates.js +++ b/media/js/joomla_module_updates.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_plugin.js b/media/js/joomla_plugin.js index 1c5636934..29ea9bbc6 100644 --- a/media/js/joomla_plugin.js +++ b/media/js/joomla_plugin.js @@ -14,7 +14,7 @@ jform_vvvvvyqvwh_required = false; jform_vvvvvyrvwi_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var class_extends_vvvvvxx = jQuery("#jform_class_extends").val(); var joomla_plugin_group_vvvvvxx = jQuery("#jform_joomla_plugin_group").val(); @@ -615,7 +615,7 @@ function vvvvvyu(addreadme_vvvvvyu) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -1099,41 +1099,52 @@ function getLinked(){ }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/joomla_plugin_files_folders_urls.js b/media/js/joomla_plugin_files_folders_urls.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_plugin_files_folders_urls.js +++ b/media/js/joomla_plugin_files_folders_urls.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_plugin_group.js b/media/js/joomla_plugin_group.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_plugin_group.js +++ b/media/js/joomla_plugin_group.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/joomla_plugin_updates.js b/media/js/joomla_plugin_updates.js index 215a78d2d..9d6629898 100644 --- a/media/js/joomla_plugin_updates.js +++ b/media/js/joomla_plugin_updates.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/language.js b/media/js/language.js index 215a78d2d..9d6629898 100644 --- a/media/js/language.js +++ b/media/js/language.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/language_translation.js b/media/js/language_translation.js index 4cd0acc5e..30c301cc7 100644 --- a/media/js/language_translation.js +++ b/media/js/language_translation.js @@ -45,4 +45,4 @@ function addButton(type, where, size){ } } }) -} +} diff --git a/media/js/layout.js b/media/js/layout.js index c896419d6..248512c9f 100644 --- a/media/js/layout.js +++ b/media/js/layout.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwba = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwba(add_php_view_vvvvwba); @@ -69,43 +69,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getSnippetDetails(id){ @@ -253,4 +264,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/media/js/library.js b/media/js/library.js index 72351e245..a7127b710 100644 --- a/media/js/library.js +++ b/media/js/library.js @@ -14,7 +14,7 @@ jform_vvvvwcyvxm_required = false; jform_vvvvwcyvxn_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var how_vvvvwci = jQuery("#jform_how").val(); var target_vvvvwci = jQuery("#jform_target input[type='radio']:checked").val(); @@ -798,7 +798,7 @@ function vvvvwcz(target_vvvvwcz) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -911,43 +911,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function addButtonID_server(type, size){ @@ -1008,4 +1019,4 @@ function getLinked(){ jQuery('#display_linked_to').html(result); } }); -} +} diff --git a/media/js/library_config.js b/media/js/library_config.js index 215a78d2d..9d6629898 100644 --- a/media/js/library_config.js +++ b/media/js/library_config.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/library_files_folders_urls.js b/media/js/library_files_folders_urls.js index 215a78d2d..9d6629898 100644 --- a/media/js/library_files_folders_urls.js +++ b/media/js/library_files_folders_urls.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/placeholder.js b/media/js/placeholder.js index 0786da5b5..268b44dd7 100644 --- a/media/js/placeholder.js +++ b/media/js/placeholder.js @@ -120,4 +120,4 @@ function placedin_server(placeholder, ide, target){ jsonp: false }); } - + diff --git a/media/js/power.js b/media/js/power.js index 097fc4c67..c88562ce3 100644 --- a/media/js/power.js +++ b/media/js/power.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_head_vvvvvyv = jQuery("#jform_add_head input[type='radio']:checked").val(); vvvvvyv(add_head_vvvvvyv); @@ -39,8 +39,7 @@ function isSet(val) } -jQuery(document).ready(function() -{ +document.addEventListener('DOMContentLoaded', function() { // get the linked details getLinked(); // load the active array values @@ -473,41 +472,52 @@ function getLinked(){ }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/server.js b/media/js/server.js index 7b3e1011e..48e95447e 100644 --- a/media/js/server.js +++ b/media/js/server.js @@ -20,7 +20,7 @@ jform_vvvvwedvyk_required = false; jform_vvvvwefvyl_required = false; // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var protocol_vvvvwdz = jQuery("#jform_protocol").val(); vvvvwdz(protocol_vvvvwdz); @@ -542,7 +542,7 @@ function authentication_vvvvweh_SomeFunc(authentication_vvvvweh) // update fields required function updateFieldRequired(name, status) { // check if not_required exist - if (jQuery('#jform_not_required').length > 0) { + if (document.getElementById('jform_not_required')) { var not_required = jQuery('#jform_not_required').val().split(","); if(status == 1) @@ -588,4 +588,4 @@ function isSet(val) return true; } return false; -} +} diff --git a/media/js/site_view.js b/media/js/site_view.js index 5dba68d7e..2d9bd9602 100644 --- a/media/js/site_view.js +++ b/media/js/site_view.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwao = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwao(add_php_view_vvvvwao); @@ -438,41 +438,52 @@ function setSnippets(array){ jQuery('#jform_snippet').trigger('liszt:updated'); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/media/js/snippet.js b/media/js/snippet.js index 215a78d2d..9d6629898 100644 --- a/media/js/snippet.js +++ b/media/js/snippet.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/snippet_type.js b/media/js/snippet_type.js index 215a78d2d..9d6629898 100644 --- a/media/js/snippet_type.js +++ b/media/js/snippet_type.js @@ -8,4 +8,4 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ - + diff --git a/media/js/template.js b/media/js/template.js index 0329e650f..80e91901d 100644 --- a/media/js/template.js +++ b/media/js/template.js @@ -9,7 +9,7 @@ */ // Initial Script -jQuery(document).ready(function() +document.addEventListener('DOMContentLoaded', function() { var add_php_view_vvvvwaz = jQuery("#jform_add_php_view input[type='radio']:checked").val(); vvvvwaz(add_php_view_vvvvwaz); @@ -69,43 +69,54 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; + }).catch(error => { + console.error('Error:', error); + }); } function getSnippetDetails(id){ @@ -265,4 +276,4 @@ function setSnippets(array){ jQuery('#jform_snippet').append(''); } jQuery('#jform_snippet').trigger('liszt:updated'); -} +} diff --git a/media/js/validation_rule.js b/media/js/validation_rule.js index 1f8888340..252b004ad 100644 --- a/media/js/validation_rule.js +++ b/media/js/validation_rule.js @@ -97,41 +97,52 @@ function checkRuleName_server(ruleName, ide){ }); } -function getEditCustomCodeButtons_server(id){ +function getEditCustomCodeButtons_server(id) { var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod); - if(token.length > 0 && id > 0){ - var request = token+'=1&id='+id+'&return_here='+return_here; + let requestParams = ''; + if (token.length > 0 && id > 0) { + requestParams = token+'=1&id='+id+'&return_here='+return_here; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + // Construct URL with parameters for GET request + const urlWithParams = getUrl + '&' + requestParams; + + // Using the Fetch API for the GET request + return fetch(urlWithParams, { + method: 'GET', + headers: { + 'Content-Type': 'application/json' + } + }).then(response => { + if (!response.ok) { + throw new Error('Network response was not ok'); + } + return response.json(); }); } -function getEditCustomCodeButtons(){ - // get the id - id = jQuery("#jform_id").val(); - getEditCustomCodeButtons_server(id).done(function(result) { - if(isObject(result)){ - jQuery.each(result, function( field, buttons ) { - jQuery('
').insertBefore(".control-wrapper-"+ field); - jQuery.each(buttons, function( name, button ) { - jQuery(".control-customcode-buttons-"+field).append(button); +function getEditCustomCodeButtons() { + // Get the id using pure JavaScript + const id = document.querySelector("#jform_id").value; + getEditCustomCodeButtons_server(id).then(function(result) { + if (typeof result === 'object') { + Object.entries(result).forEach(([field, buttons]) => { + // Creating the div element for buttons + const div = document.createElement('div'); + div.className = 'control-group'; + div.innerHTML = '
'; + + // Insert the div before .control-wrapper-{field} + const insertBeforeElement = document.querySelector(".control-wrapper-"+field); + insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement); + + // Adding buttons to the div + Object.entries(buttons).forEach(([name, button]) => { + const controlsDiv = document.querySelector(".control-customcode-buttons-"+field); + controlsDiv.innerHTML += button; }); }); } - }) -} - -// check object is not empty -function isObject(obj) { - for(var prop in obj) { - if (Object.prototype.hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; -} + }).catch(error => { + console.error('Error:', error); + }); +} diff --git a/script.php b/script.php index 2ea76bcb8..581ce90d9 100644 --- a/script.php +++ b/script.php @@ -12,25 +12,29 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Installer\Adapter\ComponentAdapter; +use Joomla\CMS\Version; +use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\FOF\Encrypt\AES; use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\GetHelper; -JHTML::_('bootstrap.renderModal'); +HTML::_('bootstrap.renderModal'); /** * Script File of Componentbuilder Component */ -class com_componentbuilderInstallerScript +class Com_ComponentbuilderInstallerScript { /** * Constructor * - * @param JAdapterInstance $parent The object responsible for running this script + * @param ComponentAdapter $parent The object responsible for running this script */ public function __construct(ComponentAdapter $parent) {} @@ -51,10 +55,10 @@ class com_componentbuilderInstallerScript public function uninstall(ComponentAdapter $parent) { // Get Application object - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // Get The Database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -84,7 +88,7 @@ class com_componentbuilderInstallerScript if ($joomla_component_done) { // If successfully remove Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__content_type table')); } // Remove Joomla_component items from the contentitem tag map table @@ -99,7 +103,7 @@ class com_componentbuilderInstallerScript if ($joomla_component_done) { // If successfully remove Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_component items from the ucm content table @@ -114,7 +118,7 @@ class com_componentbuilderInstallerScript if ($joomla_component_done) { // If successfully removed Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_component) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_component items are cleared from DB @@ -170,7 +174,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_done) { // If successfully remove Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__content_type table')); } // Remove Joomla_module items from the contentitem tag map table @@ -185,7 +189,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_done) { // If successfully remove Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_module items from the ucm content table @@ -200,7 +204,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_done) { // If successfully removed Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_module items are cleared from DB @@ -256,7 +260,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_done) { // If successfully remove Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin items from the contentitem tag map table @@ -271,7 +275,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_done) { // If successfully remove Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin items from the ucm content table @@ -286,7 +290,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_done) { // If successfully removed Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin items are cleared from DB @@ -342,7 +346,7 @@ class com_componentbuilderInstallerScript if ($power_done) { // If successfully remove Power add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.power) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.power) type alias was removed from the #__content_type table')); } // Remove Power items from the contentitem tag map table @@ -357,7 +361,7 @@ class com_componentbuilderInstallerScript if ($power_done) { // If successfully remove Power add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.power) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.power) type alias was removed from the #__contentitem_tag_map table')); } // Remove Power items from the ucm content table @@ -372,7 +376,7 @@ class com_componentbuilderInstallerScript if ($power_done) { // If successfully removed Power add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.power) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.power) type alias was removed from the #__ucm_content table')); } // Make sure that all the Power items are cleared from DB @@ -428,7 +432,7 @@ class com_componentbuilderInstallerScript if ($admin_view_done) { // If successfully remove Admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_view) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_view) type alias was removed from the #__content_type table')); } // Remove Admin_view items from the contentitem tag map table @@ -443,7 +447,7 @@ class com_componentbuilderInstallerScript if ($admin_view_done) { // If successfully remove Admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_view) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_view) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_view items from the ucm content table @@ -458,7 +462,7 @@ class com_componentbuilderInstallerScript if ($admin_view_done) { // If successfully removed Admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_view) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_view) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_view items are cleared from DB @@ -514,7 +518,7 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_done) { // If successfully remove Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__content_type table')); } // Remove Custom_admin_view items from the contentitem tag map table @@ -529,7 +533,7 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_done) { // If successfully remove Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__contentitem_tag_map table')); } // Remove Custom_admin_view items from the ucm content table @@ -544,7 +548,7 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_done) { // If successfully removed Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_admin_view) type alias was removed from the #__ucm_content table')); } // Make sure that all the Custom_admin_view items are cleared from DB @@ -600,7 +604,7 @@ class com_componentbuilderInstallerScript if ($site_view_done) { // If successfully remove Site_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.site_view) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.site_view) type alias was removed from the #__content_type table')); } // Remove Site_view items from the contentitem tag map table @@ -615,7 +619,7 @@ class com_componentbuilderInstallerScript if ($site_view_done) { // If successfully remove Site_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.site_view) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.site_view) type alias was removed from the #__contentitem_tag_map table')); } // Remove Site_view items from the ucm content table @@ -630,7 +634,7 @@ class com_componentbuilderInstallerScript if ($site_view_done) { // If successfully removed Site_view add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.site_view) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.site_view) type alias was removed from the #__ucm_content table')); } // Make sure that all the Site_view items are cleared from DB @@ -686,7 +690,7 @@ class com_componentbuilderInstallerScript if ($template_done) { // If successfully remove Template add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.template) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.template) type alias was removed from the #__content_type table')); } // Remove Template items from the contentitem tag map table @@ -701,7 +705,7 @@ class com_componentbuilderInstallerScript if ($template_done) { // If successfully remove Template add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.template) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.template) type alias was removed from the #__contentitem_tag_map table')); } // Remove Template items from the ucm content table @@ -716,7 +720,7 @@ class com_componentbuilderInstallerScript if ($template_done) { // If successfully removed Template add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.template) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.template) type alias was removed from the #__ucm_content table')); } // Make sure that all the Template items are cleared from DB @@ -772,7 +776,7 @@ class com_componentbuilderInstallerScript if ($layout_done) { // If successfully remove Layout add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.layout) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.layout) type alias was removed from the #__content_type table')); } // Remove Layout items from the contentitem tag map table @@ -787,7 +791,7 @@ class com_componentbuilderInstallerScript if ($layout_done) { // If successfully remove Layout add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.layout) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.layout) type alias was removed from the #__contentitem_tag_map table')); } // Remove Layout items from the ucm content table @@ -802,7 +806,7 @@ class com_componentbuilderInstallerScript if ($layout_done) { // If successfully removed Layout add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.layout) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.layout) type alias was removed from the #__ucm_content table')); } // Make sure that all the Layout items are cleared from DB @@ -858,7 +862,7 @@ class com_componentbuilderInstallerScript if ($dynamic_get_done) { // If successfully remove Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__content_type table')); } // Remove Dynamic_get items from the contentitem tag map table @@ -873,7 +877,7 @@ class com_componentbuilderInstallerScript if ($dynamic_get_done) { // If successfully remove Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__contentitem_tag_map table')); } // Remove Dynamic_get items from the ucm content table @@ -888,7 +892,7 @@ class com_componentbuilderInstallerScript if ($dynamic_get_done) { // If successfully removed Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.dynamic_get) type alias was removed from the #__ucm_content table')); } // Make sure that all the Dynamic_get items are cleared from DB @@ -944,7 +948,7 @@ class com_componentbuilderInstallerScript if ($custom_code_done) { // If successfully remove Custom_code add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_code) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_code) type alias was removed from the #__content_type table')); } // Remove Custom_code items from the contentitem tag map table @@ -959,7 +963,7 @@ class com_componentbuilderInstallerScript if ($custom_code_done) { // If successfully remove Custom_code add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_code) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_code) type alias was removed from the #__contentitem_tag_map table')); } // Remove Custom_code items from the ucm content table @@ -974,7 +978,7 @@ class com_componentbuilderInstallerScript if ($custom_code_done) { // If successfully removed Custom_code add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.custom_code) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.custom_code) type alias was removed from the #__ucm_content table')); } // Make sure that all the Custom_code items are cleared from DB @@ -1030,7 +1034,7 @@ class com_componentbuilderInstallerScript if ($class_property_done) { // If successfully remove Class_property add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_property) type alias was removed from the #__content_type table')); } // Remove Class_property items from the contentitem tag map table @@ -1045,7 +1049,7 @@ class com_componentbuilderInstallerScript if ($class_property_done) { // If successfully remove Class_property add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_property) type alias was removed from the #__contentitem_tag_map table')); } // Remove Class_property items from the ucm content table @@ -1060,7 +1064,7 @@ class com_componentbuilderInstallerScript if ($class_property_done) { // If successfully removed Class_property add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_property) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_property) type alias was removed from the #__ucm_content table')); } // Make sure that all the Class_property items are cleared from DB @@ -1116,7 +1120,7 @@ class com_componentbuilderInstallerScript if ($class_method_done) { // If successfully remove Class_method add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_method) type alias was removed from the #__content_type table')); } // Remove Class_method items from the contentitem tag map table @@ -1131,7 +1135,7 @@ class com_componentbuilderInstallerScript if ($class_method_done) { // If successfully remove Class_method add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_method) type alias was removed from the #__contentitem_tag_map table')); } // Remove Class_method items from the ucm content table @@ -1146,7 +1150,7 @@ class com_componentbuilderInstallerScript if ($class_method_done) { // If successfully removed Class_method add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_method) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_method) type alias was removed from the #__ucm_content table')); } // Make sure that all the Class_method items are cleared from DB @@ -1202,7 +1206,7 @@ class com_componentbuilderInstallerScript if ($placeholder_done) { // If successfully remove Placeholder add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.placeholder) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.placeholder) type alias was removed from the #__content_type table')); } // Remove Placeholder items from the contentitem tag map table @@ -1217,7 +1221,7 @@ class com_componentbuilderInstallerScript if ($placeholder_done) { // If successfully remove Placeholder add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.placeholder) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.placeholder) type alias was removed from the #__contentitem_tag_map table')); } // Remove Placeholder items from the ucm content table @@ -1232,7 +1236,7 @@ class com_componentbuilderInstallerScript if ($placeholder_done) { // If successfully removed Placeholder add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.placeholder) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.placeholder) type alias was removed from the #__ucm_content table')); } // Make sure that all the Placeholder items are cleared from DB @@ -1288,7 +1292,7 @@ class com_componentbuilderInstallerScript if ($library_done) { // If successfully remove Library add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library) type alias was removed from the #__content_type table')); } // Remove Library items from the contentitem tag map table @@ -1303,7 +1307,7 @@ class com_componentbuilderInstallerScript if ($library_done) { // If successfully remove Library add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library) type alias was removed from the #__contentitem_tag_map table')); } // Remove Library items from the ucm content table @@ -1318,7 +1322,7 @@ class com_componentbuilderInstallerScript if ($library_done) { // If successfully removed Library add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library) type alias was removed from the #__ucm_content table')); } // Make sure that all the Library items are cleared from DB @@ -1374,7 +1378,7 @@ class com_componentbuilderInstallerScript if ($snippet_done) { // If successfully remove Snippet add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet) type alias was removed from the #__content_type table')); } // Remove Snippet items from the contentitem tag map table @@ -1389,7 +1393,7 @@ class com_componentbuilderInstallerScript if ($snippet_done) { // If successfully remove Snippet add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet) type alias was removed from the #__contentitem_tag_map table')); } // Remove Snippet items from the ucm content table @@ -1404,7 +1408,7 @@ class com_componentbuilderInstallerScript if ($snippet_done) { // If successfully removed Snippet add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet) type alias was removed from the #__ucm_content table')); } // Make sure that all the Snippet items are cleared from DB @@ -1460,7 +1464,7 @@ class com_componentbuilderInstallerScript if ($validation_rule_done) { // If successfully remove Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__content_type table')); } // Remove Validation_rule items from the contentitem tag map table @@ -1475,7 +1479,7 @@ class com_componentbuilderInstallerScript if ($validation_rule_done) { // If successfully remove Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__contentitem_tag_map table')); } // Remove Validation_rule items from the ucm content table @@ -1490,7 +1494,7 @@ class com_componentbuilderInstallerScript if ($validation_rule_done) { // If successfully removed Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.validation_rule) type alias was removed from the #__ucm_content table')); } // Make sure that all the Validation_rule items are cleared from DB @@ -1546,7 +1550,7 @@ class com_componentbuilderInstallerScript if ($field_done) { // If successfully remove Field add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field) type alias was removed from the #__content_type table')); } // Remove Field items from the contentitem tag map table @@ -1561,7 +1565,7 @@ class com_componentbuilderInstallerScript if ($field_done) { // If successfully remove Field add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field) type alias was removed from the #__contentitem_tag_map table')); } // Remove Field items from the ucm content table @@ -1576,7 +1580,7 @@ class com_componentbuilderInstallerScript if ($field_done) { // If successfully removed Field add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field) type alias was removed from the #__ucm_content table')); } // Make sure that all the Field items are cleared from DB @@ -1632,7 +1636,7 @@ class com_componentbuilderInstallerScript if ($field_catid_done) { // If successfully remove Field catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field.category) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field.category) type alias was removed from the #__content_type table')); } // Remove Field catid items from the contentitem tag map table @@ -1647,7 +1651,7 @@ class com_componentbuilderInstallerScript if ($field_catid_done) { // If successfully remove Field catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field.category) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field.category) type alias was removed from the #__contentitem_tag_map table')); } // Remove Field catid items from the ucm content table @@ -1662,7 +1666,7 @@ class com_componentbuilderInstallerScript if ($field_catid_done) { // If successfully removed Field catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.field.category) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.field.category) type alias was removed from the #__ucm_content table')); } // Make sure that all the Field catid items are cleared from DB @@ -1718,7 +1722,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_done) { // If successfully remove Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__content_type table')); } // Remove Fieldtype items from the contentitem tag map table @@ -1733,7 +1737,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_done) { // If successfully remove Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__contentitem_tag_map table')); } // Remove Fieldtype items from the ucm content table @@ -1748,7 +1752,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_done) { // If successfully removed Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype) type alias was removed from the #__ucm_content table')); } // Make sure that all the Fieldtype items are cleared from DB @@ -1804,7 +1808,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_catid_done) { // If successfully remove Fieldtype catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__content_type table')); } // Remove Fieldtype catid items from the contentitem tag map table @@ -1819,7 +1823,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_catid_done) { // If successfully remove Fieldtype catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__contentitem_tag_map table')); } // Remove Fieldtype catid items from the ucm content table @@ -1834,7 +1838,7 @@ class com_componentbuilderInstallerScript if ($fieldtype_catid_done) { // If successfully removed Fieldtype catid add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.fieldtype.category) type alias was removed from the #__ucm_content table')); } // Make sure that all the Fieldtype catid items are cleared from DB @@ -1890,7 +1894,7 @@ class com_componentbuilderInstallerScript if ($language_translation_done) { // If successfully remove Language_translation add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language_translation) type alias was removed from the #__content_type table')); } // Remove Language_translation items from the contentitem tag map table @@ -1905,7 +1909,7 @@ class com_componentbuilderInstallerScript if ($language_translation_done) { // If successfully remove Language_translation add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language_translation) type alias was removed from the #__contentitem_tag_map table')); } // Remove Language_translation items from the ucm content table @@ -1920,7 +1924,7 @@ class com_componentbuilderInstallerScript if ($language_translation_done) { // If successfully removed Language_translation add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language_translation) type alias was removed from the #__ucm_content table')); } // Make sure that all the Language_translation items are cleared from DB @@ -1976,7 +1980,7 @@ class com_componentbuilderInstallerScript if ($language_done) { // If successfully remove Language add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language) type alias was removed from the #__content_type table')); } // Remove Language items from the contentitem tag map table @@ -1991,7 +1995,7 @@ class com_componentbuilderInstallerScript if ($language_done) { // If successfully remove Language add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language) type alias was removed from the #__contentitem_tag_map table')); } // Remove Language items from the ucm content table @@ -2006,7 +2010,7 @@ class com_componentbuilderInstallerScript if ($language_done) { // If successfully removed Language add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.language) type alias was removed from the #__ucm_content table')); } // Make sure that all the Language items are cleared from DB @@ -2062,7 +2066,7 @@ class com_componentbuilderInstallerScript if ($server_done) { // If successfully remove Server add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.server) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.server) type alias was removed from the #__content_type table')); } // Remove Server items from the contentitem tag map table @@ -2077,7 +2081,7 @@ class com_componentbuilderInstallerScript if ($server_done) { // If successfully remove Server add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.server) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.server) type alias was removed from the #__contentitem_tag_map table')); } // Remove Server items from the ucm content table @@ -2092,7 +2096,7 @@ class com_componentbuilderInstallerScript if ($server_done) { // If successfully removed Server add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.server) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.server) type alias was removed from the #__ucm_content table')); } // Make sure that all the Server items are cleared from DB @@ -2148,7 +2152,7 @@ class com_componentbuilderInstallerScript if ($help_document_done) { // If successfully remove Help_document add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.help_document) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.help_document) type alias was removed from the #__content_type table')); } // Remove Help_document items from the contentitem tag map table @@ -2163,7 +2167,7 @@ class com_componentbuilderInstallerScript if ($help_document_done) { // If successfully remove Help_document add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.help_document) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.help_document) type alias was removed from the #__contentitem_tag_map table')); } // Remove Help_document items from the ucm content table @@ -2178,7 +2182,7 @@ class com_componentbuilderInstallerScript if ($help_document_done) { // If successfully removed Help_document add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.help_document) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.help_document) type alias was removed from the #__ucm_content table')); } // Make sure that all the Help_document items are cleared from DB @@ -2234,7 +2238,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_done) { // If successfully remove Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__content_type table')); } // Remove Admin_fields items from the contentitem tag map table @@ -2249,7 +2253,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_done) { // If successfully remove Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_fields items from the ucm content table @@ -2264,7 +2268,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_done) { // If successfully removed Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_fields items are cleared from DB @@ -2320,7 +2324,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_done) { // If successfully remove Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__content_type table')); } // Remove Admin_fields_conditions items from the contentitem tag map table @@ -2335,7 +2339,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_done) { // If successfully remove Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_fields_conditions items from the ucm content table @@ -2350,7 +2354,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_done) { // If successfully removed Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_conditions) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_fields_conditions items are cleared from DB @@ -2406,7 +2410,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_done) { // If successfully remove Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__content_type table')); } // Remove Admin_fields_relations items from the contentitem tag map table @@ -2421,7 +2425,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_done) { // If successfully remove Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_fields_relations items from the ucm content table @@ -2436,7 +2440,7 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_done) { // If successfully removed Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_fields_relations) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_fields_relations items are cleared from DB @@ -2492,7 +2496,7 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_done) { // If successfully remove Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__content_type table')); } // Remove Admin_custom_tabs items from the contentitem tag map table @@ -2507,7 +2511,7 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_done) { // If successfully remove Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__contentitem_tag_map table')); } // Remove Admin_custom_tabs items from the ucm content table @@ -2522,7 +2526,7 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_done) { // If successfully removed Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.admin_custom_tabs) type alias was removed from the #__ucm_content table')); } // Make sure that all the Admin_custom_tabs items are cleared from DB @@ -2578,7 +2582,7 @@ class com_componentbuilderInstallerScript if ($component_admin_views_done) { // If successfully remove Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__content_type table')); } // Remove Component_admin_views items from the contentitem tag map table @@ -2593,7 +2597,7 @@ class com_componentbuilderInstallerScript if ($component_admin_views_done) { // If successfully remove Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_admin_views items from the ucm content table @@ -2608,7 +2612,7 @@ class com_componentbuilderInstallerScript if ($component_admin_views_done) { // If successfully removed Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_admin_views) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_admin_views items are cleared from DB @@ -2664,7 +2668,7 @@ class com_componentbuilderInstallerScript if ($component_site_views_done) { // If successfully remove Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__content_type table')); } // Remove Component_site_views items from the contentitem tag map table @@ -2679,7 +2683,7 @@ class com_componentbuilderInstallerScript if ($component_site_views_done) { // If successfully remove Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_site_views items from the ucm content table @@ -2694,7 +2698,7 @@ class com_componentbuilderInstallerScript if ($component_site_views_done) { // If successfully removed Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_site_views) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_site_views items are cleared from DB @@ -2750,7 +2754,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_done) { // If successfully remove Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__content_type table')); } // Remove Component_custom_admin_views items from the contentitem tag map table @@ -2765,7 +2769,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_done) { // If successfully remove Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_custom_admin_views items from the ucm content table @@ -2780,7 +2784,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_done) { // If successfully removed Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_views) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_custom_admin_views items are cleared from DB @@ -2836,7 +2840,7 @@ class com_componentbuilderInstallerScript if ($component_updates_done) { // If successfully remove Component_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_updates) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_updates) type alias was removed from the #__content_type table')); } // Remove Component_updates items from the contentitem tag map table @@ -2851,7 +2855,7 @@ class com_componentbuilderInstallerScript if ($component_updates_done) { // If successfully remove Component_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_updates) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_updates) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_updates items from the ucm content table @@ -2866,7 +2870,7 @@ class com_componentbuilderInstallerScript if ($component_updates_done) { // If successfully removed Component_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_updates) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_updates) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_updates items are cleared from DB @@ -2922,7 +2926,7 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_done) { // If successfully remove Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__content_type table')); } // Remove Component_mysql_tweaks items from the contentitem tag map table @@ -2937,7 +2941,7 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_done) { // If successfully remove Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_mysql_tweaks items from the ucm content table @@ -2952,7 +2956,7 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_done) { // If successfully removed Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_mysql_tweaks) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_mysql_tweaks items are cleared from DB @@ -3008,7 +3012,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_done) { // If successfully remove Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__content_type table')); } // Remove Component_custom_admin_menus items from the contentitem tag map table @@ -3023,7 +3027,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_done) { // If successfully remove Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_custom_admin_menus items from the ucm content table @@ -3038,7 +3042,7 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_done) { // If successfully removed Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_custom_admin_menus) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_custom_admin_menus items are cleared from DB @@ -3066,6 +3070,92 @@ class com_componentbuilderInstallerScript } } + // Create a new query object. + $query = $db->getQuery(true); + // Select id from content type table + $query->select($db->quoteName('type_id')); + $query->from($db->quoteName('#__content_types')); + // Where Component_router alias is found + $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + $db->setQuery($query); + // Execute query to see if alias is found + $db->execute(); + $component_router_found = $db->getNumRows(); + // Now check if there were any rows + if ($component_router_found) + { + // Since there are load the needed component_router type ids + $component_router_ids = $db->loadColumn(); + // Remove Component_router from the content type table + $component_router_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__content_types')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $component_router_done = $db->execute(); + if ($component_router_done) + { + // If successfully remove Component_router add queued success message. + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_router) type alias was removed from the #__content_type table')); + } + + // Remove Component_router items from the contentitem tag map table + $component_router_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__contentitem_tag_map')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $component_router_done = $db->execute(); + if ($component_router_done) + { + // If successfully remove Component_router add queued success message. + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_router) type alias was removed from the #__contentitem_tag_map table')); + } + + // Remove Component_router items from the ucm content table + $component_router_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_content')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $component_router_done = $db->execute(); + if ($component_router_done) + { + // If successfully removed Component_router add queued success message. + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_router) type alias was removed from the #__ucm_content table')); + } + + // Make sure that all the Component_router items are cleared from DB + foreach ($component_router_ids as $component_router_id) + { + // Remove Component_router items from the ucm base table + $component_router_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $component_router_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_base')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $db->execute(); + + // Remove Component_router items from the ucm history table + $component_router_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $component_router_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_history')); + $query->where($component_router_condition); + $db->setQuery($query); + // Execute the query to remove Component_router items + $db->execute(); + } + } + // Create a new query object. $query = $db->getQuery(true); // Select id from content type table @@ -3094,7 +3184,7 @@ class com_componentbuilderInstallerScript if ($component_config_done) { // If successfully remove Component_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_config) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_config) type alias was removed from the #__content_type table')); } // Remove Component_config items from the contentitem tag map table @@ -3109,7 +3199,7 @@ class com_componentbuilderInstallerScript if ($component_config_done) { // If successfully remove Component_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_config) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_config) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_config items from the ucm content table @@ -3124,7 +3214,7 @@ class com_componentbuilderInstallerScript if ($component_config_done) { // If successfully removed Component_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_config) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_config) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_config items are cleared from DB @@ -3180,7 +3270,7 @@ class com_componentbuilderInstallerScript if ($component_dashboard_done) { // If successfully remove Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__content_type table')); } // Remove Component_dashboard items from the contentitem tag map table @@ -3195,7 +3285,7 @@ class com_componentbuilderInstallerScript if ($component_dashboard_done) { // If successfully remove Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_dashboard items from the ucm content table @@ -3210,7 +3300,7 @@ class com_componentbuilderInstallerScript if ($component_dashboard_done) { // If successfully removed Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_dashboard) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_dashboard items are cleared from DB @@ -3266,7 +3356,7 @@ class com_componentbuilderInstallerScript if ($component_files_folders_done) { // If successfully remove Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__content_type table')); } // Remove Component_files_folders items from the contentitem tag map table @@ -3281,7 +3371,7 @@ class com_componentbuilderInstallerScript if ($component_files_folders_done) { // If successfully remove Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_files_folders items from the ucm content table @@ -3296,7 +3386,7 @@ class com_componentbuilderInstallerScript if ($component_files_folders_done) { // If successfully removed Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_files_folders) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_files_folders items are cleared from DB @@ -3352,7 +3442,7 @@ class com_componentbuilderInstallerScript if ($component_placeholders_done) { // If successfully remove Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__content_type table')); } // Remove Component_placeholders items from the contentitem tag map table @@ -3367,7 +3457,7 @@ class com_componentbuilderInstallerScript if ($component_placeholders_done) { // If successfully remove Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_placeholders items from the ucm content table @@ -3382,7 +3472,7 @@ class com_componentbuilderInstallerScript if ($component_placeholders_done) { // If successfully removed Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_placeholders) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_placeholders items are cleared from DB @@ -3438,7 +3528,7 @@ class com_componentbuilderInstallerScript if ($component_plugins_done) { // If successfully remove Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__content_type table')); } // Remove Component_plugins items from the contentitem tag map table @@ -3453,7 +3543,7 @@ class com_componentbuilderInstallerScript if ($component_plugins_done) { // If successfully remove Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_plugins items from the ucm content table @@ -3468,7 +3558,7 @@ class com_componentbuilderInstallerScript if ($component_plugins_done) { // If successfully removed Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_plugins) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_plugins items are cleared from DB @@ -3524,7 +3614,7 @@ class com_componentbuilderInstallerScript if ($component_modules_done) { // If successfully remove Component_modules add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_modules) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_modules) type alias was removed from the #__content_type table')); } // Remove Component_modules items from the contentitem tag map table @@ -3539,7 +3629,7 @@ class com_componentbuilderInstallerScript if ($component_modules_done) { // If successfully remove Component_modules add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_modules) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_modules) type alias was removed from the #__contentitem_tag_map table')); } // Remove Component_modules items from the ucm content table @@ -3554,7 +3644,7 @@ class com_componentbuilderInstallerScript if ($component_modules_done) { // If successfully removed Component_modules add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.component_modules) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.component_modules) type alias was removed from the #__ucm_content table')); } // Make sure that all the Component_modules items are cleared from DB @@ -3610,7 +3700,7 @@ class com_componentbuilderInstallerScript if ($snippet_type_done) { // If successfully remove Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__content_type table')); } // Remove Snippet_type items from the contentitem tag map table @@ -3625,7 +3715,7 @@ class com_componentbuilderInstallerScript if ($snippet_type_done) { // If successfully remove Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__contentitem_tag_map table')); } // Remove Snippet_type items from the ucm content table @@ -3640,7 +3730,7 @@ class com_componentbuilderInstallerScript if ($snippet_type_done) { // If successfully removed Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.snippet_type) type alias was removed from the #__ucm_content table')); } // Make sure that all the Snippet_type items are cleared from DB @@ -3696,7 +3786,7 @@ class com_componentbuilderInstallerScript if ($library_config_done) { // If successfully remove Library_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_config) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_config) type alias was removed from the #__content_type table')); } // Remove Library_config items from the contentitem tag map table @@ -3711,7 +3801,7 @@ class com_componentbuilderInstallerScript if ($library_config_done) { // If successfully remove Library_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_config) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_config) type alias was removed from the #__contentitem_tag_map table')); } // Remove Library_config items from the ucm content table @@ -3726,7 +3816,7 @@ class com_componentbuilderInstallerScript if ($library_config_done) { // If successfully removed Library_config add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_config) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_config) type alias was removed from the #__ucm_content table')); } // Make sure that all the Library_config items are cleared from DB @@ -3782,7 +3872,7 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_done) { // If successfully remove Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__content_type table')); } // Remove Library_files_folders_urls items from the contentitem tag map table @@ -3797,7 +3887,7 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_done) { // If successfully remove Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); } // Remove Library_files_folders_urls items from the ucm content table @@ -3812,7 +3902,7 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_done) { // If successfully removed Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.library_files_folders_urls) type alias was removed from the #__ucm_content table')); } // Make sure that all the Library_files_folders_urls items are cleared from DB @@ -3868,7 +3958,7 @@ class com_componentbuilderInstallerScript if ($class_extends_done) { // If successfully remove Class_extends add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_extends) type alias was removed from the #__content_type table')); } // Remove Class_extends items from the contentitem tag map table @@ -3883,7 +3973,7 @@ class com_componentbuilderInstallerScript if ($class_extends_done) { // If successfully remove Class_extends add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_extends) type alias was removed from the #__contentitem_tag_map table')); } // Remove Class_extends items from the ucm content table @@ -3898,7 +3988,7 @@ class com_componentbuilderInstallerScript if ($class_extends_done) { // If successfully removed Class_extends add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.class_extends) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.class_extends) type alias was removed from the #__ucm_content table')); } // Make sure that all the Class_extends items are cleared from DB @@ -3954,7 +4044,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_done) { // If successfully remove Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__content_type table')); } // Remove Joomla_module_updates items from the contentitem tag map table @@ -3969,7 +4059,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_done) { // If successfully remove Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_module_updates items from the ucm content table @@ -3984,7 +4074,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_done) { // If successfully removed Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_updates) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_module_updates items are cleared from DB @@ -4040,7 +4130,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_done) { // If successfully remove Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__content_type table')); } // Remove Joomla_module_files_folders_urls items from the contentitem tag map table @@ -4055,7 +4145,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_done) { // If successfully remove Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_module_files_folders_urls items from the ucm content table @@ -4070,7 +4160,7 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_done) { // If successfully removed Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_module_files_folders_urls) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_module_files_folders_urls items are cleared from DB @@ -4126,7 +4216,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_done) { // If successfully remove Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin_group items from the contentitem tag map table @@ -4141,7 +4231,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_done) { // If successfully remove Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin_group items from the ucm content table @@ -4156,7 +4246,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_done) { // If successfully removed Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_group) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin_group items are cleared from DB @@ -4212,7 +4302,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_done) { // If successfully remove Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin_updates items from the contentitem tag map table @@ -4227,7 +4317,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_done) { // If successfully remove Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin_updates items from the ucm content table @@ -4242,7 +4332,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_done) { // If successfully removed Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_updates) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin_updates items are cleared from DB @@ -4298,7 +4388,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully remove Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__content_type table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__content_type table')); } // Remove Joomla_plugin_files_folders_urls items from the contentitem tag map table @@ -4313,7 +4403,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully remove Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__contentitem_tag_map table')); } // Remove Joomla_plugin_files_folders_urls items from the ucm content table @@ -4328,7 +4418,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully removed Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__ucm_content table')); + $app->enqueueMessage(Text::_('The (com_componentbuilder.joomla_plugin_files_folders_urls) type alias was removed from the #__ucm_content table')); } // Make sure that all the Joomla_plugin_files_folders_urls items are cleared from DB @@ -4357,8 +4447,8 @@ class com_componentbuilderInstallerScript } // If All related items was removed queued success message. - $app->enqueueMessage(JText::_('All related items was removed from the #__ucm_base table')); - $app->enqueueMessage(JText::_('All related items was removed from the #__ucm_history table')); + $app->enqueueMessage(Text::_('All related items was removed from the #__ucm_base table')); + $app->enqueueMessage(Text::_('All related items was removed from the #__ucm_history table')); // Remove componentbuilder assets from the assets table $componentbuilder_condition = array( $db->quoteName('name') . ' LIKE ' . $db->quote('com_componentbuilder%') ); @@ -4372,7 +4462,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_done) { // If successfully removed componentbuilder add queued success message. - $app->enqueueMessage(JText::_('All related items was removed from the #__assets table')); + $app->enqueueMessage(Text::_('All related items was removed from the #__assets table')); } // Get the biggest rule column in the assets table at this point. @@ -4388,24 +4478,24 @@ class com_componentbuilderInstallerScript $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';"; $db->setQuery($revert_rule); $db->execute(); - $app->enqueueMessage(JText::_('Reverted the #__assets table rules column back to its default size of varchar(5120)')); + $app->enqueueMessage(Text::_('COM_COMPONENTBUILDER_REVERTED_THE_B_ASSETSB_TABLE_RULES_COLUMN_BACK_TO_ITS_DEFAULT_SIZE_OF_VARCHARFIVE_THOUSAND_ONE_HUNDRED_AND_TWENTY')); } else { - $app->enqueueMessage(JText::_('Could not revert the #__assets table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.')); + $app->enqueueMessage(Text::_('Could not revert the #__assets table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.')); } } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder from the action_logs_extensions table $componentbuilder_action_logs_extensions = array( $db->quoteName('extension') . ' = ' . $db->quote('com_componentbuilder') ); @@ -4419,18 +4509,18 @@ class com_componentbuilderInstallerScript if ($componentbuilder_removed_done) { // If successfully remove Componentbuilder add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder extension was removed from the #__action_logs_extensions table')); + $app->enqueueMessage(Text::_('The com_componentbuilder extension was removed from the #__action_logs_extensions table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_component from the action_log_config table $joomla_component_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_component') ); @@ -4444,18 +4534,18 @@ class com_componentbuilderInstallerScript if ($joomla_component_action_log_config_done) { // If successfully removed Componentbuilder Joomla_component add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_component type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_component type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_module from the action_log_config table $joomla_module_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_module') ); @@ -4469,18 +4559,18 @@ class com_componentbuilderInstallerScript if ($joomla_module_action_log_config_done) { // If successfully removed Componentbuilder Joomla_module add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_module type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_module type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin from the action_log_config table $joomla_plugin_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin') ); @@ -4494,18 +4584,18 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Power from the action_log_config table $power_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.power') ); @@ -4519,18 +4609,18 @@ class com_componentbuilderInstallerScript if ($power_action_log_config_done) { // If successfully removed Componentbuilder Power add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.power type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.power type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_view from the action_log_config table $admin_view_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_view') ); @@ -4544,18 +4634,18 @@ class com_componentbuilderInstallerScript if ($admin_view_action_log_config_done) { // If successfully removed Componentbuilder Admin_view add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_view type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_view type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Custom_admin_view from the action_log_config table $custom_admin_view_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.custom_admin_view') ); @@ -4569,18 +4659,18 @@ class com_componentbuilderInstallerScript if ($custom_admin_view_action_log_config_done) { // If successfully removed Componentbuilder Custom_admin_view add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.custom_admin_view type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.custom_admin_view type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Site_view from the action_log_config table $site_view_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.site_view') ); @@ -4594,18 +4684,18 @@ class com_componentbuilderInstallerScript if ($site_view_action_log_config_done) { // If successfully removed Componentbuilder Site_view add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.site_view type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.site_view type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Template from the action_log_config table $template_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.template') ); @@ -4619,18 +4709,18 @@ class com_componentbuilderInstallerScript if ($template_action_log_config_done) { // If successfully removed Componentbuilder Template add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.template type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.template type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Layout from the action_log_config table $layout_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.layout') ); @@ -4644,18 +4734,18 @@ class com_componentbuilderInstallerScript if ($layout_action_log_config_done) { // If successfully removed Componentbuilder Layout add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.layout type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.layout type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Dynamic_get from the action_log_config table $dynamic_get_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.dynamic_get') ); @@ -4669,18 +4759,18 @@ class com_componentbuilderInstallerScript if ($dynamic_get_action_log_config_done) { // If successfully removed Componentbuilder Dynamic_get add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.dynamic_get type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.dynamic_get type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Custom_code from the action_log_config table $custom_code_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.custom_code') ); @@ -4694,18 +4784,18 @@ class com_componentbuilderInstallerScript if ($custom_code_action_log_config_done) { // If successfully removed Componentbuilder Custom_code add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.custom_code type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.custom_code type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Class_property from the action_log_config table $class_property_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_property') ); @@ -4719,18 +4809,18 @@ class com_componentbuilderInstallerScript if ($class_property_action_log_config_done) { // If successfully removed Componentbuilder Class_property add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.class_property type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.class_property type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Class_method from the action_log_config table $class_method_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_method') ); @@ -4744,18 +4834,18 @@ class com_componentbuilderInstallerScript if ($class_method_action_log_config_done) { // If successfully removed Componentbuilder Class_method add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.class_method type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.class_method type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Placeholder from the action_log_config table $placeholder_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.placeholder') ); @@ -4769,18 +4859,18 @@ class com_componentbuilderInstallerScript if ($placeholder_action_log_config_done) { // If successfully removed Componentbuilder Placeholder add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.placeholder type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.placeholder type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Library from the action_log_config table $library_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.library') ); @@ -4794,18 +4884,18 @@ class com_componentbuilderInstallerScript if ($library_action_log_config_done) { // If successfully removed Componentbuilder Library add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.library type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.library type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Snippet from the action_log_config table $snippet_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.snippet') ); @@ -4819,18 +4909,18 @@ class com_componentbuilderInstallerScript if ($snippet_action_log_config_done) { // If successfully removed Componentbuilder Snippet add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.snippet type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.snippet type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Validation_rule from the action_log_config table $validation_rule_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.validation_rule') ); @@ -4844,18 +4934,18 @@ class com_componentbuilderInstallerScript if ($validation_rule_action_log_config_done) { // If successfully removed Componentbuilder Validation_rule add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.validation_rule type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.validation_rule type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Field from the action_log_config table $field_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.field') ); @@ -4869,18 +4959,18 @@ class com_componentbuilderInstallerScript if ($field_action_log_config_done) { // If successfully removed Componentbuilder Field add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.field type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.field type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Fieldtype from the action_log_config table $fieldtype_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.fieldtype') ); @@ -4894,18 +4984,18 @@ class com_componentbuilderInstallerScript if ($fieldtype_action_log_config_done) { // If successfully removed Componentbuilder Fieldtype add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.fieldtype type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.fieldtype type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Language_translation from the action_log_config table $language_translation_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language_translation') ); @@ -4919,18 +5009,18 @@ class com_componentbuilderInstallerScript if ($language_translation_action_log_config_done) { // If successfully removed Componentbuilder Language_translation add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.language_translation type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.language_translation type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Language from the action_log_config table $language_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language') ); @@ -4944,18 +5034,18 @@ class com_componentbuilderInstallerScript if ($language_action_log_config_done) { // If successfully removed Componentbuilder Language add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.language type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.language type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Server from the action_log_config table $server_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.server') ); @@ -4969,18 +5059,18 @@ class com_componentbuilderInstallerScript if ($server_action_log_config_done) { // If successfully removed Componentbuilder Server add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.server type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.server type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Help_document from the action_log_config table $help_document_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.help_document') ); @@ -4994,18 +5084,18 @@ class com_componentbuilderInstallerScript if ($help_document_action_log_config_done) { // If successfully removed Componentbuilder Help_document add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.help_document type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.help_document type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_fields from the action_log_config table $admin_fields_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields') ); @@ -5019,18 +5109,18 @@ class com_componentbuilderInstallerScript if ($admin_fields_action_log_config_done) { // If successfully removed Componentbuilder Admin_fields add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_fields type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_fields type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_fields_conditions from the action_log_config table $admin_fields_conditions_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_conditions') ); @@ -5044,18 +5134,18 @@ class com_componentbuilderInstallerScript if ($admin_fields_conditions_action_log_config_done) { // If successfully removed Componentbuilder Admin_fields_conditions add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_fields_conditions type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_fields_conditions type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_fields_relations from the action_log_config table $admin_fields_relations_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_fields_relations') ); @@ -5069,18 +5159,18 @@ class com_componentbuilderInstallerScript if ($admin_fields_relations_action_log_config_done) { // If successfully removed Componentbuilder Admin_fields_relations add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_fields_relations type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_fields_relations type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Admin_custom_tabs from the action_log_config table $admin_custom_tabs_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.admin_custom_tabs') ); @@ -5094,18 +5184,18 @@ class com_componentbuilderInstallerScript if ($admin_custom_tabs_action_log_config_done) { // If successfully removed Componentbuilder Admin_custom_tabs add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.admin_custom_tabs type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.admin_custom_tabs type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_admin_views from the action_log_config table $component_admin_views_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_admin_views') ); @@ -5119,18 +5209,18 @@ class com_componentbuilderInstallerScript if ($component_admin_views_action_log_config_done) { // If successfully removed Componentbuilder Component_admin_views add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_admin_views type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_admin_views type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_site_views from the action_log_config table $component_site_views_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_site_views') ); @@ -5144,18 +5234,18 @@ class com_componentbuilderInstallerScript if ($component_site_views_action_log_config_done) { // If successfully removed Componentbuilder Component_site_views add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_site_views type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_site_views type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_custom_admin_views from the action_log_config table $component_custom_admin_views_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_custom_admin_views') ); @@ -5169,18 +5259,18 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_views_action_log_config_done) { // If successfully removed Componentbuilder Component_custom_admin_views add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_custom_admin_views type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_custom_admin_views type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_updates from the action_log_config table $component_updates_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_updates') ); @@ -5194,18 +5284,18 @@ class com_componentbuilderInstallerScript if ($component_updates_action_log_config_done) { // If successfully removed Componentbuilder Component_updates add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_updates type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_updates type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_mysql_tweaks from the action_log_config table $component_mysql_tweaks_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_mysql_tweaks') ); @@ -5219,18 +5309,18 @@ class com_componentbuilderInstallerScript if ($component_mysql_tweaks_action_log_config_done) { // If successfully removed Componentbuilder Component_mysql_tweaks add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_mysql_tweaks type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_mysql_tweaks type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_custom_admin_menus from the action_log_config table $component_custom_admin_menus_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_custom_admin_menus') ); @@ -5244,18 +5334,43 @@ class com_componentbuilderInstallerScript if ($component_custom_admin_menus_action_log_config_done) { // If successfully removed Componentbuilder Component_custom_admin_menus add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_custom_admin_menus type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_custom_admin_menus type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); + } + // Remove Componentbuilder Component_router from the action_log_config table + $component_router_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_router') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__action_log_config')); + $query->where($component_router_action_log_config); + $db->setQuery($query); + // Execute the query to remove com_componentbuilder.component_router + $component_router_action_log_config_done = $db->execute(); + if ($component_router_action_log_config_done) + { + // If successfully removed Componentbuilder Component_router add queued success message. + $app->enqueueMessage(Text::_('The com_componentbuilder.component_router type alias was removed from the #__action_log_config table')); + } + + // Set db if not set already. + if (!isset($db)) + { + $db = Factory::getDbo(); + } + // Set app if not set already. + if (!isset($app)) + { + $app = Factory::getApplication(); } // Remove Componentbuilder Component_config from the action_log_config table $component_config_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_config') ); @@ -5269,18 +5384,18 @@ class com_componentbuilderInstallerScript if ($component_config_action_log_config_done) { // If successfully removed Componentbuilder Component_config add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_config type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_config type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_dashboard from the action_log_config table $component_dashboard_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_dashboard') ); @@ -5294,18 +5409,18 @@ class com_componentbuilderInstallerScript if ($component_dashboard_action_log_config_done) { // If successfully removed Componentbuilder Component_dashboard add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_dashboard type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_dashboard type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_files_folders from the action_log_config table $component_files_folders_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_files_folders') ); @@ -5319,18 +5434,18 @@ class com_componentbuilderInstallerScript if ($component_files_folders_action_log_config_done) { // If successfully removed Componentbuilder Component_files_folders add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_files_folders type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_files_folders type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_placeholders from the action_log_config table $component_placeholders_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_placeholders') ); @@ -5344,18 +5459,18 @@ class com_componentbuilderInstallerScript if ($component_placeholders_action_log_config_done) { // If successfully removed Componentbuilder Component_placeholders add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_placeholders type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_placeholders type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_plugins from the action_log_config table $component_plugins_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_plugins') ); @@ -5369,18 +5484,18 @@ class com_componentbuilderInstallerScript if ($component_plugins_action_log_config_done) { // If successfully removed Componentbuilder Component_plugins add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_plugins type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_plugins type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Component_modules from the action_log_config table $component_modules_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.component_modules') ); @@ -5394,18 +5509,18 @@ class com_componentbuilderInstallerScript if ($component_modules_action_log_config_done) { // If successfully removed Componentbuilder Component_modules add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.component_modules type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.component_modules type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Snippet_type from the action_log_config table $snippet_type_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.snippet_type') ); @@ -5419,18 +5534,18 @@ class com_componentbuilderInstallerScript if ($snippet_type_action_log_config_done) { // If successfully removed Componentbuilder Snippet_type add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.snippet_type type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.snippet_type type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Library_config from the action_log_config table $library_config_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.library_config') ); @@ -5444,18 +5559,18 @@ class com_componentbuilderInstallerScript if ($library_config_action_log_config_done) { // If successfully removed Componentbuilder Library_config add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.library_config type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.library_config type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Library_files_folders_urls from the action_log_config table $library_files_folders_urls_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.library_files_folders_urls') ); @@ -5469,18 +5584,18 @@ class com_componentbuilderInstallerScript if ($library_files_folders_urls_action_log_config_done) { // If successfully removed Componentbuilder Library_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.library_files_folders_urls type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.library_files_folders_urls type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Class_extends from the action_log_config table $class_extends_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.class_extends') ); @@ -5494,18 +5609,18 @@ class com_componentbuilderInstallerScript if ($class_extends_action_log_config_done) { // If successfully removed Componentbuilder Class_extends add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.class_extends type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.class_extends type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_module_updates from the action_log_config table $joomla_module_updates_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_module_updates') ); @@ -5519,18 +5634,18 @@ class com_componentbuilderInstallerScript if ($joomla_module_updates_action_log_config_done) { // If successfully removed Componentbuilder Joomla_module_updates add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_module_updates type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_module_updates type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_module_files_folders_urls from the action_log_config table $joomla_module_files_folders_urls_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_module_files_folders_urls') ); @@ -5544,18 +5659,18 @@ class com_componentbuilderInstallerScript if ($joomla_module_files_folders_urls_action_log_config_done) { // If successfully removed Componentbuilder Joomla_module_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_module_files_folders_urls type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_module_files_folders_urls type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin_group from the action_log_config table $joomla_plugin_group_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_group') ); @@ -5569,18 +5684,18 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_group_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin_group add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin_group type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin_group type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin_updates from the action_log_config table $joomla_plugin_updates_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_updates') ); @@ -5594,18 +5709,18 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_updates_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin_updates add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin_updates type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin_updates type alias was removed from the #__action_log_config table')); } // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Set app if not set already. if (!isset($app)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); } // Remove Componentbuilder Joomla_plugin_files_folders_urls from the action_log_config table $joomla_plugin_files_folders_urls_action_log_config = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.joomla_plugin_files_folders_urls') ); @@ -5619,7 +5734,7 @@ class com_componentbuilderInstallerScript if ($joomla_plugin_files_folders_urls_action_log_config_done) { // If successfully removed Componentbuilder Joomla_plugin_files_folders_urls add queued success message. - $app->enqueueMessage(JText::_('The com_componentbuilder.joomla_plugin_files_folders_urls type alias was removed from the #__action_log_config table')); + $app->enqueueMessage(Text::_('The com_componentbuilder.joomla_plugin_files_folders_urls type alias was removed from the #__action_log_config table')); } // little notice as after service, in case of bad experience with component. echo '

Did something go wrong? Are you disappointed?

@@ -5649,14 +5764,14 @@ class com_componentbuilderInstallerScript public function preflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // is redundant or so it seems ...hmmm let me know if it works again if ($type === 'uninstall') { return true; } // the default for both install and update - $jversion = new JVersion(); + $jversion = new Version(); if (!$jversion->isCompatible('3.8.0')) { $app->enqueueMessage('Please upgrade to at least Joomla! 3.8.0 before continuing!', 'error'); @@ -5675,7 +5790,7 @@ class com_componentbuilderInstallerScript // get the version $this->JCBversion = explode('.', $manifest->version); // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // target version less then 2.5.2 if (count($this->JCBversion) == 3 && $this->JCBversion[0] <= 2 && $this->JCBversion[1] <= 5 && (($this->JCBversion[1] == 5 && $this->JCBversion[2] <= 1) || ($this->JCBversion[1] < 5))) @@ -6100,10 +6215,15 @@ class com_componentbuilderInstallerScript } } } - // path to the new compiler - $jcb_powers = JPATH_LIBRARIES . '/jcb_powers/VDM.Joomla/src/Componentbuilder'; - // we always remove all the old files to avoid mismatching - ComponentbuilderHelper::removeFolder($jcb_powers); + // all things to clear out + $jcb_cleaner = []; + $jcb_cleaner[] = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/compiler'; + $jcb_cleaner[] = JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/extrusion'; + $jcb_cleaner[] = JPATH_LIBRARIES . '/jcb_powers/VDM.Joomla/src/Componentbuilder'; + foreach ($jcb_cleaner as $cleaner) + { + ComponentbuilderHelper::removeFolder($cleaner); + } } // do any install needed if ($type === 'install') @@ -6131,7 +6251,7 @@ class com_componentbuilderInstallerScript public function postflight($type, ComponentAdapter $parent) { // get application - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // We check if we have dynamic folders to copy $this->setDynamicF0ld3rs($app, $parent); // set the default component settings @@ -6139,226 +6259,226 @@ class com_componentbuilderInstallerScript { // Get The Database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create the joomla_component content type object. - $joomla_component = new stdClass(); + $joomla_component = new \stdClass(); $joomla_component->type_title = 'Componentbuilder Joomla_component'; $joomla_component->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_admin","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","css_admin":"css_admin","php_admin_event":"php_admin_event","php_site_event":"php_site_event","crowdin_username":"crowdin_username","component_version":"component_version","php_postflight_install":"php_postflight_install","remove_line_breaks":"remove_line_breaks","description":"description","sql_uninstall":"sql_uninstall","debug_linenr":"debug_linenr","mvc_versiondate":"mvc_versiondate","php_preflight_install":"php_preflight_install","backup_folder_path":"backup_folder_path","php_method_uninstall":"php_method_uninstall","add_placeholders":"add_placeholders","author":"author","add_sales_server":"add_sales_server","email":"email","translation_tool":"translation_tool","website":"website","buildcompsql":"buildcompsql","add_license":"add_license","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","creatuserhelper":"creatuserhelper","adduikit":"adduikit","crowdin_project_api_key":"crowdin_project_api_key","addfootable":"addfootable","crowdin_account_api_key":"crowdin_account_api_key","add_email_helper":"add_email_helper","buildcomp":"buildcomp","add_php_helper_both":"add_php_helper_both","guid":"guid","php_helper_both":"php_helper_both","name":"name"}}'; + $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_method_uninstall","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","buildcompsql":"buildcompsql","translation_tool":"translation_tool","add_sales_server":"add_sales_server","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","debug_linenr":"debug_linenr","php_site_event":"php_site_event","description":"description","author":"author","php_postflight_install":"php_postflight_install","email":"email","sql_uninstall":"sql_uninstall","website":"website","add_license":"add_license","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","license_type":"license_type","component_version":"component_version","php_helper_admin":"php_helper_admin","php_helper_site":"php_helper_site","whmcs_key":"whmcs_key","javascript":"javascript","whmcs_url":"whmcs_url","css_site":"css_site","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_update":"php_preflight_update","bom":"bom","php_postflight_update":"php_postflight_update","image":"image","sql":"sql","copyright":"copyright","addreadme":"addreadme","preferred_joomla_version":"preferred_joomla_version","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}'; $joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute'; - $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","remove_line_breaks","debug_linenr","mvc_versiondate","add_placeholders","add_sales_server","translation_tool","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","addfootable","add_email_helper","buildcomp","add_php_helper_both"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","debug_linenr","add_license","license_type","addreadme","preferred_joomla_version","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_component_Inserted = $db->insertObject('#__content_types', $joomla_component); // Create the joomla_module content type object. - $joomla_module = new stdClass(); + $joomla_module = new \stdClass(); $joomla_module->type_title = 'Componentbuilder Joomla_module'; $joomla_module->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module","key": "id","type": "Joomla_module","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","target":"target","description":"description","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","addreadme":"addreadme","default":"default","snippet":"snippet","add_sql":"add_sql","update_server_target":"update_server_target","add_sql_uninstall":"add_sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","libraries":"libraries","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; $joomla_module->router = 'ComponentbuilderHelperRoute::getJoomla_moduleRoute'; - $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_module_Inserted = $db->insertObject('#__content_types', $joomla_module); // Create the joomla_plugin content type object. - $joomla_plugin = new stdClass(); + $joomla_plugin = new \stdClass(); $joomla_plugin->type_title = 'Componentbuilder Joomla_plugin'; $joomla_plugin->type_alias = 'com_componentbuilder.joomla_plugin'; $joomla_plugin->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin","key": "id","type": "Joomla_plugin","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","class_extends":"class_extends","joomla_plugin_group":"joomla_plugin_group","add_sql":"add_sql","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","sales_server":"sales_server","add_update_server":"add_update_server","add_head":"add_head","add_sql_uninstall":"add_sql_uninstall","addreadme":"addreadme","head":"head","update_server_target":"update_server_target","main_class_code":"main_class_code","update_server":"update_server","description":"description","php_postflight_install":"php_postflight_install","plugin_version":"plugin_version","php_postflight_update":"php_postflight_update","php_method_uninstall":"php_method_uninstall","add_php_script_construct":"add_php_script_construct","sql":"sql","php_script_construct":"php_script_construct","sql_uninstall":"sql_uninstall","add_php_preflight_install":"add_php_preflight_install","readme":"readme","php_preflight_install":"php_preflight_install","update_server_url":"update_server_url","add_php_preflight_update":"add_php_preflight_update","php_preflight_update":"php_preflight_update","add_php_preflight_uninstall":"add_php_preflight_uninstall","add_sales_server":"add_sales_server","php_preflight_uninstall":"php_preflight_uninstall","guid":"guid","name":"name"}}'; $joomla_plugin->router = 'ComponentbuilderHelperRoute::getJoomla_pluginRoute'; - $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_plugin_Inserted = $db->insertObject('#__content_types', $joomla_plugin); // Create the power content type object. - $power = new stdClass(); + $power = new \stdClass(); $power->type_title = 'Componentbuilder Power'; $power->type_alias = 'com_componentbuilder.power'; $power->table = '{"special": {"dbtable": "#__componentbuilder_power","key": "id","type": "Power","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $power->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","namespace":"namespace","type":"type","power_version":"power_version","licensing_template":"licensing_template","description":"description","extends":"extends","approved":"approved","add_head":"add_head","extends_custom":"extends_custom","implements_custom":"implements_custom","implements":"implements","head":"head","approved_paths":"approved_paths","main_class_code":"main_class_code","add_licensing_template":"add_licensing_template","guid":"guid","name":"name"}}'; $power->router = 'ComponentbuilderHelperRoute::getPowerRoute'; - $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; + $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; // Set the object into the content types table. $power_Inserted = $db->insertObject('#__content_types', $power); // Create the admin_view content type object. - $admin_view = new stdClass(); + $admin_view = new \stdClass(); $admin_view->type_title = 'Componentbuilder Admin_view'; $admin_view->type_alias = 'com_componentbuilder.admin_view'; $admin_view->table = '{"special": {"dbtable": "#__componentbuilder_admin_view","key": "id","type": "Admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_allowedit","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","short_description":"short_description","php_allowedit":"php_allowedit","php_postsavehook":"php_postsavehook","php_before_save":"php_before_save","php_getlistquery":"php_getlistquery","php_import_ext":"php_import_ext","icon":"icon","php_after_publish":"php_after_publish","add_fadein":"add_fadein","description":"description","icon_category":"icon_category","icon_add":"icon_add","php_after_cancel":"php_after_cancel","mysql_table_charset":"mysql_table_charset","php_batchmove":"php_batchmove","type":"type","php_after_delete":"php_after_delete","source":"source","php_import":"php_import","php_getitems_after_all":"php_getitems_after_all","php_getform":"php_getform","php_save":"php_save","php_allowadd":"php_allowadd","php_before_cancel":"php_before_cancel","php_batchcopy":"php_batchcopy","php_before_publish":"php_before_publish","alias_builder_type":"alias_builder_type","php_before_delete":"php_before_delete","php_document":"php_document","mysql_table_row_format":"mysql_table_row_format","alias_builder":"alias_builder","sql":"sql","php_import_display":"php_import_display","add_category_submenu":"add_category_submenu","php_import_setdata":"php_import_setdata","name_list":"name_list","add_php_getlistquery":"add_php_getlistquery","add_css_view":"add_css_view","add_php_getform":"add_php_getform","css_view":"css_view","add_php_before_save":"add_php_before_save","add_css_views":"add_css_views","add_php_save":"add_php_save","css_views":"css_views","add_php_postsavehook":"add_php_postsavehook","add_javascript_view_file":"add_javascript_view_file","add_php_allowadd":"add_php_allowadd","javascript_view_file":"javascript_view_file","add_php_allowedit":"add_php_allowedit","add_javascript_view_footer":"add_javascript_view_footer","add_php_before_cancel":"add_php_before_cancel","javascript_view_footer":"javascript_view_footer","add_php_after_cancel":"add_php_after_cancel","add_javascript_views_file":"add_javascript_views_file","add_php_batchcopy":"add_php_batchcopy","javascript_views_file":"javascript_views_file","add_php_batchmove":"add_php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","add_php_before_publish":"add_php_before_publish","javascript_views_footer":"javascript_views_footer","add_php_after_publish":"add_php_after_publish","add_custom_button":"add_custom_button","add_php_before_delete":"add_php_before_delete","add_php_after_delete":"add_php_after_delete","php_controller":"php_controller","add_php_document":"add_php_document","php_model":"php_model","mysql_table_engine":"mysql_table_engine","php_controller_list":"php_controller_list","mysql_table_collate":"mysql_table_collate","php_model_list":"php_model_list","add_sql":"add_sql","add_php_ajax":"add_php_ajax","php_ajaxmethod":"php_ajaxmethod","add_custom_import":"add_custom_import","add_php_getitem":"add_php_getitem","html_import_view":"html_import_view","php_getitem":"php_getitem","php_import_headers":"php_import_headers","add_php_getitems":"add_php_getitems","php_import_save":"php_import_save","php_getitems":"php_getitems","guid":"guid","add_php_getitems_after_all":"add_php_getitems_after_all"}}'; $admin_view->router = 'ComponentbuilderHelperRoute::getAdmin_viewRoute'; - $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; + $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $admin_view_Inserted = $db->insertObject('#__content_types', $admin_view); // Create the custom_admin_view content type object. - $custom_admin_view = new stdClass(); + $custom_admin_view = new \stdClass(); $custom_admin_view->type_title = 'Componentbuilder Custom_admin_view'; $custom_admin_view->type_alias = 'com_componentbuilder.custom_admin_view'; $custom_admin_view->table = '{"special": {"dbtable": "#__componentbuilder_custom_admin_view","key": "id","type": "Custom_admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $custom_admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","css_document":"css_document","css":"css","js_document":"js_document","javascript_file":"javascript_file","codename":"codename","default":"default","snippet":"snippet","icon":"icon","add_php_jview":"add_php_jview","context":"context","add_js_document":"add_js_document","custom_get":"custom_get","add_javascript_file":"add_javascript_file","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","add_php_document":"add_php_document","add_css":"add_css","add_php_view":"add_php_view","add_php_ajax":"add_php_ajax","libraries":"libraries","dynamic_get":"dynamic_get","php_document":"php_document","php_view":"php_view","add_custom_button":"add_custom_button","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $custom_admin_view->router = 'ComponentbuilderHelperRoute::getCustom_admin_viewRoute'; - $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $custom_admin_view_Inserted = $db->insertObject('#__content_types', $custom_admin_view); // Create the site_view content type object. - $site_view = new stdClass(); + $site_view = new \stdClass(); $site_view->type_title = 'Componentbuilder Site_view'; $site_view->type_alias = 'com_componentbuilder.site_view'; $site_view->table = '{"special": {"dbtable": "#__componentbuilder_site_view","key": "id","type": "Site_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $site_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "js_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","add_php_document":"add_php_document","add_php_view":"add_php_view","js_document":"js_document","codename":"codename","javascript_file":"javascript_file","context":"context","default":"default","snippet":"snippet","add_php_jview":"add_php_jview","custom_get":"custom_get","css_document":"css_document","add_javascript_file":"add_javascript_file","css":"css","add_js_document":"add_js_document","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","libraries":"libraries","add_css":"add_css","dynamic_get":"dynamic_get","add_php_ajax":"add_php_ajax","add_custom_button":"add_custom_button","php_document":"php_document","button_position":"button_position","php_view":"php_view","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $site_view->router = 'ComponentbuilderHelperRoute::getSite_viewRoute'; - $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $site_view_Inserted = $db->insertObject('#__content_types', $site_view); // Create the template content type object. - $template = new stdClass(); + $template = new \stdClass(); $template->type_title = 'Componentbuilder Template'; $template->type_alias = 'com_componentbuilder.template'; $template->table = '{"special": {"dbtable": "#__componentbuilder_template","key": "id","type": "Template","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $template->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","php_view":"php_view","add_php_view":"add_php_view","template":"template","snippet":"snippet","libraries":"libraries","alias":"alias"}}'; $template->router = 'ComponentbuilderHelperRoute::getTemplateRoute'; - $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $template_Inserted = $db->insertObject('#__content_types', $template); // Create the layout content type object. - $layout = new stdClass(); + $layout = new \stdClass(); $layout->type_title = 'Componentbuilder Layout'; $layout->type_alias = 'com_componentbuilder.layout'; $layout->table = '{"special": {"dbtable": "#__componentbuilder_layout","key": "id","type": "Layout","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $layout->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","snippet":"snippet","php_view":"php_view","add_php_view":"add_php_view","layout":"layout","libraries":"libraries","alias":"alias"}}'; $layout->router = 'ComponentbuilderHelperRoute::getLayoutRoute'; - $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $layout_Inserted = $db->insertObject('#__content_types', $layout); // Create the dynamic_get content type object. - $dynamic_get = new stdClass(); + $dynamic_get = new \stdClass(); $dynamic_get->type_title = 'Componentbuilder Dynamic_get'; $dynamic_get->type_alias = 'com_componentbuilder.dynamic_get'; $dynamic_get->table = '{"special": {"dbtable": "#__componentbuilder_dynamic_get","key": "id","type": "Dynamic_get","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_before_getitems","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_router_parse":"php_router_parse","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","php_after_getitem":"php_after_getitem","php_getlistquery":"php_getlistquery","view_selection":"view_selection","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","php_calculation":"php_calculation","php_before_getitem":"php_before_getitem","view_table_main":"view_table_main","select_all":"select_all","add_php_before_getitem":"add_php_before_getitem","getcustom":"getcustom","add_php_after_getitem":"add_php_after_getitem","pagination":"pagination","add_php_getlistquery":"add_php_getlistquery","add_php_before_getitems":"add_php_before_getitems","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","addcalculation":"addcalculation","guid":"guid"}}'; + $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_calculation","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_calculation":"php_calculation","php_router_parse":"php_router_parse","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","view_selection":"view_selection","add_php_before_getitems":"add_php_before_getitems","add_php_before_getitem":"add_php_before_getitem","add_php_after_getitem":"add_php_after_getitem","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","view_table_main":"view_table_main","add_php_getlistquery":"add_php_getlistquery","select_all":"select_all","php_before_getitem":"php_before_getitem","getcustom":"getcustom","php_after_getitem":"php_after_getitem","pagination":"pagination","php_getlistquery":"php_getlistquery","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","addcalculation":"addcalculation","guid":"guid"}}'; $dynamic_get->router = 'ComponentbuilderHelperRoute::getDynamic_getRoute'; - $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_source","gettype","add_php_after_getitems","add_php_router_parse","add_php_before_getitems","add_php_before_getitem","add_php_after_getitem","view_table_main","add_php_getlistquery","select_all","pagination"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $dynamic_get_Inserted = $db->insertObject('#__content_types', $dynamic_get); // Create the custom_code content type object. - $custom_code = new stdClass(); + $custom_code = new \stdClass(); $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","joomla_version":"joomla_version","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; - $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","component","target","type","comment_type","joomla_version"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $custom_code_Inserted = $db->insertObject('#__content_types', $custom_code); // Create the class_property content type object. - $class_property = new stdClass(); + $class_property = new \stdClass(); $class_property->type_title = 'Componentbuilder Class_property'; $class_property->type_alias = 'com_componentbuilder.class_property'; $class_property->table = '{"special": {"dbtable": "#__componentbuilder_class_property","key": "id","type": "Class_property","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_property->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","comment":"comment","joomla_plugin_group":"joomla_plugin_group","default":"default"}}'; $class_property->router = 'ComponentbuilderHelperRoute::getClass_propertyRoute'; - $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $class_property_Inserted = $db->insertObject('#__content_types', $class_property); // Create the class_method content type object. - $class_method = new stdClass(); + $class_method = new \stdClass(); $class_method->type_title = 'Componentbuilder Class_method'; $class_method->type_alias = 'com_componentbuilder.class_method'; $class_method->table = '{"special": {"dbtable": "#__componentbuilder_class_method","key": "id","type": "Class_method","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_method->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","code":"code","comment":"comment","joomla_plugin_group":"joomla_plugin_group","arguments":"arguments"}}'; $class_method->router = 'ComponentbuilderHelperRoute::getClass_methodRoute'; - $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $class_method_Inserted = $db->insertObject('#__content_types', $class_method); // Create the placeholder content type object. - $placeholder = new stdClass(); + $placeholder = new \stdClass(); $placeholder->type_title = 'Componentbuilder Placeholder'; $placeholder->type_alias = 'com_componentbuilder.placeholder'; $placeholder->table = '{"special": {"dbtable": "#__componentbuilder_placeholder","key": "id","type": "Placeholder","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $placeholder->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "target","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"target":"target","value":"value"}}'; $placeholder->router = 'ComponentbuilderHelperRoute::getPlaceholderRoute'; - $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $placeholder_Inserted = $db->insertObject('#__content_types', $placeholder); // Create the library content type object. - $library = new stdClass(); + $library = new \stdClass(); $library->type_title = 'Componentbuilder Library'; $library->type_alias = 'com_componentbuilder.library'; $library->table = '{"special": {"dbtable": "#__componentbuilder_library","key": "id","type": "Library","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","target":"target","how":"how","type":"type","description":"description","libraries":"libraries","php_setdocument":"php_setdocument","guid":"guid"}}'; $library->router = 'ComponentbuilderHelperRoute::getLibraryRoute'; - $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $library_Inserted = $db->insertObject('#__content_types', $library); // Create the snippet content type object. - $snippet = new stdClass(); + $snippet = new \stdClass(); $snippet->type_title = 'Componentbuilder Snippet'; $snippet->type_alias = 'com_componentbuilder.snippet'; $snippet->table = '{"special": {"dbtable": "#__componentbuilder_snippet","key": "id","type": "Snippet","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","url":"url","type":"type","heading":"heading","library":"library","guid":"guid","contributor_email":"contributor_email","contributor_name":"contributor_name","contributor_website":"contributor_website","contributor_company":"contributor_company","snippet":"snippet","usage":"usage","description":"description"}}'; $snippet->router = 'ComponentbuilderHelperRoute::getSnippetRoute'; - $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $snippet_Inserted = $db->insertObject('#__content_types', $snippet); // Create the validation_rule content type object. - $validation_rule = new stdClass(); + $validation_rule = new \stdClass(); $validation_rule->type_title = 'Componentbuilder Validation_rule'; $validation_rule->type_alias = 'com_componentbuilder.validation_rule'; $validation_rule->table = '{"special": {"dbtable": "#__componentbuilder_validation_rule","key": "id","type": "Validation_rule","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $validation_rule->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","short_description":"short_description","inherit":"inherit","php":"php"}}'; $validation_rule->router = 'ComponentbuilderHelperRoute::getValidation_ruleRoute'; - $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; + $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $validation_rule_Inserted = $db->insertObject('#__content_types', $validation_rule); // Create the field content type object. - $field = new stdClass(); + $field = new \stdClass(); $field->type_title = 'Componentbuilder Field'; $field->type_alias = 'com_componentbuilder.field'; $field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_views","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","on_save_model_field":"on_save_model_field","initiator_on_get_model":"initiator_on_get_model","initiator_on_save_model":"initiator_on_save_model","xml":"xml","datalenght":"datalenght","css_views":"css_views","css_view":"css_view","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","on_get_model_field":"on_get_model_field","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer","add_css_view":"add_css_view","add_css_views":"add_css_views","add_javascript_view_footer":"add_javascript_view_footer","add_javascript_views_footer":"add_javascript_views_footer","guid":"guid"}}'; $field->router = 'ComponentbuilderHelperRoute::getFieldRoute'; - $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; + $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $field_Inserted = $db->insertObject('#__content_types', $field); // Create the field category content type object. - $field_category = new stdClass(); + $field_category = new \stdClass(); $field_category->type_title = 'Componentbuilder Field Catid'; $field_category->type_alias = 'com_componentbuilder.field.category'; $field_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -6370,19 +6490,19 @@ class com_componentbuilderInstallerScript $field_category_Inserted = $db->insertObject('#__content_types', $field_category); // Create the fieldtype content type object. - $fieldtype = new stdClass(); + $fieldtype = new \stdClass(); $fieldtype->type_title = 'Componentbuilder Fieldtype'; $fieldtype->type_alias = 'com_componentbuilder.fieldtype'; $fieldtype->table = '{"special": {"dbtable": "#__componentbuilder_fieldtype","key": "id","type": "Fieldtype","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $fieldtype->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","store":"store","null_switch":"null_switch","indexes":"indexes","datadefault_other":"datadefault_other","datadefault":"datadefault","short_description":"short_description","datatype":"datatype","has_defaults":"has_defaults","description":"description","datalenght":"datalenght","datalenght_other":"datalenght_other","guid":"guid"}}'; $fieldtype->router = 'ComponentbuilderHelperRoute::getFieldtypeRoute'; - $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $fieldtype_Inserted = $db->insertObject('#__content_types', $fieldtype); // Create the fieldtype category content type object. - $fieldtype_category = new stdClass(); + $fieldtype_category = new \stdClass(); $fieldtype_category->type_title = 'Componentbuilder Fieldtype Catid'; $fieldtype_category->type_alias = 'com_componentbuilder.fieldtype.category'; $fieldtype_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -6394,359 +6514,388 @@ class com_componentbuilderInstallerScript $fieldtype_category_Inserted = $db->insertObject('#__content_types', $fieldtype_category); // Create the language_translation content type object. - $language_translation = new stdClass(); + $language_translation = new \stdClass(); $language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; - $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $language_translation_Inserted = $db->insertObject('#__content_types', $language_translation); // Create the language content type object. - $language = new stdClass(); + $language = new \stdClass(); $language->type_title = 'Componentbuilder Language'; $language->type_alias = 'com_componentbuilder.language'; $language->table = '{"special": {"dbtable": "#__componentbuilder_language","key": "id","type": "Language","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","langtag":"langtag"}}'; $language->router = 'ComponentbuilderHelperRoute::getLanguageRoute'; - $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $language_Inserted = $db->insertObject('#__content_types', $language); // Create the server content type object. - $server = new stdClass(); + $server = new \stdClass(); $server->type_title = 'Componentbuilder Server'; $server->type_alias = 'com_componentbuilder.server'; $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","signature":"signature","private_key":"private_key","secret":"secret","password":"password","private":"private","authentication":"authentication","path":"path","port":"port","host":"host","username":"username"}}'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute'; - $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $server_Inserted = $db->insertObject('#__content_types', $server); // Create the help_document content type object. - $help_document = new stdClass(); + $help_document = new \stdClass(); $help_document->type_title = 'Componentbuilder Help_document'; $help_document->type_alias = 'com_componentbuilder.help_document'; $help_document->table = '{"special": {"dbtable": "#__componentbuilder_help_document","key": "id","type": "Help_document","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","content":"content","article":"article","url":"url","target":"target","alias":"alias"}}'; $help_document->router = 'ComponentbuilderHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Set the object into the content types table. $help_document_Inserted = $db->insertObject('#__content_types', $help_document); // Create the admin_fields content type object. - $admin_fields = new stdClass(); + $admin_fields = new \stdClass(); $admin_fields->type_title = 'Componentbuilder Admin_fields'; $admin_fields->type_alias = 'com_componentbuilder.admin_fields'; $admin_fields->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields","key": "id","type": "Admin_fields","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields->router = 'ComponentbuilderHelperRoute::getAdmin_fieldsRoute'; - $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_fields_Inserted = $db->insertObject('#__content_types', $admin_fields); // Create the admin_fields_conditions content type object. - $admin_fields_conditions = new stdClass(); + $admin_fields_conditions = new \stdClass(); $admin_fields_conditions->type_title = 'Componentbuilder Admin_fields_conditions'; $admin_fields_conditions->type_alias = 'com_componentbuilder.admin_fields_conditions'; $admin_fields_conditions->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_conditions","key": "id","type": "Admin_fields_conditions","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_conditions->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_conditions->router = 'ComponentbuilderHelperRoute::getAdmin_fields_conditionsRoute'; - $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_fields_conditions_Inserted = $db->insertObject('#__content_types', $admin_fields_conditions); // Create the admin_fields_relations content type object. - $admin_fields_relations = new stdClass(); + $admin_fields_relations = new \stdClass(); $admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations'; $admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations'; $admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute'; - $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_fields_relations_Inserted = $db->insertObject('#__content_types', $admin_fields_relations); // Create the admin_custom_tabs content type object. - $admin_custom_tabs = new stdClass(); + $admin_custom_tabs = new \stdClass(); $admin_custom_tabs->type_title = 'Componentbuilder Admin_custom_tabs'; $admin_custom_tabs->type_alias = 'com_componentbuilder.admin_custom_tabs'; $admin_custom_tabs->table = '{"special": {"dbtable": "#__componentbuilder_admin_custom_tabs","key": "id","type": "Admin_custom_tabs","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_custom_tabs->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_custom_tabs->router = 'ComponentbuilderHelperRoute::getAdmin_custom_tabsRoute'; - $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $admin_custom_tabs_Inserted = $db->insertObject('#__content_types', $admin_custom_tabs); // Create the component_admin_views content type object. - $component_admin_views = new stdClass(); + $component_admin_views = new \stdClass(); $component_admin_views->type_title = 'Componentbuilder Component_admin_views'; $component_admin_views->type_alias = 'com_componentbuilder.component_admin_views'; $component_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_admin_views","key": "id","type": "Component_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_admin_viewsRoute'; - $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_admin_views_Inserted = $db->insertObject('#__content_types', $component_admin_views); // Create the component_site_views content type object. - $component_site_views = new stdClass(); + $component_site_views = new \stdClass(); $component_site_views->type_title = 'Componentbuilder Component_site_views'; $component_site_views->type_alias = 'com_componentbuilder.component_site_views'; $component_site_views->table = '{"special": {"dbtable": "#__componentbuilder_component_site_views","key": "id","type": "Component_site_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_site_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_site_views->router = 'ComponentbuilderHelperRoute::getComponent_site_viewsRoute'; - $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_site_views_Inserted = $db->insertObject('#__content_types', $component_site_views); // Create the component_custom_admin_views content type object. - $component_custom_admin_views = new stdClass(); + $component_custom_admin_views = new \stdClass(); $component_custom_admin_views->type_title = 'Componentbuilder Component_custom_admin_views'; $component_custom_admin_views->type_alias = 'com_componentbuilder.component_custom_admin_views'; $component_custom_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_views","key": "id","type": "Component_custom_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_viewsRoute'; - $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_custom_admin_views_Inserted = $db->insertObject('#__content_types', $component_custom_admin_views); // Create the component_updates content type object. - $component_updates = new stdClass(); + $component_updates = new \stdClass(); $component_updates->type_title = 'Componentbuilder Component_updates'; $component_updates->type_alias = 'com_componentbuilder.component_updates'; $component_updates->table = '{"special": {"dbtable": "#__componentbuilder_component_updates","key": "id","type": "Component_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_updates->router = 'ComponentbuilderHelperRoute::getComponent_updatesRoute'; - $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_updates_Inserted = $db->insertObject('#__content_types', $component_updates); // Create the component_mysql_tweaks content type object. - $component_mysql_tweaks = new stdClass(); + $component_mysql_tweaks = new \stdClass(); $component_mysql_tweaks->type_title = 'Componentbuilder Component_mysql_tweaks'; $component_mysql_tweaks->type_alias = 'com_componentbuilder.component_mysql_tweaks'; $component_mysql_tweaks->table = '{"special": {"dbtable": "#__componentbuilder_component_mysql_tweaks","key": "id","type": "Component_mysql_tweaks","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_mysql_tweaks->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_mysql_tweaks->router = 'ComponentbuilderHelperRoute::getComponent_mysql_tweaksRoute'; - $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_mysql_tweaks_Inserted = $db->insertObject('#__content_types', $component_mysql_tweaks); // Create the component_custom_admin_menus content type object. - $component_custom_admin_menus = new stdClass(); + $component_custom_admin_menus = new \stdClass(); $component_custom_admin_menus->type_title = 'Componentbuilder Component_custom_admin_menus'; $component_custom_admin_menus->type_alias = 'com_componentbuilder.component_custom_admin_menus'; $component_custom_admin_menus->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_menus","key": "id","type": "Component_custom_admin_menus","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_menus->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_menus->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_menusRoute'; - $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_custom_admin_menus_Inserted = $db->insertObject('#__content_types', $component_custom_admin_menus); + // Create the component_router content type object. + $component_router = new \stdClass(); + $component_router->type_title = 'Componentbuilder Component_router'; + $component_router->type_alias = 'com_componentbuilder.component_router'; + $component_router->table = '{"special": {"dbtable": "#__componentbuilder_component_router","key": "id","type": "Component_router","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $component_router->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "methods_code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","mode_constructor_before_parent":"mode_constructor_before_parent","mode_constructor_after_parent":"mode_constructor_after_parent","mode_methods":"mode_methods","methods_code":"methods_code","constructor_after_parent_code":"constructor_after_parent_code","constructor_before_parent_code":"constructor_before_parent_code"}}'; + $component_router->router = 'ComponentbuilderHelperRoute::getComponent_routerRoute'; + $component_router->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_router.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component","mode_constructor_before_parent","mode_constructor_after_parent","mode_methods"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + + // Set the object into the content types table. + $component_router_Inserted = $db->insertObject('#__content_types', $component_router); + // Create the component_config content type object. - $component_config = new stdClass(); + $component_config = new \stdClass(); $component_config->type_title = 'Componentbuilder Component_config'; $component_config->type_alias = 'com_componentbuilder.component_config'; $component_config->table = '{"special": {"dbtable": "#__componentbuilder_component_config","key": "id","type": "Component_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_config->router = 'ComponentbuilderHelperRoute::getComponent_configRoute'; - $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_config_Inserted = $db->insertObject('#__content_types', $component_config); // Create the component_dashboard content type object. - $component_dashboard = new stdClass(); + $component_dashboard = new \stdClass(); $component_dashboard->type_title = 'Componentbuilder Component_dashboard'; $component_dashboard->type_alias = 'com_componentbuilder.component_dashboard'; $component_dashboard->table = '{"special": {"dbtable": "#__componentbuilder_component_dashboard","key": "id","type": "Component_dashboard","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_dashboard->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","php_dashboard_methods":"php_dashboard_methods"}}'; $component_dashboard->router = 'ComponentbuilderHelperRoute::getComponent_dashboardRoute'; - $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_dashboard_Inserted = $db->insertObject('#__content_types', $component_dashboard); // Create the component_files_folders content type object. - $component_files_folders = new stdClass(); + $component_files_folders = new \stdClass(); $component_files_folders->type_title = 'Componentbuilder Component_files_folders'; $component_files_folders->type_alias = 'com_componentbuilder.component_files_folders'; $component_files_folders->table = '{"special": {"dbtable": "#__componentbuilder_component_files_folders","key": "id","type": "Component_files_folders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_files_folders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_files_folders->router = 'ComponentbuilderHelperRoute::getComponent_files_foldersRoute'; - $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_files_folders_Inserted = $db->insertObject('#__content_types', $component_files_folders); // Create the component_placeholders content type object. - $component_placeholders = new stdClass(); + $component_placeholders = new \stdClass(); $component_placeholders->type_title = 'Componentbuilder Component_placeholders'; $component_placeholders->type_alias = 'com_componentbuilder.component_placeholders'; $component_placeholders->table = '{"special": {"dbtable": "#__componentbuilder_component_placeholders","key": "id","type": "Component_placeholders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_placeholders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_placeholders->router = 'ComponentbuilderHelperRoute::getComponent_placeholdersRoute'; - $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_placeholders_Inserted = $db->insertObject('#__content_types', $component_placeholders); // Create the component_plugins content type object. - $component_plugins = new stdClass(); + $component_plugins = new \stdClass(); $component_plugins->type_title = 'Componentbuilder Component_plugins'; $component_plugins->type_alias = 'com_componentbuilder.component_plugins'; $component_plugins->table = '{"special": {"dbtable": "#__componentbuilder_component_plugins","key": "id","type": "Component_plugins","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_plugins->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_plugins->router = 'ComponentbuilderHelperRoute::getComponent_pluginsRoute'; - $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_plugins_Inserted = $db->insertObject('#__content_types', $component_plugins); // Create the component_modules content type object. - $component_modules = new stdClass(); + $component_modules = new \stdClass(); $component_modules->type_title = 'Componentbuilder Component_modules'; $component_modules->type_alias = 'com_componentbuilder.component_modules'; $component_modules->table = '{"special": {"dbtable": "#__componentbuilder_component_modules","key": "id","type": "Component_modules","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_modules->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_modules->router = 'ComponentbuilderHelperRoute::getComponent_modulesRoute'; - $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $component_modules_Inserted = $db->insertObject('#__content_types', $component_modules); // Create the snippet_type content type object. - $snippet_type = new stdClass(); + $snippet_type = new \stdClass(); $snippet_type->type_title = 'Componentbuilder Snippet_type'; $snippet_type->type_alias = 'com_componentbuilder.snippet_type'; $snippet_type->table = '{"special": {"dbtable": "#__componentbuilder_snippet_type","key": "id","type": "Snippet_type","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet_type->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description"}}'; $snippet_type->router = 'ComponentbuilderHelperRoute::getSnippet_typeRoute'; - $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $snippet_type_Inserted = $db->insertObject('#__content_types', $snippet_type); // Create the library_config content type object. - $library_config = new stdClass(); + $library_config = new \stdClass(); $library_config->type_title = 'Componentbuilder Library_config'; $library_config->type_alias = 'com_componentbuilder.library_config'; $library_config->table = '{"special": {"dbtable": "#__componentbuilder_library_config","key": "id","type": "Library_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_config->router = 'ComponentbuilderHelperRoute::getLibrary_configRoute'; - $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $library_config_Inserted = $db->insertObject('#__content_types', $library_config); // Create the library_files_folders_urls content type object. - $library_files_folders_urls = new stdClass(); + $library_files_folders_urls = new \stdClass(); $library_files_folders_urls->type_title = 'Componentbuilder Library_files_folders_urls'; $library_files_folders_urls->type_alias = 'com_componentbuilder.library_files_folders_urls'; $library_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_library_files_folders_urls","key": "id","type": "Library_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_files_folders_urls->router = 'ComponentbuilderHelperRoute::getLibrary_files_folders_urlsRoute'; - $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $library_files_folders_urls_Inserted = $db->insertObject('#__content_types', $library_files_folders_urls); // Create the class_extends content type object. - $class_extends = new stdClass(); + $class_extends = new \stdClass(); $class_extends->type_title = 'Componentbuilder Class_extends'; $class_extends->type_alias = 'com_componentbuilder.class_extends'; $class_extends->table = '{"special": {"dbtable": "#__componentbuilder_class_extends","key": "id","type": "Class_extends","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_extends->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","extension_type":"extension_type","head":"head","comment":"comment"}}'; $class_extends->router = 'ComponentbuilderHelperRoute::getClass_extendsRoute'; - $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $class_extends_Inserted = $db->insertObject('#__content_types', $class_extends); // Create the joomla_module_updates content type object. - $joomla_module_updates = new stdClass(); + $joomla_module_updates = new \stdClass(); $joomla_module_updates->type_title = 'Componentbuilder Joomla_module_updates'; $joomla_module_updates->type_alias = 'com_componentbuilder.joomla_module_updates'; $joomla_module_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_updates","key": "id","type": "Joomla_module_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_updates->router = 'ComponentbuilderHelperRoute::getJoomla_module_updatesRoute'; - $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_module_updates_Inserted = $db->insertObject('#__content_types', $joomla_module_updates); // Create the joomla_module_files_folders_urls content type object. - $joomla_module_files_folders_urls = new stdClass(); + $joomla_module_files_folders_urls = new \stdClass(); $joomla_module_files_folders_urls->type_title = 'Componentbuilder Joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_files_folders_urls","key": "id","type": "Joomla_module_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_module_files_folders_urlsRoute'; - $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_module_files_folders_urls_Inserted = $db->insertObject('#__content_types', $joomla_module_files_folders_urls); // Create the joomla_plugin_group content type object. - $joomla_plugin_group = new stdClass(); + $joomla_plugin_group = new \stdClass(); $joomla_plugin_group->type_title = 'Componentbuilder Joomla_plugin_group'; $joomla_plugin_group->type_alias = 'com_componentbuilder.joomla_plugin_group'; $joomla_plugin_group->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_group","key": "id","type": "Joomla_plugin_group","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_group->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","class_extends":"class_extends"}}'; $joomla_plugin_group->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_groupRoute'; - $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; // Set the object into the content types table. $joomla_plugin_group_Inserted = $db->insertObject('#__content_types', $joomla_plugin_group); // Create the joomla_plugin_updates content type object. - $joomla_plugin_updates = new stdClass(); + $joomla_plugin_updates = new \stdClass(); $joomla_plugin_updates->type_title = 'Componentbuilder Joomla_plugin_updates'; $joomla_plugin_updates->type_alias = 'com_componentbuilder.joomla_plugin_updates'; $joomla_plugin_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_updates","key": "id","type": "Joomla_plugin_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_updates->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_updatesRoute'; - $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_plugin_updates_Inserted = $db->insertObject('#__content_types', $joomla_plugin_updates); // Create the joomla_plugin_files_folders_urls content type object. - $joomla_plugin_files_folders_urls = new stdClass(); + $joomla_plugin_files_folders_urls = new \stdClass(); $joomla_plugin_files_folders_urls->type_title = 'Componentbuilder Joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_files_folders_urls","key": "id","type": "Joomla_plugin_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_files_folders_urlsRoute'; - $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Set the object into the content types table. $joomla_plugin_files_folders_urls_Inserted = $db->insertObject('#__content_types', $joomla_plugin_files_folders_urls); + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length <= 99360) + { + // Fix the assets table rules column size + $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; + $db->setQuery($fix_rules_size); + $db->execute(); + $app->enqueueMessage(Text::_('The #__assets table rules column was resized to the MEDIUMTEXT datatype for the components possible large permission rules.')); + } + } // Install the global extension params. + $db = Factory::getDbo(); $query = $db->getQuery(true); // Field to update. $fields = array( - $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","super_powers_documentation":"0","powers_repository":"0","super_powers_repositories":"0","approved_paths":"default","add_custom_gitea_url":"1","custom_gitea_url":"https://git.vdm.dev","super_powers_core_organisation":"joomla","super_powers_core":"joomla/super-powers","builder_gif_size":"480-272","compiler_plugin":["componentbuilderactionlogcompiler","componentbuilderfieldorderingcompiler","componentbuilderheaderscompiler","componentbuilderpowersautoloadercompiler","componentbuilderprivacycompiler"],"add_menu_prefix":"1","menu_prefix":"»","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":"","uikit_style":""}'), + $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","subform_layouts":"default","editor":"none","manage_jcb_package_directories":"2","set_browser_storage":"1","storage_time_to_live":"global","super_powers_documentation":"0","powers_repository":"0","super_powers_repositories":"0","approved_paths":"default","add_custom_gitea_url":"1","custom_gitea_url":"https://git.vdm.dev","super_powers_core_organisation":"joomla","super_powers_core":"joomla/super-powers","builder_gif_size":"480-272","compiler_plugin":["componentbuilderactionlogcompiler","componentbuilderfieldorderingcompiler","componentbuilderheaderscompiler","componentbuilderpowersautoloadercompiler","componentbuilderprivacycompiler"],"add_menu_prefix":"1","menu_prefix":"»","namespace_prefix":"JCB","minify":"0","language":"en-GB","percentagelanguageadd":"30","assets_table_fix":"2","compiler_field_builder_type":"2","field_name_builder":"1","type_name_builder":"1","import_guid_only":"1","export_language_strings":"1","development_method":"1","expansion":"0","return_options_build":"2","cronjob_backup_type":"1","cronjob_backup_server":"0","backup_package_name":"JCB_Backup_[YEAR]_[MONTH]_[DAY]","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":"","uikit_style":""}'), ); // Condition. $conditions = array( @@ -6756,33 +6905,18 @@ class com_componentbuilderInstallerScript $db->setQuery($query); $allDone = $db->execute(); - // Get the biggest rule column in the assets table at this point. - $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; - $db->setQuery($get_rule_length); - if ($db->execute()) - { - $rule_length = $db->loadResult(); - // Check the size of the rules column - if ($rule_length <= 97600) - { - // Fix the assets table rules column size - $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to MEDIUMTEXT by JCB';"; - $db->setQuery($fix_rules_size); - $db->execute(); - $app->enqueueMessage(JText::_('The #__assets table rules column was resized to the MEDIUMTEXT datatype for the components possible large permission rules.')); - } - } - echo ' + + echo '
- '; +
'; // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the componentbuilder action logs extensions object. - $componentbuilder_action_logs_extensions = new stdClass(); + $componentbuilder_action_logs_extensions = new \stdClass(); $componentbuilder_action_logs_extensions->extension = 'com_componentbuilder'; // Set the object into the action logs extensions table. @@ -6791,10 +6925,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_component action log config object. - $joomla_component_action_log_config = new stdClass(); + $joomla_component_action_log_config = new \stdClass(); $joomla_component_action_log_config->type_title = 'JOOMLA_COMPONENT'; $joomla_component_action_log_config->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component_action_log_config->id_holder = 'id'; @@ -6808,10 +6942,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module action log config object. - $joomla_module_action_log_config = new stdClass(); + $joomla_module_action_log_config = new \stdClass(); $joomla_module_action_log_config->type_title = 'JOOMLA_MODULE'; $joomla_module_action_log_config->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module_action_log_config->id_holder = 'id'; @@ -6825,10 +6959,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin action log config object. - $joomla_plugin_action_log_config = new stdClass(); + $joomla_plugin_action_log_config = new \stdClass(); $joomla_plugin_action_log_config->type_title = 'JOOMLA_PLUGIN'; $joomla_plugin_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin'; $joomla_plugin_action_log_config->id_holder = 'id'; @@ -6842,10 +6976,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the power action log config object. - $power_action_log_config = new stdClass(); + $power_action_log_config = new \stdClass(); $power_action_log_config->type_title = 'POWER'; $power_action_log_config->type_alias = 'com_componentbuilder.power'; $power_action_log_config->id_holder = 'id'; @@ -6859,10 +6993,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_view action log config object. - $admin_view_action_log_config = new stdClass(); + $admin_view_action_log_config = new \stdClass(); $admin_view_action_log_config->type_title = 'ADMIN_VIEW'; $admin_view_action_log_config->type_alias = 'com_componentbuilder.admin_view'; $admin_view_action_log_config->id_holder = 'id'; @@ -6876,10 +7010,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_admin_view action log config object. - $custom_admin_view_action_log_config = new stdClass(); + $custom_admin_view_action_log_config = new \stdClass(); $custom_admin_view_action_log_config->type_title = 'CUSTOM_ADMIN_VIEW'; $custom_admin_view_action_log_config->type_alias = 'com_componentbuilder.custom_admin_view'; $custom_admin_view_action_log_config->id_holder = 'id'; @@ -6893,10 +7027,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the site_view action log config object. - $site_view_action_log_config = new stdClass(); + $site_view_action_log_config = new \stdClass(); $site_view_action_log_config->type_title = 'SITE_VIEW'; $site_view_action_log_config->type_alias = 'com_componentbuilder.site_view'; $site_view_action_log_config->id_holder = 'id'; @@ -6910,10 +7044,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the template action log config object. - $template_action_log_config = new stdClass(); + $template_action_log_config = new \stdClass(); $template_action_log_config->type_title = 'TEMPLATE'; $template_action_log_config->type_alias = 'com_componentbuilder.template'; $template_action_log_config->id_holder = 'id'; @@ -6927,10 +7061,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the layout action log config object. - $layout_action_log_config = new stdClass(); + $layout_action_log_config = new \stdClass(); $layout_action_log_config->type_title = 'LAYOUT'; $layout_action_log_config->type_alias = 'com_componentbuilder.layout'; $layout_action_log_config->id_holder = 'id'; @@ -6944,10 +7078,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the dynamic_get action log config object. - $dynamic_get_action_log_config = new stdClass(); + $dynamic_get_action_log_config = new \stdClass(); $dynamic_get_action_log_config->type_title = 'DYNAMIC_GET'; $dynamic_get_action_log_config->type_alias = 'com_componentbuilder.dynamic_get'; $dynamic_get_action_log_config->id_holder = 'id'; @@ -6961,10 +7095,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_code action log config object. - $custom_code_action_log_config = new stdClass(); + $custom_code_action_log_config = new \stdClass(); $custom_code_action_log_config->type_title = 'CUSTOM_CODE'; $custom_code_action_log_config->type_alias = 'com_componentbuilder.custom_code'; $custom_code_action_log_config->id_holder = 'id'; @@ -6978,10 +7112,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_property action log config object. - $class_property_action_log_config = new stdClass(); + $class_property_action_log_config = new \stdClass(); $class_property_action_log_config->type_title = 'CLASS_PROPERTY'; $class_property_action_log_config->type_alias = 'com_componentbuilder.class_property'; $class_property_action_log_config->id_holder = 'id'; @@ -6995,10 +7129,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_method action log config object. - $class_method_action_log_config = new stdClass(); + $class_method_action_log_config = new \stdClass(); $class_method_action_log_config->type_title = 'CLASS_METHOD'; $class_method_action_log_config->type_alias = 'com_componentbuilder.class_method'; $class_method_action_log_config->id_holder = 'id'; @@ -7012,10 +7146,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the placeholder action log config object. - $placeholder_action_log_config = new stdClass(); + $placeholder_action_log_config = new \stdClass(); $placeholder_action_log_config->type_title = 'PLACEHOLDER'; $placeholder_action_log_config->type_alias = 'com_componentbuilder.placeholder'; $placeholder_action_log_config->id_holder = 'id'; @@ -7029,10 +7163,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library action log config object. - $library_action_log_config = new stdClass(); + $library_action_log_config = new \stdClass(); $library_action_log_config->type_title = 'LIBRARY'; $library_action_log_config->type_alias = 'com_componentbuilder.library'; $library_action_log_config->id_holder = 'id'; @@ -7046,10 +7180,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet action log config object. - $snippet_action_log_config = new stdClass(); + $snippet_action_log_config = new \stdClass(); $snippet_action_log_config->type_title = 'SNIPPET'; $snippet_action_log_config->type_alias = 'com_componentbuilder.snippet'; $snippet_action_log_config->id_holder = 'id'; @@ -7063,10 +7197,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the validation_rule action log config object. - $validation_rule_action_log_config = new stdClass(); + $validation_rule_action_log_config = new \stdClass(); $validation_rule_action_log_config->type_title = 'VALIDATION_RULE'; $validation_rule_action_log_config->type_alias = 'com_componentbuilder.validation_rule'; $validation_rule_action_log_config->id_holder = 'id'; @@ -7080,10 +7214,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the field action log config object. - $field_action_log_config = new stdClass(); + $field_action_log_config = new \stdClass(); $field_action_log_config->type_title = 'FIELD'; $field_action_log_config->type_alias = 'com_componentbuilder.field'; $field_action_log_config->id_holder = 'id'; @@ -7097,10 +7231,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the fieldtype action log config object. - $fieldtype_action_log_config = new stdClass(); + $fieldtype_action_log_config = new \stdClass(); $fieldtype_action_log_config->type_title = 'FIELDTYPE'; $fieldtype_action_log_config->type_alias = 'com_componentbuilder.fieldtype'; $fieldtype_action_log_config->id_holder = 'id'; @@ -7114,10 +7248,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language_translation action log config object. - $language_translation_action_log_config = new stdClass(); + $language_translation_action_log_config = new \stdClass(); $language_translation_action_log_config->type_title = 'LANGUAGE_TRANSLATION'; $language_translation_action_log_config->type_alias = 'com_componentbuilder.language_translation'; $language_translation_action_log_config->id_holder = 'id'; @@ -7131,10 +7265,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language action log config object. - $language_action_log_config = new stdClass(); + $language_action_log_config = new \stdClass(); $language_action_log_config->type_title = 'LANGUAGE'; $language_action_log_config->type_alias = 'com_componentbuilder.language'; $language_action_log_config->id_holder = 'id'; @@ -7148,10 +7282,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the server action log config object. - $server_action_log_config = new stdClass(); + $server_action_log_config = new \stdClass(); $server_action_log_config->type_title = 'SERVER'; $server_action_log_config->type_alias = 'com_componentbuilder.server'; $server_action_log_config->id_holder = 'id'; @@ -7165,10 +7299,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the help_document action log config object. - $help_document_action_log_config = new stdClass(); + $help_document_action_log_config = new \stdClass(); $help_document_action_log_config->type_title = 'HELP_DOCUMENT'; $help_document_action_log_config->type_alias = 'com_componentbuilder.help_document'; $help_document_action_log_config->id_holder = 'id'; @@ -7182,10 +7316,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields action log config object. - $admin_fields_action_log_config = new stdClass(); + $admin_fields_action_log_config = new \stdClass(); $admin_fields_action_log_config->type_title = 'ADMIN_FIELDS'; $admin_fields_action_log_config->type_alias = 'com_componentbuilder.admin_fields'; $admin_fields_action_log_config->id_holder = 'id'; @@ -7199,10 +7333,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_conditions action log config object. - $admin_fields_conditions_action_log_config = new stdClass(); + $admin_fields_conditions_action_log_config = new \stdClass(); $admin_fields_conditions_action_log_config->type_title = 'ADMIN_FIELDS_CONDITIONS'; $admin_fields_conditions_action_log_config->type_alias = 'com_componentbuilder.admin_fields_conditions'; $admin_fields_conditions_action_log_config->id_holder = 'id'; @@ -7216,10 +7350,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_relations action log config object. - $admin_fields_relations_action_log_config = new stdClass(); + $admin_fields_relations_action_log_config = new \stdClass(); $admin_fields_relations_action_log_config->type_title = 'ADMIN_FIELDS_RELATIONS'; $admin_fields_relations_action_log_config->type_alias = 'com_componentbuilder.admin_fields_relations'; $admin_fields_relations_action_log_config->id_holder = 'id'; @@ -7233,10 +7367,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_custom_tabs action log config object. - $admin_custom_tabs_action_log_config = new stdClass(); + $admin_custom_tabs_action_log_config = new \stdClass(); $admin_custom_tabs_action_log_config->type_title = 'ADMIN_CUSTOM_TABS'; $admin_custom_tabs_action_log_config->type_alias = 'com_componentbuilder.admin_custom_tabs'; $admin_custom_tabs_action_log_config->id_holder = 'id'; @@ -7250,10 +7384,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_admin_views action log config object. - $component_admin_views_action_log_config = new stdClass(); + $component_admin_views_action_log_config = new \stdClass(); $component_admin_views_action_log_config->type_title = 'COMPONENT_ADMIN_VIEWS'; $component_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_admin_views'; $component_admin_views_action_log_config->id_holder = 'id'; @@ -7267,10 +7401,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_site_views action log config object. - $component_site_views_action_log_config = new stdClass(); + $component_site_views_action_log_config = new \stdClass(); $component_site_views_action_log_config->type_title = 'COMPONENT_SITE_VIEWS'; $component_site_views_action_log_config->type_alias = 'com_componentbuilder.component_site_views'; $component_site_views_action_log_config->id_holder = 'id'; @@ -7284,10 +7418,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_views action log config object. - $component_custom_admin_views_action_log_config = new stdClass(); + $component_custom_admin_views_action_log_config = new \stdClass(); $component_custom_admin_views_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_VIEWS'; $component_custom_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_views'; $component_custom_admin_views_action_log_config->id_holder = 'id'; @@ -7301,10 +7435,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_updates action log config object. - $component_updates_action_log_config = new stdClass(); + $component_updates_action_log_config = new \stdClass(); $component_updates_action_log_config->type_title = 'COMPONENT_UPDATES'; $component_updates_action_log_config->type_alias = 'com_componentbuilder.component_updates'; $component_updates_action_log_config->id_holder = 'id'; @@ -7318,10 +7452,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_mysql_tweaks action log config object. - $component_mysql_tweaks_action_log_config = new stdClass(); + $component_mysql_tweaks_action_log_config = new \stdClass(); $component_mysql_tweaks_action_log_config->type_title = 'COMPONENT_MYSQL_TWEAKS'; $component_mysql_tweaks_action_log_config->type_alias = 'com_componentbuilder.component_mysql_tweaks'; $component_mysql_tweaks_action_log_config->id_holder = 'id'; @@ -7335,10 +7469,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_menus action log config object. - $component_custom_admin_menus_action_log_config = new stdClass(); + $component_custom_admin_menus_action_log_config = new \stdClass(); $component_custom_admin_menus_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_MENUS'; $component_custom_admin_menus_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_menus'; $component_custom_admin_menus_action_log_config->id_holder = 'id'; @@ -7352,10 +7486,27 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); + } + // Create the component_router action log config object. + $component_router_action_log_config = new \stdClass(); + $component_router_action_log_config->type_title = 'COMPONENT_ROUTER'; + $component_router_action_log_config->type_alias = 'com_componentbuilder.component_router'; + $component_router_action_log_config->id_holder = 'id'; + $component_router_action_log_config->title_holder = 'joomla_component'; + $component_router_action_log_config->table_name = '#__componentbuilder_component_router'; + $component_router_action_log_config->text_prefix = 'COM_COMPONENTBUILDER'; + + // Set the object into the action log config table. + $component_router_Inserted = $db->insertObject('#__action_log_config', $component_router_action_log_config); + + // Set db if not set already. + if (!isset($db)) + { + $db = Factory::getDbo(); } // Create the component_config action log config object. - $component_config_action_log_config = new stdClass(); + $component_config_action_log_config = new \stdClass(); $component_config_action_log_config->type_title = 'COMPONENT_CONFIG'; $component_config_action_log_config->type_alias = 'com_componentbuilder.component_config'; $component_config_action_log_config->id_holder = 'id'; @@ -7369,10 +7520,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_dashboard action log config object. - $component_dashboard_action_log_config = new stdClass(); + $component_dashboard_action_log_config = new \stdClass(); $component_dashboard_action_log_config->type_title = 'COMPONENT_DASHBOARD'; $component_dashboard_action_log_config->type_alias = 'com_componentbuilder.component_dashboard'; $component_dashboard_action_log_config->id_holder = 'id'; @@ -7386,10 +7537,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_files_folders action log config object. - $component_files_folders_action_log_config = new stdClass(); + $component_files_folders_action_log_config = new \stdClass(); $component_files_folders_action_log_config->type_title = 'COMPONENT_FILES_FOLDERS'; $component_files_folders_action_log_config->type_alias = 'com_componentbuilder.component_files_folders'; $component_files_folders_action_log_config->id_holder = 'id'; @@ -7403,10 +7554,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_placeholders action log config object. - $component_placeholders_action_log_config = new stdClass(); + $component_placeholders_action_log_config = new \stdClass(); $component_placeholders_action_log_config->type_title = 'COMPONENT_PLACEHOLDERS'; $component_placeholders_action_log_config->type_alias = 'com_componentbuilder.component_placeholders'; $component_placeholders_action_log_config->id_holder = 'id'; @@ -7420,10 +7571,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_plugins action log config object. - $component_plugins_action_log_config = new stdClass(); + $component_plugins_action_log_config = new \stdClass(); $component_plugins_action_log_config->type_title = 'COMPONENT_PLUGINS'; $component_plugins_action_log_config->type_alias = 'com_componentbuilder.component_plugins'; $component_plugins_action_log_config->id_holder = 'id'; @@ -7437,10 +7588,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_modules action log config object. - $component_modules_action_log_config = new stdClass(); + $component_modules_action_log_config = new \stdClass(); $component_modules_action_log_config->type_title = 'COMPONENT_MODULES'; $component_modules_action_log_config->type_alias = 'com_componentbuilder.component_modules'; $component_modules_action_log_config->id_holder = 'id'; @@ -7454,10 +7605,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet_type action log config object. - $snippet_type_action_log_config = new stdClass(); + $snippet_type_action_log_config = new \stdClass(); $snippet_type_action_log_config->type_title = 'SNIPPET_TYPE'; $snippet_type_action_log_config->type_alias = 'com_componentbuilder.snippet_type'; $snippet_type_action_log_config->id_holder = 'id'; @@ -7471,10 +7622,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_config action log config object. - $library_config_action_log_config = new stdClass(); + $library_config_action_log_config = new \stdClass(); $library_config_action_log_config->type_title = 'LIBRARY_CONFIG'; $library_config_action_log_config->type_alias = 'com_componentbuilder.library_config'; $library_config_action_log_config->id_holder = 'id'; @@ -7488,10 +7639,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_files_folders_urls action log config object. - $library_files_folders_urls_action_log_config = new stdClass(); + $library_files_folders_urls_action_log_config = new \stdClass(); $library_files_folders_urls_action_log_config->type_title = 'LIBRARY_FILES_FOLDERS_URLS'; $library_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.library_files_folders_urls'; $library_files_folders_urls_action_log_config->id_holder = 'id'; @@ -7505,10 +7656,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_extends action log config object. - $class_extends_action_log_config = new stdClass(); + $class_extends_action_log_config = new \stdClass(); $class_extends_action_log_config->type_title = 'CLASS_EXTENDS'; $class_extends_action_log_config->type_alias = 'com_componentbuilder.class_extends'; $class_extends_action_log_config->id_holder = 'id'; @@ -7522,10 +7673,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_updates action log config object. - $joomla_module_updates_action_log_config = new stdClass(); + $joomla_module_updates_action_log_config = new \stdClass(); $joomla_module_updates_action_log_config->type_title = 'JOOMLA_MODULE_UPDATES'; $joomla_module_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_module_updates'; $joomla_module_updates_action_log_config->id_holder = 'id'; @@ -7539,10 +7690,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_files_folders_urls action log config object. - $joomla_module_files_folders_urls_action_log_config = new stdClass(); + $joomla_module_files_folders_urls_action_log_config = new \stdClass(); $joomla_module_files_folders_urls_action_log_config->type_title = 'JOOMLA_MODULE_FILES_FOLDERS_URLS'; $joomla_module_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; $joomla_module_files_folders_urls_action_log_config->id_holder = 'id'; @@ -7556,10 +7707,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_group action log config object. - $joomla_plugin_group_action_log_config = new stdClass(); + $joomla_plugin_group_action_log_config = new \stdClass(); $joomla_plugin_group_action_log_config->type_title = 'JOOMLA_PLUGIN_GROUP'; $joomla_plugin_group_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_group'; $joomla_plugin_group_action_log_config->id_holder = 'id'; @@ -7573,10 +7724,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_updates action log config object. - $joomla_plugin_updates_action_log_config = new stdClass(); + $joomla_plugin_updates_action_log_config = new \stdClass(); $joomla_plugin_updates_action_log_config->type_title = 'JOOMLA_PLUGIN_UPDATES'; $joomla_plugin_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_updates'; $joomla_plugin_updates_action_log_config->id_holder = 'id'; @@ -7590,10 +7741,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_files_folders_urls action log config object. - $joomla_plugin_files_folders_urls_action_log_config = new stdClass(); + $joomla_plugin_files_folders_urls_action_log_config = new \stdClass(); $joomla_plugin_files_folders_urls_action_log_config->type_title = 'JOOMLA_PLUGIN_FILES_FOLDERS_URLS'; $joomla_plugin_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls_action_log_config->id_holder = 'id'; @@ -7609,16 +7760,16 @@ class com_componentbuilderInstallerScript { // Get The Database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create the joomla_component content type object. - $joomla_component = new stdClass(); + $joomla_component = new \stdClass(); $joomla_component->type_title = 'Componentbuilder Joomla_component'; $joomla_component->type_alias = 'com_componentbuilder.joomla_component'; $joomla_component->table = '{"special": {"dbtable": "#__componentbuilder_joomla_component","key": "id","type": "Joomla_component","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_admin","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","css_admin":"css_admin","php_admin_event":"php_admin_event","php_site_event":"php_site_event","crowdin_username":"crowdin_username","component_version":"component_version","php_postflight_install":"php_postflight_install","remove_line_breaks":"remove_line_breaks","description":"description","sql_uninstall":"sql_uninstall","debug_linenr":"debug_linenr","mvc_versiondate":"mvc_versiondate","php_preflight_install":"php_preflight_install","backup_folder_path":"backup_folder_path","php_method_uninstall":"php_method_uninstall","add_placeholders":"add_placeholders","author":"author","add_sales_server":"add_sales_server","email":"email","translation_tool":"translation_tool","website":"website","buildcompsql":"buildcompsql","add_license":"add_license","php_helper_admin":"php_helper_admin","license_type":"license_type","php_helper_site":"php_helper_site","javascript":"javascript","whmcs_key":"whmcs_key","css_site":"css_site","whmcs_url":"whmcs_url","whmcs_buy_link":"whmcs_buy_link","php_preflight_update":"php_preflight_update","license":"license","php_postflight_update":"php_postflight_update","bom":"bom","sql":"sql","image":"image","addreadme":"addreadme","copyright":"copyright","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_javascript":"add_javascript","add_menu_prefix":"add_menu_prefix","add_css_admin":"add_css_admin","menu_prefix":"menu_prefix","add_css_site":"add_css_site","dashboard_type":"dashboard_type","dashboard":"dashboard","toignore":"toignore","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","add_php_postflight_install":"add_php_postflight_install","export_key":"export_key","add_php_postflight_update":"add_php_postflight_update","joomla_source_link":"joomla_source_link","add_php_method_uninstall":"add_php_method_uninstall","export_buy_link":"export_buy_link","add_sql":"add_sql","add_sql_uninstall":"add_sql_uninstall","assets_table_fix":"assets_table_fix","readme":"readme","emptycontributors":"emptycontributors","add_update_server":"add_update_server","number":"number","update_server_target":"update_server_target","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","creatuserhelper":"creatuserhelper","adduikit":"adduikit","crowdin_project_api_key":"crowdin_project_api_key","addfootable":"addfootable","crowdin_account_api_key":"crowdin_account_api_key","add_email_helper":"add_email_helper","buildcomp":"buildcomp","add_php_helper_both":"add_php_helper_both","guid":"guid","php_helper_both":"php_helper_both","name":"name"}}'; + $joomla_component->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_method_uninstall","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_code":"name_code","short_description":"short_description","companyname":"companyname","buildcompsql":"buildcompsql","translation_tool":"translation_tool","add_sales_server":"add_sales_server","php_method_uninstall":"php_method_uninstall","php_preflight_install":"php_preflight_install","css_admin":"css_admin","mvc_versiondate":"mvc_versiondate","remove_line_breaks":"remove_line_breaks","add_placeholders":"add_placeholders","debug_linenr":"debug_linenr","php_site_event":"php_site_event","description":"description","author":"author","php_postflight_install":"php_postflight_install","email":"email","sql_uninstall":"sql_uninstall","website":"website","add_license":"add_license","backup_folder_path":"backup_folder_path","php_helper_both":"php_helper_both","crowdin_username":"crowdin_username","php_admin_event":"php_admin_event","license_type":"license_type","component_version":"component_version","php_helper_admin":"php_helper_admin","php_helper_site":"php_helper_site","whmcs_key":"whmcs_key","javascript":"javascript","whmcs_url":"whmcs_url","css_site":"css_site","whmcs_buy_link":"whmcs_buy_link","license":"license","php_preflight_update":"php_preflight_update","bom":"bom","php_postflight_update":"php_postflight_update","image":"image","sql":"sql","copyright":"copyright","addreadme":"addreadme","preferred_joomla_version":"preferred_joomla_version","update_server_url":"update_server_url","add_powers":"add_powers","add_backup_folder_path":"add_backup_folder_path","crowdin_project_identifier":"crowdin_project_identifier","add_php_helper_both":"add_php_helper_both","add_php_helper_admin":"add_php_helper_admin","add_admin_event":"add_admin_event","add_php_helper_site":"add_php_helper_site","add_site_event":"add_site_event","add_namespace_prefix":"add_namespace_prefix","add_javascript":"add_javascript","namespace_prefix":"namespace_prefix","add_css_admin":"add_css_admin","add_css_site":"add_css_site","add_menu_prefix":"add_menu_prefix","dashboard_type":"dashboard_type","menu_prefix":"menu_prefix","dashboard":"dashboard","add_php_preflight_install":"add_php_preflight_install","add_php_preflight_update":"add_php_preflight_update","toignore":"toignore","add_php_postflight_install":"add_php_postflight_install","add_php_postflight_update":"add_php_postflight_update","add_php_method_uninstall":"add_php_method_uninstall","export_key":"export_key","add_sql":"add_sql","joomla_source_link":"joomla_source_link","add_sql_uninstall":"add_sql_uninstall","export_buy_link":"export_buy_link","assets_table_fix":"assets_table_fix","readme":"readme","add_update_server":"add_update_server","update_server_target":"update_server_target","emptycontributors":"emptycontributors","number":"number","update_server":"update_server","sales_server":"sales_server","add_git_folder_path":"add_git_folder_path","git_folder_path":"git_folder_path","crowdin_project_api_key":"crowdin_project_api_key","creatuserhelper":"creatuserhelper","crowdin_account_api_key":"crowdin_account_api_key","adduikit":"adduikit","buildcomp":"buildcomp","addfootable":"addfootable","guid":"guid","add_email_helper":"add_email_helper","name":"name"}}'; $joomla_component->router = 'ComponentbuilderHelperRoute::getJoomla_componentRoute'; - $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","remove_line_breaks","debug_linenr","mvc_versiondate","add_placeholders","add_sales_server","translation_tool","add_license","license_type","addreadme","add_powers","add_backup_folder_path","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","emptycontributors","add_update_server","number","update_server_target","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","addfootable","add_email_helper","buildcomp","add_php_helper_both"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_component->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_component.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","translation_tool","add_sales_server","mvc_versiondate","remove_line_breaks","add_placeholders","debug_linenr","add_license","license_type","addreadme","preferred_joomla_version","add_powers","add_backup_folder_path","add_php_helper_both","add_php_helper_admin","add_admin_event","add_php_helper_site","add_site_event","add_javascript","add_css_admin","add_css_site","dashboard_type","add_php_preflight_install","add_php_preflight_update","add_php_postflight_install","add_php_postflight_update","add_php_method_uninstall","add_sql","add_sql_uninstall","assets_table_fix","add_update_server","update_server_target","emptycontributors","number","update_server","sales_server","add_git_folder_path","creatuserhelper","adduikit","buildcomp","addfootable","add_email_helper"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dashboard","targetTable": "#__componentbuilder_custom_admin_view","targetColumn": "","displayColumn": "system_name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_component type is already in content_type DB. $joomla_component_id = null; @@ -7641,13 +7792,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_module content type object. - $joomla_module = new stdClass(); + $joomla_module = new \stdClass(); $joomla_module->type_title = 'Componentbuilder Joomla_module'; $joomla_module->type_alias = 'com_componentbuilder.joomla_module'; $joomla_module->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module","key": "id","type": "Joomla_module","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "default","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","target":"target","description":"description","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","add_php_preflight_uninstall":"add_php_preflight_uninstall","addreadme":"addreadme","default":"default","snippet":"snippet","add_sql":"add_sql","update_server_target":"update_server_target","add_sql_uninstall":"add_sql_uninstall","update_server":"update_server","add_update_server":"add_update_server","libraries":"libraries","module_version":"module_version","sales_server":"sales_server","custom_get":"custom_get","php_preflight_update":"php_preflight_update","php_preflight_uninstall":"php_preflight_uninstall","mod_code":"mod_code","php_postflight_install":"php_postflight_install","add_class_helper":"add_class_helper","php_postflight_update":"php_postflight_update","add_class_helper_header":"add_class_helper_header","php_method_uninstall":"php_method_uninstall","class_helper_header":"class_helper_header","sql":"sql","class_helper_code":"class_helper_code","sql_uninstall":"sql_uninstall","readme":"readme","add_php_script_construct":"add_php_script_construct","update_server_url":"update_server_url","php_script_construct":"php_script_construct","add_php_preflight_install":"add_php_preflight_install","php_preflight_install":"php_preflight_install","add_sales_server":"add_sales_server","add_php_preflight_update":"add_php_preflight_update","guid":"guid","name":"name"}}'; $joomla_module->router = 'ComponentbuilderHelperRoute::getJoomla_moduleRoute'; - $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_module->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","add_php_preflight_uninstall","addreadme","snippet","add_sql","update_server_target","add_sql_uninstall","update_server","add_update_server","sales_server","add_class_helper","add_class_helper_header","add_php_script_construct","add_php_preflight_install","add_sales_server","add_php_preflight_update"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_module type is already in content_type DB. $joomla_module_id = null; @@ -7670,13 +7821,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin content type object. - $joomla_plugin = new stdClass(); + $joomla_plugin = new \stdClass(); $joomla_plugin->type_title = 'Componentbuilder Joomla_plugin'; $joomla_plugin->type_alias = 'com_componentbuilder.joomla_plugin'; $joomla_plugin->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin","key": "id","type": "Joomla_plugin","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","class_extends":"class_extends","joomla_plugin_group":"joomla_plugin_group","add_sql":"add_sql","add_php_method_uninstall":"add_php_method_uninstall","add_php_postflight_update":"add_php_postflight_update","add_php_postflight_install":"add_php_postflight_install","sales_server":"sales_server","add_update_server":"add_update_server","add_head":"add_head","add_sql_uninstall":"add_sql_uninstall","addreadme":"addreadme","head":"head","update_server_target":"update_server_target","main_class_code":"main_class_code","update_server":"update_server","description":"description","php_postflight_install":"php_postflight_install","plugin_version":"plugin_version","php_postflight_update":"php_postflight_update","php_method_uninstall":"php_method_uninstall","add_php_script_construct":"add_php_script_construct","sql":"sql","php_script_construct":"php_script_construct","sql_uninstall":"sql_uninstall","add_php_preflight_install":"add_php_preflight_install","readme":"readme","php_preflight_install":"php_preflight_install","update_server_url":"update_server_url","add_php_preflight_update":"add_php_preflight_update","php_preflight_update":"php_preflight_update","add_php_preflight_uninstall":"add_php_preflight_uninstall","add_sales_server":"add_sales_server","php_preflight_uninstall":"php_preflight_uninstall","guid":"guid","name":"name"}}'; $joomla_plugin->router = 'ComponentbuilderHelperRoute::getJoomla_pluginRoute'; - $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends","joomla_plugin_group","add_sql","add_php_method_uninstall","add_php_postflight_update","add_php_postflight_install","sales_server","add_update_server","add_head","add_sql_uninstall","addreadme","update_server_target","update_server","add_php_script_construct","add_php_preflight_install","add_php_preflight_update","add_php_preflight_uninstall","add_sales_server"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "sales_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "update_server","targetTable": "#__componentbuilder_server","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_plugin type is already in content_type DB. $joomla_plugin_id = null; @@ -7699,13 +7850,13 @@ class com_componentbuilderInstallerScript } // Create the power content type object. - $power = new stdClass(); + $power = new \stdClass(); $power->type_title = 'Componentbuilder Power'; $power->type_alias = 'com_componentbuilder.power'; $power->table = '{"special": {"dbtable": "#__componentbuilder_power","key": "id","type": "Power","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $power->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "system_name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","namespace":"namespace","type":"type","power_version":"power_version","licensing_template":"licensing_template","description":"description","extends":"extends","approved":"approved","add_head":"add_head","extends_custom":"extends_custom","implements_custom":"implements_custom","implements":"implements","head":"head","approved_paths":"approved_paths","main_class_code":"main_class_code","add_licensing_template":"add_licensing_template","guid":"guid","name":"name"}}'; $power->router = 'ComponentbuilderHelperRoute::getPowerRoute'; - $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; + $power->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/power.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","approved","add_head","add_licensing_template"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "extends","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"},{"sourceColumn": "implements","targetTable": "#__componentbuilder_power","targetColumn": "guid","displayColumn": "name"}]}'; // Check if power type is already in content_type DB. $power_id = null; @@ -7728,13 +7879,13 @@ class com_componentbuilderInstallerScript } // Create the admin_view content type object. - $admin_view = new stdClass(); + $admin_view = new \stdClass(); $admin_view->type_title = 'Componentbuilder Admin_view'; $admin_view->type_alias = 'com_componentbuilder.admin_view'; $admin_view->table = '{"special": {"dbtable": "#__componentbuilder_admin_view","key": "id","type": "Admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "null","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_allowedit","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name_single":"name_single","short_description":"short_description","php_allowedit":"php_allowedit","php_postsavehook":"php_postsavehook","php_before_save":"php_before_save","php_getlistquery":"php_getlistquery","php_import_ext":"php_import_ext","icon":"icon","php_after_publish":"php_after_publish","add_fadein":"add_fadein","description":"description","icon_category":"icon_category","icon_add":"icon_add","php_after_cancel":"php_after_cancel","mysql_table_charset":"mysql_table_charset","php_batchmove":"php_batchmove","type":"type","php_after_delete":"php_after_delete","source":"source","php_import":"php_import","php_getitems_after_all":"php_getitems_after_all","php_getform":"php_getform","php_save":"php_save","php_allowadd":"php_allowadd","php_before_cancel":"php_before_cancel","php_batchcopy":"php_batchcopy","php_before_publish":"php_before_publish","alias_builder_type":"alias_builder_type","php_before_delete":"php_before_delete","php_document":"php_document","mysql_table_row_format":"mysql_table_row_format","alias_builder":"alias_builder","sql":"sql","php_import_display":"php_import_display","add_category_submenu":"add_category_submenu","php_import_setdata":"php_import_setdata","name_list":"name_list","add_php_getlistquery":"add_php_getlistquery","add_css_view":"add_css_view","add_php_getform":"add_php_getform","css_view":"css_view","add_php_before_save":"add_php_before_save","add_css_views":"add_css_views","add_php_save":"add_php_save","css_views":"css_views","add_php_postsavehook":"add_php_postsavehook","add_javascript_view_file":"add_javascript_view_file","add_php_allowadd":"add_php_allowadd","javascript_view_file":"javascript_view_file","add_php_allowedit":"add_php_allowedit","add_javascript_view_footer":"add_javascript_view_footer","add_php_before_cancel":"add_php_before_cancel","javascript_view_footer":"javascript_view_footer","add_php_after_cancel":"add_php_after_cancel","add_javascript_views_file":"add_javascript_views_file","add_php_batchcopy":"add_php_batchcopy","javascript_views_file":"javascript_views_file","add_php_batchmove":"add_php_batchmove","add_javascript_views_footer":"add_javascript_views_footer","add_php_before_publish":"add_php_before_publish","javascript_views_footer":"javascript_views_footer","add_php_after_publish":"add_php_after_publish","add_custom_button":"add_custom_button","add_php_before_delete":"add_php_before_delete","add_php_after_delete":"add_php_after_delete","php_controller":"php_controller","add_php_document":"add_php_document","php_model":"php_model","mysql_table_engine":"mysql_table_engine","php_controller_list":"php_controller_list","mysql_table_collate":"mysql_table_collate","php_model_list":"php_model_list","add_sql":"add_sql","add_php_ajax":"add_php_ajax","php_ajaxmethod":"php_ajaxmethod","add_custom_import":"add_custom_import","add_php_getitem":"add_php_getitem","html_import_view":"html_import_view","php_getitem":"php_getitem","php_import_headers":"php_import_headers","add_php_getitems":"add_php_getitems","php_import_save":"php_import_save","php_getitems":"php_getitems","guid":"guid","add_php_getitems_after_all":"add_php_getitems_after_all"}}'; $admin_view->router = 'ComponentbuilderHelperRoute::getAdmin_viewRoute'; - $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; + $admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","add_fadein","type","source","add_category_submenu","add_php_getlistquery","add_css_view","add_php_getform","add_php_before_save","add_css_views","add_php_save","add_php_postsavehook","add_javascript_view_file","add_php_allowadd","add_php_allowedit","add_javascript_view_footer","add_php_before_cancel","add_php_after_cancel","add_javascript_views_file","add_php_batchcopy","add_php_batchmove","add_javascript_views_footer","add_php_before_publish","add_php_after_publish","add_custom_button","add_php_before_delete","add_php_after_delete","add_php_document","add_sql","add_php_ajax","add_custom_import","add_php_getitem","add_php_getitems","add_php_getitems_after_all"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "alias_builder","targetTable": "#__componentbuilder_field","targetColumn": "id","displayColumn": "name"}]}'; // Check if admin_view type is already in content_type DB. $admin_view_id = null; @@ -7757,13 +7908,13 @@ class com_componentbuilderInstallerScript } // Create the custom_admin_view content type object. - $custom_admin_view = new stdClass(); + $custom_admin_view = new \stdClass(); $custom_admin_view->type_title = 'Componentbuilder Custom_admin_view'; $custom_admin_view->type_alias = 'com_componentbuilder.custom_admin_view'; $custom_admin_view->table = '{"special": {"dbtable": "#__componentbuilder_custom_admin_view","key": "id","type": "Custom_admin_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $custom_admin_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","css_document":"css_document","css":"css","js_document":"js_document","javascript_file":"javascript_file","codename":"codename","default":"default","snippet":"snippet","icon":"icon","add_php_jview":"add_php_jview","context":"context","add_js_document":"add_js_document","custom_get":"custom_get","add_javascript_file":"add_javascript_file","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","add_php_document":"add_php_document","add_css":"add_css","add_php_view":"add_php_view","add_php_ajax":"add_php_ajax","libraries":"libraries","dynamic_get":"dynamic_get","php_document":"php_document","php_view":"php_view","add_custom_button":"add_custom_button","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $custom_admin_view->router = 'ComponentbuilderHelperRoute::getCustom_admin_viewRoute'; - $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $custom_admin_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_admin_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","snippet","add_php_jview","add_js_document","add_javascript_file","add_css_document","add_php_document","add_css","add_php_view","add_php_ajax","dynamic_get","add_custom_button"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if custom_admin_view type is already in content_type DB. $custom_admin_view_id = null; @@ -7786,13 +7937,13 @@ class com_componentbuilderInstallerScript } // Create the site_view content type object. - $site_view = new stdClass(); + $site_view = new \stdClass(); $site_view->type_title = 'Componentbuilder Site_view'; $site_view->type_alias = 'com_componentbuilder.site_view'; $site_view->table = '{"special": {"dbtable": "#__componentbuilder_site_view","key": "id","type": "Site_view","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $site_view->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "js_document","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"system_name":"system_name","name":"name","description":"description","main_get":"main_get","add_php_jview_display":"add_php_jview_display","add_php_document":"add_php_document","add_php_view":"add_php_view","js_document":"js_document","codename":"codename","javascript_file":"javascript_file","context":"context","default":"default","snippet":"snippet","add_php_jview":"add_php_jview","custom_get":"custom_get","css_document":"css_document","add_javascript_file":"add_javascript_file","css":"css","add_js_document":"add_js_document","php_ajaxmethod":"php_ajaxmethod","add_css_document":"add_css_document","libraries":"libraries","add_css":"add_css","dynamic_get":"dynamic_get","add_php_ajax":"add_php_ajax","add_custom_button":"add_custom_button","php_document":"php_document","button_position":"button_position","php_view":"php_view","php_jview_display":"php_jview_display","php_jview":"php_jview","php_controller":"php_controller","guid":"guid","php_model":"php_model"}}'; $site_view->router = 'ComponentbuilderHelperRoute::getSite_viewRoute'; - $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; + $site_view->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/site_view.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_get","add_php_jview_display","add_php_document","add_php_view","snippet","add_php_jview","add_javascript_file","add_js_document","add_css_document","add_css","dynamic_get","add_php_ajax","add_custom_button","button_position"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "main_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "custom_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"}]}'; // Check if site_view type is already in content_type DB. $site_view_id = null; @@ -7815,13 +7966,13 @@ class com_componentbuilderInstallerScript } // Create the template content type object. - $template = new stdClass(); + $template = new \stdClass(); $template->type_title = 'Componentbuilder Template'; $template->type_alias = 'com_componentbuilder.template'; $template->table = '{"special": {"dbtable": "#__componentbuilder_template","key": "id","type": "Template","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $template->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","php_view":"php_view","add_php_view":"add_php_view","template":"template","snippet":"snippet","libraries":"libraries","alias":"alias"}}'; $template->router = 'ComponentbuilderHelperRoute::getTemplateRoute'; - $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $template->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/template.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","add_php_view","snippet"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if template type is already in content_type DB. $template_id = null; @@ -7844,13 +7995,13 @@ class com_componentbuilderInstallerScript } // Create the layout content type object. - $layout = new stdClass(); + $layout = new \stdClass(); $layout->type_title = 'Componentbuilder Layout'; $layout->type_alias = 'com_componentbuilder.layout'; $layout->table = '{"special": {"dbtable": "#__componentbuilder_layout","key": "id","type": "Layout","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $layout->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "php_view","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","dynamic_get":"dynamic_get","snippet":"snippet","php_view":"php_view","add_php_view":"add_php_view","layout":"layout","libraries":"libraries","alias":"alias"}}'; $layout->router = 'ComponentbuilderHelperRoute::getLayoutRoute'; - $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $layout->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/layout.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","dynamic_get","snippet","add_php_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "dynamic_get","targetTable": "#__componentbuilder_dynamic_get","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "snippet","targetTable": "#__componentbuilder_snippet","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if layout type is already in content_type DB. $layout_id = null; @@ -7873,13 +8024,13 @@ class com_componentbuilderInstallerScript } // Create the dynamic_get content type object. - $dynamic_get = new stdClass(); + $dynamic_get = new \stdClass(); $dynamic_get->type_title = 'Componentbuilder Dynamic_get'; $dynamic_get->type_alias = 'com_componentbuilder.dynamic_get'; $dynamic_get->table = '{"special": {"dbtable": "#__componentbuilder_dynamic_get","key": "id","type": "Dynamic_get","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_before_getitems","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_router_parse":"php_router_parse","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","php_after_getitem":"php_after_getitem","php_getlistquery":"php_getlistquery","view_selection":"view_selection","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","php_calculation":"php_calculation","php_before_getitem":"php_before_getitem","view_table_main":"view_table_main","select_all":"select_all","add_php_before_getitem":"add_php_before_getitem","getcustom":"getcustom","add_php_after_getitem":"add_php_after_getitem","pagination":"pagination","add_php_getlistquery":"add_php_getlistquery","add_php_before_getitems":"add_php_before_getitems","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","addcalculation":"addcalculation","guid":"guid"}}'; + $dynamic_get->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "php_calculation","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","main_source":"main_source","gettype":"gettype","php_calculation":"php_calculation","php_router_parse":"php_router_parse","add_php_after_getitems":"add_php_after_getitems","add_php_router_parse":"add_php_router_parse","view_selection":"view_selection","add_php_before_getitems":"add_php_before_getitems","add_php_before_getitem":"add_php_before_getitem","add_php_after_getitem":"add_php_after_getitem","db_table_main":"db_table_main","php_custom_get":"php_custom_get","plugin_events":"plugin_events","db_selection":"db_selection","view_table_main":"view_table_main","add_php_getlistquery":"add_php_getlistquery","select_all":"select_all","php_before_getitem":"php_before_getitem","getcustom":"getcustom","php_after_getitem":"php_after_getitem","pagination":"pagination","php_getlistquery":"php_getlistquery","php_before_getitems":"php_before_getitems","php_after_getitems":"php_after_getitems","addcalculation":"addcalculation","guid":"guid"}}'; $dynamic_get->router = 'ComponentbuilderHelperRoute::getDynamic_getRoute'; - $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","main_source","gettype","view_table_main","select_all","add_php_before_getitem","add_php_after_getitem","pagination","add_php_getlistquery","add_php_before_getitems","add_php_after_getitems","add_php_router_parse"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $dynamic_get->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/dynamic_get.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","main_source","gettype","add_php_after_getitems","add_php_router_parse","add_php_before_getitems","add_php_before_getitem","add_php_after_getitem","view_table_main","add_php_getlistquery","select_all","pagination"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "view_table_main","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if dynamic_get type is already in content_type DB. $dynamic_get_id = null; @@ -7902,13 +8053,13 @@ class com_componentbuilderInstallerScript } // Create the custom_code content type object. - $custom_code = new stdClass(); + $custom_code = new \stdClass(); $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","joomla_version":"joomla_version","function_name":"function_name","system_name":"system_name","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","from_line":"from_line","hashtarget":"hashtarget"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; - $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","component","target","type","comment_type","joomla_version"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if custom_code type is already in content_type DB. $custom_code_id = null; @@ -7931,13 +8082,13 @@ class com_componentbuilderInstallerScript } // Create the class_property content type object. - $class_property = new stdClass(); + $class_property = new \stdClass(); $class_property->type_title = 'Componentbuilder Class_property'; $class_property->type_alias = 'com_componentbuilder.class_property'; $class_property->table = '{"special": {"dbtable": "#__componentbuilder_class_property","key": "id","type": "Class_property","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_property->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","comment":"comment","joomla_plugin_group":"joomla_plugin_group","default":"default"}}'; $class_property->router = 'ComponentbuilderHelperRoute::getClass_propertyRoute'; - $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_property->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_property.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Check if class_property type is already in content_type DB. $class_property_id = null; @@ -7960,13 +8111,13 @@ class com_componentbuilderInstallerScript } // Create the class_method content type object. - $class_method = new stdClass(); + $class_method = new \stdClass(); $class_method->type_title = 'Componentbuilder Class_method'; $class_method->type_alias = 'com_componentbuilder.class_method'; $class_method->table = '{"special": {"dbtable": "#__componentbuilder_class_method","key": "id","type": "Class_method","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_method->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","visibility":"visibility","extension_type":"extension_type","guid":"guid","code":"code","comment":"comment","joomla_plugin_group":"joomla_plugin_group","arguments":"arguments"}}'; $class_method->router = 'ComponentbuilderHelperRoute::getClass_methodRoute'; - $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; + $class_method->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_method.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin_group"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin_group","targetTable": "#__componentbuilder_joomla_plugin_group","targetColumn": "id","displayColumn": "name"}]}'; // Check if class_method type is already in content_type DB. $class_method_id = null; @@ -7989,13 +8140,13 @@ class com_componentbuilderInstallerScript } // Create the placeholder content type object. - $placeholder = new stdClass(); + $placeholder = new \stdClass(); $placeholder->type_title = 'Componentbuilder Placeholder'; $placeholder->type_alias = 'com_componentbuilder.placeholder'; $placeholder->table = '{"special": {"dbtable": "#__componentbuilder_placeholder","key": "id","type": "Placeholder","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $placeholder->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "target","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"target":"target","value":"value"}}'; $placeholder->router = 'ComponentbuilderHelperRoute::getPlaceholderRoute'; - $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $placeholder->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/placeholder.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if placeholder type is already in content_type DB. $placeholder_id = null; @@ -8018,13 +8169,13 @@ class com_componentbuilderInstallerScript } // Create the library content type object. - $library = new stdClass(); + $library = new \stdClass(); $library->type_title = 'Componentbuilder Library'; $library->type_alias = 'com_componentbuilder.library'; $library->table = '{"special": {"dbtable": "#__componentbuilder_library","key": "id","type": "Library","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","target":"target","how":"how","type":"type","description":"description","libraries":"libraries","php_setdocument":"php_setdocument","guid":"guid"}}'; $library->router = 'ComponentbuilderHelperRoute::getLibraryRoute'; - $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","target","how","type"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "libraries","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if library type is already in content_type DB. $library_id = null; @@ -8047,13 +8198,13 @@ class com_componentbuilderInstallerScript } // Create the snippet content type object. - $snippet = new stdClass(); + $snippet = new \stdClass(); $snippet->type_title = 'Componentbuilder Snippet'; $snippet->type_alias = 'com_componentbuilder.snippet'; $snippet->table = '{"special": {"dbtable": "#__componentbuilder_snippet","key": "id","type": "Snippet","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","url":"url","type":"type","heading":"heading","library":"library","guid":"guid","contributor_email":"contributor_email","contributor_name":"contributor_name","contributor_website":"contributor_website","contributor_company":"contributor_company","snippet":"snippet","usage":"usage","description":"description"}}'; $snippet->router = 'ComponentbuilderHelperRoute::getSnippetRoute'; - $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $snippet->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "type","targetTable": "#__componentbuilder_snippet_type","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if snippet type is already in content_type DB. $snippet_id = null; @@ -8076,13 +8227,13 @@ class com_componentbuilderInstallerScript } // Create the validation_rule content type object. - $validation_rule = new stdClass(); + $validation_rule = new \stdClass(); $validation_rule->type_title = 'Componentbuilder Validation_rule'; $validation_rule->type_alias = 'com_componentbuilder.validation_rule'; $validation_rule->table = '{"special": {"dbtable": "#__componentbuilder_validation_rule","key": "id","type": "Validation_rule","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $validation_rule->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","short_description":"short_description","inherit":"inherit","php":"php"}}'; $validation_rule->router = 'ComponentbuilderHelperRoute::getValidation_ruleRoute'; - $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; + $validation_rule->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/validation_rule.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "inherit","targetTable": "#__componentbuilder_validation_rule","targetColumn": "id","displayColumn": "name"}]}'; // Check if validation_rule type is already in content_type DB. $validation_rule_id = null; @@ -8105,13 +8256,13 @@ class com_componentbuilderInstallerScript } // Create the field content type object. - $field = new stdClass(); + $field = new \stdClass(); $field->type_title = 'Componentbuilder Field'; $field->type_alias = 'com_componentbuilder.field'; $field->table = '{"special": {"dbtable": "#__componentbuilder_field","key": "id","type": "Field","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $field->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "css_views","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","fieldtype":"fieldtype","datatype":"datatype","indexes":"indexes","null_switch":"null_switch","store":"store","on_save_model_field":"on_save_model_field","initiator_on_get_model":"initiator_on_get_model","initiator_on_save_model":"initiator_on_save_model","xml":"xml","datalenght":"datalenght","css_views":"css_views","css_view":"css_view","datadefault_other":"datadefault_other","datadefault":"datadefault","datalenght_other":"datalenght_other","on_get_model_field":"on_get_model_field","javascript_view_footer":"javascript_view_footer","javascript_views_footer":"javascript_views_footer","add_css_view":"add_css_view","add_css_views":"add_css_views","add_javascript_view_footer":"add_javascript_view_footer","add_javascript_views_footer":"add_javascript_views_footer","guid":"guid"}}'; $field->router = 'ComponentbuilderHelperRoute::getFieldRoute'; - $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; + $field->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/field.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","xml"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","fieldtype","store","catid","add_css_view","add_css_views","add_javascript_view_footer","add_javascript_views_footer"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "fieldtype","targetTable": "#__componentbuilder_fieldtype","targetColumn": "id","displayColumn": "name"}]}'; // Check if field type is already in content_type DB. $field_id = null; @@ -8134,7 +8285,7 @@ class com_componentbuilderInstallerScript } // Create the field category content type object. - $field_category = new stdClass(); + $field_category = new \stdClass(); $field_category->type_title = 'Componentbuilder Field Catid'; $field_category->type_alias = 'com_componentbuilder.field.category'; $field_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -8163,13 +8314,13 @@ class com_componentbuilderInstallerScript } // Create the fieldtype content type object. - $fieldtype = new stdClass(); + $fieldtype = new \stdClass(); $fieldtype->type_title = 'Componentbuilder Fieldtype'; $fieldtype->type_alias = 'com_componentbuilder.fieldtype'; $fieldtype->table = '{"special": {"dbtable": "#__componentbuilder_fieldtype","key": "id","type": "Fieldtype","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $fieldtype->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "catid","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","store":"store","null_switch":"null_switch","indexes":"indexes","datadefault_other":"datadefault_other","datadefault":"datadefault","short_description":"short_description","datatype":"datatype","has_defaults":"has_defaults","description":"description","datalenght":"datalenght","datalenght_other":"datalenght_other","guid":"guid"}}'; $fieldtype->router = 'ComponentbuilderHelperRoute::getFieldtypeRoute'; - $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $fieldtype->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/fieldtype.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","store","has_defaults","catid"],"displayLookup": [{"sourceColumn": "catid","targetTable": "#__categories","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if fieldtype type is already in content_type DB. $fieldtype_id = null; @@ -8192,7 +8343,7 @@ class com_componentbuilderInstallerScript } // Create the fieldtype category content type object. - $fieldtype_category = new stdClass(); + $fieldtype_category = new \stdClass(); $fieldtype_category->type_title = 'Componentbuilder Fieldtype Catid'; $fieldtype_category->type_alias = 'com_componentbuilder.fieldtype.category'; $fieldtype_category->table = '{"special":{"dbtable":"#__categories","key":"id","type":"Category","prefix":"JTable","config":"array()"},"common":{"dbtable":"#__ucm_content","key":"ucm_id","type":"Corecontent","prefix":"JTable","config":"array()"}}'; @@ -8221,13 +8372,13 @@ class com_componentbuilderInstallerScript } // Create the language_translation content type object. - $language_translation = new stdClass(); + $language_translation = new \stdClass(); $language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_alias = 'com_componentbuilder.language_translation'; $language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}'; $language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute'; - $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if language_translation type is already in content_type DB. $language_translation_id = null; @@ -8250,13 +8401,13 @@ class com_componentbuilderInstallerScript } // Create the language content type object. - $language = new stdClass(); + $language = new \stdClass(); $language->type_title = 'Componentbuilder Language'; $language->type_alias = 'com_componentbuilder.language'; $language->table = '{"special": {"dbtable": "#__componentbuilder_language","key": "id","type": "Language","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $language->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","langtag":"langtag"}}'; $language->router = 'ComponentbuilderHelperRoute::getLanguageRoute'; - $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if language type is already in content_type DB. $language_id = null; @@ -8279,13 +8430,13 @@ class com_componentbuilderInstallerScript } // Create the server content type object. - $server = new stdClass(); + $server = new \stdClass(); $server->type_title = 'Componentbuilder Server'; $server->type_alias = 'com_componentbuilder.server'; $server->table = '{"special": {"dbtable": "#__componentbuilder_server","key": "id","type": "Server","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $server->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","protocol":"protocol","signature":"signature","private_key":"private_key","secret":"secret","password":"password","private":"private","authentication":"authentication","path":"path","port":"port","host":"host","username":"username"}}'; $server->router = 'ComponentbuilderHelperRoute::getServerRoute'; - $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $server->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/server.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","protocol","authentication"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if server type is already in content_type DB. $server_id = null; @@ -8308,13 +8459,13 @@ class com_componentbuilderInstallerScript } // Create the help_document content type object. - $help_document = new stdClass(); + $help_document = new \stdClass(); $help_document->type_title = 'Componentbuilder Help_document'; $help_document->type_alias = 'com_componentbuilder.help_document'; $help_document->table = '{"special": {"dbtable": "#__componentbuilder_help_document","key": "id","type": "Help_document","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","content":"content","article":"article","url":"url","target":"target","alias":"alias"}}'; $help_document->router = 'ComponentbuilderHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","type","location","not_required","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Check if help_document type is already in content_type DB. $help_document_id = null; @@ -8337,13 +8488,13 @@ class com_componentbuilderInstallerScript } // Create the admin_fields content type object. - $admin_fields = new stdClass(); + $admin_fields = new \stdClass(); $admin_fields->type_title = 'Componentbuilder Admin_fields'; $admin_fields->type_alias = 'com_componentbuilder.admin_fields'; $admin_fields->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields","key": "id","type": "Admin_fields","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields->router = 'ComponentbuilderHelperRoute::getAdmin_fieldsRoute'; - $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_fields type is already in content_type DB. $admin_fields_id = null; @@ -8366,13 +8517,13 @@ class com_componentbuilderInstallerScript } // Create the admin_fields_conditions content type object. - $admin_fields_conditions = new stdClass(); + $admin_fields_conditions = new \stdClass(); $admin_fields_conditions->type_title = 'Componentbuilder Admin_fields_conditions'; $admin_fields_conditions->type_alias = 'com_componentbuilder.admin_fields_conditions'; $admin_fields_conditions->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_conditions","key": "id","type": "Admin_fields_conditions","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_conditions->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_conditions->router = 'ComponentbuilderHelperRoute::getAdmin_fields_conditionsRoute'; - $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_conditions->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_conditions.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_fields_conditions type is already in content_type DB. $admin_fields_conditions_id = null; @@ -8395,13 +8546,13 @@ class com_componentbuilderInstallerScript } // Create the admin_fields_relations content type object. - $admin_fields_relations = new stdClass(); + $admin_fields_relations = new \stdClass(); $admin_fields_relations->type_title = 'Componentbuilder Admin_fields_relations'; $admin_fields_relations->type_alias = 'com_componentbuilder.admin_fields_relations'; $admin_fields_relations->table = '{"special": {"dbtable": "#__componentbuilder_admin_fields_relations","key": "id","type": "Admin_fields_relations","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_fields_relations->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_fields_relations->router = 'ComponentbuilderHelperRoute::getAdmin_fields_relationsRoute'; - $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_fields_relations->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_fields_relations.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_fields_relations type is already in content_type DB. $admin_fields_relations_id = null; @@ -8424,13 +8575,13 @@ class com_componentbuilderInstallerScript } // Create the admin_custom_tabs content type object. - $admin_custom_tabs = new stdClass(); + $admin_custom_tabs = new \stdClass(); $admin_custom_tabs->type_title = 'Componentbuilder Admin_custom_tabs'; $admin_custom_tabs->type_alias = 'com_componentbuilder.admin_custom_tabs'; $admin_custom_tabs->table = '{"special": {"dbtable": "#__componentbuilder_admin_custom_tabs","key": "id","type": "Admin_custom_tabs","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $admin_custom_tabs->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "admin_view","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"admin_view":"admin_view"}}'; $admin_custom_tabs->router = 'ComponentbuilderHelperRoute::getAdmin_custom_tabsRoute'; - $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; + $admin_custom_tabs->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/admin_custom_tabs.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","admin_view"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "admin_view","targetTable": "#__componentbuilder_admin_view","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if admin_custom_tabs type is already in content_type DB. $admin_custom_tabs_id = null; @@ -8453,13 +8604,13 @@ class com_componentbuilderInstallerScript } // Create the component_admin_views content type object. - $component_admin_views = new stdClass(); + $component_admin_views = new \stdClass(); $component_admin_views->type_title = 'Componentbuilder Component_admin_views'; $component_admin_views->type_alias = 'com_componentbuilder.component_admin_views'; $component_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_admin_views","key": "id","type": "Component_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_admin_viewsRoute'; - $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_admin_views type is already in content_type DB. $component_admin_views_id = null; @@ -8482,13 +8633,13 @@ class com_componentbuilderInstallerScript } // Create the component_site_views content type object. - $component_site_views = new stdClass(); + $component_site_views = new \stdClass(); $component_site_views->type_title = 'Componentbuilder Component_site_views'; $component_site_views->type_alias = 'com_componentbuilder.component_site_views'; $component_site_views->table = '{"special": {"dbtable": "#__componentbuilder_component_site_views","key": "id","type": "Component_site_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_site_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_site_views->router = 'ComponentbuilderHelperRoute::getComponent_site_viewsRoute'; - $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_site_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_site_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_site_views type is already in content_type DB. $component_site_views_id = null; @@ -8511,13 +8662,13 @@ class com_componentbuilderInstallerScript } // Create the component_custom_admin_views content type object. - $component_custom_admin_views = new stdClass(); + $component_custom_admin_views = new \stdClass(); $component_custom_admin_views->type_title = 'Componentbuilder Component_custom_admin_views'; $component_custom_admin_views->type_alias = 'com_componentbuilder.component_custom_admin_views'; $component_custom_admin_views->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_views","key": "id","type": "Component_custom_admin_views","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_views->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_views->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_viewsRoute'; - $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_views->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_custom_admin_views type is already in content_type DB. $component_custom_admin_views_id = null; @@ -8540,13 +8691,13 @@ class com_componentbuilderInstallerScript } // Create the component_updates content type object. - $component_updates = new stdClass(); + $component_updates = new \stdClass(); $component_updates->type_title = 'Componentbuilder Component_updates'; $component_updates->type_alias = 'com_componentbuilder.component_updates'; $component_updates->table = '{"special": {"dbtable": "#__componentbuilder_component_updates","key": "id","type": "Component_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_updates->router = 'ComponentbuilderHelperRoute::getComponent_updatesRoute'; - $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_updates type is already in content_type DB. $component_updates_id = null; @@ -8569,13 +8720,13 @@ class com_componentbuilderInstallerScript } // Create the component_mysql_tweaks content type object. - $component_mysql_tweaks = new stdClass(); + $component_mysql_tweaks = new \stdClass(); $component_mysql_tweaks->type_title = 'Componentbuilder Component_mysql_tweaks'; $component_mysql_tweaks->type_alias = 'com_componentbuilder.component_mysql_tweaks'; $component_mysql_tweaks->table = '{"special": {"dbtable": "#__componentbuilder_component_mysql_tweaks","key": "id","type": "Component_mysql_tweaks","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_mysql_tweaks->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_mysql_tweaks->router = 'ComponentbuilderHelperRoute::getComponent_mysql_tweaksRoute'; - $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_mysql_tweaks->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_mysql_tweaks type is already in content_type DB. $component_mysql_tweaks_id = null; @@ -8598,13 +8749,13 @@ class com_componentbuilderInstallerScript } // Create the component_custom_admin_menus content type object. - $component_custom_admin_menus = new stdClass(); + $component_custom_admin_menus = new \stdClass(); $component_custom_admin_menus->type_title = 'Componentbuilder Component_custom_admin_menus'; $component_custom_admin_menus->type_alias = 'com_componentbuilder.component_custom_admin_menus'; $component_custom_admin_menus->table = '{"special": {"dbtable": "#__componentbuilder_component_custom_admin_menus","key": "id","type": "Component_custom_admin_menus","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_custom_admin_menus->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_custom_admin_menus->router = 'ComponentbuilderHelperRoute::getComponent_custom_admin_menusRoute'; - $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_custom_admin_menus->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_custom_admin_menus type is already in content_type DB. $component_custom_admin_menus_id = null; @@ -8626,14 +8777,43 @@ class com_componentbuilderInstallerScript $component_custom_admin_menus_Inserted = $db->insertObject('#__content_types', $component_custom_admin_menus); } + // Create the component_router content type object. + $component_router = new \stdClass(); + $component_router->type_title = 'Componentbuilder Component_router'; + $component_router->type_alias = 'com_componentbuilder.component_router'; + $component_router->table = '{"special": {"dbtable": "#__componentbuilder_component_router","key": "id","type": "Component_router","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $component_router->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "methods_code","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","mode_constructor_before_parent":"mode_constructor_before_parent","mode_constructor_after_parent":"mode_constructor_after_parent","mode_methods":"mode_methods","methods_code":"methods_code","constructor_after_parent_code":"constructor_after_parent_code","constructor_before_parent_code":"constructor_before_parent_code"}}'; + $component_router->router = 'ComponentbuilderHelperRoute::getComponent_routerRoute'; + $component_router->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_router.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component","mode_constructor_before_parent","mode_constructor_after_parent","mode_methods"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + + // Check if component_router type is already in content_type DB. + $component_router_id = null; + $query = $db->getQuery(true); + $query->select($db->quoteName(array('type_id'))); + $query->from($db->quoteName('#__content_types')); + $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($component_router->type_alias)); + $db->setQuery($query); + $db->execute(); + + // Set the object into the content types table. + if ($db->getNumRows()) + { + $component_router->type_id = $db->loadResult(); + $component_router_Updated = $db->updateObject('#__content_types', $component_router, 'type_id'); + } + else + { + $component_router_Inserted = $db->insertObject('#__content_types', $component_router); + } + // Create the component_config content type object. - $component_config = new stdClass(); + $component_config = new \stdClass(); $component_config->type_title = 'Componentbuilder Component_config'; $component_config->type_alias = 'com_componentbuilder.component_config'; $component_config->table = '{"special": {"dbtable": "#__componentbuilder_component_config","key": "id","type": "Component_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_config->router = 'ComponentbuilderHelperRoute::getComponent_configRoute'; - $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_config type is already in content_type DB. $component_config_id = null; @@ -8656,13 +8836,13 @@ class com_componentbuilderInstallerScript } // Create the component_dashboard content type object. - $component_dashboard = new stdClass(); + $component_dashboard = new \stdClass(); $component_dashboard->type_title = 'Componentbuilder Component_dashboard'; $component_dashboard->type_alias = 'com_componentbuilder.component_dashboard'; $component_dashboard->table = '{"special": {"dbtable": "#__componentbuilder_component_dashboard","key": "id","type": "Component_dashboard","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_dashboard->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component","php_dashboard_methods":"php_dashboard_methods"}}'; $component_dashboard->router = 'ComponentbuilderHelperRoute::getComponent_dashboardRoute'; - $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_dashboard->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_dashboard.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_dashboard type is already in content_type DB. $component_dashboard_id = null; @@ -8685,13 +8865,13 @@ class com_componentbuilderInstallerScript } // Create the component_files_folders content type object. - $component_files_folders = new stdClass(); + $component_files_folders = new \stdClass(); $component_files_folders->type_title = 'Componentbuilder Component_files_folders'; $component_files_folders->type_alias = 'com_componentbuilder.component_files_folders'; $component_files_folders->table = '{"special": {"dbtable": "#__componentbuilder_component_files_folders","key": "id","type": "Component_files_folders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_files_folders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_files_folders->router = 'ComponentbuilderHelperRoute::getComponent_files_foldersRoute'; - $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_files_folders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_files_folders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_files_folders type is already in content_type DB. $component_files_folders_id = null; @@ -8714,13 +8894,13 @@ class com_componentbuilderInstallerScript } // Create the component_placeholders content type object. - $component_placeholders = new stdClass(); + $component_placeholders = new \stdClass(); $component_placeholders->type_title = 'Componentbuilder Component_placeholders'; $component_placeholders->type_alias = 'com_componentbuilder.component_placeholders'; $component_placeholders->table = '{"special": {"dbtable": "#__componentbuilder_component_placeholders","key": "id","type": "Component_placeholders","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_placeholders->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_placeholders->router = 'ComponentbuilderHelperRoute::getComponent_placeholdersRoute'; - $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_placeholders->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_placeholders.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_placeholders type is already in content_type DB. $component_placeholders_id = null; @@ -8743,13 +8923,13 @@ class com_componentbuilderInstallerScript } // Create the component_plugins content type object. - $component_plugins = new stdClass(); + $component_plugins = new \stdClass(); $component_plugins->type_title = 'Componentbuilder Component_plugins'; $component_plugins->type_alias = 'com_componentbuilder.component_plugins'; $component_plugins->table = '{"special": {"dbtable": "#__componentbuilder_component_plugins","key": "id","type": "Component_plugins","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_plugins->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_plugins->router = 'ComponentbuilderHelperRoute::getComponent_pluginsRoute'; - $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_plugins->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_plugins.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_plugins type is already in content_type DB. $component_plugins_id = null; @@ -8772,13 +8952,13 @@ class com_componentbuilderInstallerScript } // Create the component_modules content type object. - $component_modules = new stdClass(); + $component_modules = new \stdClass(); $component_modules->type_title = 'Componentbuilder Component_modules'; $component_modules->type_alias = 'com_componentbuilder.component_modules'; $component_modules->table = '{"special": {"dbtable": "#__componentbuilder_component_modules","key": "id","type": "Component_modules","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $component_modules->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_component","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_component":"joomla_component"}}'; $component_modules->router = 'ComponentbuilderHelperRoute::getComponent_modulesRoute'; - $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; + $component_modules->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/component_modules.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_component"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "clone_me","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if component_modules type is already in content_type DB. $component_modules_id = null; @@ -8801,13 +8981,13 @@ class com_componentbuilderInstallerScript } // Create the snippet_type content type object. - $snippet_type = new stdClass(); + $snippet_type = new \stdClass(); $snippet_type->type_title = 'Componentbuilder Snippet_type'; $snippet_type->type_alias = 'com_componentbuilder.snippet_type'; $snippet_type->table = '{"special": {"dbtable": "#__componentbuilder_snippet_type","key": "id","type": "Snippet_type","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $snippet_type->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description"}}'; $snippet_type->router = 'ComponentbuilderHelperRoute::getSnippet_typeRoute'; - $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $snippet_type->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/snippet_type.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if snippet_type type is already in content_type DB. $snippet_type_id = null; @@ -8830,13 +9010,13 @@ class com_componentbuilderInstallerScript } // Create the library_config content type object. - $library_config = new stdClass(); + $library_config = new \stdClass(); $library_config->type_title = 'Componentbuilder Library_config'; $library_config->type_alias = 'com_componentbuilder.library_config'; $library_config->table = '{"special": {"dbtable": "#__componentbuilder_library_config","key": "id","type": "Library_config","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_config->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_config->router = 'ComponentbuilderHelperRoute::getLibrary_configRoute'; - $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_config->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_config.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if library_config type is already in content_type DB. $library_config_id = null; @@ -8859,13 +9039,13 @@ class com_componentbuilderInstallerScript } // Create the library_files_folders_urls content type object. - $library_files_folders_urls = new stdClass(); + $library_files_folders_urls = new \stdClass(); $library_files_folders_urls->type_title = 'Componentbuilder Library_files_folders_urls'; $library_files_folders_urls->type_alias = 'com_componentbuilder.library_files_folders_urls'; $library_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_library_files_folders_urls","key": "id","type": "Library_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $library_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "library","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"library":"library"}}'; $library_files_folders_urls->router = 'ComponentbuilderHelperRoute::getLibrary_files_folders_urlsRoute'; - $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; + $library_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/library_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","library"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "library","targetTable": "#__componentbuilder_library","targetColumn": "id","displayColumn": "name"}]}'; // Check if library_files_folders_urls type is already in content_type DB. $library_files_folders_urls_id = null; @@ -8888,13 +9068,13 @@ class com_componentbuilderInstallerScript } // Create the class_extends content type object. - $class_extends = new stdClass(); + $class_extends = new \stdClass(); $class_extends->type_title = 'Componentbuilder Class_extends'; $class_extends->type_alias = 'com_componentbuilder.class_extends'; $class_extends->table = '{"special": {"dbtable": "#__componentbuilder_class_extends","key": "id","type": "Class_extends","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $class_extends->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "head","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","extension_type":"extension_type","head":"head","comment":"comment"}}'; $class_extends->router = 'ComponentbuilderHelperRoute::getClass_extendsRoute'; - $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; + $class_extends->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/class_extends.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}'; // Check if class_extends type is already in content_type DB. $class_extends_id = null; @@ -8917,13 +9097,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_module_updates content type object. - $joomla_module_updates = new stdClass(); + $joomla_module_updates = new \stdClass(); $joomla_module_updates->type_title = 'Componentbuilder Joomla_module_updates'; $joomla_module_updates->type_alias = 'com_componentbuilder.joomla_module_updates'; $joomla_module_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_updates","key": "id","type": "Joomla_module_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_updates->router = 'ComponentbuilderHelperRoute::getJoomla_module_updatesRoute'; - $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_module_updates type is already in content_type DB. $joomla_module_updates_id = null; @@ -8946,13 +9126,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_module_files_folders_urls content type object. - $joomla_module_files_folders_urls = new stdClass(); + $joomla_module_files_folders_urls = new \stdClass(); $joomla_module_files_folders_urls->type_title = 'Componentbuilder Joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; $joomla_module_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_module_files_folders_urls","key": "id","type": "Joomla_module_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_module_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_module","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_module":"joomla_module"}}'; $joomla_module_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_module_files_folders_urlsRoute'; - $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_module_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_module_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_module"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_module","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_module_files_folders_urls type is already in content_type DB. $joomla_module_files_folders_urls_id = null; @@ -8975,13 +9155,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin_group content type object. - $joomla_plugin_group = new stdClass(); + $joomla_plugin_group = new \stdClass(); $joomla_plugin_group->type_title = 'Componentbuilder Joomla_plugin_group'; $joomla_plugin_group->type_alias = 'com_componentbuilder.joomla_plugin_group'; $joomla_plugin_group->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_group","key": "id","type": "Joomla_plugin_group","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_group->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","class_extends":"class_extends"}}'; $joomla_plugin_group->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_groupRoute'; - $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; + $joomla_plugin_group->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_group.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","class_extends"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "class_extends","targetTable": "#__componentbuilder_class_extends","targetColumn": "id","displayColumn": "name"}]}'; // Check if joomla_plugin_group type is already in content_type DB. $joomla_plugin_group_id = null; @@ -9004,13 +9184,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin_updates content type object. - $joomla_plugin_updates = new stdClass(); + $joomla_plugin_updates = new \stdClass(); $joomla_plugin_updates->type_title = 'Componentbuilder Joomla_plugin_updates'; $joomla_plugin_updates->type_alias = 'com_componentbuilder.joomla_plugin_updates'; $joomla_plugin_updates->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_updates","key": "id","type": "Joomla_plugin_updates","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_updates->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_updates->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_updatesRoute'; - $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_updates->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_updates.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_plugin_updates type is already in content_type DB. $joomla_plugin_updates_id = null; @@ -9033,13 +9213,13 @@ class com_componentbuilderInstallerScript } // Create the joomla_plugin_files_folders_urls content type object. - $joomla_plugin_files_folders_urls = new stdClass(); + $joomla_plugin_files_folders_urls = new \stdClass(); $joomla_plugin_files_folders_urls->type_title = 'Componentbuilder Joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; $joomla_plugin_files_folders_urls->table = '{"special": {"dbtable": "#__componentbuilder_joomla_plugin_files_folders_urls","key": "id","type": "Joomla_plugin_files_folders_urls","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $joomla_plugin_files_folders_urls->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "joomla_plugin","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"joomla_plugin":"joomla_plugin"}}'; $joomla_plugin_files_folders_urls->router = 'ComponentbuilderHelperRoute::getJoomla_plugin_files_folders_urlsRoute'; - $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; + $joomla_plugin_files_folders_urls->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/joomla_plugin_files_folders_urls.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","version","hits","joomla_plugin"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "joomla_plugin","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"}]}'; // Check if joomla_plugin_files_folders_urls type is already in content_type DB. $joomla_plugin_files_folders_urls_id = null; @@ -9102,7 +9282,7 @@ class com_componentbuilderInstallerScript if (strpos($row->url, $library['not']) === false) { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = $id; } @@ -9112,7 +9292,7 @@ class com_componentbuilderInstallerScript if (strpos($row->url, $library['and']) !== false) { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = $id; } @@ -9120,7 +9300,7 @@ class com_componentbuilderInstallerScript else { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = $id; } @@ -9132,7 +9312,7 @@ class com_componentbuilderInstallerScript if (!isset($updater[$row->id])) { // Create an object. - $updater[$row->id] = new stdClass(); + $updater[$row->id] = new \stdClass(); $updater[$row->id]->id = $row->id; $updater[$row->id]->library = 1; // default (no library) } @@ -9160,9 +9340,9 @@ class com_componentbuilderInstallerScript if ((isset($this->setFtpValues) && ArrayHelper::check($this->setFtpValues)) || (isset($this->setMoveValues) && ArrayHelper::check($this->setMoveValues))) { // Get the date - $today = JFactory::getDate()->toSql(); + $today = Factory::getDate()->toSql(); // Get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } // check if we have stuff to move if (isset($this->setMoveValues) && ArrayHelper::check($this->setMoveValues)) @@ -9175,7 +9355,7 @@ class com_componentbuilderInstallerScript foreach($items as $item) { // okay if found ignore move - if (isset($item->{$this->dynamicTable[$table]}) && $item->{$this->dynamicTable[$table]} > 0 && !ComponentbuilderHelper::getVar($table, (int) $item->{$this->dynamicTable[$table]}, $this->dynamicTable[$table], 'id')) + if (isset($item->{$this->dynamicTable[$table]}) && $item->{$this->dynamicTable[$table]} > 0 && !GetHelper::var($table, (int) $item->{$this->dynamicTable[$table]}, $this->dynamicTable[$table], 'id')) { $item->published = 1; $item->version = 2; @@ -9210,7 +9390,7 @@ class com_componentbuilderInstallerScript { $name = explode('.', $hostusername); // Create an object. - $object = new stdClass(); + $object = new \stdClass(); $object->signature = $item['signature']; // the still locked version (if there is a basic key) $object->name = str_replace('@', ' ', $name[0]); $object->published = 1; @@ -9232,7 +9412,7 @@ class com_componentbuilderInstallerScript foreach ($item['ids'] as $compId) { // Create an object. - $object = new stdClass(); + $object = new \stdClass(); $object->id = $compId; $object->{$key} = $newId; // Update with the object the joomla_component table. @@ -9249,7 +9429,7 @@ class com_componentbuilderInstallerScript foreach ($item['ids'] as $compId) { // Create an object. - $object = new stdClass(); + $object = new \stdClass(); $object->id = $compId; $object->{$key} = ''; // remove all values to insure stability // Insert the object into the joomla_component table. @@ -9434,18 +9614,19 @@ class com_componentbuilderInstallerScript // set a notice that this was done $app->enqueueMessage('

Clean-up!
We have removed the internal old Gitea folder /libraries/jcb_powers/VDM.Gitea that is no longer used.
The new Gitea classes are now found here /libraries/jcb_powers/VDM.Joomla.Gitea and is available to any JCB project from the following super power: https://git.vdm.dev/joomla/gitea

', 'Notice'); } - echo ' + + echo '
-

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

'; +

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

'; // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the componentbuilder action logs extensions object. - $componentbuilder_action_logs_extensions = new stdClass(); + $componentbuilder_action_logs_extensions = new \stdClass(); $componentbuilder_action_logs_extensions->extension = 'com_componentbuilder'; // Check if componentbuilder action log extension is already in action logs extensions DB. @@ -9465,10 +9646,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_component action log config object. - $joomla_component_action_log_config = new stdClass(); + $joomla_component_action_log_config = new \stdClass(); $joomla_component_action_log_config->id = null; $joomla_component_action_log_config->type_title = 'JOOMLA_COMPONENT'; $joomla_component_action_log_config->type_alias = 'com_componentbuilder.joomla_component'; @@ -9499,10 +9680,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module action log config object. - $joomla_module_action_log_config = new stdClass(); + $joomla_module_action_log_config = new \stdClass(); $joomla_module_action_log_config->id = null; $joomla_module_action_log_config->type_title = 'JOOMLA_MODULE'; $joomla_module_action_log_config->type_alias = 'com_componentbuilder.joomla_module'; @@ -9533,10 +9714,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin action log config object. - $joomla_plugin_action_log_config = new stdClass(); + $joomla_plugin_action_log_config = new \stdClass(); $joomla_plugin_action_log_config->id = null; $joomla_plugin_action_log_config->type_title = 'JOOMLA_PLUGIN'; $joomla_plugin_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin'; @@ -9567,10 +9748,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the power action log config object. - $power_action_log_config = new stdClass(); + $power_action_log_config = new \stdClass(); $power_action_log_config->id = null; $power_action_log_config->type_title = 'POWER'; $power_action_log_config->type_alias = 'com_componentbuilder.power'; @@ -9601,10 +9782,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_view action log config object. - $admin_view_action_log_config = new stdClass(); + $admin_view_action_log_config = new \stdClass(); $admin_view_action_log_config->id = null; $admin_view_action_log_config->type_title = 'ADMIN_VIEW'; $admin_view_action_log_config->type_alias = 'com_componentbuilder.admin_view'; @@ -9635,10 +9816,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_admin_view action log config object. - $custom_admin_view_action_log_config = new stdClass(); + $custom_admin_view_action_log_config = new \stdClass(); $custom_admin_view_action_log_config->id = null; $custom_admin_view_action_log_config->type_title = 'CUSTOM_ADMIN_VIEW'; $custom_admin_view_action_log_config->type_alias = 'com_componentbuilder.custom_admin_view'; @@ -9669,10 +9850,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the site_view action log config object. - $site_view_action_log_config = new stdClass(); + $site_view_action_log_config = new \stdClass(); $site_view_action_log_config->id = null; $site_view_action_log_config->type_title = 'SITE_VIEW'; $site_view_action_log_config->type_alias = 'com_componentbuilder.site_view'; @@ -9703,10 +9884,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the template action log config object. - $template_action_log_config = new stdClass(); + $template_action_log_config = new \stdClass(); $template_action_log_config->id = null; $template_action_log_config->type_title = 'TEMPLATE'; $template_action_log_config->type_alias = 'com_componentbuilder.template'; @@ -9737,10 +9918,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the layout action log config object. - $layout_action_log_config = new stdClass(); + $layout_action_log_config = new \stdClass(); $layout_action_log_config->id = null; $layout_action_log_config->type_title = 'LAYOUT'; $layout_action_log_config->type_alias = 'com_componentbuilder.layout'; @@ -9771,10 +9952,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the dynamic_get action log config object. - $dynamic_get_action_log_config = new stdClass(); + $dynamic_get_action_log_config = new \stdClass(); $dynamic_get_action_log_config->id = null; $dynamic_get_action_log_config->type_title = 'DYNAMIC_GET'; $dynamic_get_action_log_config->type_alias = 'com_componentbuilder.dynamic_get'; @@ -9805,10 +9986,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the custom_code action log config object. - $custom_code_action_log_config = new stdClass(); + $custom_code_action_log_config = new \stdClass(); $custom_code_action_log_config->id = null; $custom_code_action_log_config->type_title = 'CUSTOM_CODE'; $custom_code_action_log_config->type_alias = 'com_componentbuilder.custom_code'; @@ -9839,10 +10020,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_property action log config object. - $class_property_action_log_config = new stdClass(); + $class_property_action_log_config = new \stdClass(); $class_property_action_log_config->id = null; $class_property_action_log_config->type_title = 'CLASS_PROPERTY'; $class_property_action_log_config->type_alias = 'com_componentbuilder.class_property'; @@ -9873,10 +10054,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_method action log config object. - $class_method_action_log_config = new stdClass(); + $class_method_action_log_config = new \stdClass(); $class_method_action_log_config->id = null; $class_method_action_log_config->type_title = 'CLASS_METHOD'; $class_method_action_log_config->type_alias = 'com_componentbuilder.class_method'; @@ -9907,10 +10088,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the placeholder action log config object. - $placeholder_action_log_config = new stdClass(); + $placeholder_action_log_config = new \stdClass(); $placeholder_action_log_config->id = null; $placeholder_action_log_config->type_title = 'PLACEHOLDER'; $placeholder_action_log_config->type_alias = 'com_componentbuilder.placeholder'; @@ -9941,10 +10122,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library action log config object. - $library_action_log_config = new stdClass(); + $library_action_log_config = new \stdClass(); $library_action_log_config->id = null; $library_action_log_config->type_title = 'LIBRARY'; $library_action_log_config->type_alias = 'com_componentbuilder.library'; @@ -9975,10 +10156,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet action log config object. - $snippet_action_log_config = new stdClass(); + $snippet_action_log_config = new \stdClass(); $snippet_action_log_config->id = null; $snippet_action_log_config->type_title = 'SNIPPET'; $snippet_action_log_config->type_alias = 'com_componentbuilder.snippet'; @@ -10009,10 +10190,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the validation_rule action log config object. - $validation_rule_action_log_config = new stdClass(); + $validation_rule_action_log_config = new \stdClass(); $validation_rule_action_log_config->id = null; $validation_rule_action_log_config->type_title = 'VALIDATION_RULE'; $validation_rule_action_log_config->type_alias = 'com_componentbuilder.validation_rule'; @@ -10043,10 +10224,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the field action log config object. - $field_action_log_config = new stdClass(); + $field_action_log_config = new \stdClass(); $field_action_log_config->id = null; $field_action_log_config->type_title = 'FIELD'; $field_action_log_config->type_alias = 'com_componentbuilder.field'; @@ -10077,10 +10258,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the fieldtype action log config object. - $fieldtype_action_log_config = new stdClass(); + $fieldtype_action_log_config = new \stdClass(); $fieldtype_action_log_config->id = null; $fieldtype_action_log_config->type_title = 'FIELDTYPE'; $fieldtype_action_log_config->type_alias = 'com_componentbuilder.fieldtype'; @@ -10111,10 +10292,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language_translation action log config object. - $language_translation_action_log_config = new stdClass(); + $language_translation_action_log_config = new \stdClass(); $language_translation_action_log_config->id = null; $language_translation_action_log_config->type_title = 'LANGUAGE_TRANSLATION'; $language_translation_action_log_config->type_alias = 'com_componentbuilder.language_translation'; @@ -10145,10 +10326,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the language action log config object. - $language_action_log_config = new stdClass(); + $language_action_log_config = new \stdClass(); $language_action_log_config->id = null; $language_action_log_config->type_title = 'LANGUAGE'; $language_action_log_config->type_alias = 'com_componentbuilder.language'; @@ -10179,10 +10360,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the server action log config object. - $server_action_log_config = new stdClass(); + $server_action_log_config = new \stdClass(); $server_action_log_config->id = null; $server_action_log_config->type_title = 'SERVER'; $server_action_log_config->type_alias = 'com_componentbuilder.server'; @@ -10213,10 +10394,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the help_document action log config object. - $help_document_action_log_config = new stdClass(); + $help_document_action_log_config = new \stdClass(); $help_document_action_log_config->id = null; $help_document_action_log_config->type_title = 'HELP_DOCUMENT'; $help_document_action_log_config->type_alias = 'com_componentbuilder.help_document'; @@ -10247,10 +10428,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields action log config object. - $admin_fields_action_log_config = new stdClass(); + $admin_fields_action_log_config = new \stdClass(); $admin_fields_action_log_config->id = null; $admin_fields_action_log_config->type_title = 'ADMIN_FIELDS'; $admin_fields_action_log_config->type_alias = 'com_componentbuilder.admin_fields'; @@ -10281,10 +10462,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_conditions action log config object. - $admin_fields_conditions_action_log_config = new stdClass(); + $admin_fields_conditions_action_log_config = new \stdClass(); $admin_fields_conditions_action_log_config->id = null; $admin_fields_conditions_action_log_config->type_title = 'ADMIN_FIELDS_CONDITIONS'; $admin_fields_conditions_action_log_config->type_alias = 'com_componentbuilder.admin_fields_conditions'; @@ -10315,10 +10496,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_fields_relations action log config object. - $admin_fields_relations_action_log_config = new stdClass(); + $admin_fields_relations_action_log_config = new \stdClass(); $admin_fields_relations_action_log_config->id = null; $admin_fields_relations_action_log_config->type_title = 'ADMIN_FIELDS_RELATIONS'; $admin_fields_relations_action_log_config->type_alias = 'com_componentbuilder.admin_fields_relations'; @@ -10349,10 +10530,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the admin_custom_tabs action log config object. - $admin_custom_tabs_action_log_config = new stdClass(); + $admin_custom_tabs_action_log_config = new \stdClass(); $admin_custom_tabs_action_log_config->id = null; $admin_custom_tabs_action_log_config->type_title = 'ADMIN_CUSTOM_TABS'; $admin_custom_tabs_action_log_config->type_alias = 'com_componentbuilder.admin_custom_tabs'; @@ -10383,10 +10564,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_admin_views action log config object. - $component_admin_views_action_log_config = new stdClass(); + $component_admin_views_action_log_config = new \stdClass(); $component_admin_views_action_log_config->id = null; $component_admin_views_action_log_config->type_title = 'COMPONENT_ADMIN_VIEWS'; $component_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_admin_views'; @@ -10417,10 +10598,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_site_views action log config object. - $component_site_views_action_log_config = new stdClass(); + $component_site_views_action_log_config = new \stdClass(); $component_site_views_action_log_config->id = null; $component_site_views_action_log_config->type_title = 'COMPONENT_SITE_VIEWS'; $component_site_views_action_log_config->type_alias = 'com_componentbuilder.component_site_views'; @@ -10451,10 +10632,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_views action log config object. - $component_custom_admin_views_action_log_config = new stdClass(); + $component_custom_admin_views_action_log_config = new \stdClass(); $component_custom_admin_views_action_log_config->id = null; $component_custom_admin_views_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_VIEWS'; $component_custom_admin_views_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_views'; @@ -10485,10 +10666,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_updates action log config object. - $component_updates_action_log_config = new stdClass(); + $component_updates_action_log_config = new \stdClass(); $component_updates_action_log_config->id = null; $component_updates_action_log_config->type_title = 'COMPONENT_UPDATES'; $component_updates_action_log_config->type_alias = 'com_componentbuilder.component_updates'; @@ -10519,10 +10700,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_mysql_tweaks action log config object. - $component_mysql_tweaks_action_log_config = new stdClass(); + $component_mysql_tweaks_action_log_config = new \stdClass(); $component_mysql_tweaks_action_log_config->id = null; $component_mysql_tweaks_action_log_config->type_title = 'COMPONENT_MYSQL_TWEAKS'; $component_mysql_tweaks_action_log_config->type_alias = 'com_componentbuilder.component_mysql_tweaks'; @@ -10553,10 +10734,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_custom_admin_menus action log config object. - $component_custom_admin_menus_action_log_config = new stdClass(); + $component_custom_admin_menus_action_log_config = new \stdClass(); $component_custom_admin_menus_action_log_config->id = null; $component_custom_admin_menus_action_log_config->type_title = 'COMPONENT_CUSTOM_ADMIN_MENUS'; $component_custom_admin_menus_action_log_config->type_alias = 'com_componentbuilder.component_custom_admin_menus'; @@ -10587,10 +10768,44 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); + } + // Create the component_router action log config object. + $component_router_action_log_config = new \stdClass(); + $component_router_action_log_config->id = null; + $component_router_action_log_config->type_title = 'COMPONENT_ROUTER'; + $component_router_action_log_config->type_alias = 'com_componentbuilder.component_router'; + $component_router_action_log_config->id_holder = 'id'; + $component_router_action_log_config->title_holder = 'joomla_component'; + $component_router_action_log_config->table_name = '#__componentbuilder_component_router'; + $component_router_action_log_config->text_prefix = 'COM_COMPONENTBUILDER'; + + // Check if component_router action log config is already in action_log_config DB. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('id'))); + $query->from($db->quoteName('#__action_log_config')); + $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($component_router_action_log_config->type_alias)); + $db->setQuery($query); + $db->execute(); + + // Set the object into the content types table. + if ($db->getNumRows()) + { + $component_router_action_log_config->id = $db->loadResult(); + $component_router_action_log_config_Updated = $db->updateObject('#__action_log_config', $component_router_action_log_config, 'id'); + } + else + { + $component_router_action_log_config_Inserted = $db->insertObject('#__action_log_config', $component_router_action_log_config); + } + + // Set db if not set already. + if (!isset($db)) + { + $db = Factory::getDbo(); } // Create the component_config action log config object. - $component_config_action_log_config = new stdClass(); + $component_config_action_log_config = new \stdClass(); $component_config_action_log_config->id = null; $component_config_action_log_config->type_title = 'COMPONENT_CONFIG'; $component_config_action_log_config->type_alias = 'com_componentbuilder.component_config'; @@ -10621,10 +10836,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_dashboard action log config object. - $component_dashboard_action_log_config = new stdClass(); + $component_dashboard_action_log_config = new \stdClass(); $component_dashboard_action_log_config->id = null; $component_dashboard_action_log_config->type_title = 'COMPONENT_DASHBOARD'; $component_dashboard_action_log_config->type_alias = 'com_componentbuilder.component_dashboard'; @@ -10655,10 +10870,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_files_folders action log config object. - $component_files_folders_action_log_config = new stdClass(); + $component_files_folders_action_log_config = new \stdClass(); $component_files_folders_action_log_config->id = null; $component_files_folders_action_log_config->type_title = 'COMPONENT_FILES_FOLDERS'; $component_files_folders_action_log_config->type_alias = 'com_componentbuilder.component_files_folders'; @@ -10689,10 +10904,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_placeholders action log config object. - $component_placeholders_action_log_config = new stdClass(); + $component_placeholders_action_log_config = new \stdClass(); $component_placeholders_action_log_config->id = null; $component_placeholders_action_log_config->type_title = 'COMPONENT_PLACEHOLDERS'; $component_placeholders_action_log_config->type_alias = 'com_componentbuilder.component_placeholders'; @@ -10723,10 +10938,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_plugins action log config object. - $component_plugins_action_log_config = new stdClass(); + $component_plugins_action_log_config = new \stdClass(); $component_plugins_action_log_config->id = null; $component_plugins_action_log_config->type_title = 'COMPONENT_PLUGINS'; $component_plugins_action_log_config->type_alias = 'com_componentbuilder.component_plugins'; @@ -10757,10 +10972,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the component_modules action log config object. - $component_modules_action_log_config = new stdClass(); + $component_modules_action_log_config = new \stdClass(); $component_modules_action_log_config->id = null; $component_modules_action_log_config->type_title = 'COMPONENT_MODULES'; $component_modules_action_log_config->type_alias = 'com_componentbuilder.component_modules'; @@ -10791,10 +11006,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the snippet_type action log config object. - $snippet_type_action_log_config = new stdClass(); + $snippet_type_action_log_config = new \stdClass(); $snippet_type_action_log_config->id = null; $snippet_type_action_log_config->type_title = 'SNIPPET_TYPE'; $snippet_type_action_log_config->type_alias = 'com_componentbuilder.snippet_type'; @@ -10825,10 +11040,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_config action log config object. - $library_config_action_log_config = new stdClass(); + $library_config_action_log_config = new \stdClass(); $library_config_action_log_config->id = null; $library_config_action_log_config->type_title = 'LIBRARY_CONFIG'; $library_config_action_log_config->type_alias = 'com_componentbuilder.library_config'; @@ -10859,10 +11074,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the library_files_folders_urls action log config object. - $library_files_folders_urls_action_log_config = new stdClass(); + $library_files_folders_urls_action_log_config = new \stdClass(); $library_files_folders_urls_action_log_config->id = null; $library_files_folders_urls_action_log_config->type_title = 'LIBRARY_FILES_FOLDERS_URLS'; $library_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.library_files_folders_urls'; @@ -10893,10 +11108,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the class_extends action log config object. - $class_extends_action_log_config = new stdClass(); + $class_extends_action_log_config = new \stdClass(); $class_extends_action_log_config->id = null; $class_extends_action_log_config->type_title = 'CLASS_EXTENDS'; $class_extends_action_log_config->type_alias = 'com_componentbuilder.class_extends'; @@ -10927,10 +11142,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_updates action log config object. - $joomla_module_updates_action_log_config = new stdClass(); + $joomla_module_updates_action_log_config = new \stdClass(); $joomla_module_updates_action_log_config->id = null; $joomla_module_updates_action_log_config->type_title = 'JOOMLA_MODULE_UPDATES'; $joomla_module_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_module_updates'; @@ -10961,10 +11176,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_module_files_folders_urls action log config object. - $joomla_module_files_folders_urls_action_log_config = new stdClass(); + $joomla_module_files_folders_urls_action_log_config = new \stdClass(); $joomla_module_files_folders_urls_action_log_config->id = null; $joomla_module_files_folders_urls_action_log_config->type_title = 'JOOMLA_MODULE_FILES_FOLDERS_URLS'; $joomla_module_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_module_files_folders_urls'; @@ -10995,10 +11210,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_group action log config object. - $joomla_plugin_group_action_log_config = new stdClass(); + $joomla_plugin_group_action_log_config = new \stdClass(); $joomla_plugin_group_action_log_config->id = null; $joomla_plugin_group_action_log_config->type_title = 'JOOMLA_PLUGIN_GROUP'; $joomla_plugin_group_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_group'; @@ -11029,10 +11244,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_updates action log config object. - $joomla_plugin_updates_action_log_config = new stdClass(); + $joomla_plugin_updates_action_log_config = new \stdClass(); $joomla_plugin_updates_action_log_config->id = null; $joomla_plugin_updates_action_log_config->type_title = 'JOOMLA_PLUGIN_UPDATES'; $joomla_plugin_updates_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_updates'; @@ -11063,10 +11278,10 @@ class com_componentbuilderInstallerScript // Set db if not set already. if (!isset($db)) { - $db = JFactory::getDbo(); + $db = Factory::getDbo(); } // Create the joomla_plugin_files_folders_urls action log config object. - $joomla_plugin_files_folders_urls_action_log_config = new stdClass(); + $joomla_plugin_files_folders_urls_action_log_config = new \stdClass(); $joomla_plugin_files_folders_urls_action_log_config->id = null; $joomla_plugin_files_folders_urls_action_log_config->type_title = 'JOOMLA_PLUGIN_FILES_FOLDERS_URLS'; $joomla_plugin_files_folders_urls_action_log_config->type_alias = 'com_componentbuilder.joomla_plugin_files_folders_urls'; @@ -11099,12 +11314,12 @@ class com_componentbuilderInstallerScript /** * Remove folders with files - * + * * @param string $dir The path to folder to remove * @param boolean $ignore The folders and files to ignore and not remove * * @return boolean True in all is removed - * + * */ protected function removeFolder($dir, $ignore = false) { @@ -11173,7 +11388,7 @@ class com_componentbuilderInstallerScript /** * Check if have an array with a length * - * @input array The array to check + * @input array The array to check * * @returns bool/int number of items in array on success */ @@ -11205,13 +11420,13 @@ class com_componentbuilderInstallerScript */ protected function setDynamicF0ld3rs($app, $parent) { - // get the instalation path + // get the installation path $installer = $parent->getParent(); $installPath = $installer->getPath('source'); // get all the folders $folders = Folder::folders($installPath); // check if we have folders we may want to copy - $doNotCopy = array('media','admin','site'); // Joomla already deals with these + $doNotCopy = ['media','admin','site']; // Joomla already deals with these if (count((array) $folders) > 1) { foreach ($folders as $folder) diff --git a/site/componentbuilder.php b/site/componentbuilder.php index d5fd77db9..7523dba04 100644 --- a/site/componentbuilder.php +++ b/site/componentbuilder.php @@ -19,8 +19,8 @@ if (file_exists($composer_autoloader)) require_once $composer_autoloader; } -// register this component namespace -spl_autoload_register(function ($class) { +// register additional namespace +\spl_autoload_register(function ($class) { // project-specific base directories and namespace prefix $search = [ 'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai', @@ -67,26 +67,28 @@ spl_autoload_register(function ($class) { } }); - +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\MVC\Controller\BaseController; // Set the component css/js -$document = JFactory::getDocument(); -$document->addStyleSheet('components/com_componentbuilder/assets/css/site.css'); -$document->addScript('components/com_componentbuilder/assets/js/site.js'); +Html::_('stylesheet', 'components/com_componentbuilder/assets/css/site.css', ['version' => 'auto']); +Html::_('script', 'components/com_componentbuilder/assets/js/site.js', ['version' => 'auto']); // Require helper files JLoader::register('ComponentbuilderHelper', __DIR__ . '/helpers/componentbuilder.php'); -JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php'); +\JLoader::register('ComponentbuilderEmail', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/componentbuilderemail.php'); JLoader::register('ComponentbuilderHelperRoute', __DIR__ . '/helpers/route.php'); -// Trigger the Global Site Event -ComponentbuilderHelper::globalEvent($document); +//Trigger the Global Site Event +ComponentbuilderHelper::globalEvent(Factory::getDocument()); // Get an instance of the controller prefixed by Componentbuilder -$controller = JControllerLegacy::getInstance('Componentbuilder'); +$controller = BaseController::getInstance('Componentbuilder'); // Perform the request task -$controller->execute(JFactory::getApplication()->input->get('task')); +$controller->execute(Factory::getApplication()->input->get('task')); // Redirect if set by the controller $controller->redirect(); diff --git a/site/controller.php b/site/controller.php index 90bb61f97..f4a4a6ea0 100644 --- a/site/controller.php +++ b/site/controller.php @@ -12,8 +12,13 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Router\Route; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Language\Text; +use VDM\Joomla\Utilities\StringHelper; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; /** * Componentbuilder Component Base Controller @@ -32,51 +37,51 @@ class ComponentbuilderController extends BaseController function display($cachable = false, $urlparams = false) { // set default view if not set - $view = $this->input->getCmd('view', ''); + $view = $this->input->getCmd('view', ''); $this->input->set('view', $view); - $isEdit = $this->checkEditView($view); - $layout = $this->input->get('layout', null, 'WORD'); - $id = $this->input->getInt('id'); - // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) - + $isEdit = $this->checkEditView($view); + $layout = $this->input->get('layout', null, 'WORD'); + $id = $this->input->getInt('id'); + // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238) + // insure that the view is not cashable if edit view or if user is logged in - $user = JFactory::getUser(); + $user = Factory::getUser(); if ($user->get('id') || $isEdit) { $cachable = false; } - + // Check for edit form. if($isEdit) { if ($layout == 'edit' && !$this->checkEditId('com_componentbuilder.edit.'.$view, $id)) { // Somehow the person just went to the form - we don't allow that. - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id)); $this->setMessage($this->getError(), 'error'); // check if item was opend from other then its own list view - $ref = $this->input->getCmd('ref', 0); - $refid = $this->input->getInt('refid', 0); + $ref = $this->input->getCmd('ref', 0); + $refid = $this->input->getInt('refid', 0); // set redirect - if ($refid > 0 && ComponentbuilderHelper::checkString($ref)) + if ($refid > 0 && StringHelper::check($ref)) { // redirect to item of ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false)); } - elseif (ComponentbuilderHelper::checkString($ref)) + elseif (StringHelper::check($ref)) { // redirect to ref - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view='.(string)$ref, false)); } else { // normal redirect back to the list default site view - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=', false)); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=', false)); } return false; } } - + // we may need to make this more dynamic in the future. (TODO) $safeurlparams = array( 'catid' => 'INT', @@ -97,9 +102,9 @@ class ComponentbuilderController extends BaseController 'Itemid' => 'INT'); // should these not merge? - if (ComponentbuilderHelper::checkArray($urlparams)) + if (UtilitiesArrayHelper::check($urlparams)) { - $safeurlparams = ComponentbuilderHelper::mergeArrays(array($urlparams, $safeurlparams)); + $safeurlparams = UtilitiesArrayHelper::merge(array($urlparams, $safeurlparams)); } return parent::display($cachable, $safeurlparams); @@ -107,7 +112,7 @@ class ComponentbuilderController extends BaseController protected function checkEditView($view) { - if (ComponentbuilderHelper::checkString($view)) + if (StringHelper::check($view)) { $views = array( diff --git a/site/controllers/api.php b/site/controllers/api.php index 02d3a67fe..384b220da 100644 --- a/site/controllers/api.php +++ b/site/controllers/api.php @@ -12,10 +12,16 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Controller\FormController; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; use Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Session\Session; +use Joomla\CMS\Uri\Uri; use VDM\Joomla\Utilities\ObjectHelper; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; use VDM\Joomla\Utilities\StringHelper; /** @@ -32,7 +38,7 @@ class ComponentbuilderControllerApi extends FormController */ protected $task; - public function __construct($config = array()) + public function __construct($config = []) { $this->view_list = ''; // safeguard for setting the return view listing to the default site view. parent::__construct($config); @@ -60,9 +66,9 @@ class ComponentbuilderControllerApi extends FormController public function translator() { // get params first - if (!isset($this->params) || !ComponentbuilderHelper::checkObject($this->params)) + if (!isset($this->params) || !ObjectHelper::check($this->params)) { - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = \JComponentHelper::getParams('com_componentbuilder'); } // get model $model = $this->getModel('api'); @@ -120,11 +126,11 @@ class ComponentbuilderControllerApi extends FormController echo 1; } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); // return bool echo 0; jexit(); @@ -140,7 +146,7 @@ class ComponentbuilderControllerApi extends FormController // get params first if (!isset($this->params) || !ObjectHelper::check($this->params)) { - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = \JComponentHelper::getParams('com_componentbuilder'); } // check if expansion is enabled $method = $this->params->get('development_method', 1); @@ -212,20 +218,20 @@ class ComponentbuilderControllerApi extends FormController echo 1; } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } // check if message is to be returned if (1== $returnOptionsBuild) { // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit('Access Denied!'); } } } // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); // check if message is to be returned if (1== $returnOptionsBuild) { @@ -244,7 +250,7 @@ class ComponentbuilderControllerApi extends FormController protected function getApiUser() { // return user object - return JFactory::getUser($this->params->get('api', 0, 'INT')); + return Factory::getUser($this->params->get('api', 0, 'INT')); } /** @@ -263,7 +269,7 @@ class ComponentbuilderControllerApi extends FormController // get params first if (!isset($this->params) || !ObjectHelper::check($this->params)) { - $this->params = JComponentHelper::getParams('com_componentbuilder'); + $this->params = ComponentHelper::getParams('com_componentbuilder'); } // Get the model $model = componentbuilderHelper::getModel('joomla_components', JPATH_ADMINISTRATOR . '/components/com_componentbuilder'); @@ -279,83 +285,83 @@ class ComponentbuilderControllerApi extends FormController // set auto loader ComponentbuilderHelper::autoLoader('smart'); // manual backup message - $backupNotice = array(); + $backupNotice = []; // get the data to export if (UtilitiesArrayHelper::check($pks) && $model->getSmartExport($pks)) { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY'); $backupNoticeStatus = 'Success'; // set the key string if (StringHelper::check($model->key) && strlen($model->key) == 32) { $textNotice = array(); - $keyNotice = '

' . JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '

'; - $keyNotice .= '

' . JText::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '

'; - $textNotice[] = JText::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key); + $keyNotice = '

' . Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE', $model->key) . '

'; + $keyNotice .= '

' . Text::_('COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY') . '

'; + $textNotice[] = Text::sprintf('COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S', $model->key); // set the package owner info if ((isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) || (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner']))) { - $ownerDetails = '

' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '

'; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); + $ownerDetails = '

' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS') . '

'; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); $ownerDetails .= '
    '; if (isset($model->info['getKeyFrom']['company']) && StringHelper::check($model->info['getKeyFrom']['company'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMCOMPANYEM_BSB', $model->info['getKeyFrom']['company']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_COMPANY_S', $model->info['getKeyFrom']['company']); } // add value only if set if (isset($model->info['getKeyFrom']['owner']) && StringHelper::check($model->info['getKeyFrom']['owner'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMOWNEREM_BSB', $model->info['getKeyFrom']['owner']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_OWNER_S', $model->info['getKeyFrom']['owner']); } // add value only if set if (isset($model->info['getKeyFrom']['website']) && StringHelper::check($model->info['getKeyFrom']['website'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMWEBSITEEM_BSB', $model->info['getKeyFrom']['website']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_WEBSITE_S', $model->info['getKeyFrom']['website']); } // add value only if set if (isset($model->info['getKeyFrom']['email']) && StringHelper::check($model->info['getKeyFrom']['email'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMEMAILEM_BSB', $model->info['getKeyFrom']['email']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_EMAIL_S', $model->info['getKeyFrom']['email']); } // add value only if set if (isset($model->info['getKeyFrom']['license']) && StringHelper::check($model->info['getKeyFrom']['license'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMLICENSEEM_BSB', $model->info['getKeyFrom']['license']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_LICENSE_S', $model->info['getKeyFrom']['license']); } // add value only if set if (isset($model->info['getKeyFrom']['copyright']) && StringHelper::check($model->info['getKeyFrom']['copyright'])) { - $ownerDetails .= '
  • ' . JText::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '
  • '; - $textNotice[] = '- ' . JText::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']); + $ownerDetails .= '
  • ' . Text::sprintf('COM_COMPONENTBUILDER_EMCOPYRIGHTEM_BSB', $model->info['getKeyFrom']['copyright']) . '
  • '; + $textNotice[] = '- ' . Text::sprintf('COM_COMPONENTBUILDER_COPYRIGHT_S', $model->info['getKeyFrom']['copyright']); } $ownerDetails .= '
'; - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET'); } else { - $ownerDetails = '

' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '

'; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); - $ownerDetails .= JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '
'; - $textNotice[] = JText::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); - $ownerDetails .= '

' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '

'; - $textNotice[] = '## ' . JText::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS'); - $ownerDetails .= JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '
'; - $textNotice[] = JText::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT'); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); + $ownerDetails = '

' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET') . '

'; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS'); + $ownerDetails .= Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE') . '
'; + $textNotice[] = Text::_('COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); + $ownerDetails .= '

' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS') . '

'; + $textNotice[] = '## ' . Text::_('COM_COMPONENTBUILDER_YOU_SHOULD_ADD_THE_CORRECT_OWNER_DETAILS'); + $ownerDetails .= Text::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB') . '
'; + $textNotice[] = Text::_('COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE'); } } else { - $keyNotice = '

' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '

'; - $textNotice[] = '# ' . JText::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY'); - $ownerDetails = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '
'; - $textNotice[] = JText::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); + $keyNotice = '

' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY') . '

'; + $textNotice[] = '# ' . Text::_('COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY'); + $ownerDetails = Text::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB') . '
'; + $textNotice[] = Text::_('COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY'); } // get email if ($email = $this->params->get('backup_email', null)) @@ -369,20 +375,20 @@ class ComponentbuilderControllerApi extends FormController // Build final massage. $message = $keyNotice . $ownerDetails . '
HASH: ' . $hashTracker . ''; // set the subject - $subject = JText::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY'); + $subject = Text::_('COM_COMPONENTBUILDER_JOOMLA_COMPONENT_BUILDER_BACKUP_KEY'); // email the message componentbuilderEmail::send($email, $subject, componentbuilderEmail::setTableBody($message, $subject), $plainText, 1); - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_EMAIL_WITH_THE_NEW_KEY_WAS_SENT'); } else { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_KEY_HAS_NOT_CHANGED'); } } } else { - $backupNotice[] = JText::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR'); + $backupNotice[] = Text::_('COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR'); $backupNoticeStatus = 'Error'; if (StringHelper::check($model->packagePath)) { @@ -392,7 +398,7 @@ class ComponentbuilderControllerApi extends FormController if (StringHelper::check($model->zipPath)) { // clear all if not successful - JFile::delete($model->zipPath); + File::delete($model->zipPath); } } // quite only if auto backup (adding this script from custom code :) @@ -400,21 +406,21 @@ class ComponentbuilderControllerApi extends FormController { echo "# " . $backupNoticeStatus . "\n" .implode("\n", $backupNotice); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("
", $backupNotice), $backupNoticeStatus); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), implode("
", $backupNotice), $backupNoticeStatus); return; } // quite only if auto backup (adding this script from custom code :) if ('backup' === $model->activeType) { - echo "# Error\n" . JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'); + echo "# Error\n" . Text::_('COM_COMPONENTBUILDER_ACCESS_DENIED'); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } - $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=joomla_components', false), JText::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); + $this->setRedirect(Route::_('index.php?option=com_componentbuilder&view=joomla_components', false), Text::_('COM_COMPONENTBUILDER_ACCESS_DENIED'), 'Error'); return; } @@ -427,7 +433,7 @@ class ComponentbuilderControllerApi extends FormController public function worker() { // get input values - $input = JFactory::getApplication()->input; + $input = Factory::getApplication()->input; // get DATA $DATA = $input->post->get('VDM_DATA', null, 'STRING'); // get TASK @@ -465,14 +471,14 @@ class ComponentbuilderControllerApi extends FormController // return locked values echo ComponentbuilderHelper::lock($model->messages); // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } elseif ($result) { echo 1; // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } } @@ -481,7 +487,7 @@ class ComponentbuilderControllerApi extends FormController // not success echo 0; // clear session - JFactory::getApplication()->getSession()->destroy(); + Factory::getApplication()->getSession()->destroy(); jexit(); } @@ -498,13 +504,13 @@ class ComponentbuilderControllerApi extends FormController * * @since 12.2 */ - protected function allowEdit($data = array(), $key = 'id') + protected function allowEdit($data = [], $key = 'id') { // to insure no other tampering return false; } - /** + /** * Method override to check if you can add a new record. * * @param array $data An array of input data. @@ -513,7 +519,7 @@ class ComponentbuilderControllerApi extends FormController * * @since 1.6 */ - protected function allowAdd($data = array()) + protected function allowAdd($data = []) { // to insure no other tampering return false; @@ -548,7 +554,7 @@ class ComponentbuilderControllerApi extends FormController * * @since 12.2 */ - protected function postSaveHook(JModelLegacy $model, $validData = array()) + protected function postSaveHook(JModelLegacy $model, $validData = []) { } } diff --git a/site/controllers/help.php b/site/controllers/help.php index 8beb6bb23..6fa11c5f9 100644 --- a/site/controllers/help.php +++ b/site/controllers/help.php @@ -12,7 +12,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; use Joomla\CMS\MVC\Controller\BaseController; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Session\Session; use Joomla\Utilities\ArrayHelper; /** @@ -29,12 +32,12 @@ class ComponentbuilderControllerHelp extends BaseController public function help() { - $user = JFactory::getUser(); - $jinput = JFactory::getApplication()->input; + $user = Factory::getUser(); + $jinput = Factory::getApplication()->input; // Check Token! - $token = JSession::getFormToken(); - $call_token = $jinput->get('token', 0, 'ALNUM'); - if($token == $call_token) + $token = Session::getFormToken(); + $call_token = $jinput->get('token', 0, 'ALNUM'); + if($user->id != 0 && ($jinput->get($token, 0, 'ALNUM') || $token === $call_token)) { $task = $this->getTask(); switch($task){ @@ -71,8 +74,8 @@ class ComponentbuilderControllerHelp extends BaseController protected function getHelpDocumentText($id) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true); + $db = Factory::getDbo(); + $query = $db->getQuery(true); $query->select(array('a.title','a.content')); $query->from('#__componentbuilder_help_document AS a'); $query->where('a.id = '.(int) $id); @@ -82,21 +85,21 @@ class ComponentbuilderControllerHelp extends BaseController $db->execute(); if($db->getNumRows()) { - $text = array(); + $text = []; $document = $db->loadObject(); // fix image issue - $images['src="images'] = 'src="'.JURI::root().'images'; - $images["src='images"] = "src='".JURI::root()."images"; - $images['src="/images'] = 'src="'.JURI::root().'images'; - $images["src='/images"] = "src='".JURI::root()."images"; + $images['src="images'] = 'src="'.Uri::root().'images'; + $images["src='images"] = "src='".Uri::root()."images"; + $images['src="/images'] = 'src="'.Uri::root().'images'; + $images["src='/images"] = "src='".Uri::root()."images"; // set document template $text[] = ""; $text[] = ''; $text[] = ""; $text[] = ''; $text[] = "".$document->title.""; - $text[] = ''; - $text[] = ''; + $text[] = ''; + $text[] = ''; $text[] = ""; $text[] = '
'; $text[] = '
'; diff --git a/site/helpers/categoryfield.php b/site/helpers/categoryfield.php index 1f1c5bbb2..0f4648101 100644 --- a/site/helpers/categoryfield.php +++ b/site/helpers/categoryfield.php @@ -23,7 +23,7 @@ class ComponentbuilderFieldCategories extends JCategories * @param array $options Array of options * */ - public function __construct($options = array()) + public function __construct($options = []) { $options['table'] = '#__componentbuilder_field'; $options['extension'] = 'com_componentbuilder.field'; diff --git a/site/helpers/categoryfieldtype.php b/site/helpers/categoryfieldtype.php index fc72564d9..59d4b8de1 100644 --- a/site/helpers/categoryfieldtype.php +++ b/site/helpers/categoryfieldtype.php @@ -23,7 +23,7 @@ class ComponentbuilderFieldtypeCategories extends JCategories * @param array $options Array of options * */ - public function __construct($options = array()) + public function __construct($options = []) { $options['table'] = '#__componentbuilder_fieldtype'; $options['extension'] = 'com_componentbuilder.fieldtype'; diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php index d645a8600..9fd0a482f 100644 --- a/site/helpers/componentbuilder.php +++ b/site/helpers/componentbuilder.php @@ -19,8 +19,8 @@ if (file_exists($composer_autoloader)) require_once $composer_autoloader; } -// register this component namespace -spl_autoload_register(function ($class) { +// register additional namespace +\spl_autoload_register(function ($class) { // project-specific base directories and namespace prefix $search = [ 'libraries/jcb_powers/VDM.Joomla.Openai' => 'VDM\\Joomla\\Openai', @@ -67,16 +67,26 @@ spl_autoload_register(function ($class) { } }); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Access\Access; +use Joomla\CMS\Access\Rules as AccessRules; +use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Language\Language; +use Joomla\CMS\MVC\Model\BaseDatabaseModel; +use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Table\Table; +use Joomla\CMS\Uri\Uri; +use Joomla\CMS\Version; use Joomla\Registry\Registry; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; -use VDM\Joomla\Utilities; use Joomla\Archive\Archive; use Joomla\CMS\Filesystem\Folder; use Joomla\CMS\Filesystem\Path; -use VDM\Joomla\Componentbuilder\Compiler\Factory; +use Joomla\CMS\Session\Session; +use VDM\Joomla\Openai\Factory as OpenaiFactory; use VDM\Joomla\Utilities\StringHelper as UtilitiesStringHelper; use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; @@ -84,8 +94,17 @@ use VDM\Joomla\Utilities\JsonHelper; use VDM\Joomla\Utilities\FileHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Componentbuilder\Compiler\Utilities\FieldHelper; +use VDM\Joomla\Componentbuilder\Compiler\Factory as CompilerFactory; use VDM\Joomla\Utilities\Base64Helper; use VDM\Joomla\FOF\Encrypt\AES; +use VDM\Joomla\Utilities\String\ClassfunctionHelper; +use VDM\Joomla\Utilities\String\FieldHelper as StringFieldHelper; +use VDM\Joomla\Utilities\String\TypeHelper; +use VDM\Joomla\Utilities\String\NamespaceHelper; +use VDM\Joomla\Utilities\MathHelper; +use VDM\Joomla\Utilities\String\PluginHelper; +use VDM\Joomla\Utilities\GuidHelper; +use VDM\Joomla\Utilities\Component\Helper; use VDM\Joomla\Utilities\FormHelper; /** @@ -93,24 +112,19 @@ use VDM\Joomla\Utilities\FormHelper; */ abstract class ComponentbuilderHelper { - /** - * Adding the utilities trait to this class - * - * @deprecated 4.0 - Check the trait methods for details, a legacy implementation - */ - use Utilities; - - /** - * get the Component Code Name - */ - public static $ComponentCodeName = 'componentbuilder'; - /** * Composer Switch - * + * * @var array */ - protected static $composer = array(); + protected static $composer = []; + + /** + * The Main Active Language + * + * @var string + */ + public static $langTag; /** * The Global Site Event Method. @@ -124,7 +138,7 @@ abstract class ComponentbuilderHelper /** * Just to Add the OPEN AI api to JCB (soon) - * Factory + * OpenaiFactory **/ /** @@ -245,9 +259,9 @@ abstract class ComponentbuilderHelper if ('property' === $type || 'method' === $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Get user object - $user = JFactory::getUser(); + $user = Factory::getUser(); // Create a new query object. $query = $db->getQuery(true); // get method @@ -651,7 +665,7 @@ abstract class ComponentbuilderHelper if ('property' === $table || 'method' === $table) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); // get method @@ -837,7 +851,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // get the global company details if (!UtilitiesArrayHelper::check(self::$localCompany)) @@ -865,7 +879,7 @@ abstract class ComponentbuilderHelper // get the library files, folders, and urls $files = array(); // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('b.name','a.addurls','a.addfolders','a.addfiles'))); @@ -917,13 +931,13 @@ abstract class ComponentbuilderHelper if (isset($url['path'])) { // load document script - $files[md5($url['path'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LOCAL'); + $files[md5($url['path'])] = '(' . Text::_('URL') . ') ' . basename($url['url']) . ' - ' . Text::_('COM_COMPONENTBUILDER_LOCAL'); } // check if link must be added if (isset($url['url']) && ((isset($url['type']) && $url['type'] == 1) || (isset($url['type']) && $url['type'] == 3) || !isset($url['type']))) { // load url also if not building document - $files[md5($url['url'])] = '(' . JText::_('URL') . ') ' . basename($url['url']) . ' - ' . JText::_('COM_COMPONENTBUILDER_LINK'); + $files[md5($url['url'])] = '(' . Text::_('URL') . ') ' . basename($url['url']) . ' - ' . Text::_('COM_COMPONENTBUILDER_LINK'); } } } @@ -947,12 +961,12 @@ abstract class ComponentbuilderHelper if (isset($pathInfo['extension']) && $pathInfo['extension']) { // load document script - $files[md5($path)] = '(' . JText::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; + $files[md5($path)] = '(' . Text::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; } else { // load document script - $files[md5($path.'/'.trim($file['file'],'/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; + $files[md5($path.'/'.trim($file['file'],'/'))] = '(' . Text::_('COM_COMPONENTBUILDER_FILE') . ') ' . $file['file']; } } } @@ -969,7 +983,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // reset bucket $bucket = array(); @@ -1007,7 +1021,7 @@ abstract class ComponentbuilderHelper // load per path foreach($paths as $path) { - $files[md5($root.'/'.trim($path, '/'))] = '(' . JText::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path) . ' - ' . basename($root); + $files[md5($root.'/'.trim($path, '/'))] = '(' . Text::_('COM_COMPONENTBUILDER_FOLDER') . ') ' . basename($path) . ' - ' . basename($root); } } } @@ -1062,7 +1076,7 @@ abstract class ComponentbuilderHelper public static function getComponentIDs() { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('id'))); @@ -1106,15 +1120,6 @@ abstract class ComponentbuilderHelper jimport('joomla.application'); } - /** - * The dynamic builder of views, tables and fields - **/ - public static function dynamicBuilder(&$data, $type) - { - self::autoLoader('extrusion'); - $extruder = new Extrusion($data); - } - /* * Convert repeatable field to subform * @@ -1204,7 +1209,7 @@ abstract class ComponentbuilderHelper $target = trim($_table) . '.' . trim($_key) . '.' . trim($_value); if (!isset(self::$globalUpdater[$target])) { - self::$globalUpdater[$target] = new stdClass; + self::$globalUpdater[$target] = new \stdClass; self::$globalUpdater[$target]->{$_key} = (int) $_value; } // load the new subform values to global updater @@ -1239,7 +1244,7 @@ abstract class ComponentbuilderHelper if (UtilitiesArrayHelper::check(self::$globalUpdater)) { // get the database object - $db = JFactory::getDbo(); + $db = Factory::getDbo(); foreach (self::$globalUpdater as $tableKeyID => $object) { // get the table @@ -1269,7 +1274,7 @@ abstract class ComponentbuilderHelper { // get the model $model = self::getModel($type); - $app = \JFactory::getApplication(); + $app = Factory::getApplication(); // get item if ($item = $model->getItem($id)) { @@ -1451,14 +1456,14 @@ abstract class ComponentbuilderHelper public static function getPackageOwnerDetailsDisplay(&$info, $trust = false) { $hasOwner = false; - $ownerDetails = ''; + $ownerDetails = ''; $ownerDetails .= '
'; // load the list items foreach (self::$pkOwnerSearch as $key => $dd) { if ($value = self::getPackageOwnerValue($key, $info)) { - $ownerDetails .= JText::sprintf($dd, $value); + $ownerDetails .= Text::sprintf($dd, $value); // check if we have a owner/source name if (('owner' === $key || 'company' === $key) && !$hasOwner) { @@ -1473,7 +1478,7 @@ abstract class ComponentbuilderHelper if ($hasOwner && isset($info['getKeyFrom']['buy_link']) && UtilitiesStringHelper::check($info['getKeyFrom']['buy_link'])) { $ownerDetails .= '
'; - $ownerDetails .= JText::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA', 'class="btn btn-primary" href="'.$info['getKeyFrom']['buy_link'].'" target="_blank" title="get a key from '.$owner.'"', $owner); + $ownerDetails .= Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA', 'class="btn btn-primary" href="'.$info['getKeyFrom']['buy_link'].'" target="_blank" title="get a key from '.$owner.'"', $owner); } // add more custom links elseif ($hasOwner && isset($info['getKeyFrom']['buy_links']) && UtilitiesArrayHelper::check($info['getKeyFrom']['buy_links'])) @@ -1481,7 +1486,7 @@ abstract class ComponentbuilderHelper $buttons = array(); foreach ($info['getKeyFrom']['buy_links'] as $keyName => $link) { - $buttons[] = JText::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA', $owner, 'class="btn btn-primary" href="'.$link.'" target="_blank" title="get a key from '.$owner.'"', $keyName); + $buttons[] = Text::sprintf('COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA', $owner, 'class="btn btn-primary" href="'.$link.'" target="_blank" title="get a key from '.$owner.'"', $keyName); } $ownerDetails .= '
'; $ownerDetails .= implode('
', $buttons); @@ -1489,10 +1494,10 @@ abstract class ComponentbuilderHelper // return the owner details if (!$hasOwner) { - $ownerDetails = '

' . JText::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '

'; + $ownerDetails = '

' . Text::_('COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND') . '

'; if (!$trust) { - $ownerDetails .= '

' . JText::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '

'; + $ownerDetails .= '

' . Text::_('COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE') . '

'; } } return '
'.$ownerDetails.'
'; @@ -1574,11 +1579,11 @@ abstract class ComponentbuilderHelper $display[] = $name; if ($needKey) { - $display[] = ' - ' . JText::sprintf('COM_COMPONENTBUILDER_PAIDLOCKED') . ''; + $display[] = ' - ' . Text::sprintf('COM_COMPONENTBUILDER_PAIDLOCKED') . ''; } else { - $display[] = ' - ' . JText::sprintf('COM_COMPONENTBUILDER_FREEOPEN') . ''; + $display[] = ' - ' . Text::sprintf('COM_COMPONENTBUILDER_FREEOPEN') . ''; } $display[] = '

'; $display[] = $info['short_description'][$key]; @@ -1589,7 +1594,7 @@ abstract class ComponentbuilderHelper { if (isset($info[$li]) && isset($info[$li][$key])) { - $display[] = '
  • '.JText::sprintf($value, $info[$li][$key]).'
  • '; + $display[] = '
  • '.Text::sprintf($value, $info[$li][$key]).'
  • '; } } $display[] = ''; @@ -1603,7 +1608,7 @@ abstract class ComponentbuilderHelper { if (isset($info[$other]) && isset($info[$other][$key])) { - $display[] = JText::sprintf($value, $info[$other][$key]); + $display[] = Text::sprintf($value, $info[$other][$key]); } } $display[] = '

    '; @@ -1617,7 +1622,7 @@ abstract class ComponentbuilderHelper } return implode("\n",$display); } - return '
    '.JText::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
    '; + return '
    '.Text::_('COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE').'
    '; } /** @@ -1626,7 +1631,7 @@ abstract class ComponentbuilderHelper public static function getDbTableColumns($tableName, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // get the columns $columns = $db->getTableColumns("#__" . $tableName); // set the type (multi or single) @@ -1654,7 +1659,7 @@ abstract class ComponentbuilderHelper public static function getViewTableColumns($admin_view, $as, $type) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1734,7 +1739,7 @@ abstract class ComponentbuilderHelper public static function getFieldNameAndType($id, $spacers = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -1802,7 +1807,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE_IN_THE_COMPILER'), 'status' => 'danger'); } return false; @@ -1815,7 +1820,7 @@ abstract class ComponentbuilderHelper if (!$bool) { return array ( - 'message' => JText::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), + 'message' => Text::_('COM_COMPONENTBUILDER_SORRY_THIS_PLACEHOLDER_IS_ALREADY_IN_USE'), 'status' => 'danger'); } return false; @@ -1825,7 +1830,7 @@ abstract class ComponentbuilderHelper { return array ( 'name' => $name, - 'message' => JText::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), + 'message' => Text::_('COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK'), 'status' => 'success'); } return true; @@ -1857,7 +1862,7 @@ abstract class ComponentbuilderHelper protected static function getPlaceholderTarget($id, $name) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('id', 'target'))); @@ -1886,7 +1891,7 @@ abstract class ComponentbuilderHelper if (!isset(self::$exPowers[$id])) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array('a.id'))); @@ -2144,7 +2149,7 @@ abstract class ComponentbuilderHelper } } // return found content - return str_replace('[[[ROOT-URL]]]', JURI::root(), $target['html']); + return str_replace('[[[ROOT-URL]]]', Uri::root(), $target['html']); } } return $default; @@ -2203,7 +2208,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set the defaults self::setSessionDefaults(); @@ -2216,7 +2221,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // set to local memory to speed up program self::$localSession[$key] = $value; @@ -2231,7 +2236,7 @@ abstract class ComponentbuilderHelper { if (!isset(self::$session) || !ObjectHelper::check(self::$session)) { - self::$session = JFactory::getSession(); + self::$session = Factory::getSession(); } // check if in local memory if (!isset(self::$localSession[$key])) @@ -2252,7 +2257,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypeProperties($value, $type, $settings = array(), $xml = null, $dbDefaults = false) { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2294,7 +2299,7 @@ abstract class ComponentbuilderHelper // value to check since there are false and null values even 0 in the values returned $confirmation = '8qvZHoyuFYQqpj0YQbc6F3o5DhBlmS-_-a8pmCZfOVSfANjkmV5LG8pCdAY2JNYu6cB'; // set the headers - $field['values_description'] .= '' . JText::_('COM_COMPONENTBUILDER_PROPERTY') . '' . JText::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . JText::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; + $field['values_description'] .= '' . Text::_('COM_COMPONENTBUILDER_PROPERTY') . '' . Text::_('COM_COMPONENTBUILDER_EXAMPLE') . '' . Text::_('COM_COMPONENTBUILDER_DESCRIPTION') . ''; foreach ($properties as $property) { $example = (isset($property['example']) && UtilitiesStringHelper::check($property['example'])) ? $property['example'] : ''; @@ -2425,7 +2430,7 @@ abstract class ComponentbuilderHelper public static function getFieldTypesProperties($targets = array(), $filter = array(), $exclude = array(), $type = 'id', $operator = 'IN') { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -2659,7 +2664,7 @@ abstract class ComponentbuilderHelper if (isset($errorMessage['error']) && UtilitiesStringHelper::check($errorMessage['error'])) { // set the error in the application - JFactory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); + Factory::getApplication()->enqueueMessage($errorMessage['error'], 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $errorMessage['error']; } @@ -2668,9 +2673,9 @@ abstract class ComponentbuilderHelper elseif (UtilitiesStringHelper::check($target)) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $target); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2679,9 +2684,9 @@ abstract class ComponentbuilderHelper elseif ('nomemory' !== $type) { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_S_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2690,9 +2695,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DID_NOT_RETURN_VALID_DATA', $url, $type); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2702,9 +2707,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_RETURN_ANY_DATA', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2714,9 +2719,9 @@ abstract class ComponentbuilderHelper else { // setup error string - $error = JText::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); + $error = Text::sprintf('COM_COMPONENTBUILDER_THE_URL_S_SET_TO_RETRIEVE_THE_PACKAGES_DOES_NOT_EXIST', $url); // set the error in the application - JFactory::getApplication()->enqueueMessage($error, 'Error'); + Factory::getApplication()->enqueueMessage($error, 'Error'); // set the error also in the class encase it is and Ajax call self::$githubRepoDataErrors[] = $error; // we are done here @@ -2764,7 +2769,7 @@ abstract class ComponentbuilderHelper $type = 'data'; } // add little more help if it is an access token issue - $errorMessage = JText::sprintf('COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S', $errorMessage, $type); + $errorMessage = Text::sprintf('COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S', $errorMessage, $type); } // set error notice $message['error'] = $errorMessage; @@ -2791,7 +2796,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } self::$gitHubAccessToken = self::$params->get('github_access_token', null); } @@ -2854,7 +2859,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "// Include helper submenu"; $script['display'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::addSubmenu('import');"; $script['display'][] = self::_t(2) . "}"; - $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new stdClass;"; + $script['display'][] = PHP_EOL . self::_t(2) . "\$paths = new \stdClass;"; $script['display'][] = self::_t(2) . "\$paths->first = '';"; $script['display'][] = self::_t(2) . "\$state = \$this->get('state');"; $script['display'][] = PHP_EOL . self::_t(2) . "\$this->paths = &\$paths;"; @@ -2868,7 +2873,7 @@ abstract class ComponentbuilderHelper $script['display'][] = self::_t(3) . "\$this->sidebar = JHtmlSidebar::render();"; $script['display'][] = self::_t(2) . "}"; $script['display'][] = PHP_EOL . self::_t(2) . "// get the session object"; - $script['display'][] = self::_t(2) . "\$session = JFactory::getSession();"; + $script['display'][] = self::_t(2) . "\$session = Factory::getSession();"; $script['display'][] = self::_t(2) . "// check if it has package"; $script['display'][] = self::_t(2) . "\$this->hasPackage" . self::_t(1) . "= \$session->get('hasPackage', false);"; $script['display'][] = self::_t(2) . "\$this->dataType" . self::_t(1) . "= \$session->get('dataType', false);"; @@ -2901,11 +2906,11 @@ abstract class ComponentbuilderHelper $script['setdata'][] = self::_t(1) . "**/"; $script['setdata'][] = self::_t(1) . "protected function setData(\$package,\$table,\$target_headers)"; $script['setdata'][] = self::_t(1) . "{"; - $script['setdata'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$target_headers))"; + $script['setdata'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$target_headers))"; $script['setdata'][] = self::_t(2) . "{"; $script['setdata'][] = self::_t(3) . "// make sure the file is loaded"; $script['setdata'][] = self::_t(3) . "[[[-#-#-Component]]]Helper::composerAutoload('phpspreadsheet');"; - $script['setdata'][] = self::_t(3) . "\$jinput = JFactory::getApplication()->input;"; + $script['setdata'][] = self::_t(3) . "\$jinput = Factory::getApplication()->input;"; $script['setdata'][] = self::_t(3) . "foreach(\$target_headers as \$header)"; $script['setdata'][] = self::_t(3) . "{"; $script['setdata'][] = self::_t(4) . "if ((\$column = \$jinput->getString(\$header, false)) !== false ||"; @@ -2945,16 +2950,16 @@ abstract class ComponentbuilderHelper $script['headers'][] = self::_t(1) . "public function getExImPortHeaders()"; $script['headers'][] = self::_t(1) . "{"; $script['headers'][] = self::_t(2) . "// Get a db connection."; - $script['headers'][] = self::_t(2) . "\$db = JFactory::getDbo();"; + $script['headers'][] = self::_t(2) . "\$db = Factory::getDbo();"; $script['headers'][] = self::_t(2) . "// get the columns"; $script['headers'][] = self::_t(2) . "\$columns = \$db->getTableColumns(\"#__[[[-#-#-component]]]_[[[-#-#-view]]]\");"; - $script['headers'][] = self::_t(2) . "if ([[[-#-#-Component]]]Helper::checkArray(\$columns))"; + $script['headers'][] = self::_t(2) . "if (Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$columns))"; $script['headers'][] = self::_t(2) . "{"; $script['headers'][] = self::_t(3) . "// remove the headers you don't import/export."; $script['headers'][] = self::_t(3) . "unset(\$columns['asset_id']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out']);"; $script['headers'][] = self::_t(3) . "unset(\$columns['checked_out_time']);"; - $script['headers'][] = self::_t(3) . "\$headers = new stdClass();"; + $script['headers'][] = self::_t(3) . "\$headers = new \stdClass();"; $script['headers'][] = self::_t(3) . "foreach (\$columns as \$column => \$type)"; $script['headers'][] = self::_t(3) . "{"; $script['headers'][] = self::_t(4) . "\$headers->{\$column} = \$column;"; @@ -2978,10 +2983,10 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(1) . "protected function save(\$data,\$table)"; $script['save'][] = self::_t(1) . "{"; $script['save'][] = self::_t(2) . "// import the data if there is any"; - $script['save'][] = self::_t(2) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']))"; + $script['save'][] = self::_t(2) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']))"; $script['save'][] = self::_t(2) . "{"; $script['save'][] = self::_t(3) . "// get user object"; - $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= JFactory::getUser();"; + $script['save'][] = self::_t(3) . "\$user" . self::_t(2) . "= Factory::getUser();"; $script['save'][] = self::_t(3) . "// remove header if it has headers"; $script['save'][] = self::_t(3) . "\$id_key" . self::_t(1) . "= \$data['target_headers']['id'];"; $script['save'][] = self::_t(3) . "\$published_key" . self::_t(1) . "= \$data['target_headers']['published'];"; @@ -2996,14 +3001,14 @@ abstract class ComponentbuilderHelper $script['save'][] = self::_t(3) . "}"; $script['save'][] = self::_t(3) . ""; $script['save'][] = self::_t(3) . "// make sure there is still values in array and that it was not only headers"; - $script['save'][] = self::_t(3) . "if([[[-#-#-Component]]]Helper::checkArray(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; + $script['save'][] = self::_t(3) . "if(Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$data['array']) && \$user->authorise(\$table.'.import', 'com_[[[-#-#-component]]]') && \$user->authorise('core.import', 'com_[[[-#-#-component]]]'))"; $script['save'][] = self::_t(3) . "{"; $script['save'][] = self::_t(4) . "// set target."; $script['save'][] = self::_t(4) . "\$target" . self::_t(1) . "= array_flip(\$data['target_headers']);"; $script['save'][] = self::_t(4) . "// Get a db connection."; - $script['save'][] = self::_t(4) . "\$db = JFactory::getDbo();"; + $script['save'][] = self::_t(4) . "\$db = Factory::getDbo();"; $script['save'][] = self::_t(4) . "// set some defaults"; - $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= JFactory::getDate()->toSql();"; + $script['save'][] = self::_t(4) . "\$todayDate" . self::_t(2) . "= Factory::getDate()->toSql();"; $script['save'][] = self::_t(4) . "// get global action permissions"; $script['save'][] = self::_t(4) . "\$canDo" . self::_t(3) . "= [[[-#-#-Component]]]Helper::getActions(\$table);"; $script['save'][] = self::_t(4) . "\$canEdit" . self::_t(2) . "= \$canDo->get('core.edit');"; @@ -3191,7 +3196,7 @@ abstract class ComponentbuilderHelper { $script['view'] = array(); $script['view'][] = ""; $script['view'][] = ""; $script['view'][] = PHP_EOL . "
    "; - $script['view'][] = "
    \" method=\"post\" name=\"adminForm\" id=\"adminForm\" class=\"form-horizontal form-validate\">"; + $script['view'][] = "\" method=\"post\" name=\"adminForm\" id=\"adminForm\" class=\"form-horizontal form-validate\">"; $script['view'][] = ""; $script['view'][] = PHP_EOL . self::_t(1) . "sidebar)) : ?>"; $script['view'][] = self::_t(2) . "
    "; @@ -3305,7 +3310,7 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(2) . "
    "; $script['view'][] = self::_t(1) . ""; $script['view'][] = ""; - $script['view'][] = PHP_EOL . self::_t(1) . "hasPackage && [[[-#-#-Component]]]Helper::checkArray(\$this->headerList) && [[[-#-#-Component]]]Helper::checkArray(\$this->headers)) : ?>"; + $script['view'][] = PHP_EOL . self::_t(1) . "hasPackage && Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$this->headerList) && Super-#-#-___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check(\$this->headers)) : ?>"; $script['view'][] = self::_t(2) . "
    "; $script['view'][] = self::_t(3) . ""; $script['view'][] = self::_t(3) . "
    "; @@ -3335,9 +3340,9 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(2) . "
    "; $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(1) . ""; - $script['view'][] = self::_t(2) . " 'upload')); ?>"; + $script['view'][] = self::_t(2) . " 'upload')); ?>"; $script['view'][] = self::_t(2) . ""; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(3) . "
    "; $script['view'][] = self::_t(4) . ""; $script['view'][] = self::_t(4) . "
    "; @@ -3350,9 +3355,9 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(5) . "\" onclick=\"Joomla.submitbutton()\" />    (.csv .xls .ods)"; $script['view'][] = self::_t(4) . "
    "; $script['view'][] = self::_t(3) . "
    "; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(2) . ""; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(3) . "
    "; $script['view'][] = self::_t(4) . ""; $script['view'][] = self::_t(4) . "
    "; @@ -3365,9 +3370,9 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(5) . "\" onclick=\"Joomla.submitbutton3()\" />    (.csv .xls .ods)"; $script['view'][] = self::_t(4) . "
    "; $script['view'][] = self::_t(4) . "
    "; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = ""; - $script['view'][] = PHP_EOL . self::_t(2) . ""; + $script['view'][] = PHP_EOL . self::_t(2) . ""; $script['view'][] = self::_t(3) . "
    "; $script['view'][] = self::_t(4) . ""; $script['view'][] = self::_t(4) . "
    "; @@ -3380,12 +3385,12 @@ abstract class ComponentbuilderHelper $script['view'][] = self::_t(5) . "\" onclick=\"Joomla.submitbutton4()\" />    (.csv .xls .ods)"; $script['view'][] = self::_t(4) . "
    "; $script['view'][] = self::_t(3) . "
    "; - $script['view'][] = self::_t(2) . ""; - $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; + $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(2) . ""; $script['view'][] = self::_t(1) . ""; $script['view'][] = self::_t(1) . ""; - $script['view'][] = self::_t(1) . ""; + $script['view'][] = self::_t(1) . ""; $script['view'][] = ""; $script['view'][] = "
    "; } @@ -3401,8 +3406,8 @@ abstract class ComponentbuilderHelper $script['import'][] = self::_t(1) . "public function import()"; $script['import'][] = self::_t(1) . "{"; $script['import'][] = self::_t(2) . "\$this->setState('action', 'import');"; - $script['import'][] = self::_t(2) . "\$app" . self::_t(2) . "= JFactory::getApplication();"; - $script['import'][] = self::_t(2) . "\$session" . self::_t(1) . "= JFactory::getSession();"; + $script['import'][] = self::_t(2) . "\$app" . self::_t(2) . "= Factory::getApplication();"; + $script['import'][] = self::_t(2) . "\$session" . self::_t(1) . "= Factory::getSession();"; $script['import'][] = self::_t(2) . "\$package" . self::_t(1) . "= null;"; $script['import'][] = self::_t(2) . "\$continue" . self::_t(1) . "= false;"; $script['import'][] = self::_t(2) . "// get import type"; @@ -3590,44 +3595,44 @@ abstract class ComponentbuilderHelper * @param boolean $option The field grouping * * @return boolean if the field was found - * @deprecated 3.3 Use Factory::_('Field.Groups')->check($type, $option); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->check($type, $option); */ public static function fieldCheck($type, $option = 'default') { - return Factory::_('Field.Groups')->check($type, $option); + return CompilerFactory::_('Field.Groups')->check($type, $option); } /** * get the field types id -> name of a group or groups * * @return array ids of the spacer field types - * @deprecated 3.3 Use Factory::_('Field.Groups')->types($groups); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->types($groups); */ public static function getFieldTypesByGroup($groups = array()) { - return Factory::_('Field.Groups')->types($groups); + return CompilerFactory::_('Field.Groups')->types($groups); } /** * get the field types IDs of a group or groups * * @return array ids of the spacer field types - * @deprecated 3.3 Use Factory::_('Field.Groups')->typesIds($groups); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->typesIds($groups); */ public static function getFieldTypesIdsByGroup($groups = array()) { - return Factory::_('Field.Groups')->typesIds($groups); + return CompilerFactory::_('Field.Groups')->typesIds($groups); } /** * get the spacer IDs * * @return array ids of the spacer field types - * @deprecated 3.3 Use Factory::_('Field.Groups')->spacerIds(); + * @deprecated 3.3 Use CompilerFactory::_('Field.Groups')->spacerIds(); */ public static function getSpacerIds() { - return Factory::_('Field.Groups')->spacerIds(); + return CompilerFactory::_('Field.Groups')->spacerIds(); } @@ -3697,7 +3702,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } $folderPath = self::$params->get($target, $default); // create the folder if it does not exist @@ -3711,10 +3716,10 @@ abstract class ComponentbuilderHelper if (strpos($folderPath, JPATH_SITE) !== false) { $folderPath = trim( str_replace( JPATH_SITE, '', $folderPath), '/'); - return JURI::root() . $folderPath . '/'; + return Uri::root() . $folderPath . '/'; } // since the path is behind the root folder of the site, return only the root url (may be used to build the link) - return JURI::root(); + return Uri::root(); } // sanitize the path return '/' . trim( $folderPath, '/' ) . '/'; @@ -3769,7 +3774,7 @@ abstract class ComponentbuilderHelper if (!class_exists($CLASS)) { // class not in place so send out error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', $CLASS), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESPHPSECLIBVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', $CLASS), 'Error'); return false; } // does this crypt class use mode @@ -3806,7 +3811,7 @@ abstract class ComponentbuilderHelper break; default: // No valid mode has been specified - JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_NO_VALID_MODE_HAS_BEEN_SPECIFIED'), 'Error'); + Factory::getApplication()->enqueueMessage(Text::_('COM_COMPONENTBUILDER_NO_VALID_MODE_HAS_BEEN_SPECIFIED'), 'Error'); return false; break; } @@ -3842,7 +3847,7 @@ abstract class ComponentbuilderHelper // now move the file if (!$server->store($localPath, $fileName)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER', $fileName, $server->jcb_remote_server_name[(int) $serverID]), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_SERVER', $fileName, $server->jcb_remote_server_name[(int) $serverID]), 'Error'); return false; } // close the connection @@ -3856,7 +3861,7 @@ abstract class ComponentbuilderHelper // now move the file if (!$server->put($remote_path, FileHelper::getContent($localPath, null))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER', $fileName, $server->jcb_remote_server_path[(int) $serverID], $server->jcb_remote_server_name[(int) $serverID]), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_BSB_FILE_COULD_NOT_BE_MOVED_TO_BSB_PATH_ON_BSB_SERVER', $fileName, $server->jcb_remote_server_path[(int) $serverID], $server->jcb_remote_server_name[(int) $serverID]), 'Error'); return false; } } @@ -3926,7 +3931,7 @@ abstract class ComponentbuilderHelper if (!class_exists('\phpseclib\Net\SFTP')) { // class not in place so send out error - JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error'); + Factory::getApplication()->enqueueMessage(Text::_('COM_COMPONENTBUILDER_THE_BPHPSECLIBNETSFTPB_LIBRARYCLASS_IS_NOT_AVAILABLE_THIS_LIBRARYCLASS_SHOULD_HAVE_BEEN_ADDED_TO_YOUR_BLIBRARIESVDM_IOVENDORB_FOLDER_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO'), 'Error'); return false; } // insure the port is set @@ -3941,7 +3946,7 @@ abstract class ComponentbuilderHelper case 1: // password if (!self::$sftp[$server->cache]->login($server->username, $server->password)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -3957,14 +3962,14 @@ abstract class ComponentbuilderHelper // now load the key file if (!self::crypt('RSA')->loadKey(FileHelper::getContent($server->private, null))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -3981,14 +3986,14 @@ abstract class ComponentbuilderHelper // now load the key file if (!self::crypt('RSA')->loadKey(FileHelper::getContent($server->private, null))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FILE_COULD_NOT_BE_LOADEDFOUND_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -4005,14 +4010,14 @@ abstract class ComponentbuilderHelper // now load the key field if (!self::crypt('RSA')->loadKey($server->private_key)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -4029,14 +4034,14 @@ abstract class ComponentbuilderHelper // now load the key file if (!self::crypt('RSA')->loadKey($server->private_key)) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_PRIVATE_KEY_FIELD_COULD_NOT_BE_LOADED_FOR_BSB_SERVER', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } // now login if (!self::$sftp[$server->cache]->login($server->username, $server->password, self::crypt('RSA'))) { - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_LOGIN_TO_BSB_HAS_FAILED_PLEASE_CHECK_THAT_YOUR_DETAILS_ARE_CORRECT', $server->name), 'Error'); unset(self::$sftp[$server->cache]); return false; } @@ -4127,7 +4132,7 @@ abstract class ComponentbuilderHelper else { // load error to indicate signature was in error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_FTP_SIGNATURE_FOR_BSB_WAS_NOT_WELL_FORMED_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); return false; } // check if we are connected @@ -4149,7 +4154,7 @@ abstract class ComponentbuilderHelper unset(self::$ftp[$server->cache]); } // load error to indicate signature was in error - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_FTP_CONNECTION_FOR_BSB_COULD_NOT_BE_MADE_PLEASE_CHECK_YOUR_SIGNATURE_DETAILS', $server->name), 'Error'); } return false; } @@ -4166,17 +4171,17 @@ abstract class ComponentbuilderHelper public static function getServerDetails($serverID, $protocol = 2, $permission = 'core.export') { // check if this user has permission to access items - if (!JFactory::getUser()->authorise($permission, 'com_componentbuilder')) + if (!Factory::getUser()->authorise($permission, 'com_componentbuilder')) { // set message to inform the user that permission was denied - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', UtilitiesStringHelper::safe($permission, 'w')), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO', UtilitiesStringHelper::safe($permission, 'w')), 'Error'); return false; } // now insure we have correct values if (is_int($serverID) && is_int($protocol)) { // Get a db connection - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // start the query $query = $db->getQuery(true); // select based to protocol @@ -4238,7 +4243,7 @@ abstract class ComponentbuilderHelper return $server; } } - JFactory::getApplication()->enqueueMessage(JText::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); + Factory::getApplication()->enqueueMessage(Text::sprintf('COM_COMPONENTBUILDER_THE_SERVER_DETAILS_FOR_BID_SB_COULD_NOT_BE_RETRIEVED', $serverID), 'Error'); return false; } @@ -4257,39 +4262,42 @@ abstract class ComponentbuilderHelper /** - * the locker - * - * @var array - **/ - protected static $locker = array(); + * the locker + * + * @var array + * @since 3.1 + */ + protected static array $locker = []; /** - * the dynamic replacement salt - * - * @var array - **/ - protected static $globalSalt = array(); + * the dynamic replacement salt + * + * @var array + * @since 3.1 + */ + protected static array $globalSalt = []; /** - * the timer - * - * @var object - **/ + * the timer + * + * @var object + * @since 3.1 + */ protected static $keytimer; /** - * To Lock string - * - * @param string $string The string/array to lock - * @param string $key The custom key to use - * @param int $salt The switch to add salt and type of salt - * @param int $dynamic The dynamic replacement array of salt build string - * @param int $urlencode The switch to control url encoding - * - * @return string Encrypted String - * - **/ - public static function lock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true) + * To Lock string + * + * @param string $string The string/array to lock + * @param string|null $key The custom key to use + * @param int $salt The switch to add salt and type of salt + * @param int|null $dynamic The dynamic replacement array of salt build string + * @param int $urlencode The switch to control url encoding + * + * @return string Encrypted String + * @since 3.1 + */ + public static function lock(string $string, ?string $key = null, int $salt = 2, ?int $dynamic = null, $urlencode = true): string { // get the global settings if (!$key || !UtilitiesStringHelper::check($key)) @@ -4334,18 +4342,18 @@ abstract class ComponentbuilderHelper } /** - * To un-Lock string - * - * @param string $string The string to unlock - * @param string $key The custom key to use - * @param int $salt The switch to add salt and type of salt - * @param int $dynamic The dynamic replacement array of salt build string - * @param int $urlencode The switch to control url decoding - * - * @return string Decrypted String - * - **/ - public static function unlock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true) + * To un-Lock string + * + * @param string $string The string to unlock + * @param string $key The custom key to use + * @param int $salt The switch to add salt and type of salt + * @param int $dynamic The dynamic replacement array of salt build string + * @param int $urlencode The switch to control url decoding + * + * @return string Decrypted String + * @since 3.1 + */ + public static function unlock($string, $key = null, $salt = 2, $dynamic = null, $urlencode = true): string { // get the global settings if (!$key || !UtilitiesStringHelper::check($key)) @@ -4391,19 +4399,20 @@ abstract class ComponentbuilderHelper $string = unserialize($string); } } + return $string; } /** - * The Salt - * - * @param int $type The type of length the salt should be valid - * @param int $dynamic The dynamic replacement array of salt build string - * - * @return string - * - **/ - public static function salt($type = 1, $dynamic = null) + * The Salt + * + * @param int $type The type of length the salt should be valid + * @param int $dynamic The dynamic replacement array of salt build string + * + * @return string + * @since 3.1 + */ + public static function salt(int $type = 1, $dynamic = null): string { // get dynamic replacement salt $dynamic = self::getDynamicSalt($dynamic); @@ -4446,31 +4455,33 @@ abstract class ComponentbuilderHelper } /** - * The function to insure the salt is valid within the given period (third try) - * - * @param int $main The main number - */ - protected static function periodFix($main) + * The function to insure the salt is valid within the given period (third try) + * + * @param int $main The main number + * @since 3.1 + */ + protected static function periodFix(int $main): int { return round($main / 3) * 3; } /** - * Check if a string is serialized - * - * @param string $string - * - * @return Boolean - * - */ - public static function is_serial($string) + * Check if a string is serialized + * + * @param string $string + * + * @return Boolean + * @since 3.1 + */ + public static function is_serial(string $string): bool { return (@unserialize($string) !== false); } /** - * Get dynamic replacement salt - */ + * Get dynamic replacement salt + * @since 3.1 + */ public static function getDynamicSalt($dynamic = null) { // load global if not manually set @@ -4486,8 +4497,9 @@ abstract class ComponentbuilderHelper } /** - * The random or dynamic secret salt - */ + * The random or dynamic secret salt + * @since 3.1 + */ public static function getSecretSalt($string = null, $size = 9) { // set the string @@ -4509,8 +4521,9 @@ abstract class ComponentbuilderHelper } /** - * Get global replacement salt - */ + * Get global replacement salt + * @since 3.1 + */ public static function getGlobalSalt() { // load from memory if found @@ -4519,7 +4532,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = ComponentHelper::getParams('com_componentbuilder'); } // check if we have a global dynamic replacement array available (format --> ' 1->!,3->E,4->A') $tmp = self::$params->get('dynamic_salt', null); @@ -4549,8 +4562,9 @@ abstract class ComponentbuilderHelper } /** - * Close public protocol - */ + * Close public protocol + * @since 3.1 + */ public static function closePublicProtocol($id, $public) { // get secret salt @@ -4576,8 +4590,9 @@ abstract class ComponentbuilderHelper } /** - * Open public protocol - */ + * Open public protocol + * @since 3.1 + */ public static function openPublicProtocol($SECRET, $ID, $PUBLIC) { // get secret salt @@ -4601,42 +4616,46 @@ abstract class ComponentbuilderHelper } /** - * Workers to load tasks - * - * @var array - */ - protected static $worker = array(); + * Workers to load tasks + * + * @var array + * @since 3.1 + */ + protected static array $worker = []; /** - * Set a worker dynamic URLs - * - * @var array - */ - protected static $workerURL = array(); + * Set a worker dynamic URLs + * + * @var array + * @since 3.1 + */ + protected static array $workerURL = []; /** - * Set a worker dynamic HEADERs - * - * @var array - */ - protected static $workerHEADER = array(); + * Set a worker dynamic HEADERs + * + * @var array + * @since 3.1 + */ + protected static array $workerHEADER = []; /** - * Curl Error Notice - * - * @var bool - */ - protected static $curlErrorLoaded = false; + * Curl Error Notice + * + * @var bool + * @since 3.1 + */ + protected static bool $curlErrorLoaded = false; /** - * check if a worker has more work - * - * @param string $function The function to target to perform the task - * - * @return bool - * - */ - public static function hasWork(&$function) + * check if a worker has more work + * + * @param string $function The function to target to perform the task + * + * @return bool + * @since 3.1 + */ + public static function hasWork(string $function): bool { if (isset(self::$worker[$function]) && UtilitiesArrayHelper::check(self::$worker[$function])) { @@ -4646,15 +4665,15 @@ abstract class ComponentbuilderHelper } /** - * Set a worker url - * - * @param string $function The function to target to perform the task - * @param string $url The url of where the task is to be performed - * - * @return void - * - */ - public static function setWorkerUrl(&$function, &$url) + * Set a worker url + * + * @param string $function The function to target to perform the task + * @param string $url The url of where the task is to be performed + * + * @return void + * @since 3.1 + */ + public static function setWorkerUrl(string $function, string $url): void { // set the URL if found if (UtilitiesStringHelper::check($url)) @@ -4665,15 +4684,15 @@ abstract class ComponentbuilderHelper } /** - * Set a worker headers - * - * @param string $function The function to target to perform the task - * @param array $headers The headers needed for these workers/function - * - * @return void - * - */ - public static function setWorkerHeaders(&$function, &$headers) + * Set a worker headers + * + * @param string $function The function to target to perform the task + * @param array|null $headers The headers needed for these workers/function + * + * @return void + * @since 3.1 + */ + public static function setWorkerHeaders(string $function, ?array $headers): void { // set the Headers if found if (UtilitiesArrayHelper::check($headers)) @@ -4684,30 +4703,33 @@ abstract class ComponentbuilderHelper } /** - * Set a worker that needs to perform a task - * - * @param mixed $data The data to pass to the task - * @param string $function The function to target to perform the task - * @param string $url The url of where the task is to be performed - * @param array $headers The headers needed for these workers/function - * - * @return void - * - */ - public static function setWorker($data, $function, $url = null, $headers = null) + * Set a worker that needs to perform a task + * + * @param mixed $data The data to pass to the task + * @param string $function The function to target to perform the task + * @param string $url The url of where the task is to be performed + * @param array $headers The headers needed for these workers/function + * + * @return void + * @since 3.1 + */ + public static function setWorker($data, string $function, ?string $url = null, ?array $headers = null) { // make sure task function is up if (!isset(self::$worker[$function])) { - self::$worker[$function] = array(); + self::$worker[$function] = []; } + // load the task self::$worker[$function][] = self::lock($data); + // set the Headers if found if ($headers && !isset(self::$workerHEADER[$function])) { self::setWorkerHeaders($function, $headers); } + // set the URL if found if ($url && !isset(self::$workerURL[$function])) { @@ -4716,17 +4738,17 @@ abstract class ComponentbuilderHelper } /** - * Run set Workers - * - * @param string $function The function to target to perform the task - * @param string $perTask The amount of task per worker - * @param function $callback The option to do a call back when task is completed - * @param int $threadSize The size of the thread - * - * @return bool true On success - * - */ - public static function runWorker($function, $perTask = 50, $callback = null, $threadSize = 20) + * Run set Workers + * + * @param string $function The function to target to perform the task + * @param string $perTask The amount of task per worker + * @param function $callback The option to do a call back when task is completed + * @param int $threadSize The size of the thread + * + * @return bool true On success + * @since 3.1 + */ + public static function runWorker(string $function, $perTask = 50, $callback = null, $threadSize = 20): bool { // set task $task = self::lock($function); @@ -4780,7 +4802,7 @@ abstract class ComponentbuilderHelper } else { - $url = JURI::root() . '/index.php?option=com_componentbuilder&task=api.worker'; + $url = Uri::root() . '/index.php?option=com_componentbuilder&task=api.worker'; } return self::curlMultiExec($url, $options, $callback, $threadSize); } @@ -4788,16 +4810,16 @@ abstract class ComponentbuilderHelper } /** - * Do a multi curl execution of tasks - * - * @param string $url The url of where the task is to be performed - * @param array $_options The array of curl options/headers to set - * @param function $callback The option to do a call back when task is completed - * @param int $threadSize The size of the thread - * - * @return bool true On success - * - */ + * Do a multi curl execution of tasks + * + * @param string $url The url of where the task is to be performed + * @param array $_options The array of curl options/headers to set + * @param function $callback The option to do a call back when task is completed + * @param int $threadSize The size of the thread + * + * @return bool true On success + * @since 3.1 + */ public static function curlMultiExec(&$url, &$_options, $callback = null, $threadSize = 20) { // make sure we have curl available @@ -4806,7 +4828,7 @@ abstract class ComponentbuilderHelper if (!self::$curlErrorLoaded) { // set the notice - JFactory::getApplication()->enqueueMessage(JText::_('COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP'), 'Error'); + Factory::getApplication()->enqueueMessage(Text::_('COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP'), 'Error'); // load the notice only once self::$curlErrorLoaded = true; } @@ -4909,7 +4931,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } // get UIKIT version $uikit = self::$params->get('uikit_version', 2); @@ -4943,17 +4965,17 @@ abstract class ComponentbuilderHelper $checked_out = self::getVar($view, $item, 'id', 'checked_out', '=', str_replace('com_', '', $component)); } // set the link title - $title = UtilitiesStringHelper::safe(JText::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); + $title = UtilitiesStringHelper::safe(Text::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); // check that there is a check message if (UtilitiesStringHelper::check($headsup)) { if (3 == $uikit) { - $href = 'onclick="UIkit.modal.confirm(\''.JText::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; + $href = 'onclick="UIkit.modal.confirm(\''.Text::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; } else { - $href = 'onclick="UIkit2.modal.confirm(\''.JText::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; + $href = 'onclick="UIkit2.modal.confirm(\''.Text::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; } } else @@ -4967,11 +4989,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' '; } - return ' '; + return ' '; } // return normal edit link return ' '; @@ -4980,11 +5002,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' '; } - return ' '; + return ' '; } // return normal edit link return ' '; @@ -5021,7 +5043,7 @@ abstract class ComponentbuilderHelper // get the global settings if (!ObjectHelper::check(self::$params)) { - self::$params = JComponentHelper::getParams('com_componentbuilder'); + self::$params = \JComponentHelper::getParams('com_componentbuilder'); } // get UIKIT version $uikit = self::$params->get('uikit_version', 2); @@ -5055,17 +5077,17 @@ abstract class ComponentbuilderHelper $checked_out = self::getVar($view, $item, 'id', 'checked_out', '=', str_replace('com_', '', $component)); } // set the link title - $title = UtilitiesStringHelper::safe(JText::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); + $title = UtilitiesStringHelper::safe(Text::_('COM_COMPONENTBUILDER_EDIT') . ' ' . $view, 'W'); // check that there is a check message if (UtilitiesStringHelper::check($headsup)) { if (3 == $uikit) { - $href = 'onclick="UIkit.modal.confirm(\''.JText::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; + $href = 'onclick="UIkit.modal.confirm(\''.Text::_($headsup).'\').then( function(){ window.location.href = \'' . $url . '\' } )" href="javascript:void(0)"'; } else { - $href = 'onclick="UIkit2.modal.confirm(\''.JText::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; + $href = 'onclick="UIkit2.modal.confirm(\''.Text::_($headsup).'\', function(){ window.location.href = \'' . $url . '\' })" href="javascript:void(0)"'; } } else @@ -5079,11 +5101,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' ' . $text . ''; } - return ' ' . $text . ''; + return ' ' . $text . ''; } // return normal edit link return ' ' . $text . ''; @@ -5092,11 +5114,11 @@ abstract class ComponentbuilderHelper if (isset($checked_out) && $checked_out > 0) { // is this user the one who checked it out - if ($checked_out == JFactory::getUser()->id) + if ($checked_out == Factory::getUser()->id) { return ' ' . $text . ''; } - return ' ' . $text . ''; + return ' ' . $text . ''; } // return normal edit link return ' ' . $text . ''; @@ -5120,14 +5142,14 @@ abstract class ComponentbuilderHelper public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $jRoute = true) { // build record - $record = new stdClass(); + $record = new \stdClass(); // check if user can edit if (self::canEditItem($record, $item, $view, $views, $component)) { // set the edit link if ($jRoute) { - return JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref); + return \JRoute::_("index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref); } return "index.php?option=" . $component . "&view=" . $views . "&task=" . $view . ".edit&id=" . $record->id . $ref; } @@ -5148,7 +5170,7 @@ abstract class ComponentbuilderHelper public static function allowEdit(&$item, $view, $views, $component = 'com_componentbuilder') { // build record - $record = new stdClass(); + $record = new \stdClass(); return self::canEditItem($record, $item, $view, $views, $component); } @@ -5167,7 +5189,7 @@ abstract class ComponentbuilderHelper protected static function canEditItem(&$record, &$item, $view, $views, $component = 'com_componentbuilder') { // make sure the user has access to view - if (!JFactory::getUser()->authorise($view. '.access', $component)) + if (!Factory::getUser()->authorise($view. '.access', $component)) { return false; } @@ -5458,7 +5480,7 @@ abstract class ComponentbuilderHelper // get global values if (self::$subformLayouts === false) { - self::$subformLayouts = JComponentHelper::getParams('com_componentbuilder')->get('subform_layouts', false); + self::$subformLayouts = ComponentHelper::getParams('com_componentbuilder')->get('subform_layouts', false); } // check what we found (else) return default if (ObjectHelper::check(self::$subformLayouts)) @@ -5494,7 +5516,7 @@ abstract class ComponentbuilderHelper public static function checkExist($table, $where, $what = 'id', $operator = '=', $main = 'componentbuilder') { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); $query->select($db->quoteName(array($what))); @@ -5548,6 +5570,384 @@ abstract class ComponentbuilderHelper } return false; } + + + /** + * Making class or function name safe + * + * @input string The name you would like to make safe + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use ClassfunctionHelper::safe($name); + */ + public static function safeClassFunctionName($name) + { + return ClassfunctionHelper::safe($name); + } + + /** + * Making field names safe + * + * @input string The you would like to make safe + * @input boolean The switch to return an ALL UPPER CASE string + * @input string The string to use in white space + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use StringFieldHelper::safe($string, $allcap, $spacer); + */ + public static function safeFieldName($string, $allcap = false, $spacer = '_') + { + // set the local component option + self::setComponentOption(); + + return StringFieldHelper::safe($string, $allcap, $spacer); + } + + /** + * Making field type name safe + * + * @input string The you would like to make safe + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use TypeHelper::safe($string); + */ + public static function safeTypeName($string) + { + // set the local component option + self::setComponentOption(); + + return TypeHelper::safe($string); + } + + /** + * Making namespace safe + * + * @input string The you would like to make safe + * + * @returns string on success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use NamespaceHelper::safe($string); + */ + public static function safeNamespace($string) + { + return NamespaceHelper::safe($string); + } + + /** + * get all strings between two other strings + * + * @param string $content The content to search + * @param string $start The starting value + * @param string $end The ending value + * + * @return array On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GetHelper::allBetween($content, $start, $end); + */ + public static function getAllBetween($content, $start, $end) + { + return GetHelper::allBetween($content, $start, $end); + } + + /** + * get a string between two other strings + * + * @param string $content The content to search + * @param string $start The starting value + * @param string $end The ending value + * @param string $default The default value if none found + * + * @return string On success / empty string on failure + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GetHelper::between($content, $start, $end, $default); + */ + public static function getBetween($content, $start, $end, $default = '') + { + return GetHelper::between($content, $start, $end, $default); + } + + /** + * bc math wrapper (very basic not for accounting) + * + * @param string $type The type bc math + * @param int $val1 The first value + * @param int $val2 The second value + * @param int $scale The scale value + * + * @return float|int + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use MathHelper::bc($type, $val1, $val2, $scale); + */ + public static function bcmath($type, $val1, $val2, $scale = 0) + { + return MathHelper::bc($type, $val1, $val2, $scale); + } + + /** + * Basic sum of an array with more precision + * + * @param array $array The values to sum + * @param int $scale The scale value + * + * @return float|int + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use MathHelper::sum($array, $scale); + */ + public static function bcsum($array, $scale = 4) + { + return MathHelper::sum($array, $scale); + } + + /** + * create plugin class name + * + * @input string The group name + * @input string The name + * + * @return string + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use PluginHelper::safe($name, $group); + */ + public static function createPluginClassName($group, $name) + { + return PluginHelper::safeClassName($name, $group); + } + + /** + * Returns a GUIDv4 string + * + * Thanks to Dave Pearson (and other) + * https://www.php.net/manual/en/function.com-create-guid.php#119168 + * + * Uses the best cryptographically secure method + * for all supported platforms with fallback to an older, + * less secure version. + * + * @param bool $trim + * + * @return string + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GuidHelper::get($trim); + */ + public static function GUID($trim = true) + { + return GuidHelper::get($trim); + } + + /** + * Validate the Globally Unique Identifier ( and check if table already has this identifier) + * + * @param string $guid + * @param string $table + * @param int $id + * @param string|null $component + * + * @return bool + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); + */ + public static function validGUID($guid, $table = null, $id = 0, $component = null) + { + // set the local component option + self::setComponentOption(); + + return GuidHelper::valid($guid, $table, $id, $component); + } + + /** + * get the ITEM of a GUID by table + * + * @param string $guid + * @param string $table + * @param string/array $what + * @param string|null $component + * + * @return mixed + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use GuidHelper::valid($guid, $table, $id, $component); + */ + public static function getGUID($guid, $table, $what = 'a.id', $component = null) + { + // set the local component option + self::setComponentOption(); + + return GuidHelper::item($guid, $table, $what, $component); + } + + /** + * Validate the Globally Unique Identifier + * + * Thanks to Lewie + * https://stackoverflow.com/a/1515456/1429677 + * + * @param string $guid + * + * @return bool + * + * @deprecated 4.0 - Use GuidHelper::validate($guid); + */ + protected static function validateGUID($guid) + { + return GuidHelper::valid($guid); + } + + /** + * The zipper method + * + * @param string $workingDIR The directory where the items must be zipped + * @param string $filepath The path to where the zip file must be placed + * + * @return bool true On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::zip($workingDIR, $filepath); + */ + public static function zip($workingDIR, &$filepath) + { + return FileHelper::zip($workingDIR, $filepath); + } + + /** + * get the content of a file + * + * @param string $path The path to the file + * @param mixed $none The return value if no content was found + * + * @return string On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getContent($path, $none); + */ + public static function getFileContents($path, $none = '') + { + return FileHelper::getContent($path, $none); + } + + /** + * Write a file to the server + * + * @param string $path The path and file name where to safe the data + * @param string $data The data to safe + * + * @return bool true On success + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::write($path, $data); + */ + public static function writeFile($path, $data) + { + return FileHelper::write($path, $data); + } + + /** + * get all the file paths in folder and sub folders + * + * @param string $folder The local path to parse + * @param array $fileTypes The type of files to get + * + * @return array|null + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getPaths($folder, $fileTypes , $recurse, $full); + */ + public static function getAllFilePaths($folder, $fileTypes = array('\.php', '\.js', '\.css', '\.less'), $recurse = true, $full = true) + { + return FileHelper::getPaths($folder, $fileTypes , $recurse, $full); + } + + /** + * Get the file path or url + * + * @param string $type The (url/path) type to return + * @param string $target The Params Target name (if set) + * @param string $fileType The kind of filename to generate (if not set no file name is generated) + * @param string $key The key to adjust the filename (if not set ignored) + * @param string $default The default path if not set in Params (fallback path) + * @param bool $createIfNotSet The switch to create the folder if not found + * + * @return string On success the path or url is returned based on the type requested + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); + */ + public static function getFilePath($type = 'path', $target = 'filepath', $fileType = null, $key = '', $default = '', $createIfNotSet = true) + { + // set the local component option + self::setComponentOption(); + + return FileHelper::getPath($type, $target, $fileType, $key, $default, $createIfNotSet); + } + + /** + * Check if file exist + * + * @param string $path The url/path to check + * + * @return bool If exist true + * + * @since 3.0.9 + * + * @deprecated 4.0 - Use FileHelper::exists($path); + */ + public static function urlExists($path) + { + return FileHelper::exists($path); + } + + /** + * Set the component option + * + * @param String|null $option The option for the component. + * + * @since 3.0.11 + */ + public static function setComponentOption($option = null) + { + // set the local component option + if (empty($option)) + { + if (empty(Helper::$option) && property_exists(__CLASS__, 'ComponentCodeName')) + { + Helper::$option = 'com_' . self::$ComponentCodeName; + } + } + else + { + Helper::$option = $option; + } + } /** @@ -5559,7 +5959,7 @@ abstract class ComponentbuilderHelper if (!isset(self::$composer[$target])) { // get the function name - $functionName = self::safeString('compose' . $target); + $functionName = UtilitiesStringHelper::safe('compose' . $target); // check if method exist if (method_exists(__CLASS__, $functionName)) { @@ -5570,6 +5970,25 @@ abstract class ComponentbuilderHelper return self::$composer[$target]; } + /** + * Convert a json object to a string + * + * @input string $value The json string to convert + * + * @returns a string + * @deprecated 3.3 Use JsonHelper::string(...); + */ + public static function jsonToString($value, $sperator = ", ", $table = null, $id = 'id', $name = 'name') + { + return JsonHelper::string( + $value, + $sperator, + $table, + $id, + $name + ); + } + /** * Load the Component xml manifest. */ @@ -5581,7 +6000,7 @@ abstract class ComponentbuilderHelper /** * Joomla version object - */ + */ protected static $JVersion; /** @@ -5590,9 +6009,9 @@ abstract class ComponentbuilderHelper public static function jVersion() { // check if set - if (!self::checkObject(self::$JVersion)) + if (!ObjectHelper::check(self::$JVersion)) { - self::$JVersion = new JVersion(); + self::$JVersion = new Version(); } return self::$JVersion; } @@ -5603,9 +6022,9 @@ abstract class ComponentbuilderHelper public static function getContributors() { // get params - $params = JComponentHelper::getParams('com_componentbuilder'); + $params = ComponentHelper::getParams('com_componentbuilder'); // start contributors array - $contributors = array(); + $contributors = []; // get all Contributors (max 20) $searchArray = range('0','20'); foreach($searchArray as $nr) @@ -5614,22 +6033,22 @@ abstract class ComponentbuilderHelper { // set link based of selected option if($params->get("useContributor".$nr) == 1) - { + { $link_front = ''; $link_back = ''; } - elseif($params->get("useContributor".$nr) == 2) - { + elseif($params->get("useContributor".$nr) == 2) + { $link_front = ''; $link_back = ''; } - else - { + else + { $link_front = ''; $link_back = ''; } - $contributors[$nr]['title'] = self::htmlEscape($params->get("titleContributor".$nr)); - $contributors[$nr]['name'] = $link_front.self::htmlEscape($params->get("nameContributor".$nr)).$link_back; + $contributors[$nr]['title'] = UtilitiesStringHelper::html($params->get("titleContributor".$nr)); + $contributors[$nr]['name'] = $link_front.UtilitiesStringHelper::html($params->get("nameContributor".$nr)).$link_back; } } return $contributors; @@ -5640,9 +6059,9 @@ abstract class ComponentbuilderHelper **/ public static function getHelpUrl($view) { - $user = JFactory::getUser(); + $user = Factory::getUser(); $groups = $user->get('groups'); - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.id','a.groups','a.target','a.type','a.article','a.url')); $query->from('#__componentbuilder_help_document AS a'); @@ -5654,7 +6073,7 @@ abstract class ComponentbuilderHelper if($db->getNumRows()) { $helps = $db->loadObjectList(); - if (self::checkArray($helps)) + if (UtilitiesArrayHelper::check($helps)) { foreach ($helps as $nr => $help) { @@ -5695,7 +6114,7 @@ abstract class ComponentbuilderHelper **/ protected static function loadArticleLink($id) { - return JURI::root().'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; + return Uri::root() . 'index.php?option=com_content&view=article&id='.$id.'&tmpl=component&layout=modal'; } /** @@ -5703,29 +6122,29 @@ abstract class ComponentbuilderHelper **/ protected static function loadHelpTextLink($id) { - $token = JSession::getFormToken(); - return 'index.php?option=com_componentbuilder&task=help.getText&id=' . (int) $id . '&token=' . $token; + $token = Session::getFormToken(); + return 'index.php?option=com_componentbuilder&task=help.getText&id=' . (int) $id . '&' . $token . '=1'; } /** * Get any component's model */ - public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = 'Componentbuilder', $config = array()) + public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = 'Componentbuilder', $config = []) { // fix the name - $name = self::safeString($name); + $name = UtilitiesStringHelper::safe($name); // full path to models $fullPathModels = $path . '/models'; // load the model file - JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model'); + BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model'); // make sure the table path is loaded - if (!isset($config['table_path']) || !self::checkString($config['table_path'])) + if (!isset($config['table_path']) || !UtilitiesStringHelper::check($config['table_path'])) { // This is the JCB default path to tables in Joomla 3.x $config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables'; } // get instance - $model = JModelLegacy::getInstance($name, $Component . 'Model', $config); + $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config); // if model not found (strange) if ($model == false) { @@ -5760,14 +6179,14 @@ abstract class ComponentbuilderHelper */ public static function setAsset($id, $table, $inherit = true) { - $parent = JTable::getInstance('Asset'); + $parent = Table::getInstance('Asset'); $parent->loadByName('com_componentbuilder'); - + $parentId = $parent->id; $name = 'com_componentbuilder.'.$table.'.'.$id; $title = ''; - $asset = JTable::getInstance('Asset'); + $asset = Table::getInstance('Asset'); $asset->loadByName($name); // Check for an error. @@ -5791,14 +6210,14 @@ abstract class ComponentbuilderHelper $asset->title = $title; // get the default asset rules $rules = self::getDefaultAssetRules('com_componentbuilder', $table, $inherit); - if ($rules instanceof JAccessRules) + if ($rules instanceof AccessRules) { $asset->rules = (string) $rules; } if (!$asset->check() || !$asset->store()) { - JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); + Factory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else @@ -5811,7 +6230,7 @@ abstract class ComponentbuilderHelper $object->asset_id = (int) $asset->id; // Update their asset_id to link to the asset table. - return JFactory::getDbo()->updateObject('#__componentbuilder_'.$table, $object, 'id'); + return Factory::getDbo()->updateObject('#__componentbuilder_'.$table, $object, 'id'); } } return false; @@ -5828,7 +6247,7 @@ abstract class ComponentbuilderHelper if (!$inherit) { // Need to find the asset id by the name of the component. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true) ->select($db->quoteName('id')) ->from($db->quoteName('#__assets')) @@ -5843,8 +6262,8 @@ abstract class ComponentbuilderHelper } } // get asset rules - $result = JAccess::getAssetRules($assetId); - if ($result instanceof JAccessRules) + $result = Access::getAssetRules($assetId); + if ($result instanceof AccessRules) { $_result = (string) $result; $_result = json_decode($_result); @@ -5859,7 +6278,7 @@ abstract class ComponentbuilderHelper elseif ($inherit) { // clear the value since we inherit - $rule = array(); + $rule = []; } } // check if there are any view values remaining @@ -5867,8 +6286,8 @@ abstract class ComponentbuilderHelper { $_result = json_encode($_result); $_result = array($_result); - // Instantiate and return the JAccessRules object for the asset rules. - $rules = new JAccessRules($_result); + // Instantiate and return the AccessRules object for the asset rules. + $rules = new AccessRules($_result); // return filtered rules return $rules; } @@ -5910,10 +6329,10 @@ abstract class ComponentbuilderHelper * @param SimpleXMLElement $xml The XML element reference in which to inject a comment * @param array $attributes The attributes to apply to the XML element * - * @return void + * @return null * @deprecated 3.3 Use FormHelper::attributes($xml, $attributes); */ - public static function xmlAddAttributes(&$xml, $attributes = array()) + public static function xmlAddAttributes(&$xml, $attributes = []) { FormHelper::attributes($xml, $attributes); } @@ -5927,7 +6346,7 @@ abstract class ComponentbuilderHelper * @return void * @deprecated 3.3 Use FormHelper::options($xml, $options); */ - public static function xmlAddOptions(&$xml, $options = array()) + public static function xmlAddOptions(&$xml, $options = []) { FormHelper::options($xml, $options); } @@ -5982,17 +6401,17 @@ abstract class ComponentbuilderHelper // button attributes $buttonAttributes = array( 'type' => 'radio', - 'name' => isset($args[0]) ? self::htmlEscape($args[0]) : 'bool_button', - 'label' => isset($args[0]) ? self::safeString(self::htmlEscape($args[0]), 'Ww') : 'Bool Button', // not seen anyway + 'name' => isset($args[0]) ? UtilitiesStringHelper::html($args[0]) : 'bool_button', + 'label' => isset($args[0]) ? UtilitiesStringHelper::safe(UtilitiesStringHelper::html($args[0]), 'Ww') : 'Bool Button', // not seen anyway 'class' => 'btn-group', 'filter' => 'INT', 'default' => isset($args[2]) ? (int) $args[2] : 0); // set the button options $buttonOptions = array( - '1' => isset($args[3]) ? self::htmlEscape($args[3]) : 'JYES', - '0' => isset($args[4]) ? self::htmlEscape($args[4]) : 'JNO'); + '1' => isset($args[3]) ? UtilitiesStringHelper::html($args[3]) : 'JYES', + '0' => isset($args[4]) ? UtilitiesStringHelper::html($args[4]) : 'JNO'); // return the input - return self::getFieldObject($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; + return FormHelper::field($buttonAttributes, $buttonAttributes['default'], $buttonOptions)->input; } /** @@ -6065,7 +6484,7 @@ abstract class ComponentbuilderHelper if (strpos($content,'class="uk-') !== false) { // reset - $temp = array(); + $temp = []; foreach (self::$uk_components as $looking => $add) { if (strpos($content,$looking) !== false) @@ -6079,10 +6498,10 @@ abstract class ComponentbuilderHelper self::$uikit = true; } // sorter - if (self::checkArray($temp)) + if (UtilitiesArrayHelper::check($temp)) { // merger - if (self::checkArray($classes)) + if (UtilitiesArrayHelper::check($classes)) { $newTemp = array_merge($temp,$classes); $temp = array_unique($newTemp); @@ -6090,20 +6509,72 @@ abstract class ComponentbuilderHelper return $temp; } } - if (self::checkArray($classes)) + if (UtilitiesArrayHelper::check($classes)) { return $classes; } return false; } + /** + * Get a variable + * + * @param string $table The table from which to get the variable + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * + * @return mix string/int/float + * @deprecated 3.3 Use GetHelper::var(...); + */ + public static function getVar($table, $where = null, $whereString = 'user', $what = 'id', $operator = '=', $main = 'componentbuilder') + { + return GetHelper::var( + $table, + $where, + $whereString, + $what, + $operator, + $main + ); + } + + /** + * Get array of variables + * + * @param string $table The table from which to get the variables + * @param string $where The value where + * @param string $whereString The target/field string where/name + * @param string $what The return field + * @param string $operator The operator between $whereString/field and $where/value + * @param string $main The component in which the table is found + * @param bool $unique The switch to return a unique array + * + * @return array + * @deprecated 3.3 Use GetHelper::vars(...); + */ + public static function getVars($table, $where = null, $whereString = 'user', $what = 'id', $operator = 'IN', $main = 'componentbuilder', $unique = true) + { + return GetHelper::vars( + $table, + $where, + $whereString, + $what, + $operator, + $main, + $unique + ); + } + public static function isPublished($id,$type) { if ($type == 'raw') { $type = 'item'; } - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select(array('a.published')); $query->from('#__componentbuilder_'.$type.' AS a'); @@ -6121,7 +6592,7 @@ abstract class ComponentbuilderHelper public static function getGroupName($id) { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); $query = $db->getQuery(true); $query->select(array('a.title')); $query->from('#__usergroups AS a'); @@ -6146,39 +6617,39 @@ abstract class ComponentbuilderHelper * @param string $component The target component * @param object $user The user whose permissions we are loading * - * @return object The JObject of permission/authorised actions - * + * @return object The CMSObject of permission/authorised actions + * */ public static function getActions($view, &$record = null, $views = null, $target = null, $component = 'componentbuilder', $user = 'null') { // load the user if not given - if (!self::checkObject($user)) + if (!ObjectHelper::check($user)) { // get the user object - $user = JFactory::getUser(); + $user = Factory::getUser(); } - // load the JObject - $result = new JObject; + // load the CMSObject + $result = new CMSObject; // make view name safe (just incase) - $view = self::safeString($view); - if (self::checkString($views)) + $view = UtilitiesStringHelper::safe($view); + if (UtilitiesStringHelper::check($views)) { - $views = self::safeString($views); - } + $views = UtilitiesStringHelper::safe($views); + } // get all actions from component - $actions = JAccess::getActionsFromFile( + $actions = Access::getActionsFromFile( JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml', "/access/section[@name='component']/" ); - // if non found then return empty JObject + // if non found then return empty CMSObject if (empty($actions)) { return $result; } // get created by if not found - if (self::checkObject($record) && !isset($record->created_by) && isset($record->id)) + if (ObjectHelper::check($record) && !isset($record->created_by) && isset($record->id)) { - $record->created_by = self::getVar($view, $record->id, 'id', 'created_by', '=', $component); + $record->created_by = GetHelper::var($view, $record->id, 'id', 'created_by', '=', $component); } // set actions only set in component settings $componentActions = array('core.admin', 'core.manage', 'core.options', 'core.export'); @@ -6187,12 +6658,12 @@ abstract class ComponentbuilderHelper if ($target) { // convert to an array - if (self::checkString($target)) + if (UtilitiesStringHelper::check($target)) { $target = array($target); } // check if we are good to go - if (self::checkArray($target)) + if (UtilitiesArrayHelper::check($target)) { $checkTarget = true; } @@ -6213,7 +6684,7 @@ abstract class ComponentbuilderHelper // set area $area = 'comp'; // check if the record has an ID and the action is item related (not a component action) - if (self::checkObject($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && + if (ObjectHelper::check($record) && isset($record->id) && $record->id > 0 && !in_array($action->name, $componentActions) && (strpos($action->name, 'core.') !== false || strpos($action->name, $view . '.') !== false)) { // we are in item @@ -6246,7 +6717,7 @@ abstract class ComponentbuilderHelper } } } - elseif (self::checkString($views) && isset($record->catid) && $record->catid > 0) + elseif (UtilitiesStringHelper::check($views) && isset($record->catid) && $record->catid > 0) { // we are in item $area = 'category'; @@ -6318,7 +6789,7 @@ abstract class ComponentbuilderHelper * @param array $targets The array of target actions * * @return boolean true if action should be filtered out - * + * */ protected static function filterActions(&$view, &$action, &$targets) { @@ -6334,6 +6805,58 @@ abstract class ComponentbuilderHelper return true; } + /** + * Check if have an json string + * + * @input string The json string to check + * + * @returns bool true on success + * @deprecated 3.3 Use JsonHelper::check($string); + */ + public static function checkJson($string) + { + return JsonHelper::check($string); + } + + /** + * Check if have an object with a length + * + * @input object The object to check + * + * @returns bool true on success + * @deprecated 3.3 Use ObjectHelper::check($object); + */ + public static function checkObject($object) + { + return ObjectHelper::check($object); + } + + /** + * Check if have an array with a length + * + * @input array The array to check + * + * @returns bool/int number of items in array on success + * @deprecated 3.3 Use UtilitiesArrayHelper::check($array, $removeEmptyString); + */ + public static function checkArray($array, $removeEmptyString = false) + { + return UtilitiesArrayHelper::check($array, $removeEmptyString); + } + + /** + * Check if have a string with a length + * + * @input string The string to check + * + * @returns bool true on success + * @deprecated 3.3 Use UtilitiesStringHelper::check($string); + */ + public static function checkString($string) + { + return UtilitiesStringHelper::check($string); + } + /** * Check if we are connected * Thanks https://stackoverflow.com/a/4860432/1429677 @@ -6343,8 +6866,8 @@ abstract class ComponentbuilderHelper public static function isConnected() { // If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right? - $connected = @fsockopen("www.example.com", 80); - // website, port (try 80 or 443) + $connected = @fsockopen("www.example.com", 80); + // website, port (try 80 or 443) if ($connected) { //action when connected @@ -6359,12 +6882,125 @@ abstract class ComponentbuilderHelper return $is_conn; } + /** + * Merge an array of array's + * + * @input array The arrays you would like to merge + * + * @returns array on success + * @deprecated 3.3 Use UtilitiesArrayHelper::merge($arrays); + */ + public static function mergeArrays($arrays) + { + return UtilitiesArrayHelper::merge($arrays); + } + // typo sorry! public static function sorten($string, $length = 40, $addTip = true) { return self::shorten($string, $length, $addTip); } + /** + * Shorten a string + * + * @input string The you would like to shorten + * + * @returns string on success + * @deprecated 3.3 Use UtilitiesStringHelper::shorten(...); + */ + public static function shorten($string, $length = 40, $addTip = true) + { + return UtilitiesStringHelper::shorten($string, $length, $addTip); + } + + /** + * Making strings safe (various ways) + * + * @input string The you would like to make safe + * + * @returns string on success + * @deprecated 3.3 Use UtilitiesStringHelper::safe(...); + */ + public static function safeString($string, $type = 'L', $spacer = '_', $replaceNumbers = true, $keepOnlyCharacters = true) + { + return UtilitiesStringHelper::safe( + $string, + $type, + $spacer, + $replaceNumbers, + $keepOnlyCharacters + ); + } + + /** + * Convert none English strings to code usable string + * + * @input an string + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::transliterate($string); + */ + public static function transliterate($string) + { + return UtilitiesStringHelper::transliterate($string); + } + + /** + * make sure a string is HTML save + * + * @input an html string + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::html(...); + */ + public static function htmlEscape($var, $charset = 'UTF-8', $shorten = false, $length = 40) + { + return UtilitiesStringHelper::html( + $var, + $charset, + $shorten, + $length + ); + } + + /** + * Convert all int in a string to an English word string + * + * @input an string with numbers + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::numbers($string); + */ + public static function replaceNumbers($string) + { + return UtilitiesStringHelper::numbers($string); + } + + /** + * Convert an integer into an English word string + * Thanks to Tom Nicholson + * + * @input an int + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::number($x); + */ + public static function numberToString($x) + { + return UtilitiesStringHelper::number($x); + } + + /** + * Random Key + * + * @returns a string + * @deprecated 3.3 Use UtilitiesStringHelper::random($size); + */ + public static function randomkey($size) + { + return UtilitiesStringHelper::random($size); + } + /** * Get The Encryption Keys * @@ -6377,12 +7013,12 @@ abstract class ComponentbuilderHelper public static function getCryptKey($type, $default = false) { // Get the global params - $params = JComponentHelper::getParams('com_componentbuilder', true); + $params = ComponentHelper::getParams('com_componentbuilder', true); // Basic Encryption Type if ('basic' === $type) { $basic_key = $params->get('basic_key', $default); - if (self::checkString($basic_key)) + if (UtilitiesStringHelper::check($basic_key)) { return $basic_key; } diff --git a/site/helpers/headercheck.php b/site/helpers/headercheck.php index 707708464..d165c691d 100644 --- a/site/helpers/headercheck.php +++ b/site/helpers/headercheck.php @@ -12,24 +12,36 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; + class componentbuilderHeaderCheck { + protected $document = null; + protected $app = null; + function js_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['scripts']) as $script) { if (stristr($script, $script_name)) @@ -40,24 +52,30 @@ class componentbuilderHeaderCheck return false; } - + function css_loaded($script_name) { // UIkit check point if (strpos($script_name,'uikit') !== false) { - $app = JFactory::getApplication(); - $getTemplateName = $app->getTemplate('template')->template; - + if (!$this->app) + { + $this->app = Factory::getApplication(); + } + + $getTemplateName = $this->app->getTemplate('template')->template; if (strpos($getTemplateName,'yoo') !== false) { return true; } } - - $document = JFactory::getDocument(); - $head_data = $document->getHeadData(); - + + if (!$this->document) + { + $this->document = Factory::getDocument(); + } + + $head_data = $this->document->getHeadData(); foreach (array_keys($head_data['styleSheets']) as $script) { if (stristr($script, $script_name)) diff --git a/site/helpers/route.php b/site/helpers/route.php index 05b86176f..2fcfbaa33 100644 --- a/site/helpers/route.php +++ b/site/helpers/route.php @@ -12,6 +12,14 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Language\Multilanguage; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Categories\CategoryNode; +use Joomla\CMS\Categories\Categories; +use VDM\Joomla\Utilities\ArrayHelper; + /** * Componentbuilder Route Helper **/ @@ -44,7 +52,7 @@ abstract class ComponentbuilderHelperRoute } if ($catid > 1) { - $categories = JCategories::getInstance('componentbuilder.api'); + $categories = Categories::getInstance('componentbuilder.api'); $category = $categories->get($catid); if ($category) { @@ -65,7 +73,7 @@ abstract class ComponentbuilderHelperRoute /** * Get the URL route for componentbuilder category from a category ID and language * - * @param mixed $catid The id of the items's category either an integer id or a instance of JCategoryNode + * @param mixed $catid The id of the items's category either an integer id or a instance of CategoryNode * @param mixed $language The id of the language being used. * * @return string The link to the contact @@ -74,22 +82,22 @@ abstract class ComponentbuilderHelperRoute */ public static function getCategoryRoute_keep_for_later($catid, $language = 0) { - if ($catid instanceof JCategoryNode) + if ($catid instanceof CategoryNode) { - $id = $catid->id; - $category = $catid; + $id = $catid->id; + $category = $catid; } else - { - throw new Exception('First parameter must be JCategoryNode'); + { + throw new Exception('First parameter must be CategoryNode'); } - + $views = array( "com_componentbuilder.field" => "field", "com_componentbuilder.fieldtype" => "fieldtype"); $view = $views[$category->extension]; - - if ($id < 1 || !($category instanceof JCategoryNode)) + + if ($id < 1 || !($category instanceof CategoryNode)) { $link = ''; } @@ -97,20 +105,20 @@ abstract class ComponentbuilderHelperRoute { //Create the link $link = 'index.php?option=com_componentbuilder&view='.$view.'&category='.$category->slug; - + $needles = array( $view => array($id), 'category' => array($id) ); - - if ($language && $language != "*" && JLanguageMultilang::isEnabled()) + + if ($language && $language != "*" && Multilanguage::isEnabled()) { - $db = JFactory::getDbo(); - $query = $db->getQuery(true) + $db = Factory::getDbo(); + $query = $db->getQuery(true) ->select('a.sef AS sef') ->select('a.lang_code AS lang_code') ->from('#__languages AS a'); - + $db->setQuery($query); $langs = $db->loadObjectList(); foreach ($langs as $lang) @@ -122,11 +130,11 @@ abstract class ComponentbuilderHelperRoute } } } - + if ($item = self::_findItem($needles,'category')) { - $link .= '&Itemid='.$item; + $link .= '&Itemid='.$item; } else { @@ -152,16 +160,16 @@ abstract class ComponentbuilderHelperRoute protected static function _findItem($needles = null,$type = null) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $menus = $app->getMenu('site'); $language = isset($needles['language']) ? $needles['language'] : '*'; // Prepare the reverse lookup array. if (!isset(self::$lookup[$language])) { - self::$lookup[$language] = array(); + self::$lookup[$language] = []; - $component = JComponentHelper::getComponent('com_componentbuilder'); + $component = ComponentHelper::getComponent('com_componentbuilder'); $attributes = array('component_id'); $values = array($component->id); @@ -182,7 +190,7 @@ abstract class ComponentbuilderHelperRoute if (!isset(self::$lookup[$language][$view])) { - self::$lookup[$language][$view] = array(); + self::$lookup[$language][$view] = []; } if (isset($item->query['id'])) @@ -211,7 +219,7 @@ abstract class ComponentbuilderHelperRoute { if (isset(self::$lookup[$language][$view])) { - if (ComponentbuilderHelper::checkArray($ids)) + if (ArrayHelper::check($ids)) { foreach ($ids as $id) { @@ -232,7 +240,7 @@ abstract class ComponentbuilderHelperRoute if ($type) { // Check if the global menu item has been set. - $params = JComponentHelper::getParams('com_componentbuilder'); + $params = ComponentHelper::getParams('com_componentbuilder'); if ($item = $params->get($type.'_menu', 0)) { return $item; @@ -244,7 +252,7 @@ abstract class ComponentbuilderHelperRoute if ($active && $active->component == 'com_componentbuilder' - && ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled())) + && ($language == '*' || in_array($active->language, array('*', $language)) || !Multilanguage::isEnabled())) { return $active->id; } diff --git a/site/language/en-GB/en-GB.com_componentbuilder.ini b/site/language/en-GB/en-GB.com_componentbuilder.ini index 0c1f65c4c..3701d6482 100644 --- a/site/language/en-GB/en-GB.com_componentbuilder.ini +++ b/site/language/en-GB/en-GB.com_componentbuilder.ini @@ -1,21 +1,24 @@ COM_COMPONENTBUILDER="Component Builder" COM_COMPONENTBUILDER_ACCESS_DENIED="Access denied!" +COM_COMPONENTBUILDER_ALL_THE_FIELDS_AND_VIEWS_FROM_YOUR_SQL_DUMP_HAS_BEEN_CREATED_AND_LINKED_TO_THIS_COMPONENT="All the fields and views from your sql dump has been created and linked to this component." COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work on this page will be lost, are you sure you want to continue?" COM_COMPONENTBUILDER_API="Api" COM_COMPONENTBUILDER_API_DESC="Sync Portal API" -COM_COMPONENTBUILDER_A_METHOD_SETDYNAMICFZEROLDTHREERS_WAS_ADDED_TO_THE_INSTALL_BSCRIPTPHPB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED="A method (setDynamicF0ld3rs) was added to the install script.php of this package to insure that the folder(s) are copied into the correct place when this component is installed!" +COM_COMPONENTBUILDER_A_METHOD_S_WAS_ADDED_TO_THE_INSTALL_BSB_OF_THIS_PACKAGE_TO_INSURE_THAT_THE_FOLDERS_ARE_COPIED_INTO_THE_CORRECT_PLACE_WHEN_THIS_COMPONENT_IS_INSTALLED="A method (%s) was added to the install %s of this package to insure that the folder(s) are copied into the correct place when this component is installed!" COM_COMPONENTBUILDER_BACKUP_FAILED_PLEASE_TRY_AGAIN_IF_THE_ERROR_CONTINUE_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR="Backup failed, please try again. If the error continue, please contact your system administrator." COM_COMPONENTBUILDER_BACKUP_WAS_DONE_SUCCESSFULLY="Backup was done successfully" COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE="Be cautious! Do not continue unless you trust the origin of this package!" COM_COMPONENTBUILDER_BGET_THE_KEY_FROMB_A_SSA="Get the key from %s" COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA="Get the key from %s for %s" COM_COMPONENTBUILDER_CHECK_YOUR_OWNER_DETAILS_IT_HAS_NOT_BEEN_SET_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="Check your owner details, it has not been set. Open the JCB Global Options, go to the Company tab and add the correct company details there." +COM_COMPONENTBUILDER_CODESTRINGS="code/strings" COM_COMPONENTBUILDER_COMPANY_S="Company: %s" COM_COMPONENTBUILDER_COMPONENT="Component" COM_COMPONENTBUILDER_COMPONENT_DID_NOT_COMPILE="Component did not compile!" COM_COMPONENTBUILDER_COMPONENT_IS_NOT_PUBLISHED_OR_IS_CHECKED_OUT="Component is not published, or is checked out!" COM_COMPONENTBUILDER_COMPONENT_WAS_NOT_FOUND="Component was not found!" COM_COMPONENTBUILDER_COPYRIGHT_S="Copyright: %s" +COM_COMPONENTBUILDER_COULD_NOT_FIND_THE_DATA_NEEDED_TO_CONTINUE="Could not find the data needed to continue." COM_COMPONENTBUILDER_CREATE_NEW_S="Create New %s" COM_COMPONENTBUILDER_DESCRIPTION="Description" COM_COMPONENTBUILDER_DTCOMPANYDTDDSDD="
    Company
    %s
    " @@ -24,6 +27,7 @@ COM_COMPONENTBUILDER_DTEMAILDTDDSDD="
    Email
    %s
    " COM_COMPONENTBUILDER_DTLICENSEDTDDSDD="
    License
    %s
    " COM_COMPONENTBUILDER_DTOWNERDTDDSDD="
    Owner
    %s
    " COM_COMPONENTBUILDER_DTWEBSITEDTDDSDD="
    Website
    %s
    " +COM_COMPONENTBUILDER_DYNAMIC_BUTTON_ERROR="Dynamic Button Error" COM_COMPONENTBUILDER_EDIT="Edit" COM_COMPONENTBUILDER_EDIT_S="Edit %s" COM_COMPONENTBUILDER_EDIT_S_S_DIRECTLY="Edit %s (%s) directly" @@ -43,18 +47,27 @@ COM_COMPONENTBUILDER_FREEOPEN="Free/Open" COM_COMPONENTBUILDER_GREAT_THIS_PLACEHOLDER_WILL_WORK="Great, this placeholder will work!" COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERCOPYRIGHTHFOURPSP="

    %s

    " COM_COMPONENTBUILDER_HFOUR_CLASSNAVHEADERLICENSEHFOURPSP="

    %s

    " +COM_COMPONENTBUILDER_HR_HTHREEASSETS_TABLE_NOTICEHTHREE="

    Assets Table Notice

    " +COM_COMPONENTBUILDER_HR_HTHREEASSETS_TABLE_WARNINGHTHREE="

    Assets Table Warning

    " +COM_COMPONENTBUILDER_HR_HTHREECONDITIONAL_SCRIPT_WARNINGHTHREE="

    Conditional Script Warning

    " COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODES_WARNINGHTHREE="

    Custom Codes Warning

    " +COM_COMPONENTBUILDER_HR_HTHREECUSTOM_CODE_WARNINGHTHREE="

    Custom Code Warning

    " COM_COMPONENTBUILDER_HR_HTHREECZEROMPZERONTHREENT_ISSUE_FOUNDHTHREEPTHE_PATH_S_COULD_NOT_BE_USEDP="

    c0mp0n3nt issue found

    The path (%s) could not be used.

    " COM_COMPONENTBUILDER_HR_HTHREEDASHBOARD_ERRORHTHREE="

    Dashboard Error

    " -COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_BUTTON_ERRORHTHREE="

    Dynamic Button Error

    " COM_COMPONENTBUILDER_HR_HTHREEDYNAMIC_FOLDERS_WERE_DETECTEDHTHREE="

    Dynamic folder(s) were detected.

    " COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_ERRORHTHREE="

    External Code Error

    " COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_NOTICEHTHREE="

    External Code Notice

    " COM_COMPONENTBUILDER_HR_HTHREEEXTERNAL_CODE_WARNINGHTHREE="

    External Code Warning

    " COM_COMPONENTBUILDER_HR_HTHREEFIELD_NOTICEHTHREE="

    Field Notice

    " +COM_COMPONENTBUILDER_HR_HTHREEFIELD_WARNINGHTHREE="

    Field Warning

    " COM_COMPONENTBUILDER_HR_HTHREEFILE_PATH_ERRORHTHREE="

    File Path Error

    " COM_COMPONENTBUILDER_HR_HTHREEFOLDER_PATH_ERRORHTHREE="

    Folder Path Error

    " +COM_COMPONENTBUILDER_HR_HTHREELANGUAGE_NOTICEHTHREE="

    Language Notice

    " +COM_COMPONENTBUILDER_HR_HTHREELANGUAGE_WARNINGHTHREE="

    Language Warning

    " +COM_COMPONENTBUILDER_HR_HTHREEMULTI_FILTER_ERRORHTHREE="

    Multi Filter Error

    " +COM_COMPONENTBUILDER_HR_HTHREES_WARNINGHTHREE="

    %s Warning

    " COM_COMPONENTBUILDER_HR_HTHREETIDY_ERRORHTHREE="

    Tidy Error

    " +COM_COMPONENTBUILDER_HR_HTHREEWHMCS_ERRORHTHREE="

    WHMCS Error

    " COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_S_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s namespace error (%s)

    You must at-least have two sections in your namespace, you just have one (%s). This is an unacceptable action, please see psr-4 for more info.

    This %s was therefore removed, click here to fix this issue.

    " COM_COMPONENTBUILDER_HTHREES_NAMESPACE_ERROR_SHTHREEPYOU_MUST_ATLEAST_HAVE_TWO_SECTIONS_IN_YOUR_NAMESPACE_YOU_JUST_HAVE_ONE_THIS_IS_AN_UNACCEPTABLE_ACTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPTHIS_S_WAS_THEREFORE_REMOVED_A_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s namespace error (%s)

    You must at-least have two sections in your namespace, you just have one. This is an unacceptable action, please see psr-4 for more info.

    This %s was therefore removed, click here to fix this issue.

    " COM_COMPONENTBUILDER_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BCOMPONENTBUILDERB_WILL_NOT_FUNCTION_CORRECTLYP="

    Curl Not Found!

    Please setup curl on your system, or componentbuilder will not function correctly!

    " @@ -78,6 +91,7 @@ COM_COMPONENTBUILDER_NONE="None" COM_COMPONENTBUILDER_NOT_FOUND_OR_ACCESS_DENIED="Not found or access denied!" COM_COMPONENTBUILDER_NO_ACCESS_GRANTED="No Access Granted!" COM_COMPONENTBUILDER_NO_COMPONENT_DETAILS_FOUND_SO_IT_IS_NOT_SAFE_TO_CONTINUE="No component details found, so it is not safe to continue!" +COM_COMPONENTBUILDER_NO_CREATE_TABLE_WERE_FOUND_PLEASE_CHECK_YOUR_SQL="No "CREATE TABLE.." were found, please check your sql." COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="No keys were found. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key." COM_COMPONENTBUILDER_NO_VALID_MODE_HAS_BEEN_SPECIFIED="No valid mode has been specified!" COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET="Owner details was set" @@ -87,11 +101,13 @@ COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND="Package owner details not COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET="Package Owner Not Set" COM_COMPONENTBUILDER_PAIDLOCKED="Paid/Locked" COM_COMPONENTBUILDER_PFILE_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="

    File at %s/%s gave the following error!
    %s

    " +COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_THIS_ERROR_USUALY_HAPPENS_IF_IT_IS_A_NEW_COMPONENT_BEACUES_WE_NEED_A_COMPONENT_ID_TO_DO_THIS_BUILD_WITH_YOUR_SQL_DUMP="Please try again, this error usualy happens if it is a new component, beacues we need a component ID to do this build with your sql dump." COM_COMPONENTBUILDER_PLUGIN="Plugin" COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP="

    Power guid:%s not found!

    " COM_COMPONENTBUILDER_PROPERTY="Property" COM_COMPONENTBUILDER_PSUPER_POWERB_REPOSITORY_AT_BSSB_GAVE_THE_FOLLOWING_ERRORBR_SP="

    Super Power repository at %s/%s gave the following error!
    %s

    " COM_COMPONENTBUILDER_PS_NAMING_MISMATCH_ERROR_SPPTHE_S_NAME_IS_BSB_AND_THE_ENDING_FILE_NAME_IN_THE_NAMESPACE_IS_BSB_THIS_IS_BAD_CONVENTION_PLEASE_SEE_A_HREFS_PSRFOURA_FOR_MORE_INFOPPA_HREFSCLICK_HEREA_TO_FIX_THIS_ISSUEP="

    %s naming mismatch error (%s)

    The %s name is %s and the ending file name in the namespace is %s. This is bad convention, please see psr-4 for more info.

    Click here to fix this issue.

    " +COM_COMPONENTBUILDER_REVERTED_THE_B_ASSETSB_TABLE_RULES_COLUMN_BACK_TO_ITS_DEFAULT_SIZE_OF_VARCHARFIVE_THOUSAND_ONE_HUNDRED_AND_TWENTY="Reverted the #__assets table rules column back to its default size of varchar(5120)" COM_COMPONENTBUILDER_SBR_YOU_CAN_ADD_A_BGITHUB_ACCESS_TOKENB_TO_COMPONENTBUILDER_GLOBAL_OPTIONS_TO_MAKE_AUTHENTICATED_REQUESTS_TO_GITHUB_AN_ACCESS_TOKEN_WITH_ONLY_PUBLIC_ACCESS_WILL_DO_TO_RETRIEVE_S="%s
    You can add a gitHub Access Token to Componentbuilder global options to make authenticated requests to gitHub. An access token with only public access will do to retrieve %s." COM_COMPONENTBUILDER_SELECT_EXTENSION="Select Extension" COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it." @@ -142,6 +158,12 @@ COM_COMPONENTBUILDER_TRANSLATOR_MODULE_NOT_READYBR_THIS_AREA_IS_STILL_UNDER_PROD COM_COMPONENTBUILDER_VJRZDESSMHBTRWFIFTYTWVZEROAESFLVVXJTMTHREEJTWOIXM="VjRzdE%ssMHBtRW50TWV0aE%sFlvVXJTM3J2IXM=" COM_COMPONENTBUILDER_WEBSITE_S="Website: %s" COM_COMPONENTBUILDER_WE_FOUND_DYNAMIC_CODE_BALL_IN_ONE_LINEB_AND_IGNORED_IT_PLEASE_REVIEW_S_FOR_MORE_DETAILS="We found dynamic code all in one line, and ignored it! Please review (%s) for more details!" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_COMPONENT_TO_THE_GIT_REPOSITORY="We where was unable to transfer the component to the git repository:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_COMPONENT_ZIP_FILE_TO_THE_BACKUP_FOLDER="We where was unable to transfer the component ZIP file to the backup folder:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_MODULE_TO_THE_GIT_REPOSITORY="We where was unable to transfer the (%s) module to the git repository:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_MODULE_ZIP_FILE_TO_THE_BACKUP_FOLDER="We where was unable to transfer the (%s) module zip file to the backup folder:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_PLUGIN_TO_THE_GIT_REPOSITORY="We where was unable to transfer the (%s) plugin to the git repository:" +COM_COMPONENTBUILDER_WE_WHERE_WAS_UNABLE_TO_TRANSFER_THE_S_PLUGIN_ZIP_FILE_TO_THE_BACKUP_FOLDER="We where was unable to transfer the (%s) plugin zip file to the backup folder:" COM_COMPONENTBUILDER_YOUR_DATA_IS_ENCRYPTED_WITH_A_AES_TWO_HUNDRED_AND_FIFTY_SIX_BIT_ENCRYPTION_USING_THE_ABOVE_THIRTY_TWO_CHARACTER_KEY="Your data is encrypted with a AES 256 bit encryption using the above 32 character key." COM_COMPONENTBUILDER_YOU_DO_NOT_HAVE_PERMISSION_TO_ACCESS_THE_SERVER_DETAILS_BS_DENIEDB_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_INFO="You do not have permission to access the server details (%s - denied), please contact your system administrator for more info." COM_COMPONENTBUILDER_YOU_MUST_ENABLE_THE_BTIDYB_EXTENSION_IN_YOUR_PHPINI_FILE_SO_WE_CAN_TIDY_UP_YOUR_XML_IF_YOU_NEED_HELP_PLEASE_A_SSTART_HEREA="You must enable the Tidy extension in your php.ini file so we can tidy up your xml! If you need help please start here!" diff --git a/site/models/api.php b/site/models/api.php index 2e4c557b5..713a4c3f4 100644 --- a/site/models/api.php +++ b/site/models/api.php @@ -12,9 +12,18 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\MVC\Model\ItemModel; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Router\Route; +use Joomla\CMS\Uri\Uri; use Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Helper\TagsHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; +use VDM\Joomla\Utilities\ArrayHelper as UtilitiesArrayHelper; +use VDM\Joomla\Utilities\GetHelper; /** * Componentbuilder Api Item Model @@ -58,7 +67,7 @@ class ComponentbuilderModelApi extends ItemModel */ protected function populateState() { - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->input = $this->app->input; // Get the itme main id $id = $this->input->getInt('id', null); @@ -79,7 +88,7 @@ class ComponentbuilderModelApi extends ItemModel */ public function getItem($pk = null) { - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); $this->userId = $this->user->get('id'); $this->guest = $this->user->get('guest'); $this->groups = $this->user->get('groups'); @@ -88,10 +97,10 @@ class ComponentbuilderModelApi extends ItemModel $this->initSet = true; $pk = (!empty($pk)) ? $pk : (int) $this->getState('api.id'); - + if ($this->_item === null) { - $this->_item = array(); + $this->_item = []; } if (!isset($this->_item[$pk])) @@ -99,7 +108,7 @@ class ComponentbuilderModelApi extends ItemModel try { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -117,10 +126,10 @@ class ComponentbuilderModelApi extends ItemModel if (empty($data)) { - $app = JFactory::getApplication(); + $app = Factory::getApplication(); // If no data is found redirect to default page and show warning. - $app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_NOT_FOUND_OR_ACCESS_DENIED'), 'warning'); - $app->redirect(JURI::root()); + $app->enqueueMessage(Text::_('COM_COMPONENTBUILDER_NOT_FOUND_OR_ACCESS_DENIED'), 'warning'); + $app->redirect(Uri::root()); return false; } @@ -132,7 +141,7 @@ class ComponentbuilderModelApi extends ItemModel if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWarning(404, $e->getMessage()); + JError::raiseError(404, $e->getMessage()); } else { @@ -153,7 +162,7 @@ class ComponentbuilderModelApi extends ItemModel */ public function getUikitComp() { - if (isset($this->uikitComp) && ComponentbuilderHelper::checkArray($this->uikitComp)) + if (isset($this->uikitComp) && UtilitiesArrayHelper::check($this->uikitComp)) { return $this->uikitComp; } @@ -168,7 +177,7 @@ class ComponentbuilderModelApi extends ItemModel public function getTranslationLinkedComponents() { // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); // for now we only have crowdin @@ -187,7 +196,7 @@ class ComponentbuilderModelApi extends ItemModel public function translate($component) { - $this->messages[] = JText::_('COM_COMPONENTBUILDER_TRANSLATOR_MODULE_NOT_READYBR_THIS_AREA_IS_STILL_UNDER_PRODUCTION_HOPEFULLY_WITH_NEXT_UPDATE'); + $this->messages[] = Text::_('COM_COMPONENTBUILDER_TRANSLATOR_MODULE_NOT_READYBR_THIS_AREA_IS_STILL_UNDER_PRODUCTION_HOPEFULLY_WITH_NEXT_UPDATE'); return false; } @@ -215,9 +224,9 @@ class ComponentbuilderModelApi extends ItemModel if (isset($values['component_id']) && $values['component_id'] > 1) { // make sure the component is published - $published = ComponentbuilderHelper::getVar('joomla_component', (int) $values['component_id'], 'id', 'published'); + $published = GetHelper::var('joomla_component', (int) $values['component_id'], 'id', 'published'); // make sure the component is checked in - $checked_out = ComponentbuilderHelper::getVar('joomla_component', (int) $values['component_id'], 'id', 'checked_out'); + $checked_out = GetHelper::var('joomla_component', (int) $values['component_id'], 'id', 'checked_out'); if (1 == $published && $checked_out == 0) { // load the config values @@ -227,50 +236,50 @@ class ComponentbuilderModelApi extends ItemModel if($this->compiler) { // component was compiled - $this->messages[] = JText::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_SUCCESSFULLY_COMPILED', $this->compiler->componentFolderName); + $this->messages[] = Text::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_SUCCESSFULLY_COMPILED', $this->compiler->componentFolderName); // get compiler model to run the installer $model = ComponentbuilderHelper::getModel('compiler', JPATH_COMPONENT_ADMINISTRATOR); // now install components if (1 == CFactory::_('Config')->install && $model->install($this->compiler->componentFolderName.'.zip')) { // component was installed - $this->messages[] = JText::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_SUCCESSFULLY_INSTALLED_AND_REMOVED_FROM_TEMP_FOLDER', $this->compiler->componentFolderName); + $this->messages[] = Text::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_SUCCESSFULLY_INSTALLED_AND_REMOVED_FROM_TEMP_FOLDER', $this->compiler->componentFolderName); } elseif (1 != CFactory::_('Config')->install) { jimport('joomla.filesystem.file'); - $config = JFactory::getConfig(); + $config = Factory::getConfig(); $package = $config->get('tmp_path') . '/' . $this->compiler->componentFolderName.'.zip'; // just remove from temp if (JFile::delete($package) && !is_file($package)) { // component was installed - $this->messages[] = JText::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_NOT_INSTALLED_BY_YOUR_REQUEST_AND_IS_ALSO_REMOVED_FROM_TEMP_FOLDER', $this->compiler->componentFolderName); + $this->messages[] = Text::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_NOT_INSTALLED_BY_YOUR_REQUEST_AND_IS_ALSO_REMOVED_FROM_TEMP_FOLDER', $this->compiler->componentFolderName); } else { // component was not installed - $this->messages[] = JText::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_NOT_INSTALLED_BY_YOUR_REQUEST_AND_IS_STILL_IN_THE_TEMP_FOLDER', $this->compiler->componentFolderName); + $this->messages[] = Text::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_NOT_INSTALLED_BY_YOUR_REQUEST_AND_IS_STILL_IN_THE_TEMP_FOLDER', $this->compiler->componentFolderName); } } else { // component was not installed - $this->messages[] = JText::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_NOT_INSTALLED_AND_IS_STILL_IN_THE_TEMP_FOLDER', $this->compiler->componentFolderName); + $this->messages[] = Text::sprintf('COM_COMPONENTBUILDER_THE_S_WAS_NOT_INSTALLED_AND_IS_STILL_IN_THE_TEMP_FOLDER', $this->compiler->componentFolderName); } // get all the messages from application (TODO) return true; } // set that the component was not found - $this->messages[] = JText::_('COM_COMPONENTBUILDER_COMPONENT_DID_NOT_COMPILE'); + $this->messages[] = Text::_('COM_COMPONENTBUILDER_COMPONENT_DID_NOT_COMPILE'); return false; } // set that the component was not found - $this->messages[] = JText::_('COM_COMPONENTBUILDER_COMPONENT_IS_NOT_PUBLISHED_OR_IS_CHECKED_OUT'); + $this->messages[] = Text::_('COM_COMPONENTBUILDER_COMPONENT_IS_NOT_PUBLISHED_OR_IS_CHECKED_OUT'); return false; } // set that the component was not found - $this->messages[] = JText::_('COM_COMPONENTBUILDER_COMPONENT_WAS_NOT_FOUND'); + $this->messages[] = Text::_('COM_COMPONENTBUILDER_COMPONENT_WAS_NOT_FOUND'); return false; } } diff --git a/site/router.php b/site/router.php index 5b01543c8..6706e5bcb 100644 --- a/site/router.php +++ b/site/router.php @@ -12,13 +12,16 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Component\ComponentHelper; + /** * Routing class from com_componentbuilder * * @since 3.3 */ class ComponentbuilderRouter extends JComponentRouterBase -{ +{ /** * Build the route for the com_componentbuilder component * @@ -30,11 +33,11 @@ class ComponentbuilderRouter extends JComponentRouterBase */ public function build(&$query) { - $segments = array(); + $segments = []; // Get a menu item based on Itemid or currently active - $params = JComponentHelper::getParams('com_componentbuilder'); - + $params = ComponentHelper::getParams('com_componentbuilder'); + if (empty($query['Itemid'])) { $menuItem = $this->menu->getActive(); @@ -58,7 +61,7 @@ class ComponentbuilderRouter extends JComponentRouterBase unset($query['view']); } - + // Are we dealing with a item that is attached to a menu item? if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id'])) { @@ -88,7 +91,7 @@ class ComponentbuilderRouter extends JComponentRouterBase } unset($query['id']); } - + $total = count($segments); for ($i = 0; $i < $total; $i++) @@ -96,8 +99,8 @@ class ComponentbuilderRouter extends JComponentRouterBase $segments[$i] = str_replace(':', '-', $segments[$i]); } - return $segments; - + return $segments; + } /** @@ -110,10 +113,10 @@ class ComponentbuilderRouter extends JComponentRouterBase * @since 3.3 */ public function parse(&$segments) - { + { $count = count($segments); - $vars = array(); - + $vars = []; + // Handle View and Identifier switch($segments[0]) { @@ -135,7 +138,7 @@ class ComponentbuilderRouter extends JComponentRouterBase } return $vars; - } + } protected function getVar($table, $where = null, $whereString = null, $what = null, $category = false, $operator = '=', $main = 'componentbuilder') { @@ -144,7 +147,7 @@ class ComponentbuilderRouter extends JComponentRouterBase return false; } // Get a db connection. - $db = JFactory::getDbo(); + $db = Factory::getDbo(); // Create a new query object. $query = $db->getQuery(true); @@ -160,7 +163,7 @@ class ComponentbuilderRouter extends JComponentRouterBase { // we must check if the table exist (TODO not ideal) $tables = $db->getTableList(); - $app = JFactory::getApplication(); + $app = Factory::getApplication(); $prefix = $app->get('dbprefix'); $check = $prefix.$main.'_'.$table; if (in_array($check, $tables)) @@ -202,7 +205,7 @@ class ComponentbuilderRouter extends JComponentRouterBase } return false; } - + protected function checkString($string) { if (isset($string) && is_string($string) && strlen($string) > 0) @@ -216,7 +219,7 @@ class ComponentbuilderRouter extends JComponentRouterBase function ComponentbuilderBuildRoute(&$query) { $router = new ComponentbuilderRouter; - + return $router->build($query); } diff --git a/site/views/api/submitbutton.js b/site/views/api/submitbutton.js index 2458be89e..3c8ebb743 100644 --- a/site/views/api/submitbutton.js +++ b/site/views/api/submitbutton.js @@ -12,7 +12,7 @@ Joomla.submitbutton = function(task) { if (task == ''){ return false; - } else { + } else { var action = task.split('.'); if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){ Joomla.submitform(task, document.getElementById("adminForm")); diff --git a/site/views/api/tmpl/default.php b/site/views/api/tmpl/default.php index b087fc387..95867eb1e 100644 --- a/site/views/api/tmpl/default.php +++ b/site/views/api/tmpl/default.php @@ -12,9 +12,12 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); - +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Router\Route; +use Joomla\CMS\HTML\HTMLHelper as Html; ?>
    -

    +

    diff --git a/site/views/api/view.html.php b/site/views/api/view.html.php index 5d346fc42..caaf46e3c 100644 --- a/site/views/api/view.html.php +++ b/site/views/api/view.html.php @@ -12,7 +12,16 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); +use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Toolbar\Toolbar; +use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\HTML\HTMLHelper as Html; +use Joomla\CMS\Layout\FileLayout; use Joomla\CMS\MVC\View\HtmlView; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Toolbar\ToolbarHelper; +use VDM\Joomla\Utilities\StringHelper; /** * Componentbuilder Html View class for the Api @@ -21,13 +30,13 @@ class ComponentbuilderViewApi extends HtmlView { // Overwriting JView display method function display($tpl = null) - { + { // get combined params of both component and menu - $this->app = JFactory::getApplication(); + $this->app = Factory::getApplication(); $this->params = $this->app->getParams(); $this->menu = $this->app->getMenu()->getActive(); // get the user object - $this->user = JFactory::getUser(); + $this->user = Factory::getUser(); // Initialise variables. $this->item = $this->get('Item'); // do not load the display @@ -36,13 +45,13 @@ class ComponentbuilderViewApi extends HtmlView // Set the toolbar $this->addToolBar(); - // set the document + // Set the html view document stuff $this->_prepareDocument(); // Check for errors. if (count($errors = $this->get('Errors'))) { - throw new Exception(implode(PHP_EOL, $errors), 500); + throw new \Exception(implode(PHP_EOL, $errors), 500); } parent::display($tpl); @@ -57,12 +66,12 @@ class ComponentbuilderViewApi extends HtmlView // Only load jQuery if needed. (default is true) if ($this->params->get('add_jquery_framework', 1) == 1) { - JHtml::_('jquery.framework'); + Html::_('jquery.framework'); } // Load the header checker class. require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' ); // Initialize the header checker. - $HeaderCheck = new componentbuilderHeaderCheck; + $HeaderCheck = new componentbuilderHeaderCheck(); // Load uikit options. $uikit = $this->params->get('uikit_load'); @@ -74,15 +83,15 @@ class ComponentbuilderViewApi extends HtmlView // The uikit css. if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { - JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); + Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']); } // The uikit js. if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3) { - JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); - } + Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']); + } // add the document default css file - JHtml::_('stylesheet', 'components/com_componentbuilder/assets/css/api.css', ['version' => 'auto']); + Html::_('stylesheet', 'components/com_componentbuilder/assets/css/api.css', ['version' => 'auto']); } /** @@ -93,12 +102,12 @@ class ComponentbuilderViewApi extends HtmlView // set help url for this view if found $this->help_url = ComponentbuilderHelper::getHelpUrl('api'); - if (ComponentbuilderHelper::checkString($this->help_url)) + if (StringHelper::check($this->help_url)) { - JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); + ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url); } // now initiate the toolbar - $this->toolbar = JToolbar::getInstance(); + $this->toolbar = Toolbar::getInstance(); } /** @@ -111,6 +120,16 @@ class ComponentbuilderViewApi extends HtmlView public function escape($var, $sorten = false, $length = 40) { // use the helper htmlEscape method instead. - return ComponentbuilderHelper::htmlEscape($var, $this->_charset, $sorten, $length); + return StringHelper::html($var, $this->_charset, $sorten, $length); + } + + /** + * Get the Document (helper method toward Joomla 4 and 5) + */ + public function getDocument() + { + $this->document ??= JFactory::getDocument(); + + return $this->document; } }