diff --git a/.gitea/ISSUE_TEMPLATE/a-bug.yml b/.gitea/ISSUE_TEMPLATE/a-bug.yml
new file mode 100644
index 000000000..01a78f1a9
--- /dev/null
+++ b/.gitea/ISSUE_TEMPLATE/a-bug.yml
@@ -0,0 +1,165 @@
+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: 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/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 7ae4e2d56..8c7ce1943 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,24 +1,17 @@
Contributing to the Joomla Component Builder (JCB)
===============
-You are welcome to submit a contribution for review and possible inclusion in the Joomla Component Builder but, before it will be accepted, we ask that you follow these simple steps:
+If you wish to submit a contribution for review and potential inclusion in the Joomla Component Builder (JCB), please follow these simple steps:
-1) Please watch [these tutorials][Tutorials]
+1) Open an issue on GitHub, and if possible, provide a fix and create a pull request (PR). Creating a PR automatically generates an issue so that you do not need to create one separately.
-2) Open an issue on GitHub. If you can, please provide a fix and create a pull request (PR) instead; this will automatically create an issue for you so you do not have to create an issue if you are creating a pull request.
+2) Adhere to the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html).
-3) Follow the [Joomla! Coding Standards][Standards].
+3) When filing an issue or opening a PR, provide a clear and concise title and description. The title should include a brief summary of the issue and reference to an open issue if possible. For example, Invalid Query in com_admin (Ref #1234) is sufficient. Additionally, provide a detailed description of the issue or PR, including what the problem is, what the PR is addressing, testing instructions, and environmental information such as PHP version and database driver and version, in case the issue is specific to certain environments.
-4) When filing an issue or opening a PR, please include a clear title and description. The title should be a short summary of an issue and, if possible, should include a reference to an open issue. For example, `Invalid Query in com_admin (Ref #1234)` would be sufficient. All issues and PRs should include a description with as much detail as possible.
-If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission.
+4) Report security issues to the JCB! Core Team using the [Report security issues contact form](https://www.vdm.io/report-security-issues) instead of using public forums.
-5) Report security issues to the JCB! Core Team using the [Report security issues contact form][Security]. Please do not use the public forums for security issues.
-
-Please be patient as not all items will be tested immediately (remember, all bug testing for the JCB is done by volunteers) and be receptive to feedback about your code.
+Please be patient, as not all items will be immediately tested since all bug testing for the JCB is performed by volunteers. Additionally, be open to feedback regarding your code.
#### Branches
-PRs should usually be made to the `staging` branch as this contains the most recent version of the code.
-
-[Tutorials]: https://www.youtube.com/watch?v=lLOfx9YA7VQ&list=PLQRGFI8XZ_wsfz3NdKawCiYsALuZ-GhwJ
-[Standards]: https://developer.joomla.org/coding-standards.html\
-[Security]: http://joomlacomponentbuilder.com/report-security-issues
+For PRs, submit to the staging branch as it contains the most up-to-date version of the code.
diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md
index 905f46fc1..1d8b13a8f 100644
--- a/.github/SUPPORT.md
+++ b/.github/SUPPORT.md
@@ -1,27 +1,22 @@
Where can you get support and help?
====================
-+ [The JCB Tutorials][Tutorials]
-+ [Hello World Tutorial][HelloWorld]
-+ [The JCB! Wiki][Wiki]
-+ [JCB Forum][forum]
-+ [Report a Security Issue][Security]
-+ [Community Complaint][Complaint]
-+ [Open Issue On Github][Issue] ^^
+- [Package](https://git.vdm.dev/joomla/pkg-component-builder).
+- [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
+- [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
+- [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
+- [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
+- [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
+- [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
+- [Issues](https://git.vdm.dev/joomla/Component-Builder/issues). ^^
+- [Issues Stream](https://t.me/jcb_issues).
+- [Updates](https://t.me/jcb_updates).
+- [User Group](https://t.me/jcb_group).
+- [Announcement](https://t.me/Joomla_component_builder).
+- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
+- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
+- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
+- [Security](https://www.vdm.io/report-security-issues).
-Since JCB has become a community project [VDM.io][VDM] is **no longer solely responsible** for support.
-
-We have started a [**JCB forum**][forum] where you can post questions, about how things work, or if you need some kind of help in relation to your development of your components.
-
-^^ Then if you run into any issues, related to the JCB code, like bugs, **start by searching** the (*open & closed*) [issues][Issue] over on Github, and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines][guidelines].
-
-[Tutorials]: https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE
-[HelloWorld]: https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45
-[Wiki]: https://git.vdm.dev/joomla/Component-Builder/wiki
-[forum]: https://vdm.bz/jcb-forum
-[Security]: http://joomlacomponentbuilder.com/report-security-issues
-[Complaint]: http://joomlacomponentbuilder.com/community-complaint
-[Issue]: https://git.vdm.dev/joomla/Component-Builder/issues
-[VDM]: https://www.vdm.io/joomla-component-builder
-[guidelines]: https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md
+^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 000000000..f9cb19948
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,185 @@
+# v3.2.1-beta3
+
+- Fix version_update column size.
+- Improved the Schema Table update engine.
+
+# v3.2.1-beta2
+
+- Fix the media field size limitation. #1109
+- Add dynamic datatype update to schema field check.
+
+# v3.2.1-beta1
+
+- Add fallback option to ensure that all JCB tables and fields exist.
+- Move the powers autoloader to its own file.
+
+# v3.2.1-alpha4
+
+- Add Joomla powers for namespace dynamic management.
+
+# v3.2.1-alpha3
+
+- Fix plugin code display when methods and properties are missing.
+
+# v3.2.1-alpha2
+
+- Add view list and single name fix.
+- Add component code name fix.
+- Add reset list of powers.
+- Fix missing Factory class in plugin. #1102
+
+# v3.2.1-alpha1
+
+- Add power path override option on component level.
+- Fix the sql build feature. #1032
+
+# 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.
+- Fixed connection failure to remote server.
+- Adds overriding of back-folder and git-folder on component level.
+
+# v3.1.27
+
+- Adds better remote repository management for the super power features.
+- Fixes #1014 so that powers are added to components.
+
+# v3.1.26
+
+- Fixed changelog direction so newest changes is listed at top of the file.
+- Finished the init function of super powers.
+- Adds rest function inside super power.
+- Adds super powers to all templates.
+- Updates many helper class methods to now use the utility classes.
+- Adds the `spl_autoload_register` method to the component entry file (as-well).
+- Moved most methods from the compiler fields class to powers. #955
+- Refactored many new builder classes from the registry class.
+- Converted the Content class to two builder classes.
+- 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 `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.
+- Improved the `getDynamicContent` method and all banner locations to fetch from https://git.vdm.dev/joomla/jcb-external/ instead.
+- Major stability improvements all over the new powers complier classes.
+- New [base Registry class](https://git.vdm.dev/joomla/super-powers/src/branch/master/src/7e822c03-1b20-41d1-9427-f5b8d5836af7) has been created specially for JCB.
+- Remember to update all plug-ins with this version update (use the package).
+
+# v3.1.24
+
+- Fix the update server #978 issue.
+- Fixed the change log to load all entries, not just the last one.
+- Fixed #983 so that database updates are created when adding a new adminview
+- Moved a few builder arrays to the Compiler Registry
+- Adds super powers to JCB
+- Adds Gitea API library
+- Improves Power filters
+- Fix #991 to add the Utilities service class
+- Adds Superpower Key (SPK) replacement feature
+- Adds Superpower search (GREP) feature
+- Adds Power Insert/Update Classes
+- Fix #995 that all update sites are using the correct URL
+
+# v3.1.19
+
+- We fixed #972 so that custom code (in the header) will be added after the power namespaces
+- We added a message to show when a server move failed
+- We fixed the BaseConfig to not use '_' as separator
+- We fixed the footable loading issue
+- We removed the need for passing placeholders by reference
+- We added the option to generate a CHANGELOG
+- We fixed the server class to load new client if server details changed.
+- We fixed the readme placeholder issue #978.
+- We fixed the empty server url issue #978.
+- Fixed Package import to now use the phplibsec version 3
\ No newline at end of file
diff --git a/README.md b/README.md
index 6f5a0b002..1162ef525 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
-# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
+# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@@ -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.5) 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.1-beta3) 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)
@@ -23,8 +23,8 @@ Some of the Features
+ Add you [own dashboard](https://www.youtube.com/watch?v=tU7TeYn1Djo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=60) in the back-end.
+ [Dynamic File and Folder](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=56) Inclusion concept.
+ [Easy Translation](https://www.youtube.com/watch?v=q5NwKGnOHoQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=51) via excel.
-+ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](http://joomlacomponentbuilder.com)
-+ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](http://joomlacomponentbuilder.com).
++ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](https://www.joomlacomponentbuilder.com)
++ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](https://www.joomlacomponentbuilder.com).
+ Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
@@ -83,13 +83,13 @@ You are in Control
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
-+ Export any component completely mapped in [JCB](http://joomlacomponentbuilder.com) and import into another [JCB](http://joomlacomponentbuilder.com).
++ Export any component completely mapped in [JCB](https://www.joomlacomponentbuilder.com) and import into another [JCB](https://www.joomlacomponentbuilder.com).
+ This and much much more are all possible with this component builder!
Get More Demo Content
====================
-> You can now get access to the WOW factor, [JCB](http://joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](http://joomlacomponentbuilder.com) mapped components.
+> You can now get access to the WOW factor, [JCB](https://www.joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](https://www.joomlacomponentbuilder.com) mapped components.
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
@@ -99,18 +99,22 @@ To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jc
Where can you get support and help?
====================
-+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
-+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
-+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
-+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki)
-+ [Forum](https://vdm.bz/jcb-forum)
-+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues)
-+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint)
-+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^
-
-Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
-
-We have started a [**JCB forum**](https://vdm.bz/jcb-forum) where you can post questions, about how things work, or if you need some kind of help in relation to your development of your components.
+- [Package](https://git.vdm.dev/joomla/pkg-component-builder).
+- [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
+- [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
+- [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
+- [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
+- [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
+- [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
+- [Issues](https://git.vdm.dev/joomla/Component-Builder/issues). ^^
+- [Issues Stream](https://t.me/jcb_issues).
+- [Updates](https://t.me/jcb_updates).
+- [User Group](https://t.me/jcb_group).
+- [Announcement](https://t.me/Joomla_component_builder).
+- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
+- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
+- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
+- [Security](https://www.vdm.io/report-security-issues).
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
@@ -125,14 +129,14 @@ Our idea was to almost let this tool serve as a cheat sheet to how things can be
MAKING IT BETTER!
====================
-Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](http://joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](http://joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
+Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](https://www.joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](https://www.joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
TODO
======
-- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](http://joomlacomponentbuilder.com).
-- Team collaborative development across [JCB](http://joomlacomponentbuilder.com) installations offline and online.
-- Documentation (maintained by the community) for [JCB](http://joomlacomponentbuilder.com). (help us select the best system for this)
+- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](https://www.joomlacomponentbuilder.com).
+- Team collaborative development across [JCB](https://www.joomlacomponentbuilder.com) installations offline and online.
+- Documentation (maintained by the community) for [JCB](https://www.joomlacomponentbuilder.com). (help us select the best system for this)
# Build Details
@@ -140,17 +144,17 @@ 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*: 31st August, 2022
-+ *Version*: 3.1.5
++ *Last Build*: 24th April, 2024
++ *Version*: 3.2.1-beta3
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **319873**
-+ *Field count*: **2002**
-+ *File count*: **2090**
-+ *Folder count*: **359**
++ *Line count*: **764955**
++ *Field count*: **2097**
++ *File count*: **5382**
++ *Folder count*: **471**
-> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
-> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+> 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)
## Contributors
diff --git a/admin/README.txt b/admin/README.txt
index 6f5a0b002..1162ef525 100644
--- a/admin/README.txt
+++ b/admin/README.txt
@@ -1,5 +1,5 @@
-# Joomla Component Builder ([JCB](http://joomlacomponentbuilder.com))
+# Joomla Component Builder ([JCB](https://www.joomlacomponentbuilder.com))
This is a [Joomla 3.x](https://extensions.joomla.org/extension/component-builder/) component. [__See In Action__](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@@ -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.5) 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.1-beta3) 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)
@@ -23,8 +23,8 @@ Some of the Features
+ Add you [own dashboard](https://www.youtube.com/watch?v=tU7TeYn1Djo&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=60) in the back-end.
+ [Dynamic File and Folder](https://www.youtube.com/watch?v=_c7wzW075lA&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=56) Inclusion concept.
+ [Easy Translation](https://www.youtube.com/watch?v=q5NwKGnOHoQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=51) via excel.
-+ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](http://joomlacomponentbuilder.com)
-+ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](http://joomlacomponentbuilder.com).
++ Adding your [own rule validation](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=46) to a field in [JCB](https://www.joomlacomponentbuilder.com)
++ [Automated backup system](https://www.youtube.com/watch?v=GUWZaODo_IM&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=0s&index=40) in [JCB](https://www.joomlacomponentbuilder.com).
+ Adding mySQL Dump to any View/Table.
+ Grab existing Table data and build a dynamic dump.
+ Unlimited [Joomla](https://extensions.joomla.org/extension/component-builder/) Components.
@@ -83,13 +83,13 @@ You are in Control
+ You can dynamically add internal help structures to all component.
+ There is no limitations on how big or how much you want to build (server limitation only).
+ This is a complete factory kind of component that functions like a deployment hub.
-+ Export any component completely mapped in [JCB](http://joomlacomponentbuilder.com) and import into another [JCB](http://joomlacomponentbuilder.com).
++ Export any component completely mapped in [JCB](https://www.joomlacomponentbuilder.com) and import into another [JCB](https://www.joomlacomponentbuilder.com).
+ This and much much more are all possible with this component builder!
Get More Demo Content
====================
-> You can now get access to the WOW factor, [JCB](http://joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](http://joomlacomponentbuilder.com) mapped components.
+> You can now get access to the WOW factor, [JCB](https://www.joomlacomponentbuilder.com) fully mapped can now be yours! Including many other [JCB](https://www.joomlacomponentbuilder.com) mapped components.
### All you need to do is [explained here](https://vdm.bz/how-to-get-free-vdm-package-keys)!
@@ -99,18 +99,22 @@ To install these packages [watch this tutorial](https://vdm.bz/how-to-install-jc
Where can you get support and help?
====================
-+ [The JCB Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE)
-+ [German Basic Introduction](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7)
-+ [Hello World Tutorial](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
-+ [The JCB! Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki)
-+ [Forum](https://vdm.bz/jcb-forum)
-+ [Report a Security Issue](http://joomlacomponentbuilder.com/report-security-issues)
-+ [Community Complaint](http://joomlacomponentbuilder.com/community-complaint)
-+ [Open Issue On Gitea](https://git.vdm.dev/joomla/Component-Builder/issues) ^^
-
-Since [JCB](http://joomlacomponentbuilder.com) has [become a community](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/SUPPORT.md) project [VDM.io](https://www.vdm.io/) is **no longer solely responsible** for support.
-
-We have started a [**JCB forum**](https://vdm.bz/jcb-forum) where you can post questions, about how things work, or if you need some kind of help in relation to your development of your components.
+- [Package](https://git.vdm.dev/joomla/pkg-component-builder).
+- [Download](https://git.vdm.dev/joomla/pkg-component-builder/archive/master.zip).
+- [Tutorials](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE).
+- [German](https://www.youtube.com/playlist?list=PLQRGFI8XZ_wu0tDFxJtZFwW7AxA4JHQV7).
+- [Hello World](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45).
+- [Discussions](https://github.com/vdm-io/Joomla-Component-Builder/discussions).
+- [Wiki](https://git.vdm.dev/joomla/Component-Builder/wiki).
+- [Issues](https://git.vdm.dev/joomla/Component-Builder/issues). ^^
+- [Issues Stream](https://t.me/jcb_issues).
+- [Updates](https://t.me/jcb_updates).
+- [User Group](https://t.me/jcb_group).
+- [Announcement](https://t.me/Joomla_component_builder).
+- [Beta](https://git.vdm.dev/joomla-beta/pkg-component-builder).
+- [Nightly Build](https://git.vdm.dev/joomla-beta/pkg-component-builder/archive/master.zip).
+- [Community Complaint](https://www.joomlacomponentbuilder.com/community-complaint).
+- [Security](https://www.vdm.io/report-security-issues).
^^ Then if you run into any issues, related to the [JCB](https://git.vdm.dev/joomla/Component-Builder/issues) code, like bugs, **start by searching** the (*open & closed*) issues over on [Gitea](https://git.vdm.dev/joomla/Component-Builder/issues), and if the issue has not been mentioned before, **then only** open a new issue, following the [community guidelines](https://git.vdm.dev/joomla/Component-Builder/src/branch/master/.github/CONTRIBUTING.md).
@@ -125,14 +129,14 @@ Our idea was to almost let this tool serve as a cheat sheet to how things can be
MAKING IT BETTER!
====================
-Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](http://joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](http://joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
+Get involved on the forums, and the Gitea issues, and you can even help us develop/improve the pipeline of [JCB](https://www.joomlacomponentbuilder.com) for continues delivery. We really want to see [JCB](https://www.joomlacomponentbuilder.com) remain the tool of choice for all [Joomla Component Development](https://extensions.joomla.org/extension/component-builder/) needs and ideas.
TODO
======
-- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](http://joomlacomponentbuilder.com).
-- Team collaborative development across [JCB](http://joomlacomponentbuilder.com) installations offline and online.
-- Documentation (maintained by the community) for [JCB](http://joomlacomponentbuilder.com). (help us select the best system for this)
+- Add automatic unit testing. To nurture pipeline integration for all components build with [JCB](https://www.joomlacomponentbuilder.com).
+- Team collaborative development across [JCB](https://www.joomlacomponentbuilder.com) installations offline and online.
+- Documentation (maintained by the community) for [JCB](https://www.joomlacomponentbuilder.com). (help us select the best system for this)
# Build Details
@@ -140,17 +144,17 @@ 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*: 31st August, 2022
-+ *Version*: 3.1.5
++ *Last Build*: 24th April, 2024
++ *Version*: 3.2.1-beta3
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
-+ *Line count*: **319873**
-+ *Field count*: **2002**
-+ *File count*: **2090**
-+ *Folder count*: **359**
++ *Line count*: **764955**
++ *Field count*: **2097**
++ *File count*: **5382**
++ *Folder count*: **471**
-> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com).
-> Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+> 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)
## Contributors
diff --git a/admin/access.xml b/admin/access.xml
index 1e51d294b..8bc3e282b 100644
--- a/admin/access.xml
+++ b/admin/access.xml
@@ -19,7 +19,6 @@
-
@@ -212,6 +211,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -235,7 +244,6 @@
-
@@ -410,6 +418,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -485,6 +506,8 @@
+
+
@@ -498,6 +521,10 @@
+
+
+
+
@@ -515,7 +542,6 @@
-
@@ -594,6 +620,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -896,6 +933,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/css/joomla_power.css b/admin/assets/css/joomla_power.css
new file mode 100644
index 000000000..2731fc5aa
--- /dev/null
+++ b/admin/assets/css/joomla_power.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/joomla_powers.css b/admin/assets/css/joomla_powers.css
new file mode 100644
index 000000000..2731fc5aa
--- /dev/null
+++ b/admin/assets/css/joomla_powers.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/search.css b/admin/assets/css/search.css
new file mode 100644
index 000000000..56b77adcf
--- /dev/null
+++ b/admin/assets/css/search.css
@@ -0,0 +1,40 @@
+/**
+ * @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 */
+
+.selected {
+ background-color:#d7d8db !important
+}
+tr.selected td {
+ background-color:#d7d8db !important
+}
+#search_settings_block .controls {
+ margin-left: 1px !important;
+}
+tr {
+ cursor:pointer
+}
+.found_code {
+ color: #46a546;
+ font-weight: bolder;
+}
+.search_details_title {
+ font-size: large;
+ font-weight: bolder;
+}
+.small_column {
+ padding: 2px;
+ text-align: center;
+}
+th.small_column {
+ padding: 2px !important;
+ text-align: center !important;
+}
diff --git a/admin/assets/images/icons/admin_view_add.png b/admin/assets/images/icons/admin_view_add.png
deleted file mode 100644
index 38b7209f5..000000000
Binary files a/admin/assets/images/icons/admin_view_add.png and /dev/null differ
diff --git a/admin/assets/images/icons/custom_admin_view_add.png b/admin/assets/images/icons/custom_admin_view_add.png
deleted file mode 100644
index cb35345f6..000000000
Binary files a/admin/assets/images/icons/custom_admin_view_add.png and /dev/null differ
diff --git a/admin/assets/images/icons/placeholders.png b/admin/assets/images/icons/placeholders.png
index dae19113e..e05f4a723 100644
Binary files a/admin/assets/images/icons/placeholders.png and b/admin/assets/images/icons/placeholders.png differ
diff --git a/admin/assets/images/icons/search.png b/admin/assets/images/icons/search.png
new file mode 100644
index 000000000..dae19113e
Binary files /dev/null and b/admin/assets/images/icons/search.png differ
diff --git a/admin/assets/images/icons/site_view_add.png b/admin/assets/images/icons/site_view_add.png
deleted file mode 100644
index 97a8ce39e..000000000
Binary files a/admin/assets/images/icons/site_view_add.png and /dev/null differ
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/assets/js/search.js b/admin/assets/js/search.js
new file mode 100644
index 000000000..1433d72ed
--- /dev/null
+++ b/admin/assets/js/search.js
@@ -0,0 +1,956 @@
+/**
+ * @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
+ */
+
+/* JS Document */
+/**
+ * JS Function to execute the search
+ */
+const doSearch = async (signal, tables) => {
+ try {
+ // build form
+ const formData = new FormData();
+
+ // load the result table
+ const resultsTable = new DataTable('#search_results_table');
+
+ // get the search mode
+ let typeSearch = modeObject.querySelector('input[type=\'radio\']:checked').value;
+
+ // set some search values
+ let searchValue = searchObject.value;
+ let replaceValue = replaceObject.value;
+ let matchValue = matchObject.checked ? 1 : 0;
+ let wholeValue = wholeObject.checked ? 1 : 0;
+ let regexValue = regexObject.checked ? 1 : 0;
+
+ // add the form data
+ formData.append('table_name', '');
+ formData.append('type_search', typeSearch);
+ formData.append('search_value', searchValue);
+ formData.append('replace_value', replaceValue);
+ formData.append('match_case', matchValue);
+ formData.append('whole_word', wholeValue);
+ formData.append('regex_search', regexValue);
+
+ // update the URL
+ updateUrlQuery(searchValue, replaceValue, matchValue, wholeValue, regexValue, typeSearch);
+
+ let abort_this_search_values = false;
+
+ // reset the progress bar
+ searchProgressBarObject.style.width = '0%';
+ searchProgressBarObject.innerHTML = '0%';
+
+ // show the progress bar
+ searchProgressObject.style.display = '';
+
+ // hidde the search button
+ startSearchButton.style.display = 'none';
+
+ // show the stop search button
+ stopSearchButton.style.display = '';
+
+ // start search timer
+ startSearchTimer();
+
+ // reset our global counters
+ fieldCount = 0;
+ lineCount = 0;
+
+ // set our local counters
+ let total = 0;
+ let progress = tables.length;
+ let index;
+
+ for (index = 0; index < progress; index++) {
+
+ let tableName = tables[index];
+
+ // add the table name
+ formData.set('table_name', tableName);
+
+ let options = {
+ signal: signal,
+ method: 'POST', // *GET, POST, PUT, DELETE, etc.
+ body: formData
+ }
+
+ if (abort_this_search_values) {
+ break;
+ }
+ const response = await fetch(UrlAjax + 'doSearch', options).then(response => {
+ total++;
+ // return the json response
+ if (response.ok) {
+ return response.json();
+ } else {
+ UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_THE_SEARCH_PROCESS_HAD_AN_ERROR_WITH_TABLE') + ' ' + tableName, {pos:'top-right', status:'danger'});
+ }
+ }).then((data) => {
+ if (typeof data.success !== 'undefined') {
+ UIkit.notify(data.success, {pos:'top-right', timeout : 200, status:'success'});
+ //} else if (typeof data.not_found !== 'undefined') {
+ // UIkit.notify(data.not_found, {pos:'bottom-right', timeout : 200});
+ }
+ if (typeof data.items !== 'undefined') {
+ addTableItems(resultsTable, data.items, typeSearch);
+ }
+ if (typeof data.fields_count !== 'undefined') {
+ fieldCount += data.fields_count;
+ }
+ if (typeof data.line_count !== 'undefined') {
+ lineCount += data.line_count;
+ }
+ // calculate the percent
+ let percent = 100.0 * (total / progress);
+ // update the progress bar
+ searchProgressObject.style.display = ''; // always make sure it still shows...
+ searchProgressBarObject.style.width = percent.toFixed(2) + '%';
+ searchProgressBarObject.innerHTML = percent.toFixed(2) + '%';
+ // when complete hide the progress bar
+ if (progress == total) {
+ let total_field_line = ' ' + fieldCount + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_FIELDS_THAT_HAD') + ' ' + lineCount + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_LINES') + ' ';
+ if (progress == 1) {
+ searchProgressBarObject.innerHTML = Joomla.JText._('COM_COMPONENTBUILDER_SEARCHING') + ' ' + tableName + total_field_line + Joomla.JText._('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN') + ' ' + getSearchLenght() + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_SECONDS');
+ } else {
+ searchProgressBarObject.innerHTML = Joomla.JText._('COM_COMPONENTBUILDER_SEARCHING') + ' ' + progress + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_TABLES_WITH') + total_field_line + Joomla.JText._('COM_COMPONENTBUILDER_AND_FINISHED_THE_SEARCH_IN') + ' ' + getSearchLenght() + ' ' + Joomla.JText._('COM_COMPONENTBUILDER_SECONDS');
+ }
+ // show the search button
+ startSearchButton.style.display = '';
+ // hidde the stop search button
+ stopSearchButton.style.display = 'none';
+ setTimeout(function () {
+ // hide the progress bar again
+ searchProgressObject.style.display = 'none';
+ }, 13000);
+ }
+ }).catch(error => {
+ console.log(error);
+ if (error.name === "AbortError") {
+ abort_this_search_values = true;
+ }
+ });
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ // Executed regardless if we caught the error
+ }
+};
+
+
+/**
+ * JS Function to start search timer
+ */
+const startSearchTimer = () => {
+ startSearchTime = new Date();
+};
+
+/**
+ * JS Function to get search lenght
+ */
+const getSearchLenght = () => {
+ // set ending time
+ endSearchTime = new Date();
+
+ // get diff in ms
+ var timeDiff = endSearchTime - startSearchTime;
+
+ // strip the ms
+ timeDiff /= 1000;
+
+ // get seconds
+ return Math.round(timeDiff);
+};
+
+/**
+ * JS Function to fetch selected item
+ */
+const getSelectedItem = async (table, row, field, line) => {
+ try {
+ // get the search mode
+ let mode = modeObject.querySelector('input[type=\'radio\']:checked').value;
+
+ // build form
+ const formData = new FormData();
+
+ formData.append('field_name', field);
+ formData.append('row_id', row);
+ formData.append('table_name', table);
+ formData.append('search_value', searchObject.value);
+ formData.append('replace_value', replaceObject.value);
+ formData.append('match_case', matchObject.checked ? 1 : 0);
+ formData.append('whole_word', wholeObject.checked ? 1 : 0);
+ formData.append('regex_search', regexObject.checked ? 1 : 0);
+
+ // get search value
+ if (mode == 2) {
+ // add the line value
+ formData.append('line_nr', line);
+ // calling URL
+ postURL = UrlAjax + 'getReplaceValue';
+ } else {
+ // calling URL
+ postURL = UrlAjax + 'getSearchValue';
+ }
+
+ let options = {
+ method: 'POST', // *GET, POST, PUT, DELETE, etc.
+ body: formData
+ }
+
+ const response = await fetch(postURL, options).then(response => {
+ if (response.ok) {
+ return response.json();
+ }
+ }).then((data) => {
+ if (typeof data.success !== 'undefined') {
+ UIkit.notify(data.success, {pos:'top-right', status:'success'});
+ }
+ if (typeof data.value !== 'undefined') {
+ addSelectedItem(data.value, table, row, field, line);
+ }
+ }).catch(error => {
+ console.log(error);
+ });
+ } catch (error) {
+ console.log(error);
+ } finally {
+ // Executed regardless if we caught the error
+ }
+};
+
+/**
+ * JS Function to check if we should save/update the all current found items
+ */
+const replaceAllCheck = () => {
+ // get the current searc and replace values
+ let searchValue = searchObject.value;
+ let replaceValue = replaceObject.value;
+ // load question
+ let question = Joomla.JText._('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_BALLB_VALUES_THAT_CAN_BE_FOUND_IN_THE_DATABASE') + ' ' +
+ Joomla.JText._('COM_COMPONENTBUILDER_YOU_WILL_REPLACE') + ': [' + htmlentities(searchValue) + '] ' +
+ Joomla.JText._('COM_COMPONENTBUILDER_WITH') + ': [' + htmlentities(replaceValue) + '] ' +
+ Joomla.JText._('COM_COMPONENTBUILDER_THIS_CAN_NOT_BE_UNDONE_BYOU_HAVE_BEEN_WARNEDB') + '
' +
+ Joomla.JText._('COM_COMPONENTBUILDER_ARE_YOU_THEREFORE_ABSOLUTELY_SURE_YOU_WANT_TO_CONTINUE');
+ // do check
+ UIkit.modal.confirm(question, function () {
+
+ // show the search settings again
+ showSearch();
+
+ // Create new controller and issue new request
+ controller_replace = new AbortController();
+
+ // check if any specific table was set
+ let tables = [];
+ let table = tableObject.value;
+ if (table != -1) {
+ tables.push(table);
+ replaceAll(controller_replace.signal, tables);
+ } else {
+ replaceAll(controller_replace.signal, searchTables);
+ }
+ }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES_UPDATE_ALL'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
+};
+
+/**
+ * JS Function to execute the search
+ */
+const replaceAll = async (signal, tables) => {
+ try {
+ // build form
+ const formData = new FormData();
+
+ // get the search mode
+ let typeSearch = modeObject.querySelector('input[type=\'radio\']:checked').value;
+
+ // set some search values
+ let searchValue = searchObject.value;
+ let replaceValue = replaceObject.value;
+ let matchValue = matchObject.checked ? 1 : 0;
+ let wholeValue = wholeObject.checked ? 1 : 0;
+ let regexValue = regexObject.checked ? 1 : 0;
+
+ // add the form data
+ formData.append('table_name', '');
+ formData.append('type_search', typeSearch);
+ formData.append('search_value', searchValue);
+ formData.append('replace_value', replaceValue);
+ formData.append('match_case', matchValue);
+ formData.append('whole_word', wholeValue);
+ formData.append('regex_search', regexValue);
+
+ // reset the progress bar
+ replaceProgressBarObject.style.width = '0%';
+
+ // show the progress bar
+ replaceProgressObject.style.display = '';
+
+ let abort_this_replace_values = false;
+
+ let total = 0;
+ let progress = tables.length;
+ let index;
+
+ for (index = 0; index < progress; index++) {
+
+ let tableName = tables[index];
+
+ // add the table name
+ formData.set('table_name', tableName);
+
+ let options = {
+ signal: signal,
+ method: 'POST', // *GET, POST, PUT, DELETE, etc.
+ body: formData
+ }
+
+ if (abort_this_replace_values) {
+ break;
+ }
+ const response = await fetch(UrlAjax + 'replaceAll', options).then(response => {
+ total++;
+ if (response.ok) {
+ return response.json();
+ } else {
+ UIkit.notify(Joomla.JText._('COM_COMPONENTBUILDER_THE_REPLACE_PROCESS_HAD_AN_ERROR_WITH_TABLE') + ' ' + tableName, {pos:'top-right', status:'danger'});
+ }
+ }).then((data) => {
+ if (typeof data.success !== 'undefined') {
+ UIkit.notify(data.success, {pos:'top-right', timeout : 200, status:'success'});
+ } else if (typeof data.error !== 'undefined') {
+ UIkit.notify(data.error, {pos:'bottom-right', timeout : 200});
+ }
+ // calculate the percent
+ let percent = 100.0 * (total / progress);
+ // update the progress bar
+ replaceProgressBarObject.style.width = percent.toFixed(2) + '%';
+ // when complete hide the progress bar
+ if (progress == total) {
+ setTimeout(function () {
+ // hide the progress bar again
+ replaceProgressObject.style.display = 'none';
+ // we clear the table again
+ clearAll();
+ // if not reqex we reverse the search for you so you can see the update was a success
+ if (regexValue == 0) {
+ // set the replace value as the search value
+ UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_DO_A_REVERSE_SEARCH'), function(){
+ startNewSearch(replaceValue, searchValue, matchValue, wholeValue, regexValue, 2);
+ }, function () {
+ UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH'), function(){
+ startSearch();
+ }, function () {
+ clearSearch();
+ }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
+ }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
+ } else {
+ // else we search it again just to prove its changed
+ UIkit.modal.confirm(Joomla.JText._('COM_COMPONENTBUILDER_WOULD_YOU_LIKE_TO_REPEAT_THE_SAME_SEARCH'), function(){
+ startSearch();
+ }, function () {
+ clearSearch();
+ }, {labels: { Ok: Joomla.JText._('COM_COMPONENTBUILDER_YES'), Cancel: Joomla.JText._('COM_COMPONENTBUILDER_NO') }});
+ }
+ }, 3000);
+ }
+ }).catch(error => {
+ console.log(error);
+ if (error.name === "AbortError") {
+ abort_this_replace_values = true;
+ }
+ });
+ }
+ } catch (error) {
+ console.log(error);
+ } finally {
+ // Executed regardless if we caught the error
+ }
+};
+
+/**
+ * JS Function to check if we should save/update the current selected item
+ */
+const setValueCheck = (row, field, table) => {
+ // load question
+ let question = Joomla.JText._('COM_COMPONENTBUILDER_YOUR_ARE_ABOUT_TO_UPDATE_ROW') + ' (' + row + ') -> (' + field + ') ' +
+ Joomla.JText._('COM_COMPONENTBUILDER_FIELD_IN_THE') + ' (' + table + ') ' + Joomla.JText._('COM_COMPONENTBUILDER_TABLE') + '.
';
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 @@
// 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 @@ public function __construct($config)
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 @@ public function help()
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 @@ protected function getHelpDocumentText($id)
$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 @@
// 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 @@ function display($cachable = false, $urlparams = false)
'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 @@ function display($cachable = false, $urlparams = false)
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 @@ public function __construct($config)
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 9a13dbd18..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
*/
@@ -17,8 +17,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-use Joomla\CMS\MVC\Controller\BaseController;
-use Joomla\Utilities\ArrayHelper;
+###IMPORT_CONTROLLER_HEADER###
/**
* ###Component### Import Base Controller
@@ -33,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 a4474ba5e..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
*/
@@ -17,8 +17,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-use Joomla\CMS\MVC\Controller\BaseController;
-use Joomla\Utilities\ArrayHelper;
+###IMPORT_CUSTOM_CONTROLLER_HEADER###
/**
* ###Component### ###View### Base Controller
@@ -33,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 7d7b21a68..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
*/
@@ -17,13 +17,9 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-use Joomla\CMS\MVC\Model\BaseDatabaseModel;
-use Joomla\CMS\Filesystem\File;
-use Joomla\CMS\Filesystem\Folder;
-use Joomla\Utilities\ArrayHelper;
-use PhpOffice\PhpSpreadsheet\IOFactory;
+###IMPORT_MODEL_HEADER###
-/**
+/***
* ###Component### Import Base Database Model
*/
class ###Component###ModelImport extends BaseDatabaseModel
@@ -31,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
*/
@@ -49,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.
*
@@ -66,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', '');
@@ -86,14 +82,14 @@ protected function populateState()
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)
{
@@ -114,9 +110,9 @@ public function import()
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');
@@ -124,7 +120,7 @@ public function import()
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;
@@ -138,10 +134,10 @@ public function import()
$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);
@@ -150,13 +146,13 @@ public function import()
$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)
{
@@ -168,12 +164,12 @@ public function import()
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;
}
@@ -184,7 +180,7 @@ public function import()
// remove file after import
$this->remove($package['packagename']);
$session->clear($this->getType.'_VDM_IMPORTHEADERS');
-
+
return $result;
}
@@ -194,48 +190,47 @@ public function import()
* @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');
@@ -257,16 +252,16 @@ protected function _getPackageFromUpload()
*/
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;
}
@@ -276,17 +271,17 @@ protected function _getPackageFromFolder()
// 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;
@@ -302,26 +297,26 @@ protected function _getPackageFromFolder()
*/
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;
}
@@ -330,7 +325,7 @@ protected function _getPackageFromUrl()
return $package;
}
-
+
/**
* Check a file and verifies it as a spreadsheet file
* Supports .csv .xlsx .xls and .ods
@@ -342,29 +337,29 @@ protected function _getPackageFromUrl()
*/
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###
@@ -379,8 +374,8 @@ protected function check($archivename)
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?
@@ -388,23 +383,23 @@ protected function remove($package)
{
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)
@@ -413,7 +408,7 @@ protected function getAlias($name,$type = false)
}
return $alias;
}
-
+
/**
* Method to generate a uniqe value.
*
@@ -428,16 +423,16 @@ protected function getUniqe($value,$field,$type)
// 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 43d0c526f..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
*/
@@ -17,11 +17,7 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-use Joomla\CMS\MVC\Model\BaseDatabaseModel;
-use Joomla\CMS\Filesystem\File;
-use Joomla\CMS\Filesystem\Folder;
-use Joomla\Utilities\ArrayHelper;
-use PhpOffice\PhpSpreadsheet\IOFactory;
+###IMPORT_CUSTOM_MODEL_HEADER###
/**
* ###Component### ###View### Base Database Model
@@ -31,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
*/
@@ -49,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.
*
@@ -66,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', '');
@@ -76,7 +72,7 @@ protected function populateState()
$this->setState('import.directory', $path);
parent::populateState();
}
- ###IMPORT_METHOD_CUSTOM###
+ ###IMPORT_METHOD_CUSTOM###
/**
* Works out an importation spreadsheet from a HTTP upload
@@ -84,37 +80,37 @@ protected function populateState()
* @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'];
@@ -124,7 +120,7 @@ protected function _getPackageFromUpload()
// Was the package downloaded?
if (!$p_file)
{
- $session = JFactory::getSession();
+ $session = Factory::getSession();
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
@@ -146,16 +142,16 @@ protected function _getPackageFromUpload()
*/
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;
}
@@ -165,17 +161,17 @@ protected function _getPackageFromFolder()
// 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;
@@ -191,7 +187,7 @@ protected function _getPackageFromFolder()
*/
protected function _getPackageFromUrl()
{
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$input = $app->input;
// Get the URL of the package to import
@@ -200,17 +196,17 @@ protected function _getPackageFromUrl()
// 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;
}
@@ -219,7 +215,7 @@ protected function _getPackageFromUrl()
return $package;
}
-
+
/**
* Check a file and verifies it as a spreadsheet file
* Supports .csv .xlsx .xls and .ods
@@ -231,29 +227,29 @@ protected function _getPackageFromUrl()
*/
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###
@@ -268,9 +264,7 @@ protected function check($archivename)
*/
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?
@@ -278,10 +272,10 @@ protected function remove($package)
{
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###
@@ -290,13 +284,13 @@ protected function remove($package)
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)
@@ -305,7 +299,7 @@ protected function getAlias($name,$type = false)
}
return $alias;
}
-
+
/**
* Method to generate a uniqe value.
*
@@ -320,16 +314,16 @@ protected function getUniqe($value,$field,$type)
// 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/CHANGELOG.md b/admin/compiler/joomla_3/CHANGELOG.md
new file mode 100644
index 000000000..def8704dd
--- /dev/null
+++ b/admin/compiler/joomla_3/CHANGELOG.md
@@ -0,0 +1 @@
+###CHANGELOG###
\ No newline at end of file
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 @@
/**
* ###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 @@ function display($tpl = null)
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 @@ protected function addToolBar()
*/
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 @@ public function __construct($config = array())
*
* @since 1.6
*/
- protected function allowAdd($data = array())
+ protected function allowAdd($data = [])
{###JCONTROLLERFORM_ALLOWADD###
}
@@ -69,7 +69,7 @@ protected function allowAdd($data = array())
*
* @since 1.6
*/
- protected function allowEdit($data = array(), $key = 'id')
+ protected function allowEdit($data = [], $key = 'id')
{###JCONTROLLERFORM_ALLOWEDIT###
}
@@ -94,12 +94,12 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
// 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 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
*/
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 @@ public function cancel($key = null)
$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 @@ public function cancel($key = null)
// Redirect to the item screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@@ -175,7 +175,7 @@ public function cancel($key = null)
// Redirect to the list screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@@ -201,7 +201,7 @@ public function save($key = null, $urlVar = null)
// 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 @@ public function save($key = null, $urlVar = null)
// 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 @@ public function save($key = null, $urlVar = null)
* 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 @@ public function __construct($config = array())
*
* @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 @@ protected function allowEdit($data = array(), $key = 'id')
*
* @since 1.6
*/
- protected function allowAdd($data = array())
+ protected function allowAdd($data = [])
{
// to insure no other tampering
return false;
@@ -101,7 +101,7 @@ protected function allowSave($data, $key = 'id')
*
* @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 @@ public function __construct($config = array())
*
* @since 1.6
*/
- protected function allowAdd($data = array())
+ protected function allowAdd($data = [])
{###JCONTROLLERFORM_ALLOWADD###
}
@@ -69,7 +69,7 @@ protected function allowAdd($data = array())
*
* @since 1.6
*/
- protected function allowEdit($data = array(), $key = 'id')
+ protected function allowEdit($data = [], $key = 'id')
{###JCONTROLLERFORM_ALLOWEDIT###
}
@@ -94,12 +94,12 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
// 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 @@ protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
*/
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 @@ public function cancel($key = null)
$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 @@ public function save($key = null, $urlVar = null)
// 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 @@ public function save($key = null, $urlVar = null)
// 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 @@ public function save($key = null, $urlVar = null)
* 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 12ed53087..5df959fc1 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
*/
@@ -15,7 +15,14 @@
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###ADMIN_POWER_HELPER###
+defined('_JEXEC') or die('Restricted access');
+
+// The power autoloader for this project admin area.
+$power_autoloader = JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/powerloader.php';
+if (file_exists($power_autoloader))
+{
+ require_once $power_autoloader;
+}
###ADMIN_HELPER_CLASS_HEADER###
@@ -26,14 +33,14 @@ abstract class ###Component###Helper
{
/**
* Composer Switch
- *
+ *
* @var array
*/
- protected static $composer = array();
+ protected static $composer = [];
/**
* The Main Active Language
- *
+ *
* @var string
*/
public static $langTag;###ADMIN_GLOBAL_EVENT_HELPER######CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
@@ -47,7 +54,7 @@ public static function composerAutoload($target)
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))
{
@@ -69,7 +76,7 @@ public static function manifest()
/**
* Joomla version object
- */
+ */
protected static $JVersion;
/**
@@ -78,9 +85,9 @@ public static function manifest()
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;
}
@@ -91,18 +98,18 @@ public static function jVersion()
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 +123,8 @@ public static function getContributors()
$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;
@@ -129,13 +136,13 @@ public static function getContributors()
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###
/**
- * Get a Variable
+ * Get a Variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
@@ -145,46 +152,18 @@ public static function addSubmenu($submenu)
* @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###')
{
- if(!$where)
- {
- $where = JFactory::getUser()->id;
- }
- // Get a db connection.
- $db = JFactory::getDbo();
- // Create a new query object.
- $query = $db->getQuery(true);
- $query->select($db->quoteName(array($what)));
- if (empty($table))
- {
- $query->from($db->quoteName('#__'.$main));
- }
- else
- {
- $query->from($db->quoteName('#__'.$main.'_'.$table));
- }
- if (is_numeric($where))
- {
- $query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
- }
- elseif (is_string($where))
- {
- $query->where($db->quoteName($whereString) . ' '.$operator.' '. $db->quote((string)$where));
- }
- else
- {
- return false;
- }
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- return $db->loadResult();
- }
- return false;
+ return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(
+ $table,
+ $where,
+ $whereString,
+ $what,
+ $operator,
+ $main
+ );
}
/**
@@ -199,110 +178,38 @@ public static function getVar($table, $where = null, $whereString = 'user', $wha
* @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)
{
- if(!$where)
- {
- $where = JFactory::getUser()->id;
- }
-
- if (!self::checkArray($where) && $where > 0)
- {
- $where = array($where);
- }
-
- if (self::checkArray($where))
- {
- // prep main <-- why? well if $main='' is empty then $table can be categories or users
- if (self::checkString($main))
- {
- $main = '_'.ltrim($main, '_');
- }
- // Get a db connection.
- $db = JFactory::getDbo();
- // Create a new query object.
- $query = $db->getQuery(true);
-
- $query->select($db->quoteName(array($what)));
- if (empty($table))
- {
- $query->from($db->quoteName('#__'.$main));
- }
- else
- {
- $query->from($db->quoteName('#_'.$main.'_'.$table));
- }
- // add strings to array search
- if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
- {
- $query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
- }
- else
- {
- $query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
- }
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- if ($unique)
- {
- return array_unique($db->loadColumn());
- }
- return $db->loadColumn();
- }
- }
- return false;
+ 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')
{
- // do some table foot work
- $external = false;
- if (strpos($table, '#__') !== false)
- {
- $external = true;
- $table = str_replace('#__', '', $table);
- }
- // check if string is JSON
- $result = json_decode($value, true);
- if (json_last_error() === JSON_ERROR_NONE)
- {
- // is JSON
- if (self::checkArray($result))
- {
- if (self::checkString($table))
- {
- $names = array();
- foreach ($result as $val)
- {
- if ($external)
- {
- if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
- {
- $names[] = $_name;
- }
- }
- else
- {
- if ($_name = self::getVar($table, $val, $id, $name))
- {
- $names[] = $_name;
- }
- }
- }
- if (self::checkArray($names))
- {
- return (string) implode($sperator,$names);
- }
- }
- return (string) implode($sperator,$result);
- }
- return (string) json_decode($value);
- }
- return $value;
+ return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(
+ $value,
+ $sperator,
+ $table,
+ $id,
+ $name
+ );
}
public static function isPublished($id,$type)
@@ -311,7 +218,7 @@ public static function isPublished($id,$type)
{
$type = 'item';
}
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select(array('a.published'));
$query->from('#__###component###_'.$type.' AS a');
@@ -329,7 +236,7 @@ public static function isPublished($id,$type)
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');
@@ -338,7 +245,7 @@ public static function getGroupName($id)
$db->execute();
$found = $db->getNumRows();
if($found)
- {
+ {
return $db->loadResult();
}
return $id;
@@ -354,39 +261,39 @@ public static function getGroupName($id)
* @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::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 = 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');
@@ -395,12 +302,12 @@ public static function getActions($view, &$record = null, $views = null, $target
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;
}
@@ -421,7 +328,7 @@ public static function getActions($view, &$record = null, $views = null, $target
// 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
@@ -454,7 +361,7 @@ public static function getActions($view, &$record = null, $views = null, $target
}
}
}
- 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';
@@ -526,7 +433,7 @@ public static function getActions($view, &$record = null, $views = null, $target
* @param array $targets The array of target actions
*
* @return boolean true if action should be filtered out
- *
+ *
*/
protected static function filterActions(&$view, &$action, &$targets)
{
@@ -545,22 +452,22 @@ protected static function filterActions(&$view, &$action, &$targets)
/**
* 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 = self::safeString($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']) || !self::checkString($config['table_path']))
+ if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::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)
{
@@ -595,14 +502,14 @@ public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $C
*/
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.
@@ -626,14 +533,14 @@ public static function setAsset($id, $table, $inherit = true)
$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
@@ -646,7 +553,7 @@ public static function setAsset($id, $table, $inherit = true)
$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;
@@ -663,7 +570,7 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
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'))
@@ -678,8 +585,8 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
}
}
// 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);
@@ -694,7 +601,7 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
elseif ($inherit)
{
// clear the value since we inherit
- $rule = array();
+ $rule = [];
}
}
// check if there are any view values remaining
@@ -702,8 +609,8 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
{
$_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;
}
@@ -717,35 +624,12 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
*
- * @return null
- *
+ * @return void
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/
public static function xmlAppend(&$xml, $node)
{
- if (!$node)
- {
- // element was not returned
- return;
- }
- switch (get_class($node))
- {
- case 'stdClass':
- if (property_exists($node, 'comment'))
- {
- self::xmlComment($xml, $node->comment);
- }
- if (property_exists($node, 'fieldXML'))
- {
- self::xmlAppend($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;
- }
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
}
/**
@@ -754,16 +638,12 @@ public static function xmlAppend(&$xml, $node)
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
- * @return null
- *
+ * @return void
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/
public static function xmlComment(&$xml, $comment)
{
- $domXML = dom_import_simplexml($xml);
- $domComment = new DOMComment($comment);
- $nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
- $domXML->appendChild($nodeTarget);
- $xml = simplexml_import_dom($domXML);
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
}
/**
@@ -773,14 +653,11 @@ public static function xmlComment(&$xml, $comment)
* @param array $attributes The attributes to apply to the XML element
*
* @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 = [])
{
- foreach ($attributes as $key => $value)
- {
- $xml->addAttribute($key, $value);
- }
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
/**
@@ -790,16 +667,11 @@ public static function xmlAddAttributes(&$xml, $attributes = array())
* @param array $options The options to apply to the XML element
*
* @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 = [])
{
- foreach ($options as $key => $value)
- {
- $addOption = $xml->addChild('option');
- $addOption->addAttribute('value', $key);
- $addOption[] = $value;
- }
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
/**
@@ -810,28 +682,11 @@ public static function xmlAddOptions(&$xml, $options = array())
* @param array $options The options to apply to the XML element
*
* @return object
- *
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/
public static function getFieldObject(&$attributes, $default = '', $options = null)
{
- // make sure we have attributes and a type value
- if (self::checkArray($attributes) && isset($attributes['type']))
- {
- // make sure the form helper class is loaded
- if (!method_exists('JFormHelper', 'loadFieldType'))
- {
- jimport('joomla.form.form');
- }
- // get field type
- $field = JFormHelper::loadFieldType($attributes['type'], true);
- // get field xml
- $XML = self::getFieldXML($attributes, $options);
- // setup the field
- $field->setup($XML, $default);
- // return the field object
- return $field;
- }
- return false;
+ return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
}
/**
@@ -841,27 +696,11 @@ public static function getFieldObject(&$attributes, $default = '', $options = nu
* @param array $options The options to apply to the XML element
*
* @return object
- *
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/
public static function getFieldXML(&$attributes, $options = null)
{
- // make sure we have attributes and a type value
- if (self::checkArray($attributes))
- {
- // start field xml
- $XML = new SimpleXMLElement('');
- // load the attributes
- self::xmlAddAttributes($XML, $attributes);
- // check if we have options
- if (self::checkArray($options))
- {
- // load the options
- self::xmlAddOptions($XML, $options);
- }
- // return the field xml
- return $XML;
- }
- return false;
+ return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
}
/**
@@ -885,94 +724,69 @@ public static function renderBoolButton()
// 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
+ * @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)
{
- if (self::checkString($string))
- {
- json_decode($string);
- return (json_last_error() === JSON_ERROR_NONE);
- }
- return false;
+ return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
}
/**
* 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);
*/
public static function checkObject($object)
{
- if (isset($object) && is_object($object))
- {
- return count((array)$object) > 0;
- }
- return false;
+ return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
}
/**
* 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);
*/
public static function checkArray($array, $removeEmptyString = false)
{
- if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0)
- {
- // also make sure the empty strings are removed
- if ($removeEmptyString)
- {
- foreach ($array as $key => $string)
- {
- if (empty($string))
- {
- unset($array[$key]);
- }
- }
- return self::checkArray($array, false);
- }
- return $nr;
- }
- return 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
+ * @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)
{
- if (isset($string) && is_string($string) && strlen($string) > 0)
- {
- return true;
- }
- return false;
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
}
/**
@@ -984,8 +798,8 @@ public static function checkString($string)
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
@@ -1003,25 +817,14 @@ public static function isConnected()
/**
* 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);
*/
public static function mergeArrays($arrays)
{
- if(self::checkArray($arrays))
- {
- $arrayBuket = array();
- foreach ($arrays as $array)
- {
- if (self::checkArray($array))
- {
- $arrayBuket = array_merge($arrayBuket, $array);
- }
- }
- return $arrayBuket;
- }
- return false;
+ return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
}
// typo sorry!
@@ -1033,310 +836,100 @@ public static function sorten($string, $length = 40, $addTip = true)
/**
* 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(...);
*/
public static function shorten($string, $length = 40, $addTip = true)
{
- if (self::checkString($string))
- {
- $initial = strlen($string);
- $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
- $words_count = count((array)$words);
-
- $word_length = 0;
- $last_word = 0;
- for (; $last_word < $words_count; ++$last_word)
- {
- $word_length += strlen($words[$last_word]);
- if ($word_length > $length)
- {
- break;
- }
- }
-
- $newString = implode(array_slice($words, 0, $last_word));
- $final = strlen($newString);
- if ($initial != $final && $addTip)
- {
- $title = self::shorten($string, 400 , false);
- return ''.trim($newString).'...';
- }
- elseif ($initial != $final && !$addTip)
- {
- return trim($newString).'...';
- }
- }
- return $string;
+ 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
+ * @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)
{
- if ($replaceNumbers === true)
- {
- // remove all numbers and replace with english text version (works well only up to millions)
- $string = self::replaceNumbers($string);
- }
- // 0nly continue if we have a string
- if (self::checkString($string))
- {
- // create file name without the extention that is safe
- if ($type === 'filename')
- {
- // make sure VDM is not in the string
- $string = str_replace('VDM', 'vDm', $string);
- // Remove anything which isn't a word, whitespace, number
- // or any of the following caracters -_()
- // If you don't need to handle multi-byte characters
- // you can use preg_replace rather than mb_ereg_replace
- // Thanks @Łukasz Rysiak!
- // $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
- $string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
- // http://stackoverflow.com/a/2021729/1429677
- return preg_replace('/\s+/', ' ', $string);
- }
- // remove all other characters
- $string = trim($string);
- $string = preg_replace('/'.$spacer.'+/', ' ', $string);
- $string = preg_replace('/\s+/', ' ', $string);
- // Transliterate string
- $string = self::transliterate($string);
- // remove all and keep only characters
- if ($keepOnlyCharacters)
- {
- $string = preg_replace("/[^A-Za-z ]/", '', $string);
- }
- // keep both numbers and characters
- else
- {
- $string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
- }
- // select final adaptations
- if ($type === 'L' || $type === 'strtolower')
- {
- // replace white space with underscore
- $string = preg_replace('/\s+/', $spacer, $string);
- // default is to return lower
- return strtolower($string);
- }
- elseif ($type === 'W')
- {
- // return a string with all first letter of each word uppercase(no undersocre)
- return ucwords(strtolower($string));
- }
- elseif ($type === 'w' || $type === 'word')
- {
- // return a string with all lowercase(no undersocre)
- return strtolower($string);
- }
- elseif ($type === 'Ww' || $type === 'Word')
- {
- // return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
- return ucfirst(strtolower($string));
- }
- elseif ($type === 'WW' || $type === 'WORD')
- {
- // return a string with all the uppercase(no undersocre)
- return strtoupper($string);
- }
- elseif ($type === 'U' || $type === 'strtoupper')
- {
- // replace white space with underscore
- $string = preg_replace('/\s+/', $spacer, $string);
- // return all upper
- return strtoupper($string);
- }
- elseif ($type === 'F' || $type === 'ucfirst')
- {
- // replace white space with underscore
- $string = preg_replace('/\s+/', $spacer, $string);
- // return with first caracter to upper
- return ucfirst(strtolower($string));
- }
- elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
- {
- // convert all words to first letter uppercase
- $string = ucwords(strtolower($string));
- // remove white space
- $string = preg_replace('/\s+/', '', $string);
- // now return first letter lowercase
- return lcfirst($string);
- }
- // return string
- return $string;
- }
- // not a string
- return '';
+ 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)
{
- // set tag only once
- if (!self::checkString(self::$langTag))
- {
- // get global value
- self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
- }
- // Transliterate on the language requested
- $lang = Language::getInstance(self::$langTag);
- return $lang->transliterate($string);
+ 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)
{
- if (self::checkString($var))
- {
- $filter = new JFilterInput();
- $string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
- if ($shorten)
- {
- return self::shorten($string,$length);
- }
- return $string;
- }
- else
- {
- return '';
- }
+ 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)
{
- // set numbers array
- $numbers = array();
- // first get all numbers
- preg_match_all('!\d+!', $string, $numbers);
- // check if we have any numbers
- if (isset($numbers[0]) && self::checkArray($numbers[0]))
- {
- foreach ($numbers[0] as $number)
- {
- $searchReplace[$number] = self::numberToString((int)$number);
- }
- // now replace numbers in string
- $string = str_replace(array_keys($searchReplace), array_values($searchReplace),$string);
- // check if we missed any, strange if we did.
- return self::replaceNumbers($string);
- }
- // return the string with no numbers remaining.
- return $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
+ * @input an int
* @returns a string
+ * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/
public static function numberToString($x)
{
- $nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
- "eight", "nine", "ten", "eleven", "twelve", "thirteen",
- "fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
- "nineteen", "twenty", 30 => "thirty", 40 => "forty",
- 50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty",
- 90 => "ninety" );
-
- if(!is_numeric($x))
- {
- $w = $x;
- }
- elseif(fmod($x, 1) != 0)
- {
- $w = $x;
- }
- else
- {
- if($x < 0)
- {
- $w = 'minus ';
- $x = -$x;
- }
- else
- {
- $w = '';
- // ... now $x is a non-negative integer.
- }
-
- if($x < 21) // 0 to 20
- {
- $w .= $nwords[$x];
- }
- elseif($x < 100) // 21 to 99
- {
- $w .= $nwords[10 * floor($x/10)];
- $r = fmod($x, 10);
- if($r > 0)
- {
- $w .= ' '. $nwords[$r];
- }
- }
- elseif($x < 1000) // 100 to 999
- {
- $w .= $nwords[floor($x/100)] .' hundred';
- $r = fmod($x, 100);
- if($r > 0)
- {
- $w .= ' and '. self::numberToString($r);
- }
- }
- elseif($x < 1000000) // 1000 to 999999
- {
- $w .= self::numberToString(floor($x/1000)) .' thousand';
- $r = fmod($x, 1000);
- if($r > 0)
- {
- $w .= ' ';
- if($r < 100)
- {
- $w .= 'and ';
- }
- $w .= self::numberToString($r);
- }
- }
- else // millions
- {
- $w .= self::numberToString(floor($x/1000000)) .' million';
- $r = fmod($x, 1000000);
- if($r > 0)
- {
- $w .= ' ';
- if($r < 100)
- {
- $w .= 'and ';
- }
- $w .= self::numberToString($r);
- }
- }
- }
- return $w;
+ 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)
{
- $bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
- $key = array();
- $bagsize = strlen($bag) - 1;
- for ($i = 0; $i < $size; $i++)
- {
- $get = rand(0, $bagsize);
- $key[] = $bag[$get];
- }
- return implode($key);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
}###GET_CRYPT_KEY###
}
-
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 @@
// 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 @@ public static function getConfig()
{
if (!self::$config)
{
- self::$config = JComponentHelper::getParams('com_###component###');
+ self::$config = ComponentHelper::getParams('com_###component###');
}
return self::$config;
@@ -97,7 +102,7 @@ public static function getMailerInstance()
* @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 @@ public static function validateAddress($address, $patternselect = null)
/**
* 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 @@ public static function getMailer()
/**
* 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 @@ public static function setHeader($target, $value)
*/
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 @@ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $
// set the subject & Body
$mail->setSubject($subject);
$mail->setBody($body);
-
+
// Are we sending the email as HTML?
if ($mode)
{
@@ -273,7 +278,7 @@ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $
//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 @@ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $
{
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 @@ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $
/**
* 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 @@ public static function send($recipient, $subject, $body, $textonly, $mode = 0, $
*/
public static function setBasicBody($html, $subject)
{
- $body = array();
+ $body = [];
$body[] = "";
$body[] = "";
$body[] = "
";
@@ -397,7 +402,7 @@ public static function setBasicBody($html, $subject)
/**
* 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 @@ public static function setBasicBody($html, $subject)
*/
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 d9069328c..d773a70df 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
*/
@@ -15,7 +15,14 @@
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###SITE_POWER_HELPER###
+defined('_JEXEC') or die('Restricted access');
+
+// The power autoloader for this project site area.
+$power_autoloader = JPATH_SITE . '/components/com_###component###/helpers/powerloader.php';
+if (file_exists($power_autoloader))
+{
+ require_once $power_autoloader;
+}
###SITE_HELPER_CLASS_HEADER###
@@ -26,14 +33,14 @@ abstract class ###Component###Helper
{
/**
* Composer Switch
- *
+ *
* @var array
*/
- protected static $composer = array();
+ protected static $composer = [];
/**
* The Main Active Language
- *
+ *
* @var string
*/
public static $langTag;###SITE_GLOBAL_EVENT_HELPER######SITE_CUSTOM_HELPER_SCRIPT######BOTH_CUSTOM_HELPER_SCRIPT###
@@ -47,7 +54,7 @@ public static function composerAutoload($target)
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))
{
@@ -59,54 +66,22 @@ public static function composerAutoload($target)
}
/**
- * Convert it into a string
+ * 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')
{
- // do some table foot work
- $external = false;
- if (strpos($table, '#__') !== false)
- {
- $external = true;
- $table = str_replace('#__', '', $table);
- }
- // check if string is JSON
- $result = json_decode($value, true);
- if (json_last_error() === JSON_ERROR_NONE)
- {
- // is JSON
- if (self::checkArray($result))
- {
- if (self::checkString($table))
- {
- $names = array();
- foreach ($result as $val)
- {
- if ($external)
- {
- if ($_name = self::getVar(null, $val, $id, $name, '=', $table))
- {
- $names[] = $_name;
- }
- }
- else
- {
- if ($_name = self::getVar($table, $val, $id, $name))
- {
- $names[] = $_name;
- }
- }
- }
- if (self::checkArray($names))
- {
- return (string) implode($sperator,$names);
- }
- }
- return (string) implode($sperator,$result);
- }
- return (string) json_decode($value);
- }
- return $value;
+ return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::string(
+ $value,
+ $sperator,
+ $table,
+ $id,
+ $name
+ );
}
/**
@@ -120,7 +95,7 @@ public static function manifest()
/**
* Joomla version object
- */
+ */
protected static $JVersion;
/**
@@ -129,9 +104,9 @@ public static function manifest()
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;
}
@@ -142,9 +117,9 @@ public static function jVersion()
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)
@@ -153,22 +128,22 @@ public static function getContributors()
{
// 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;
@@ -177,22 +152,22 @@ public static function getContributors()
/**
* 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 = self::safeString($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']) || !self::checkString($config['table_path']))
+ if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::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)
{
@@ -227,14 +202,14 @@ public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component
*/
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.
@@ -258,14 +233,14 @@ public static function setAsset($id, $table, $inherit = true)
$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
@@ -278,7 +253,7 @@ public static function setAsset($id, $table, $inherit = true)
$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;
@@ -295,7 +270,7 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
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'))
@@ -310,8 +285,8 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
}
}
// 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);
@@ -326,7 +301,7 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
elseif ($inherit)
{
// clear the value since we inherit
- $rule = array();
+ $rule = [];
}
}
// check if there are any view values remaining
@@ -334,8 +309,8 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
{
$_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;
}
@@ -349,35 +324,12 @@ protected static function getDefaultAssetRules($component, $view, $inherit = tru
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param mixed $node A SimpleXMLElement node to append to the XML element reference, or a stdClass object containing a comment attribute to be injected before the XML node and a fieldXML attribute containing a SimpleXMLElement
*
- * @return null
- *
+ * @return void
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
*/
public static function xmlAppend(&$xml, $node)
{
- if (!$node)
- {
- // element was not returned
- return;
- }
- switch (get_class($node))
- {
- case 'stdClass':
- if (property_exists($node, 'comment'))
- {
- self::xmlComment($xml, $node->comment);
- }
- if (property_exists($node, 'fieldXML'))
- {
- self::xmlAppend($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;
- }
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::append($xml, $node);
}
/**
@@ -386,16 +338,12 @@ public static function xmlAppend(&$xml, $node)
* @param SimpleXMLElement $xml The XML element reference in which to inject a comment
* @param string $comment The comment to inject
*
- * @return null
- *
+ * @return void
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
*/
public static function xmlComment(&$xml, $comment)
{
- $domXML = dom_import_simplexml($xml);
- $domComment = new DOMComment($comment);
- $nodeTarget = $domXML->ownerDocument->importNode($domComment, true);
- $domXML->appendChild($nodeTarget);
- $xml = simplexml_import_dom($domXML);
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::comment($xml, $comment);
}
/**
@@ -405,14 +353,11 @@ public static function xmlComment(&$xml, $comment)
* @param array $attributes The attributes to apply to the XML element
*
* @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 = [])
{
- foreach ($attributes as $key => $value)
- {
- $xml->addAttribute($key, $value);
- }
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
/**
@@ -422,16 +367,11 @@ public static function xmlAddAttributes(&$xml, $attributes = array())
* @param array $options The options to apply to the XML element
*
* @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 = [])
{
- foreach ($options as $key => $value)
- {
- $addOption = $xml->addChild('option');
- $addOption->addAttribute('value', $key);
- $addOption[] = $value;
- }
+ Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
/**
@@ -442,28 +382,11 @@ public static function xmlAddOptions(&$xml, $options = array())
* @param array $options The options to apply to the XML element
*
* @return object
- *
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
*/
public static function getFieldObject(&$attributes, $default = '', $options = null)
{
- // make sure we have attributes and a type value
- if (self::checkArray($attributes) && isset($attributes['type']))
- {
- // make sure the form helper class is loaded
- if (!method_exists('JFormHelper', 'loadFieldType'))
- {
- jimport('joomla.form.form');
- }
- // get field type
- $field = JFormHelper::loadFieldType($attributes['type'], true);
- // get field xml
- $XML = self::getFieldXML($attributes, $options);
- // setup the field
- $field->setup($XML, $default);
- // return the field object
- return $field;
- }
- return false;
+ return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::field($attributes, $default, $options);
}
/**
@@ -473,27 +396,11 @@ public static function getFieldObject(&$attributes, $default = '', $options = nu
* @param array $options The options to apply to the XML element
*
* @return object
- *
+ * @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
*/
public static function getFieldXML(&$attributes, $options = null)
{
- // make sure we have attributes and a type value
- if (self::checkArray($attributes))
- {
- // start field xml
- $XML = new SimpleXMLElement('');
- // load the attributes
- self::xmlAddAttributes($XML, $attributes);
- // check if we have options
- if (self::checkArray($options))
- {
- // load the options
- self::xmlAddOptions($XML, $options);
- }
- // return the field xml
- return $XML;
- }
- return false;
+ return Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::xml($attributes, $options);
}
/**
@@ -517,21 +424,21 @@ public static function renderBoolButton()
// 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
+ * Get a variable
*
* @param string $table The table from which to get the variable
* @param string $where The value where
@@ -541,46 +448,18 @@ public static function renderBoolButton()
* @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###')
{
- if(!$where)
- {
- $where = JFactory::getUser()->id;
- }
- // Get a db connection.
- $db = JFactory::getDbo();
- // Create a new query object.
- $query = $db->getQuery(true);
- $query->select($db->quoteName(array($what)));
- if (empty($table))
- {
- $query->from($db->quoteName('#__'.$main));
- }
- else
- {
- $query->from($db->quoteName('#__'.$main.'_'.$table));
- }
- if (is_numeric($where))
- {
- $query->where($db->quoteName($whereString) . ' '.$operator.' '.(int) $where);
- }
- elseif (is_string($where))
- {
- $query->where($db->quoteName($whereString) . ' '.$operator.' '. $db->quote((string)$where));
- }
- else
- {
- return false;
- }
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- return $db->loadResult();
- }
- return false;
+ return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::var(
+ $table,
+ $where,
+ $whereString,
+ $what,
+ $operator,
+ $main
+ );
}
/**
@@ -595,63 +474,20 @@ public static function getVar($table, $where = null, $whereString = 'user', $wha
* @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)
{
- if(!$where)
- {
- $where = JFactory::getUser()->id;
- }
-
- if (!self::checkArray($where) && $where > 0)
- {
- $where = array($where);
- }
-
- if (self::checkArray($where))
- {
- // prep main <-- why? well if $main='' is empty then $table can be categories or users
- if (self::checkString($main))
- {
- $main = '_'.ltrim($main, '_');
- }
- // Get a db connection.
- $db = JFactory::getDbo();
- // Create a new query object.
- $query = $db->getQuery(true);
-
- $query->select($db->quoteName(array($what)));
- if (empty($table))
- {
- $query->from($db->quoteName('#__'.$main));
- }
- else
- {
- $query->from($db->quoteName('#_'.$main.'_'.$table));
- }
- // add strings to array search
- if ('IN_STRINGS' === $operator || 'NOT IN_STRINGS' === $operator)
- {
- $query->where($db->quoteName($whereString) . ' ' . str_replace('_STRINGS', '', $operator) . ' ("' . implode('","',$where) . '")');
- }
- else
- {
- $query->where($db->quoteName($whereString) . ' ' . $operator . ' (' . implode(',',$where) . ')');
- }
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- if ($unique)
- {
- return array_unique($db->loadColumn());
- }
- return $db->loadColumn();
- }
- }
- return false;
- }
+ return Super___db87c339_5bb6_4291_a7ef_2c48ea1b06bc___Power::vars(
+ $table,
+ $where,
+ $whereString,
+ $what,
+ $operator,
+ $main,
+ $unique
+ );
+ }
public static function isPublished($id,$type)
{
@@ -659,7 +495,7 @@ public static function isPublished($id,$type)
{
$type = 'item';
}
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select(array('a.published'));
$query->from('#__###component###_'.$type.' AS a');
@@ -677,7 +513,7 @@ public static function isPublished($id,$type)
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');
@@ -702,39 +538,39 @@ public static function getGroupName($id)
* @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::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 = 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');
@@ -743,12 +579,12 @@ public static function getActions($view, &$record = null, $views = null, $target
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;
}
@@ -769,7 +605,7 @@ public static function getActions($view, &$record = null, $views = null, $target
// 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
@@ -802,7 +638,7 @@ public static function getActions($view, &$record = null, $views = null, $target
}
}
}
- 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';
@@ -874,7 +710,7 @@ public static function getActions($view, &$record = null, $views = null, $target
* @param array $targets The array of target actions
*
* @return boolean true if action should be filtered out
- *
+ *
*/
protected static function filterActions(&$view, &$action, &$targets)
{
@@ -893,78 +729,53 @@ protected static function filterActions(&$view, &$action, &$targets)
/**
* 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);
*/
public static function checkJson($string)
{
- if (self::checkString($string))
- {
- json_decode($string);
- return (json_last_error() === JSON_ERROR_NONE);
- }
- return false;
+ return Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
}
/**
* 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);
*/
public static function checkObject($object)
{
- if (isset($object) && is_object($object))
- {
- return count((array)$object) > 0;
- }
- return false;
+ return Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
}
/**
* 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);
*/
public static function checkArray($array, $removeEmptyString = false)
{
- if (isset($array) && is_array($array) && ($nr = count((array)$array)) > 0)
- {
- // also make sure the empty strings are removed
- if ($removeEmptyString)
- {
- foreach ($array as $key => $string)
- {
- if (empty($string))
- {
- unset($array[$key]);
- }
- }
- return self::checkArray($array, false);
- }
- return $nr;
- }
- return 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
+ * @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)
{
- if (isset($string) && is_string($string) && strlen($string) > 0)
- {
- return true;
- }
- return false;
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
}
/**
@@ -976,8 +787,8 @@ public static function checkString($string)
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
@@ -995,25 +806,14 @@ public static function isConnected()
/**
* 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);
*/
public static function mergeArrays($arrays)
{
- if(self::checkArray($arrays))
- {
- $arrayBuket = array();
- foreach ($arrays as $array)
- {
- if (self::checkArray($array))
- {
- $arrayBuket = array_merge($arrayBuket, $array);
- }
- }
- return $arrayBuket;
- }
- return false;
+ return Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
}
// typo sorry!
@@ -1025,310 +825,100 @@ public static function sorten($string, $length = 40, $addTip = true)
/**
* 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(...);
*/
public static function shorten($string, $length = 40, $addTip = true)
{
- if (self::checkString($string))
- {
- $initial = strlen($string);
- $words = preg_split('/([\s\n\r]+)/', $string, null, PREG_SPLIT_DELIM_CAPTURE);
- $words_count = count((array)$words);
-
- $word_length = 0;
- $last_word = 0;
- for (; $last_word < $words_count; ++$last_word)
- {
- $word_length += strlen($words[$last_word]);
- if ($word_length > $length)
- {
- break;
- }
- }
-
- $newString = implode(array_slice($words, 0, $last_word));
- $final = strlen($newString);
- if ($initial != $final && $addTip)
- {
- $title = self::shorten($string, 400 , false);
- return ''.trim($newString).'...';
- }
- elseif ($initial != $final && !$addTip)
- {
- return trim($newString).'...';
- }
- }
- return $string;
+ 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
+ * @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)
{
- if ($replaceNumbers === true)
- {
- // remove all numbers and replace with english text version (works well only up to millions)
- $string = self::replaceNumbers($string);
- }
- // 0nly continue if we have a string
- if (self::checkString($string))
- {
- // create file name without the extention that is safe
- if ($type === 'filename')
- {
- // make sure VDM is not in the string
- $string = str_replace('VDM', 'vDm', $string);
- // Remove anything which isn't a word, whitespace, number
- // or any of the following caracters -_()
- // If you don't need to handle multi-byte characters
- // you can use preg_replace rather than mb_ereg_replace
- // Thanks @Łukasz Rysiak!
- // $string = mb_ereg_replace("([^\w\s\d\-_\(\)])", '', $string);
- $string = preg_replace("([^\w\s\d\-_\(\)])", '', $string);
- // http://stackoverflow.com/a/2021729/1429677
- return preg_replace('/\s+/', ' ', $string);
- }
- // remove all other characters
- $string = trim($string);
- $string = preg_replace('/'.$spacer.'+/', ' ', $string);
- $string = preg_replace('/\s+/', ' ', $string);
- // Transliterate string
- $string = self::transliterate($string);
- // remove all and keep only characters
- if ($keepOnlyCharacters)
- {
- $string = preg_replace("/[^A-Za-z ]/", '', $string);
- }
- // keep both numbers and characters
- else
- {
- $string = preg_replace("/[^A-Za-z0-9 ]/", '', $string);
- }
- // select final adaptations
- if ($type === 'L' || $type === 'strtolower')
- {
- // replace white space with underscore
- $string = preg_replace('/\s+/', $spacer, $string);
- // default is to return lower
- return strtolower($string);
- }
- elseif ($type === 'W')
- {
- // return a string with all first letter of each word uppercase(no undersocre)
- return ucwords(strtolower($string));
- }
- elseif ($type === 'w' || $type === 'word')
- {
- // return a string with all lowercase(no undersocre)
- return strtolower($string);
- }
- elseif ($type === 'Ww' || $type === 'Word')
- {
- // return a string with first letter of the first word uppercase and all the rest lowercase(no undersocre)
- return ucfirst(strtolower($string));
- }
- elseif ($type === 'WW' || $type === 'WORD')
- {
- // return a string with all the uppercase(no undersocre)
- return strtoupper($string);
- }
- elseif ($type === 'U' || $type === 'strtoupper')
- {
- // replace white space with underscore
- $string = preg_replace('/\s+/', $spacer, $string);
- // return all upper
- return strtoupper($string);
- }
- elseif ($type === 'F' || $type === 'ucfirst')
- {
- // replace white space with underscore
- $string = preg_replace('/\s+/', $spacer, $string);
- // return with first caracter to upper
- return ucfirst(strtolower($string));
- }
- elseif ($type === 'cA' || $type === 'cAmel' || $type === 'camelcase')
- {
- // convert all words to first letter uppercase
- $string = ucwords(strtolower($string));
- // remove white space
- $string = preg_replace('/\s+/', '', $string);
- // now return first letter lowercase
- return lcfirst($string);
- }
- // return string
- return $string;
- }
- // not a string
- return '';
+ 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)
{
- // set tag only once
- if (!self::checkString(self::$langTag))
- {
- // get global value
- self::$langTag = JComponentHelper::getParams('com_###component###')->get('language', 'en-GB');
- }
- // Transliterate on the language requested
- $lang = Language::getInstance(self::$langTag);
- return $lang->transliterate($string);
+ 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)
{
- if (self::checkString($var))
- {
- $filter = new JFilterInput();
- $string = $filter->clean(html_entity_decode(htmlentities($var, ENT_COMPAT, $charset)), 'HTML');
- if ($shorten)
- {
- return self::shorten($string,$length);
- }
- return $string;
- }
- else
- {
- return '';
- }
+ 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)
{
- // set numbers array
- $numbers = array();
- // first get all numbers
- preg_match_all('!\d+!', $string, $numbers);
- // check if we have any numbers
- if (isset($numbers[0]) && self::checkArray($numbers[0]))
- {
- foreach ($numbers[0] as $number)
- {
- $searchReplace[$number] = self::numberToString((int)$number);
- }
- // now replace numbers in string
- $string = str_replace(array_keys($searchReplace), array_values($searchReplace),$string);
- // check if we missed any, strange if we did.
- return self::replaceNumbers($string);
- }
- // return the string with no numbers remaining.
- return $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
+ * @input an int
* @returns a string
+ * @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/
public static function numberToString($x)
{
- $nwords = array( "zero", "one", "two", "three", "four", "five", "six", "seven",
- "eight", "nine", "ten", "eleven", "twelve", "thirteen",
- "fourteen", "fifteen", "sixteen", "seventeen", "eighteen",
- "nineteen", "twenty", 30 => "thirty", 40 => "forty",
- 50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty",
- 90 => "ninety" );
-
- if(!is_numeric($x))
- {
- $w = $x;
- }
- elseif(fmod($x, 1) != 0)
- {
- $w = $x;
- }
- else
- {
- if($x < 0)
- {
- $w = 'minus ';
- $x = -$x;
- }
- else
- {
- $w = '';
- // ... now $x is a non-negative integer.
- }
-
- if($x < 21) // 0 to 20
- {
- $w .= $nwords[$x];
- }
- elseif($x < 100) // 21 to 99
- {
- $w .= $nwords[10 * floor($x/10)];
- $r = fmod($x, 10);
- if($r > 0)
- {
- $w .= ' '. $nwords[$r];
- }
- }
- elseif($x < 1000) // 100 to 999
- {
- $w .= $nwords[floor($x/100)] .' hundred';
- $r = fmod($x, 100);
- if($r > 0)
- {
- $w .= ' and '. self::numberToString($r);
- }
- }
- elseif($x < 1000000) // 1000 to 999999
- {
- $w .= self::numberToString(floor($x/1000)) .' thousand';
- $r = fmod($x, 1000);
- if($r > 0)
- {
- $w .= ' ';
- if($r < 100)
- {
- $w .= 'and ';
- }
- $w .= self::numberToString($r);
- }
- }
- else // millions
- {
- $w .= self::numberToString(floor($x/1000000)) .' million';
- $r = fmod($x, 1000000);
- if($r > 0)
- {
- $w .= ' ';
- if($r < 100)
- {
- $w .= 'and ';
- }
- $w .= self::numberToString($r);
- }
- }
- }
- return $w;
+ 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)
{
- $bag = "abcefghijknopqrstuwxyzABCDDEFGHIJKLLMMNOPQRSTUVVWXYZabcddefghijkllmmnopqrstuvvwxyzABCEFGHIJKNOPQRSTUWXYZ";
- $key = array();
- $bagsize = strlen($bag) - 1;
- for ($i = 0; $i < $size; $i++)
- {
- $get = rand(0, $bagsize);
- $key[] = $bag[$get];
- }
- return implode($key);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::random($size);
}###GET_CRYPT_KEY###
}
-
diff --git a/admin/compiler/joomla_3/HtmlView_custom_admin.php b/admin/compiler/joomla_3/HtmlView_custom_admin.php
index ca7f5df16..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 @@
###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 @@ function display($tpl = null)
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
- $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###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 @@ protected function addToolBar()
// 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 @@ protected function addToolBar()
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 @@ public function display($tpl = null)
// 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 @@ public function display($tpl = null)
// Set the toolbar
$this->addToolBar();
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -99,11 +99,11 @@ public function escape($var)
{
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 @@ public function escape($var)
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 @@ public function display($tpl = null)
// 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 @@ public function display($tpl = null)
// Set the toolbar
$this->addToolBar();
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -86,7 +86,7 @@ public function display($tpl = null)
protected function addToolBar()
{###ADDTOOLBAR###
// now initiate the toolbar
- $this->toolbar = JToolbar::getInstance();
+ $this->toolbar = Toolbar::getInstance();
}
/**
@@ -100,11 +100,11 @@ public function escape($var)
{
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 @@ public function escape($var)
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 @@ protected function setDocument()
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 @@
// 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 @@ public function display($tpl = null)
$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 @@ public function display($tpl = null)
}
// 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 @@ public function display($tpl = null)
*/
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 @@
// 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 @@ function display($tpl = null)
$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 @@ function display($tpl = null)
$this->batchDisplay = JHtmlBatch_::render();
}
}
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -77,32 +77,32 @@ function display($tpl = null)
*/
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 @@ protected function addToolBar()
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 @@ protected function addToolBar()
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 @@ protected function setDocument()
{
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 @@ public function escape($var)
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 766c63395..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 @@
###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 @@ function display($tpl = null)
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
- $this->document->addStyleSheet(JURI::root(true) .'/administrator/components/com_###component###/assets/css/###sviews###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###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 @@ protected function setDocument()
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 @@ protected function addToolBar()
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 dea200543..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 @@
###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 @@ function display($tpl = null)
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
- $this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###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 @@ protected function _prepareDocument()
*/
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 @@ protected function addToolBar()
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 12e20f031..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 @@
###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
- $this->document->addStyleSheet(JURI::root(true) .'/components/com_###component###/assets/css/###sview###.css', (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###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 @@ protected function addToolBar()
// 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 @@ protected function addToolBar()
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 @@ protected function populateState()
*/
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 @@ public function getItem($pk = null)
$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 @@ public function getItem($pk = null)
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 @@ protected function populateState()
*/
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 @@ public function getItem($pk = null)
$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 @@ public function getItem($pk = null)
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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
// 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 @@
*/
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 @@ public function __construct($config = array())
*/
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 @@ protected function populateState($ordering = null, $direction = null)
// List state information.
parent::populateState($ordering, $direction);
}
-
+
/**
* Method to get an array of data items.
*
@@ -70,21 +70,21 @@ 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
+ * @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 @@
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 @@ public function __construct()
{
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 @@ public function getIcons()
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 @@ public function getIcons()
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 @@ public function getIcons()
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 @@ public function getIcons()
{
$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).'